mkfs_ext2, mkfs_vfat: fix warnings in STORE_LE on big-endian platforms
"warning: large integer implicitly truncated to unsigned type [-Woverflow]" Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
a48eadbc22
commit
7398892ac0
@ -83,11 +83,11 @@ char BUG_wrong_field_size(void);
|
|||||||
#define STORE_LE(field, value) \
|
#define STORE_LE(field, value) \
|
||||||
do { \
|
do { \
|
||||||
if (sizeof(field) == 4) \
|
if (sizeof(field) == 4) \
|
||||||
field = SWAP_LE32(value); \
|
field = SWAP_LE32((uint32_t)(value)); \
|
||||||
else if (sizeof(field) == 2) \
|
else if (sizeof(field) == 2) \
|
||||||
field = SWAP_LE16(value); \
|
field = SWAP_LE16((uint16_t)(value)); \
|
||||||
else if (sizeof(field) == 1) \
|
else if (sizeof(field) == 1) \
|
||||||
field = (value); \
|
field = (uint8_t)(value); \
|
||||||
else \
|
else \
|
||||||
BUG_wrong_field_size(); \
|
BUG_wrong_field_size(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
@ -210,11 +210,11 @@ void BUG_unsupported_field_size(void);
|
|||||||
#define STORE_LE(field, value) \
|
#define STORE_LE(field, value) \
|
||||||
do { \
|
do { \
|
||||||
if (sizeof(field) == 4) \
|
if (sizeof(field) == 4) \
|
||||||
field = SWAP_LE32(value); \
|
field = SWAP_LE32((uint32_t)(value)); \
|
||||||
else if (sizeof(field) == 2) \
|
else if (sizeof(field) == 2) \
|
||||||
field = SWAP_LE16(value); \
|
field = SWAP_LE16((uint16_t)(value)); \
|
||||||
else if (sizeof(field) == 1) \
|
else if (sizeof(field) == 1) \
|
||||||
field = (value); \
|
field = (uint8_t)(value); \
|
||||||
else \
|
else \
|
||||||
BUG_unsupported_field_size(); \
|
BUG_unsupported_field_size(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
Loading…
Reference in New Issue
Block a user