diff --git a/source/sw/src/config.cpp b/source/sw/src/config.cpp index a939943c3..f4c20b8ca 100644 --- a/source/sw/src/config.cpp +++ b/source/sw/src/config.cpp @@ -250,7 +250,7 @@ void CONFIG_SetDefaults(void) } memset(JoystickDigitalAxes, -1, sizeof(JoystickDigitalAxes)); - for (i=0; i < (int32_t)(sizeof(joystickanalogdefaults)/sizeof(char *)); i++) + for (i=0; i < MAXJOYAXES; i++) { JoystickAnalogScale[i] = 65536; JoystickAnalogDead[i] = 1024; diff --git a/source/sw/src/console.cpp b/source/sw/src/console.cpp index d704dbb58..6f5e7e4e3 100644 --- a/source/sw/src/console.cpp +++ b/source/sw/src/console.cpp @@ -816,12 +816,9 @@ int TileRangeMem(int start) void CON_Cache(void) { - char incache[8192]; // 8192 so it can index maxwalls as well + char incache[MAXTILES]{}; int i,j,tottiles,totsprites,totactors; - - memset(incache,0,8192); - // Calculate all level tiles, non-actor stuff for (i=0; i 0) tottiles += tilesiz[i].x*tilesiz[i].y; ////////////////////////////////////////////// - memset(incache,0,8192); + memset(incache, 0, sizeof(incache)); // Sprites on the stat list get counted as cached, others don't for (i=0; i 0) {