Ryan O'Leary has uploaded this change for review.

View Change

Fix a handful of compiler warnings

These warnings (which I believe are not enabled by default) were
generated by -Wformat-security and -Wenum-conversion.

Change-Id: I3d01f4ff620f4c4111dd675d49ce3254f2360b29
Signed-off-by: Ryan O'Leary <ryanoleary@google.com>
---
M libflashrom.c
M print.c
M programmer.h
3 files changed, 7 insertions(+), 5 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/46/36946/1
diff --git a/libflashrom.c b/libflashrom.c
index 0dec22e..b15b5f6 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -188,7 +188,8 @@
for (; i < boards_known_size; ++i) {
supported_boards[i].vendor = binfo[i].vendor;
supported_boards[i].name = binfo[i].name;
- supported_boards[i].working = binfo[i].working;
+ supported_boards[i].working =
+ (enum flashrom_test_state)binfo[i].working;
}
} else {
msg_gerr("Memory allocation error!\n");
@@ -226,8 +227,9 @@
supported_chipsets[i].chipset = chipset[i].device_name;
supported_chipsets[i].vendor_id = chipset[i].vendor_id;
supported_chipsets[i].chipset_id = chipset[i].device_id;
- supported_chipsets[i].status = chipset[i].status;
- }
+ supported_chipsets[i].status =
+ (enum flashrom_test_state)chipset[i].status;
+ }
} else {
msg_gerr("Memory allocation error!\n");
}
diff --git a/print.c b/print.c
index 596fc53..173c7da 100644
--- a/print.c
+++ b/print.c
@@ -401,7 +401,7 @@
for (i = 0; i < maxboardlen - strlen(b->name); i++)
msg_ginfo(" ");

- msg_pinfo(test_state_to_text(b->working));
+ msg_pinfo("%s", test_state_to_text(b->working));

for (e = board_matches; e->vendor_name != NULL; e++) {
if (strcmp(e->vendor_name, b->vendor)
diff --git a/programmer.h b/programmer.h
index 5a21b2e..96add05 100644
--- a/programmer.h
+++ b/programmer.h
@@ -307,7 +307,7 @@

/* cbtable.c */
int cb_parse_table(const char **vendor, const char **model);
-int cb_check_image(const uint8_t *bios, unsigned int size);
+int cb_check_image(const uint8_t *image, unsigned int size);

/* dmi.c */
#if defined(__i386__) || defined(__x86_64__)

To view, visit change 36946. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3d01f4ff620f4c4111dd675d49ce3254f2360b29
Gerrit-Change-Number: 36946
Gerrit-PatchSet: 1
Gerrit-Owner: Ryan O'Leary <ryanoleary@google.com>
Gerrit-MessageType: newchange