Fix warnings

This commit is contained in:
Christian Semmler 2024-02-01 15:26:44 -05:00
parent f466c089c4
commit f3abc48000
10 changed files with 23 additions and 22 deletions

View File

@ -239,7 +239,7 @@ void MxControlPresenter::VTable0x6c(MxS16 p_val)
MxS16 i = 0; MxS16 i = 0;
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) { for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
(*it)->Enable((m_unk0x4c == 3 && m_unk0x4e == 0 || !IsEnabled()) ? FALSE : m_unk0x4e == i); (*it)->Enable(((m_unk0x4c == 3 && m_unk0x4e == 0) || !IsEnabled()) ? FALSE : m_unk0x4e == i);
i++; i++;
} }
} }

View File

@ -537,7 +537,7 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p_param)
return FAILURE; return FAILURE;
} }
if (m_soundManager = new LegoSoundManager()) { if ((m_soundManager = new LegoSoundManager())) {
if (m_soundManager->Create(10, 0) != SUCCESS) { if (m_soundManager->Create(10, 0) != SUCCESS) {
delete m_soundManager; delete m_soundManager;
m_soundManager = NULL; m_soundManager = NULL;
@ -545,14 +545,14 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p_param)
} }
} }
if (m_videoManager = new LegoVideoManager()) { if ((m_videoManager = new LegoVideoManager())) {
if (m_videoManager->Create(p_param.GetVideoParam(), 100, 0) != SUCCESS) { if (m_videoManager->Create(p_param.GetVideoParam(), 100, 0) != SUCCESS) {
delete m_videoManager; delete m_videoManager;
m_videoManager = NULL; m_videoManager = NULL;
} }
} }
if (m_inputMgr = new LegoInputManager()) { if ((m_inputMgr = new LegoInputManager())) {
if (m_inputMgr->Create(p_param.GetWindowHandle()) != SUCCESS) { if (m_inputMgr->Create(p_param.GetWindowHandle()) != SUCCESS) {
delete m_inputMgr; delete m_inputMgr;
m_inputMgr = NULL; m_inputMgr = NULL;

View File

@ -747,7 +747,7 @@ int MxDeviceEnumerate::FUN_1009d0d0()
} }
if ((und && (*it2).m_HELDesc.dcmColorModel == D3DCOLOR_RGB && i == 0) || if ((und && (*it2).m_HELDesc.dcmColorModel == D3DCOLOR_RGB && i == 0) ||
(*it2).m_HELDesc.dcmColorModel == D3DCOLOR_MONO && i == 0 && k < 0) { ((*it2).m_HELDesc.dcmColorModel == D3DCOLOR_MONO && i == 0 && k < 0)) {
k = j; k = j;
} }

View File

@ -118,8 +118,8 @@ MxBool KeyValueStringParse(char* p_outputValue, const char* p_key, const char* p
MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* p_presenter) MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* p_presenter)
{ {
for (MxCompositePresenterList::iterator it = p_presenterList.begin(); it != p_presenterList.end(); it++) { for (MxCompositePresenterList::iterator it = p_presenterList.begin(); it != p_presenterList.end(); it++) {
if (p_presenter == *it || (*it)->IsA("MxCompositePresenter") && if (p_presenter == *it || ((*it)->IsA("MxCompositePresenter") &&
ContainsPresenter(((MxCompositePresenter*) *it)->GetList(), p_presenter)) { ContainsPresenter(((MxCompositePresenter*) *it)->GetList(), p_presenter))) {
return TRUE; return TRUE;
} }
} }

View File

@ -190,7 +190,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p_param)
} }
if (p_param.CreateFlags().CreateNotificationManager()) { if (p_param.CreateFlags().CreateNotificationManager()) {
if (m_notificationManager = new MxNotificationManager()) { if ((m_notificationManager = new MxNotificationManager())) {
if (m_notificationManager->Create(100, 0) != SUCCESS) { if (m_notificationManager->Create(100, 0) != SUCCESS) {
goto done; goto done;
} }
@ -207,7 +207,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p_param)
} }
if (p_param.CreateFlags().CreateVideoManager()) { if (p_param.CreateFlags().CreateVideoManager()) {
if (m_videoManager = new MxVideoManager()) { if ((m_videoManager = new MxVideoManager())) {
if (m_videoManager->Create(p_param.GetVideoParam(), 100, 0) != SUCCESS) { if (m_videoManager->Create(p_param.GetVideoParam(), 100, 0) != SUCCESS) {
delete m_videoManager; delete m_videoManager;
m_videoManager = NULL; m_videoManager = NULL;
@ -216,7 +216,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p_param)
} }
if (p_param.CreateFlags().CreateSoundManager()) { if (p_param.CreateFlags().CreateSoundManager()) {
if (m_soundManager = new MxSoundManager()) { if ((m_soundManager = new MxSoundManager())) {
if (m_soundManager->Create(10, 0) != SUCCESS) { if (m_soundManager->Create(10, 0) != SUCCESS) {
delete m_soundManager; delete m_soundManager;
m_soundManager = NULL; m_soundManager = NULL;
@ -225,7 +225,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p_param)
} }
if (p_param.CreateFlags().CreateMusicManager()) { if (p_param.CreateFlags().CreateMusicManager()) {
if (m_musicManager = new MxMusicManager()) { if ((m_musicManager = new MxMusicManager())) {
if (m_musicManager->Create(50, 0) != SUCCESS) { if (m_musicManager->Create(50, 0) != SUCCESS) {
delete m_musicManager; delete m_musicManager;
m_musicManager = NULL; m_musicManager = NULL;
@ -234,7 +234,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p_param)
} }
if (p_param.CreateFlags().CreateEventManager()) { if (p_param.CreateFlags().CreateEventManager()) {
if (m_eventManager = new MxEventManager()) { if ((m_eventManager = new MxEventManager())) {
if (m_eventManager->Create(50, 0) != SUCCESS) { if (m_eventManager->Create(50, 0) != SUCCESS) {
delete m_eventManager; delete m_eventManager;
m_eventManager = NULL; m_eventManager = NULL;
@ -243,6 +243,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p_param)
} }
result = SUCCESS; result = SUCCESS;
done: done:
if (result != SUCCESS) { if (result != SUCCESS) {
Destroy(); Destroy();

View File

@ -128,9 +128,9 @@ void MxNotificationManager::FlushPending(MxCore* p_listener)
MxNotificationPtrList::iterator it = m_sendList->begin(); MxNotificationPtrList::iterator it = m_sendList->begin();
while (it != m_sendList->end()) { while (it != m_sendList->end()) {
notif = *it; notif = *it;
if ((notif->GetTarget()->GetId() == p_listener->GetId()) || if (notif->GetTarget()->GetId() == p_listener->GetId() ||
(notif->GetParam()->GetSender()) && (notif->GetParam()->GetSender() && notif->GetParam()->GetSender()->GetId() == p_listener->GetId()
(notif->GetParam()->GetSender()->GetId() == p_listener->GetId())) { )) {
m_sendList->erase(it++); m_sendList->erase(it++);
pending.push_back(notif); pending.push_back(notif);
} }
@ -143,8 +143,8 @@ void MxNotificationManager::FlushPending(MxCore* p_listener)
MxNotificationPtrList::iterator it = m_queue->begin(); MxNotificationPtrList::iterator it = m_queue->begin();
while (it != m_queue->end()) { while (it != m_queue->end()) {
notif = *it; notif = *it;
if ((notif->GetTarget()->GetId() == p_listener->GetId()) || if (notif->GetTarget()->GetId() == p_listener->GetId() ||
(notif->GetParam()->GetSender()) && (notif->GetParam()->GetSender()->GetId() == p_listener->GetId())) { (notif->GetParam()->GetSender() && notif->GetParam()->GetSender()->GetId() == p_listener->GetId())) {
m_queue->erase(it++); m_queue->erase(it++);
pending.push_back(notif); pending.push_back(notif);
} }

View File

@ -169,7 +169,7 @@ MxResult MxDSBuffer::FUN_100c67b0(
} }
MxU8* data; MxU8* data;
while (data = (MxU8*) SkipToData()) { while ((data = (MxU8*) SkipToData())) {
if (*p_streamingAction == NULL) { if (*p_streamingAction == NULL) {
result = CreateObject(p_controller, (MxU32*) data, p_action, p_streamingAction); result = CreateObject(p_controller, (MxU32*) data, p_action, p_streamingAction);

View File

@ -15,7 +15,7 @@ MxSemaphore::MxSemaphore()
MxResult MxSemaphore::Init(MxU32 p_initialCount, MxU32 p_maxCount) MxResult MxSemaphore::Init(MxU32 p_initialCount, MxU32 p_maxCount)
{ {
MxResult result = FAILURE; MxResult result = FAILURE;
if (m_hSemaphore = CreateSemaphoreA(NULL, p_initialCount, p_maxCount, NULL)) { if ((m_hSemaphore = CreateSemaphoreA(NULL, p_initialCount, p_maxCount, NULL))) {
result = SUCCESS; result = SUCCESS;
} }
return result; return result;

View File

@ -63,8 +63,8 @@ MxResult MxThread::Start(MxS32 p_stack, MxS32 p_flag)
{ {
MxResult result = FAILURE; MxResult result = FAILURE;
if (m_semaphore.Init(0, 1) == SUCCESS) { if (m_semaphore.Init(0, 1) == SUCCESS) {
if (m_hThread = if ((m_hThread =
_beginthreadex(NULL, p_stack << 2, (ThreadFunc) &MxThread::ThreadProc, this, p_flag, &m_threadId)) { _beginthreadex(NULL, p_stack << 2, (ThreadFunc) &MxThread::ThreadProc, this, p_flag, &m_threadId))) {
result = SUCCESS; result = SUCCESS;
} }
} }

View File

@ -347,7 +347,7 @@ void MxVideoPresenter::PutFrame()
MxRegionCursor cursor(region); MxRegionCursor cursor(region);
MxRect32* regionRect; MxRect32* regionRect;
while (regionRect = cursor.VTable0x24(rect)) { while ((regionRect = cursor.VTable0x24(rect))) {
if (regionRect->GetWidth() >= 1 && regionRect->GetHeight() >= 1) { if (regionRect->GetWidth() >= 1 && regionRect->GetHeight() >= 1) {
if (m_unk0x58) { if (m_unk0x58) {
rectSrc.SetLeft(regionRect->GetLeft() - m_location.GetX()); rectSrc.SetLeft(regionRect->GetLeft() - m_location.GetX());