summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
authorPaul Menzel <paulepanter@users.sourceforge.net>2017-01-20 23:29:21 +0100
committerPatrick Georgi <pgeorgi@google.com>2017-01-25 10:05:54 +0100
commite7385d14b1577114b3b7aae0969e45fae67e4331 (patch)
tree527ef06ae574487b2fedb75563ca8e91aa3a745a /payloads
parent06a629e4b1b7f517866adb984c169459a9b2ecdf (diff)
nvramcui: Declare variable outside for loop
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 <paulepanter@users.sourceforge.net> Reviewed-on: https://review.coreboot.org/18196 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/nvramcui/nvramcui.c6
1 files 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;