libopenbmc_intf: fix various warnings
Trying to compile with stricter warnings results in numerous
errors, such as ignored results and unsigned/signed comparisons.
Fix these in libopenbmc_intf.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia0b34fdc27b32675082741a0f3c18f0b538be108
diff --git a/libopenbmc_intf/gpio_json.c b/libopenbmc_intf/gpio_json.c
index ae13c90..ec85c16 100644
--- a/libopenbmc_intf/gpio_json.c
+++ b/libopenbmc_intf/gpio_json.c
@@ -29,7 +29,7 @@
}
fseek(fd, 0, SEEK_END);
- long size = ftell(fd);
+ size_t size = (size_t) ftell(fd);
rewind(fd);
char* data = malloc(size + 1);
@@ -39,7 +39,7 @@
if (rc != size)
{
free(data);
- fprintf(stderr, "Only read %d out of %ld bytes of GPIO file %s\n",
+ fprintf(stderr, "Only read %zd out of %zd bytes of GPIO file %s\n",
rc, size, GPIO_FILE);
return NULL;
}