aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-02-15 13:46:34 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-02-15 13:46:34 +0100
commit7398892ac0592999397532ba168376edd402438c (patch)
treec487cbbb0fe75bce23db81bdf808cf8ecb98b70e
parenta48eadbc22d3892481826e0b7dc4c7a5d2baad5c (diff)
downloadbusybox-w32-7398892ac0592999397532ba168376edd402438c.tar.gz
busybox-w32-7398892ac0592999397532ba168376edd402438c.tar.bz2
busybox-w32-7398892ac0592999397532ba168376edd402438c.zip
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>
-rw-r--r--util-linux/mkfs_ext2.c6
-rw-r--r--util-linux/mkfs_vfat.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c
index 8434dd6ad..f524bc239 100644
--- a/util-linux/mkfs_ext2.c
+++ b/util-linux/mkfs_ext2.c
@@ -83,11 +83,11 @@ char BUG_wrong_field_size(void);
83#define STORE_LE(field, value) \ 83#define STORE_LE(field, value) \
84do { \ 84do { \
85 if (sizeof(field) == 4) \ 85 if (sizeof(field) == 4) \
86 field = SWAP_LE32(value); \ 86 field = SWAP_LE32((uint32_t)(value)); \
87 else if (sizeof(field) == 2) \ 87 else if (sizeof(field) == 2) \
88 field = SWAP_LE16(value); \ 88 field = SWAP_LE16((uint16_t)(value)); \
89 else if (sizeof(field) == 1) \ 89 else if (sizeof(field) == 1) \
90 field = (value); \ 90 field = (uint8_t)(value); \
91 else \ 91 else \
92 BUG_wrong_field_size(); \ 92 BUG_wrong_field_size(); \
93} while (0) 93} while (0)
diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c
index 426854b1e..26a919536 100644
--- a/util-linux/mkfs_vfat.c
+++ b/util-linux/mkfs_vfat.c
@@ -210,11 +210,11 @@ void BUG_unsupported_field_size(void);
210#define STORE_LE(field, value) \ 210#define STORE_LE(field, value) \
211do { \ 211do { \
212 if (sizeof(field) == 4) \ 212 if (sizeof(field) == 4) \
213 field = SWAP_LE32(value); \ 213 field = SWAP_LE32((uint32_t)(value)); \
214 else if (sizeof(field) == 2) \ 214 else if (sizeof(field) == 2) \
215 field = SWAP_LE16(value); \ 215 field = SWAP_LE16((uint16_t)(value)); \
216 else if (sizeof(field) == 1) \ 216 else if (sizeof(field) == 1) \
217 field = (value); \ 217 field = (uint8_t)(value); \
218 else \ 218 else \
219 BUG_unsupported_field_size(); \ 219 BUG_unsupported_field_size(); \
220} while (0) 220} while (0)