Replace #define with typedef
pull/4439/head
Sam Grove 2017-06-04 11:26:21 -05:00
parent 1fa30b7403
commit 02bf926ffb
2 changed files with 16 additions and 16 deletions

View File

@ -38,16 +38,16 @@ MBED_PACKED(struct) mbr_table {
static inline uint32_t tole32(uint32_t a)
{
union {
uint32_t w;
uint8_t b[4];
} s;
uint32_t u32;
uint8_t u8[4];
} w;
s.b[0] = a >> 0;
s.b[1] = a >> 8;
s.b[2] = a >> 16;
s.b[3] = a >> 24;
w.u8[0] = a >> 0;
w.u8[1] = a >> 8;
w.u8[2] = a >> 16;
w.u8[3] = a >> 24;
return s.w;
return w.u32;
}
static inline uint32_t fromle32(uint32_t a)

View File

@ -63,14 +63,14 @@ typedef signed long long __int64_t;
typedef unsigned long long __uint64_t;
#endif
#define s8 int8_t
#define u8 uint8_t
#define s16 int16_t
#define u16 uint16_t
#define s32 int32_t
#define u32 uint32_t
#define s64 int64_t
#define u64 uint64_t
typedef int8_t s8;
typedef uint8_t u8;
typedef int16_t s16;
typedef uint16_t u16;
typedef int32_t s32;
typedef uint32_t u32;
typedef int64_t s64;
typedef uint64_t u64;
#ifdef CONFIG_MBED_ENABLED
#ifndef BOOL