Skip to content

Commit 1fa30b7

Browse files
committed
Resolve conflict in builtin type names
In class MBRBlockDevice the tole32 function had used union member names u32 and u8. The introduction of REALTEK_RTL8195AM cauesd a conflict with type names in basic_types given they're aliased as macros to uint32_t and uint8_t respectively.
1 parent be35b3f commit 1fa30b7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
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 u32;
42-
uint8_t u8[4];
43-
} w;
41+
uint32_t w;
42+
uint8_t b[4];
43+
} s;
4444

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

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

5353
static inline uint32_t fromle32(uint32_t a)

0 commit comments

Comments
 (0)