While reviewing https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/345 I found several lines where a variable was not properly initialized. The basic pattern is:
type varName =
#ifdef SOME_DEFINED_VALUE
type someOtherVar = theVarsValue;
...
#endif // SOME_DEFINED_VALUE
This is problematic from two perspectives as the variable (varName) is not actually initialized with its correct value in a verifiable manner:
someOtherVar converted to its type.We should look at the git history of each file to try to determine if something was improperly removed in order to try to determine the correct values.
List of occurrences found in the PR:
g_game.sound_enabled = on engine/src/aldrv/al_init.cpp, line 162 (https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/345#discussion_r528777404)g_game.max_sound_sources = on engine/src/aldrv/al_init.cpp, line 176 (https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/345#discussion_r529201188)int used = on engine/src/audio/codecs/FFStream.cpp, line 278 (https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/345#discussion_r529205347)More occurrences:
WSK_BACKSPACE = on line 88 of engine/src/gldrv/winsys.hWSK_DELETE = on line 94 of engine/src/gldrv/winsys.hWSK_BACKSPACE = on line 215 of engine/src/gldrv/winsys.hWSK_DELETE = on line 221 of engine/src/gldrv/winsys.hThese are probably causing some of the compile errors on Windows. (Since AL_whatever_it_is is undefined there for some reason.)
@stephengtuggy there's probably more, we just discovered these in the PR. We'll get there. Just will take some time and effort to find them all.
@BenjamenMeyer Yep. We might be able to run some sort of multi-line regex search to find the rest, I'm thinking. (I.e., search for an equals sign that has nothing but whitespace after it until the end of the line, then a #if at the beginning of the next line.)