Skip to content

WoodyOPL: remove global static variables.#194

Open
mywave82 wants to merge 2 commits into
adplug:masterfrom
mywave82:woody-static
Open

WoodyOPL: remove global static variables.#194
mywave82 wants to merge 2 commits into
adplug:masterfrom
mywave82:woody-static

Conversation

@mywave82

Copy link
Copy Markdown
Contributor

Make them either static or part of the class depending on the usage.

Make them either static or part of the class depending on the usage.
@mywave82

Copy link
Copy Markdown
Contributor Author

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.

@mywave82

Copy link
Copy Markdown
Contributor Author

Should probably change .SO version, since the CWemuopl contains a instance of OPLChipClass that is not allocated

@binarymaster

Copy link
Copy Markdown
Member

Is this in sync with upstream? (if not, any chance to send patch upstream?)

@mywave82

Copy link
Copy Markdown
Contributor Author

Upstream for this file will be DosBox (vanilla), and we can push this upstream to them when this patch is finished here.

@mywave82

Copy link
Copy Markdown
Contributor Author

Upstream DOSBOX and DOSBOX-X are not using classes, so upstream would require more changes. We can notify them after we apply.

@Malvineous

Copy link
Copy Markdown
Member

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.

@mywave82

Copy link
Copy Markdown
Contributor Author

The original DOSBox project are only doing bugfixes and compatibility-fixes.
DOSBox-X seems to very quite active, but not on this code.

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 ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants