WINTERMUTE: Fix Duplicated Branch GCC Warnings

These are emitted if -Wduplicated-branches is passed.
This commit is contained in:
D G Turner 2021-11-07 00:12:58 +00:00
parent 16bf767de3
commit ff4cd452b5
4 changed files with 10 additions and 9 deletions

View File

@ -1898,15 +1898,18 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetSavingScreen") == 0) {
stack->correctParams(3);
ScValue *val = stack->pop();
/* ScValue *val = */stack->pop();
int saveImageX = stack->pop()->getInt();
int saveImageY = stack->pop()->getInt();
// FIXME: Dead code or bug?
#if 0
if (val->isNULL()) {
_renderer->setSaveImage(NULL, saveImageX, saveImageY);
} else {
#endif
_renderer->setSaveImage(NULL, saveImageX, saveImageY);
}
//}
stack->pushNULL();
return STATUS_OK;
}

View File

@ -377,9 +377,7 @@ bool PartEmitter::sortParticlesByZ() {
bool PartEmitter::compareZ(const PartParticle *p1, const PartParticle *p2) {
if (p1->_posZ < p2->_posZ) {
return true;
} else if (p1->_posZ > p2->_posZ) {
return false;
} else {
} else { // p1->_posZ >= p2->_posZ
return false;
}
}

View File

@ -106,8 +106,8 @@ bool SXDirectory::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSt
// used in secret scene of "Art of Murder 1: FBI Confidential"
if (strcmp(dirName, "X:\\FBI\\data\\scenes\\17-magic\\") == 0 && strcmp(name, "GetDirectories") == 0) {
//TODO: return list of "scenes\17-magic" subfolders from data.dcp
warning("Directory.%s is not implemented! Returning empty array...", name);
// TODO: return list of "scenes\17-magic" subfolders from data.dcp
warning("FBI\\scenes\\17-magic Directory.%s is not implemented! Returning empty array...", name);
} else {
// No currently known games need this
warning("Directory.%s is not implemented! Returning empty array...", name);

View File

@ -419,9 +419,9 @@ bool SXMemBuffer::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSt
memcpy((byte *)_buffer+Start, &Pointer, sizeof(void*));
stack->pushBool(true);
*/
// TODO fix
// TODO: fix
debug(3, "SXMemBuffer::ScCallMethod - SetPointer Bounds FIXME");
stack->pushBool(false);
}
return STATUS_OK;
}