summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-04-20 08:12:24 +0000
committerbernard.xiong <[email protected]>2010-04-20 08:12:24 +0000
commit760349dd5e34cc154c7eac2298c6d86b7658f756 (patch)
tree63401d92fba0763af3548a3174d13c5a8f2bd6d4
parent367015d3fd38f477df028455715ce2a5b589bf74 (diff)
add type conversion in finsh.h file.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@659 bbd45198-f89e-11dd-88c7-29a3b14d5316
-rw-r--r--components/finsh/finsh.h43
1 files changed, 22 insertions, 21 deletions
diff --git a/components/finsh/finsh.h b/components/finsh/finsh.h
index 6cd5233028..273abbcf04 100644
--- a/components/finsh/finsh.h
+++ b/components/finsh/finsh.h
@@ -17,35 +17,36 @@
#include <rtthread.h>
/* -- the beginning of option -- */
-#define FINSH_NAME_MAX 16 /* max length of identifier */
-#define FINSH_NODE_MAX 16 /* max number of node */
+#define FINSH_NAME_MAX 16 /* max length of identifier */
+#define FINSH_NODE_MAX 16 /* max number of node */
-#define FINSH_HEAP_MAX 128 /* max length of heap */
-#define FINSH_STRING_MAX 128 /* max length of string */
-#define FINSH_VARIABLE_MAX 8 /* max number of variable */
+#define FINSH_HEAP_MAX 128 /* max length of heap */
+#define FINSH_STRING_MAX 128 /* max length of string */
+#define FINSH_VARIABLE_MAX 8 /* max number of variable */
-#define FINSH_STACK_MAX 128 /* max stack size */
-#define FINSH_TEXT_MAX 128 /* max text segment size */
+#define FINSH_STACK_MAX 128 /* max stack size */
+#define FINSH_TEXT_MAX 128 /* max text segment size */
-#define HEAP_ALIGNMENT 4 /* heap alignment */
+#define HEAP_ALIGNMENT 4 /* heap alignment */
#define FINSH_GET16(x) (*(x)) | (*((x)+1) << 8)
-#define FINSH_GET32(x) (*(x)) | (*((x)+1) << 8) | (*((x)+2) << 16) | (*((x)+3) << 24)
+#define FINSH_GET32(x) (rt_uint32_t)(*(x)) | (rt_uint32_t)(*((x)+1) << 8) | \
+ (rt_uint32_t)(*((x)+2) << 16) | (rt_uint32_t)(*((x)+3) << 24)
-#define FINSH_SET16(x, v) \
- do \
- { \
- *(x) = (v) & 0x00ff; \
- (*((x)+1)) = (v) >> 8; \
+#define FINSH_SET16(x, v) \
+ do \
+ { \
+ *(x) = (v) & 0x00ff; \
+ (*((x)+1)) = (v) >> 8; \
} while ( 0 )
-#define FINSH_SET32(x, v) \
- do \
- { \
- *(x) = (v) & 0x000000ff; \
- (*((x)+1)) = ((v) >> 8) & 0x000000ff; \
- (*((x)+2)) = ((v) >> 16) & 0x000000ff; \
- (*((x)+3)) = ((v) >> 24); \
+#define FINSH_SET32(x, v) \
+ do \
+ { \
+ *(x) = (rt_uint32_t)(v) & 0x000000ff; \
+ (*((x)+1)) = (rt_uint32_t)((v) >> 8) & 0x000000ff; \
+ (*((x)+2)) = (rt_uint32_t)((v) >> 16) & 0x000000ff; \
+ (*((x)+3)) = (rt_uint32_t)((v) >> 24); \
} while ( 0 )
/* -- the end of option -- */