From 86d6816db21b9d8ecb3ae31f54542f721e893ebc Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Sat, 13 Feb 2021 22:40:46 -0700 Subject: util/archive: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of these 4 warnings: archive.c: In function ‘set_file_name’: warning: comparison of integer expressions of different signedness archive.c: In function ‘add_file’: warning: comparison of integer expressions of different signedness archive.c: In function ‘archive_files’: warning: comparison of integer expressions of different signedness archive.c: In function ‘convert_endian’: warning: comparison of integer expressions of different signedness BUG=None TEST=Build and run Signed-off-by: Martin Roth Change-Id: I57ee8b31bbc9e97168e3b818c4d053eadf8a4f84 Reviewed-on: https://review.coreboot.org/c/coreboot/+/50651 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- util/archive/archive.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'util/archive') diff --git a/util/archive/archive.c b/util/archive/archive.c index 82a2f39062..f877632dcc 100644 --- a/util/archive/archive.c +++ b/util/archive/archive.c @@ -43,7 +43,7 @@ static int set_file_name(const char *path, struct dentry *dest) { struct dentry *entry; char *name, *copy; - int i; + uint32_t i; copy = strdup(path); name = basename(copy); @@ -106,7 +106,7 @@ static int add_file(const char *path, struct dentry *entry, uint32_t offset) path, errno, strerror(errno)); return -1; } - if (fread((char *)archive + offset, sizeof(char), size, fp) != size) { + if (fread((char *)archive + offset, sizeof(char), size, fp) != (size_t)size) { fprintf(stderr, "Error: failed to read %s\n", path); fclose(fp); return -1; @@ -169,7 +169,7 @@ static int archive_files(const char **files) { struct dentry *entry; uint32_t offset; - int i; + uint32_t i; entry = get_first_dentry(archive); offset = get_first_offset(archive); @@ -186,7 +186,7 @@ static int archive_files(const char **files) static void convert_endian(void) { struct dentry *entry; - int i; + uint32_t i; entry = get_first_dentry(archive); for (i = 0; i < archive->count; i++) { -- cgit v1.2.3