Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all mingw errors & warnings #411

Merged
merged 15 commits into from
Jan 7, 2024
Merged

Conversation

madebr
Copy link
Contributor

@madebr madebr commented Jan 6, 2024

When building with mingw gcc 10 from ubuntu 22.04, I saw a couple more warnings.

In the last 2 commits, I also fixed the "inline function used but not defined warning".
If those decrease accuracy, perhaps these aren't inlined in the first place?

(I did not yet test the resulting exe + dll on Windows)

@foxtacles
Copy link
Member

foxtacles commented Jan 6, 2024

Looks good to me.

To match functionality precisely (or at least better), you should add a scope in those instances where a "temporary" object is passed by reference, otherwise the destructor will not be called at the right time. So instead of:

#ifdef COMPAT_MODE
	MxAtomIdCounter id_counter(m_internal);
	MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(&id_counter);
#else
	MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(&MxAtomIdCounter(m_internal));
#endif

it would have to be:

#ifdef COMPAT_MODE
	{
		MxAtomIdCounter id_counter(m_internal);
		MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(&id_counter);
	}
#else
	MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(&MxAtomIdCounter(m_internal));
#endif

This most likely won't make a difference, but could theoretically introduce bugs in the "compat" version if not changed.

@foxtacles foxtacles merged commit fbe7f8b into isledecomp:master Jan 7, 2024
10 checks passed
@madebr
Copy link
Contributor Author

madebr commented Jan 7, 2024

Thanks! When I boot my Windows box, I'm going to test building with msys2 and Visual Studio 2019,
and of course also try executing them.

Thanks for the quick reviews and fast responses! It's really nice to have somebody on top of things.

@madebr madebr deleted the mingw-fixes branch January 7, 2024 17:40
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.

2 participants