Fix all mingw errors & warnings (#411)

* Use COMPAT_MODE macro to fix errors with mingw gcc 12.2

* MxOmni::m_timerRunning is a MxBool

* MxDirect3D::m_unk0x88c is a MxBool

* MxBackgroundAudioManager::m_unk0x13c is a MxS32

* Fix warning: deleting 'void*' is undefined [-Wdelete-incomplete]

* Fix inline function 'void TglImpl::RendererImpl::Destroy()' used but never defined

* Fix warning: inline function 'MxStreamerSubClass1::MxStreamerSubClass1(undefined4)' used but never defined

* Use `FALSE` for m_timerRunning

* Format

* Format

* Remove comment

* Limit scope for variables in compat mode

* clang-format

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Anonymous Maarten
2024-01-07 18:30:45 +01:00
committed by GitHub
parent bb7e4df11b
commit fbe7f8bbb0
16 changed files with 144 additions and 40 deletions

View File

@@ -81,8 +81,16 @@ MxLong MxStreamer::Close(const char* p_name)
if (c->FUN_100c20d0(ds))
delete c;
else
else {
#ifdef COMPAT_MODE
{
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
NotificationManager()->Send(this, &notification);
}
#else
NotificationManager()->Send(this, &MxStreamerNotification(MXSTREAMER_DELETE_NOTIFY, NULL, c));
#endif
}
return SUCCESS;
}
@@ -185,20 +193,17 @@ MxLong MxStreamer::Notify(MxParam& p_param)
if (c->FUN_100c20d0(ds))
delete c;
else
else {
#ifdef COMPAT_MODE
{
MxStreamerNotification notification(MXSTREAMER_DELETE_NOTIFY, NULL, c);
NotificationManager()->Send(this, &notification);
}
#else
NotificationManager()->Send(this, &MxStreamerNotification(MXSTREAMER_DELETE_NOTIFY, NULL, c));
#endif
}
}
return 0;
}
// No offset, function is always inlined
MxStreamerSubClass1::MxStreamerSubClass1(undefined4 p_size)
{
m_buffer = NULL;
m_size = p_size;
undefined4* ptr = &m_unk0x08;
for (int i = 0; i >= 0; i--) {
ptr[i] = 0;
}
}