summaryrefslogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2018-12-23 20:03:35 +0100
committerNico Huber <nico.h@gmx.de>2019-07-31 08:26:59 +0000
commit519be66fc59558971dd653afe69ccaf1a633b492 (patch)
tree74f0912de156a86d56111f377db080246e5205e9 /layout.c
parentef78de4a21323b8c459337356289218211f2c5ce (diff)
downloadflashrom-519be66fc59558971dd653afe69ccaf1a633b492.tar.gz
flashrom-519be66fc59558971dd653afe69ccaf1a633b492.tar.bz2
flashrom-519be66fc59558971dd653afe69ccaf1a633b492.zip
Fix -Wsign-compare trouble
Mostly by changing to `unsigned` types where applicable, sometimes `signed` types, and casting as a last resort. Change-Id: I08895543ffb7a48058bcf91ef6500ca113f2d305 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/30409 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jacob Garber <jgarber1@ualberta.ca>
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/layout.c b/layout.c
index 6e476c21e..d80b01fa6 100644
--- a/layout.c
+++ b/layout.c
@@ -46,7 +46,8 @@ int read_romlayout(const char *name)
struct flashrom_layout *const layout = get_global_layout();
FILE *romlayout;
char tempstr[256], tempname[256];
- int i, ret = 1;
+ unsigned int i;
+ int ret = 1;
romlayout = fopen(name, "r");
@@ -154,7 +155,7 @@ static int find_romentry(struct flashrom_layout *const l, char *name)
*/
int process_include_args(struct flashrom_layout *l, const struct layout_include_args *const args)
{
- int found = 0;
+ unsigned int found = 0;
const struct layout_include_args *tmp;
if (args == NULL)
@@ -193,7 +194,7 @@ int process_include_args(struct flashrom_layout *l, const struct layout_include_
void layout_cleanup(struct layout_include_args **args)
{
struct flashrom_layout *const layout = get_global_layout();
- int i;
+ unsigned int i;
struct layout_include_args *tmp;
while (*args) {
@@ -216,7 +217,7 @@ int normalize_romentries(const struct flashctx *flash)
chipsize_t total_size = flash->chip->total_size * 1024;
int ret = 0;
- int i;
+ unsigned int i;
for (i = 0; i < layout->num_entries; i++) {
if (layout->entries[i].start >= total_size || layout->entries[i].end >= total_size) {
msg_gwarn("Warning: Address range of region \"%s\" exceeds the current chip's "