diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-18 07:07:12 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-18 07:07:12 +0000 |
commit | c18947b947064e7eceed8047c42d4c8dfd8ae964 (patch) | |
tree | 095162ab48bb63952b95a8d65a98d276e3d63775 /src/helper/types.h | |
parent | 310be8a838c9db6b67bc4d6d7d3c7ff41b32af4c (diff) |
Transform 'u8' to 'uint8_t'
- Replace '\([^_]\)u8' with '\1uint8_t'.
- Replace '^u8' with 'uint8_t'.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2276 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper/types.h')
-rw-r--r-- | src/helper/types.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/helper/types.h b/src/helper/types.h index 49933184..4ea66e24 100644 --- a/src/helper/types.h +++ b/src/helper/types.h @@ -30,8 +30,8 @@ #include <stdint.h> #endif -#ifndef u8 -typedef unsigned char u8; +#ifndef uint8_t +typedef unsigned char uint8_t; #endif #ifndef u16 @@ -88,52 +88,52 @@ typedef bool _Bool; */ -static inline u32 le_to_h_u32(const u8* buf) +static inline u32 le_to_h_u32(const uint8_t* buf) { return (u32)(buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24); } -static inline u16 le_to_h_u16(const u8* buf) +static inline u16 le_to_h_u16(const uint8_t* buf) { return (u16)(buf[0] | buf[1] << 8); } -static inline u32 be_to_h_u32(const u8* buf) +static inline u32 be_to_h_u32(const uint8_t* buf) { return (u32)(buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24); } -static inline u16 be_to_h_u16(const u8* buf) +static inline u16 be_to_h_u16(const uint8_t* buf) { return (u16)(buf[1] | buf[0] << 8); } -static inline void h_u32_to_le(u8* buf, int val) +static inline void h_u32_to_le(uint8_t* buf, int val) { - buf[3] = (u8) (val >> 24); - buf[2] = (u8) (val >> 16); - buf[1] = (u8) (val >> 8); - buf[0] = (u8) (val >> 0); + buf[3] = (uint8_t) (val >> 24); + buf[2] = (uint8_t) (val >> 16); + buf[1] = (uint8_t) (val >> 8); + buf[0] = (uint8_t) (val >> 0); } -static inline void h_u32_to_be(u8* buf, int val) +static inline void h_u32_to_be(uint8_t* buf, int val) { - buf[0] = (u8) (val >> 24); - buf[1] = (u8) (val >> 16); - buf[2] = (u8) (val >> 8); - buf[3] = (u8) (val >> 0); + buf[0] = (uint8_t) (val >> 24); + buf[1] = (uint8_t) (val >> 16); + buf[2] = (uint8_t) (val >> 8); + buf[3] = (uint8_t) (val >> 0); } -static inline void h_u16_to_le(u8* buf, int val) +static inline void h_u16_to_le(uint8_t* buf, int val) { - buf[1] = (u8) (val >> 8); - buf[0] = (u8) (val >> 0); + buf[1] = (uint8_t) (val >> 8); + buf[0] = (uint8_t) (val >> 0); } -static inline void h_u16_to_be(u8* buf, int val) +static inline void h_u16_to_be(uint8_t* buf, int val) { - buf[0] = (u8) (val >> 8); - buf[1] = (u8) (val >> 0); + buf[0] = (uint8_t) (val >> 8); + buf[1] = (uint8_t) (val >> 0); } #ifdef __ECOS |