From c18947b947064e7eceed8047c42d4c8dfd8ae964 Mon Sep 17 00:00:00 2001 From: zwelch Date: Thu, 18 Jun 2009 07:07:12 +0000 Subject: 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 --- src/helper/types.h | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/helper/types.h') 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 #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 -- cgit v1.2.3