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>
This commit is contained in:
Paul Menzel 2017-01-20 23:29:21 +01:00 committed by Patrick Georgi
parent 06a629e4b1
commit e7385d14b1
1 changed files with 4 additions and 2 deletions

View File

@ -90,8 +90,9 @@ static void cmos_walk_options(struct cb_cmos_option_table *opttbl,
FIELD **fields, int numopts, int maxlength) FIELD **fields, int numopts, int maxlength)
{ {
struct cb_cmos_entries *option = first_cmos_entry(opttbl); 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') || while ((option->config == 'r') ||
(strcmp("check_sum", (char *)option->name) == 0)) { (strcmp("check_sum", (char *)option->name) == 0)) {
option = next_cmos_entry(option); option = next_cmos_entry(option);
@ -173,6 +174,7 @@ static void cmos_walk_options(struct cb_cmos_option_table *opttbl,
int main(void) int main(void)
{ {
int ch, done; int ch, done;
int i;
/* coreboot data structures */ /* coreboot data structures */
lib_get_sysinfo(); lib_get_sysinfo();
@ -268,7 +270,7 @@ int main(void)
endwin(); endwin();
for (int i = 0; i < numopts; i++) { for (i = 0; i < numopts; i++) {
char *name = field_buffer(fields[2 * i], 0); char *name = field_buffer(fields[2 * i], 0);
char *value = field_buffer(fields[2 * i + 1], 0); char *value = field_buffer(fields[2 * i + 1], 0);
char *ptr; char *ptr;