diff options
author | Nico Huber <nico.h@gmx.de> | 2018-12-23 20:03:35 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2019-07-31 08:26:59 +0000 |
commit | 519be66fc59558971dd653afe69ccaf1a633b492 (patch) | |
tree | 74f0912de156a86d56111f377db080246e5205e9 /fmap.c | |
parent | ef78de4a21323b8c459337356289218211f2c5ce (diff) | |
download | flashrom-519be66fc59558971dd653afe69ccaf1a633b492.tar.gz flashrom-519be66fc59558971dd653afe69ccaf1a633b492.tar.bz2 flashrom-519be66fc59558971dd653afe69ccaf1a633b492.zip |
Fix -Wsign-compare trouble
Mostly by changing to `unsigned` types where applicable, sometimes
`signed` types, and casting as a last resort.
Change-Id: I08895543ffb7a48058bcf91ef6500ca113f2d305
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/30409
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jacob Garber <jgarber1@ualberta.ca>
Diffstat (limited to 'fmap.c')
-rw-r--r-- | fmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -96,7 +96,7 @@ static off_t fmap_lsearch(const uint8_t *buf, size_t len) off_t offset; bool fmap_found = 0; - for (offset = 0; offset <= len - sizeof(struct fmap); offset++) { + for (offset = 0; offset <= (off_t)(len - sizeof(struct fmap)); offset++) { if (is_valid_fmap((struct fmap *)&buf[offset])) { fmap_found = 1; break; @@ -178,7 +178,7 @@ _finalize_ret: } static int fmap_bsearch_rom(struct fmap **fmap_out, struct flashctx *const flashctx, - size_t rom_offset, size_t len, int min_stride) + size_t rom_offset, size_t len, size_t min_stride) { size_t stride, fmap_len = 0; int ret = 1, fmap_found = 0, check_offset_0 = 1; |