Skip to content

Commit

Permalink
LILLIPUT: Silent some CppCheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and sev- committed Mar 28, 2018
1 parent b17dfaa commit 37067dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
17 changes: 6 additions & 11 deletions engines/lilliput/lilliput.cpp
Expand Up @@ -432,9 +432,8 @@ void LilliputEngine::displayInterfaceHotspots() {
if (_displayMap)
return;

int tmpVal;
for (int index = 0; index < _interfaceHotspotNumb; index++) {
tmpVal = _scriptHandler->_interfaceHotspotStatus[index] * 20;
int tmpVal = _scriptHandler->_interfaceHotspotStatus[index] * 20;
display16x16IndexedBuf(_bufferIdeogram, tmpVal + index, Common::Point(_interfaceHotspotsX[index], _interfaceHotspotsY[index]));
}
}
Expand Down Expand Up @@ -462,12 +461,10 @@ void LilliputEngine::displaySpeechBubble() {
static const byte _array15976[16] = {244, 248, 250, 250, 252, 252, 252, 252, 252, 252, 252, 252, 250, 250, 248, 244};

int index = 192;
int tmpIndex;
int var3;

for (int i = 0; i < 16; i++) {
var3 = _array15976[i];
tmpIndex = index - (var3 / 2);
int var3 = _array15976[i];
int tmpIndex = index - (var3 / 2);
var3 &= 0xFE;
for (int j = 0; j < var3; j++) {
((byte *)_mainSurface->getPixels())[tmpIndex + j] = 17;
Expand Down Expand Up @@ -1477,10 +1474,9 @@ void LilliputEngine::sub1693A_chooseDirections(int index) {
byte byte16939 = 0;

int mapIndex = ((_word16937Pos.y * 64) + _word16937Pos.x) * 4;
int mapIndexDiff = 0;
int retVal = 0;
for (int i = 3; i >= 0; i--) {
mapIndexDiff = mapArrayMove[i];
int mapIndexDiff = mapArrayMove[i];
assert(mapIndex + mapIndexDiff + 3 < 16384);
if (((_bufferIsoMap[mapIndex + mapIndexDiff + 3] & _array16C54[i]) != 0) && ((_bufferIsoMap[mapIndex + 3] & _array16C58[i]) != 0)) {
if ((_bufferIsoMap[mapIndex + mapIndexDiff + 3] & 0x80) != 0 && (sub16A76(i, index) != 0)) {
Expand Down Expand Up @@ -1606,11 +1602,10 @@ void LilliputEngine::numberToString(int param1) {

static const int _array18AE3[6] = {10000, 1000, 100, 10, 1};

int count;
int var1 = param1;
bool hideZeros = true;
for (int i = 0; i < 5; i++) {
count = 0;
int count = 0;
while (var1 >= 0) {
++count;
var1 -= _array18AE3[i];
Expand Down Expand Up @@ -2784,7 +2779,7 @@ void LilliputEngine::handleGameScripts() {
while (1);
*/

i = index;
//i = index;
//debugC(1, kDebugEngineTBC, "before char %d, pos %d %d, var0 %d, var1 %d, var2 %d var16 %d, script enabled %d", i, _characterPositionX[i], _characterPositionY[i], *getCharacterVariablesPtr(i * 32 + 0), *getCharacterVariablesPtr(i * 32 + 1), *getCharacterVariablesPtr(i * 32 + 2), *getCharacterVariablesPtr(i * 32 + 22), _scriptHandler->_characterScriptEnabled[i]);

assert(tmpVal < _gameScriptIndexSize);
Expand Down
14 changes: 3 additions & 11 deletions engines/lilliput/script.cpp
Expand Up @@ -805,12 +805,6 @@ void LilliputScript::disasmScript(ScriptStream script) {
if (val == 0xFFF6) // end of script
return;

bool hasIf = false;

if (val != 0xFFF8) {
hasIf = true;
}

bool firstIf = true;

// check the conditions.
Expand All @@ -824,7 +818,7 @@ void LilliputScript::disasmScript(ScriptStream script) {
}

// op code type 1
assert(val < sizeof(opCodes1)/sizeof(OpCode));
assert(val < sizeof(opCodes1) / sizeof(OpCode));
const OpCode *opCode = &opCodes1[val];
const kValueType *opArgType = &opCode->_arg1;

Expand Down Expand Up @@ -1038,9 +1032,8 @@ void LilliputScript::sub17B6C(int var1) {

++var1;
int curVal = 0;
int tmpVal;
while (curVal < var1) {
tmpVal = _currScript->readUint16LE();
int tmpVal = _currScript->readUint16LE();
if (tmpVal == 0xFFF7)
++curVal;
}
Expand Down Expand Up @@ -1093,10 +1086,9 @@ void LilliputScript::formatSpeechString() {

int index = 0;
int var2 = 0x100;
int var1;

for (;;) {
var1 = _vm->_displayStringBuf[index++];
int var1 = _vm->_displayStringBuf[index++];
if (var1 == 0)
break;

Expand Down

0 comments on commit 37067dd

Please sign in to comment.