compilers which dont build in C99 mode by default are super lame

This commit is contained in:
Richard Goedeken 2018-03-12 22:10:40 -07:00
parent e90085e34d
commit 5485240100

View file

@ -235,6 +235,7 @@ int debugger_loop(void *arg) {
}
else if (strncmp(input, "mem", 3) == 0) {
uint32_t readAddr, length=1, rows=1, size=4;
uint32_t i, j;
char chSize;
if (sscanf(input, "mem /%ux%u%c %i", &rows, &length, &chSize, &readAddr) == 4 && (chSize == 'b' || chSize == 'h' || chSize == 'w' || chSize == 'd'))
{
@ -276,9 +277,9 @@ int debugger_loop(void *arg) {
printf("Improperly formatted memory read command: '%s'\n", input);
continue;
}
for (uint32_t i = 0; i < rows; i++)
for (i = 0; i < rows; i++)
{
for (uint32_t j = 0; j < length; j++)
for (j = 0; j < length; j++)
{
uint32_t thisAddr = readAddr + ((i * length) + j) * size;
switch(size)