diff options
| author | bernard.xiong <[email protected]> | 2010-04-21 02:00:40 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-04-21 02:00:40 +0000 |
| commit | 146d88b0507c173919e1e8f8dee9f5c9157731fc (patch) | |
| tree | ed80fb59d55c22538c8a8ebdb9ee9904d88f35a7 /components | |
| parent | a0c9b0e90ef72ef130dd7c7e04788b17fc746bd0 (diff) | |
fix the rt_uint32_t type conversion.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@662 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
| -rw-r--r-- | components/finsh/finsh.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/finsh/finsh.h b/components/finsh/finsh.h index 273abbcf04..1480af9bbd 100644 --- a/components/finsh/finsh.h +++ b/components/finsh/finsh.h @@ -30,8 +30,8 @@ #define HEAP_ALIGNMENT 4 /* heap alignment */ #define FINSH_GET16(x) (*(x)) | (*((x)+1) << 8) -#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_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 \ @@ -44,9 +44,9 @@ 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); \ + (*((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 -- */ |
