diff --git a/plat/cpm/emu/biosbdos.c b/plat/cpm/emu/biosbdos.c index 0e0a4890e..4eb87aca4 100644 --- a/plat/cpm/emu/biosbdos.c +++ b/plat/cpm/emu/biosbdos.c @@ -114,7 +114,8 @@ static void bios_warmboot(void) close(fd); int offset = 1; - for (int word = 1; user_command_line[word]; word++) + int word; + for (word = 1; user_command_line[word]; word++) { if (word > 1) { diff --git a/plat/cpm/emu/emulator.c b/plat/cpm/emu/emulator.c index 09d58e18b..63a40a671 100644 --- a/plat/cpm/emu/emulator.c +++ b/plat/cpm/emu/emulator.c @@ -104,11 +104,12 @@ static void cmd_register(void) static void cmd_break(void) { + int i; char* w1 = strtok(NULL, delimiters); if (w1) { uint16_t breakpc = strtoul(w1, NULL, 16); - for (int i=0; ienabled) @@ -149,7 +151,7 @@ static void cmd_watch(void) } else { - for (int i=0; ienabled) @@ -160,11 +162,12 @@ static void cmd_watch(void) static void cmd_delete_breakpoint(void) { + int i; char* w1 = strtok(NULL, delimiters); if (w1) { uint16_t breakpc = strtoul(w1, NULL, 16); - for (int i=0; ienabled && (w->address == address)) @@ -197,6 +201,7 @@ static void cmd_delete_watchpoint(void) static void cmd_memory(void) { + int i; char* w1 = strtok(NULL, delimiters); char* w2 = strtok(NULL, delimiters); @@ -215,7 +220,7 @@ static void cmd_memory(void) while (p < endrounded) { printf("%04x : ", p); - for (int i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { uint16_t pp = p + i; if ((pp >= startaddr) && (pp < endaddr)) @@ -224,7 +229,7 @@ static void cmd_memory(void) printf(" "); } printf(": "); - for (int i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { uint16_t pp = p + i; if ((pp >= startaddr) && (pp < endaddr)) @@ -359,7 +364,8 @@ static void sigusr1_cb(int number) void emulator_init(void) { - for (int i=0; ienabled && (ram[w->address] != w->value)) diff --git a/plat/cpm/emu/fileio.c b/plat/cpm/emu/fileio.c index 2b338cd66..a193805eb 100644 --- a/plat/cpm/emu/fileio.c +++ b/plat/cpm/emu/fileio.c @@ -37,11 +37,12 @@ static DIR* currentdir; void files_init(void) { - for (int i=0; ibytes; char* pout = unixfilename; - for (int i=0; i<8; i++) + for (i=0; i<8; i++) { char c = *pin++; if (c != ' ') *pout++ = tolower(c); } *pout++ = '.'; - for (int i=0; i<3; i++) + for (i=0; i<3; i++) { char c = *pin++; if (c != ' ') @@ -169,10 +171,11 @@ static bool unix_filename_to_cpm(const char* unixfilename, cpm_filename_t* cpmfi static bool match_filenames(cpm_filename_t* pattern, cpm_filename_t* filename) { + int i; if (pattern->drive != filename->drive) return false; - for (int i=0; ibytes); i++) + for (i=0; ibytes); i++) { char p = pattern->bytes[i]; if (p == '?')