WoodyOPL: remove global static variables.#194
Conversation
Make them either static or part of the class depending on the usage.
|
gcc 13.1.0 gave warnings about assigning local arrays into global variables. So I decided to move all the global statics that could not be made const to inside the class. |
|
Should probably change .SO version, since the CWemuopl contains a instance of OPLChipClass that is not allocated |
|
Is this in sync with upstream? (if not, any chance to send patch upstream?) |
|
Upstream for this file will be DosBox (vanilla), and we can push this upstream to them when this patch is finished here. |
|
Upstream DOSBOX and DOSBOX-X are not using classes, so upstream would require more changes. We can notify them after we apply. |
|
Yeah the reason why this is "messy" is because it's almost a direct copy and paste from the DOSBox source code. This was done to make it easier to update as changes are made to the DOSBox version - we can just copy their file here. Once we start making changes to this file the two codebases will diverge, and it will be harder to bring updates across from the upstream code. So I'm in two minds about these sorts of changes. Yes it's good to clean up the code, but it will then make it much harder to bring across any changes from the upstream codebase. |
|
The original DOSBox project are only doing bugfixes and compatibility-fixes. The goal is to locate all the parts that potentially are using global variables, and thus multithread-safe and ensure that behaviour is consistent. Not all of these PRs has to be accepted ;-) |
Make them either static or part of the class depending on the usage.