Skip to content

Commit 6002bdd

Browse files
authored
Merge pull request #4439 from sg-/proper-realtek-fix
Proper fix for 1fa30b7
2 parents 6b1f64f + 02bf926 commit 6002bdd

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

features/filesystem/bd/MBRBlockDevice.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ MBED_PACKED(struct) mbr_table {
3838
static inline uint32_t tole32(uint32_t a)
3939
{
4040
union {
41-
uint32_t w;
42-
uint8_t b[4];
43-
} s;
41+
uint32_t u32;
42+
uint8_t u8[4];
43+
} w;
4444

45-
s.b[0] = a >> 0;
46-
s.b[1] = a >> 8;
47-
s.b[2] = a >> 16;
48-
s.b[3] = a >> 24;
45+
w.u8[0] = a >> 0;
46+
w.u8[1] = a >> 8;
47+
w.u8[2] = a >> 16;
48+
w.u8[3] = a >> 24;
4949

50-
return s.w;
50+
return w.u32;
5151
}
5252

5353
static inline uint32_t fromle32(uint32_t a)

targets/TARGET_Realtek/TARGET_AMEBA/sdk/soc/realtek/common/bsp/basic_types.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ typedef signed long long __int64_t;
6363
typedef unsigned long long __uint64_t;
6464
#endif
6565

66-
#define s8 int8_t
67-
#define u8 uint8_t
68-
#define s16 int16_t
69-
#define u16 uint16_t
70-
#define s32 int32_t
71-
#define u32 uint32_t
72-
#define s64 int64_t
73-
#define u64 uint64_t
66+
typedef int8_t s8;
67+
typedef uint8_t u8;
68+
typedef int16_t s16;
69+
typedef uint16_t u16;
70+
typedef int32_t s32;
71+
typedef uint32_t u32;
72+
typedef int64_t s64;
73+
typedef uint64_t u64;
7474

7575
#ifdef CONFIG_MBED_ENABLED
7676
#ifndef BOOL

0 commit comments

Comments
 (0)