diff options
author | Sipke Vriend <Sipke.Vriend@miot.com.au> | 2019-09-09 06:53:50 +0300 |
---|---|---|
committer | Sipke Vriend <Sipke.Vriend@miot.com.au> | 2019-09-09 06:53:50 +0300 |
commit | 965d29b88740fad3c5aab6082e2efc6fe30bf7af (patch) | |
tree | e469bfd1fda8b887802192704c025449b6984411 /lfs.c | |
parent | 494dd6673d008c03e3199b24af7bff0fe82017f1 (diff) |
build: Fix warnings about shift count width difference for 16 bit compiler
Build warnings exist on a gcc based 16 bit compiler. Cast relevant types
to fix.
littlefs/lfs.c: In function 'lfs_gstate_xororphans':
littlefs/lfs.c:355:5: warning: left shift count >= width of type
littlefs/lfs.c: In function 'lfs_dir_fetchmatch':
littlefs/lfs.c:849:17: warning: left shift count >= width of type
littlefs/lfs.c: In function 'lfs_dir_commitcrc':
littlefs/lfs.c:1278:9: warning: left shift count >= width of type
Diffstat (limited to 'lfs.c')
-rw-r--r-- | lfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -352,7 +352,7 @@ static inline bool lfs_gstate_hasmovehere(const struct lfs_gstate *a, static inline void lfs_gstate_xororphans(struct lfs_gstate *a, const struct lfs_gstate *b, bool orphans) { - a->tag ^= LFS_MKTAG(0x800, 0, 0) & (b->tag ^ (orphans << 31)); + a->tag ^= LFS_MKTAG(0x800, 0, 0) & (b->tag ^ ((uint32_t)orphans << 31)); } static inline void lfs_gstate_xormove(struct lfs_gstate *a, @@ -846,7 +846,7 @@ static lfs_stag_t lfs_dir_fetchmatch(lfs_t *lfs, } // reset the next bit if we need to - ptag ^= (lfs_tag_chunk(tag) & 1U) << 31; + ptag ^= (lfs_tag_t)(lfs_tag_chunk(tag) & 1U) << 31; // toss our crc into the filesystem seed for // pseudorandom numbers @@ -1275,7 +1275,7 @@ static int lfs_dir_commitcrc(lfs_t *lfs, struct lfs_commit *commit) { } commit->off += sizeof(tag)+lfs_tag_size(tag); - commit->ptag = tag ^ (reset << 31); + commit->ptag = tag ^ ((lfs_tag_t)reset << 31); commit->crc = LFS_BLOCK_NULL; // reset crc for next "commit" } |