summaryrefslogtreecommitdiff
path: root/util/archive
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2021-02-13 22:40:46 -0700
committerPatrick Georgi <pgeorgi@google.com>2021-02-16 08:11:21 +0000
commit86d6816db21b9d8ecb3ae31f54542f721e893ebc (patch)
treecaeac6fc262be35c59d067061df66701cfd6b12c /util/archive
parentd509076044a353f89f2d6751e0cb8ee923ba4b2f (diff)
downloadcoreboot-86d6816db21b9d8ecb3ae31f54542f721e893ebc.tar.xz
util/archive: fix warnings
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 <martin@coreboot.org> Change-Id: I57ee8b31bbc9e97168e3b818c4d053eadf8a4f84 Reviewed-on: https://review.coreboot.org/c/coreboot/+/50651 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/archive')
-rw-r--r--util/archive/archive.c8
1 files changed, 4 insertions, 4 deletions
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++) {