src/lib/hexdump: Use size_t for indices

Spotted out using -Wconversion gcc warning option.

Change-Id: I29a7ae8c499bb1e8ab7c8741b2dfb7663d82a362
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33799
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jacob Garber <jgarber1@ualberta.ca>
This commit is contained in:
Elyes HAOUAS 2019-06-26 09:52:17 +02:00 committed by Patrick Georgi
parent 34b0d4804f
commit 65fe2948a9
1 changed files with 2 additions and 3 deletions

View File

@ -19,14 +19,13 @@
void hexdump(const void *memory, size_t length) void hexdump(const void *memory, size_t length)
{ {
int i; size_t i, j;
uint8_t *line; uint8_t *line;
int all_zero = 0; int all_zero = 0;
int all_one = 0; int all_one = 0;
size_t num_bytes; size_t num_bytes;
for (i = 0; i < length; i += 16) { for (i = 0; i < length; i += 16) {
int j;
num_bytes = MIN(length - i, 16); num_bytes = MIN(length - i, 16);
line = ((uint8_t *)memory) + i; 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) void hexdump32(char LEVEL, const void *d, size_t len)
{ {
int count = 0; size_t count = 0;
while (len > 0) { while (len > 0) {
if (count % 8 == 0) { if (count % 8 == 0) {