From 2644e2ac5362d19e0ba8a2497de95e37a81853be Mon Sep 17 00:00:00 2001 From: Bryce Denney Date: Tue, 3 Sep 2002 15:59:52 +0000 Subject: [PATCH] - can't use "for (int i=0; ...)" twice because some compilers (e.g. MSVC++) think i is still defined the second time. - MSVC++: can't use a variable to define another variable's array bounds. Now I use a #define for the array bounds instead. --- bochs/main.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bochs/main.cc b/bochs/main.cc index a4881f99d..5ef7c0b98 100644 --- a/bochs/main.cc +++ b/bochs/main.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: main.cc,v 1.132 2002-09-03 08:42:23 bdenney Exp $ +// $Id: main.cc,v 1.133 2002-09-03 15:59:52 bdenney Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -262,7 +262,8 @@ char *bx_param_string_handler (bx_param_string_c *param, int set, char *val, int void bx_init_options () -{ +{ + int i; bx_list_c *menu; bx_list_c *deplist; char name[1024], descr[1024]; @@ -533,13 +534,14 @@ void bx_init_options () bx_options.memory.Osize->set_ask_format ("Enter memory size (MB): [%d] "); // initialize serial and parallel port options - int max = (BXP_PARAMS_PER_PARALLEL_PORT * BX_N_PARALLEL_PORTS) - + (BXP_PARAMS_PER_SERIAL_PORT * BX_N_SERIAL_PORTS); - bx_param_c *par_ser_init_list[1+max]; +#define PAR_SER_INIT_LIST_MAX \ + ((BXP_PARAMS_PER_PARALLEL_PORT * BX_N_PARALLEL_PORTS) \ + + (BXP_PARAMS_PER_SERIAL_PORT * BX_N_SERIAL_PORTS)) + bx_param_c *par_ser_init_list[1+PAR_SER_INIT_LIST_MAX]; bx_param_c **par_ser_ptr = &par_ser_init_list[0]; // parallel ports - for (int i=0; i