From 65fe2948a91529c858fdae23a45408ca06953fcf Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Wed, 26 Jun 2019 09:52:17 +0200 Subject: src/lib/hexdump: Use size_t for indices Spotted out using -Wconversion gcc warning option. Change-Id: I29a7ae8c499bb1e8ab7c8741b2dfb7663d82a362 Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/c/coreboot/+/33799 Tested-by: build bot (Jenkins) Reviewed-by: Jacob Garber --- src/lib/hexdump.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/hexdump.c b/src/lib/hexdump.c index 1e689e3e53..2c9e483d1d 100644 --- a/src/lib/hexdump.c +++ b/src/lib/hexdump.c @@ -19,14 +19,13 @@ void hexdump(const void *memory, size_t length) { - int i; + size_t i, j; uint8_t *line; int all_zero = 0; int all_one = 0; size_t num_bytes; for (i = 0; i < length; i += 16) { - int j; num_bytes = MIN(length - i, 16); line = ((uint8_t *)memory) + i; @@ -65,7 +64,7 @@ void hexdump(const void *memory, size_t length) void hexdump32(char LEVEL, const void *d, size_t len) { - int count = 0; + size_t count = 0; while (len > 0) { if (count % 8 == 0) { -- cgit v1.2.3