From 39411101a5f4df8d05bb5f79d7c63ae273d0acfd Mon Sep 17 00:00:00 2001 From: Rahix <rahix@rahix.de> Date: Sat, 23 Nov 2019 01:01:02 +0100 Subject: [PATCH] chore(l0der): Fix sign-compare warnings Signed-off-by: Rahix <rahix@rahix.de> --- epicardium/l0der/l0der.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epicardium/l0der/l0der.c b/epicardium/l0der/l0der.c index 8b0aff9b..5f10c441 100644 --- a/epicardium/l0der/l0der.c +++ b/epicardium/l0der/l0der.c @@ -119,7 +119,7 @@ static int _seek_and_read(int fd, uint32_t address, void *data, size_t count) return res; } - if ((res = epic_file_read(fd, data, count)) != count) { + if ((size_t)(res = epic_file_read(fd, data, count)) != count) { LOG_ERR("l0der", "_seek_and_read: could not read: %d", res); return res; } @@ -366,7 +366,7 @@ static int _parse_dynamic_symbols( return res; } - for (int j = 0; j < sym_count; j++) { + for (uint32_t j = 0; j < sym_count; j++) { if ((res = epic_file_read( fd, &sym, sizeof(Elf32_Sym))) != sizeof(Elf32_Sym)) { @@ -447,7 +447,7 @@ static int _run_relocations( return res; } - for (int j = 0; j < reloc_count; j++) { + for (uint32_t j = 0; j < reloc_count; j++) { if ((res = epic_file_read( fd, &rel, sizeof(Elf32_Rel))) != sizeof(Elf32_Rel)) { @@ -464,7 +464,7 @@ static int _run_relocations( // (ie., do not resolve relocation - they default to a safe NULL) uint8_t skip = 0; if (sym != 0) { - for (int k = 0; k < li->weak_symbol_count; + for (uint32_t k = 0; k < li->weak_symbol_count; k++) { if (li->weak_symbols[k] == sym) { skip = 1; -- GitLab