1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +02:00

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>
This commit is contained in:
Nico Huber
2018-12-23 20:03:35 +01:00
parent ef78de4a21
commit 519be66fc5
32 changed files with 116 additions and 107 deletions

View File

@ -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 "