From e7385d14b1577114b3b7aae0969e45fae67e4331 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Fri, 20 Jan 2017 23:29:21 +0100 Subject: nvramcui: Declare variable outside for loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the code C89 compatible, which doesn’t allow loop initial declarations. Older compilers use C89 by default, so just declare the variable outside. Change-Id: I3c5a8109e66f7a25687f4e4b2c72718d74276e04 Signed-off-by: Paul Menzel Reviewed-on: https://review.coreboot.org/18196 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- payloads/nvramcui/nvramcui.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/payloads/nvramcui/nvramcui.c b/payloads/nvramcui/nvramcui.c index 84e5536dfb..97be9df2fe 100644 --- a/payloads/nvramcui/nvramcui.c +++ b/payloads/nvramcui/nvramcui.c @@ -90,8 +90,9 @@ static void cmos_walk_options(struct cb_cmos_option_table *opttbl, FIELD **fields, int numopts, int maxlength) { struct cb_cmos_entries *option = first_cmos_entry(opttbl); + int i; - for (int i = 0; i < numopts; i++) { + for (i = 0; i < numopts; i++) { while ((option->config == 'r') || (strcmp("check_sum", (char *)option->name) == 0)) { option = next_cmos_entry(option); @@ -173,6 +174,7 @@ static void cmos_walk_options(struct cb_cmos_option_table *opttbl, int main(void) { int ch, done; + int i; /* coreboot data structures */ lib_get_sysinfo(); @@ -268,7 +270,7 @@ int main(void) endwin(); - for (int i = 0; i < numopts; i++) { + for (i = 0; i < numopts; i++) { char *name = field_buffer(fields[2 * i], 0); char *value = field_buffer(fields[2 * i + 1], 0); char *ptr; -- cgit v1.2.3