From fdb5fabc8660e0b733257ad7ccb4968d0f73be44 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 10 Apr 2019 01:01:07 +0000 Subject: [PATCH] SW: Fix -Waggressive-loop-optimizations git-svn-id: https://svn.eduke32.com/eduke32@7562 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/sw/src/config.cpp | 2 +- source/sw/src/console.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) 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) {