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>
diff --git a/layout.c b/layout.c
index 6e476c2..d80b01f 100644
--- a/layout.c
+++ b/layout.c
@@ -46,7 +46,8 @@
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 @@
*/
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 @@
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 @@
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 "