mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
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>
This commit is contained in:
4
fmap.c
4
fmap.c
@ -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;
|
||||
|
Reference in New Issue
Block a user