aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2012-02-16 18:32:04 +0100
committerStrangerke2012-02-16 18:32:04 +0100
commit856aa5119b899d798af212f946224ab4886775fe (patch)
tree4d21912ab4da6d83e6e6809f61a1dbf29c92d109 /engines
parent1030212aa24d547f0300c25558d7f0e2e72200fb (diff)
downloadscummvm-rg350-856aa5119b899d798af212f946224ab4886775fe.tar.gz
scummvm-rg350-856aa5119b899d798af212f946224ab4886775fe.tar.bz2
scummvm-rg350-856aa5119b899d798af212f946224ab4886775fe.zip
TSAGE: R2R - Fix various warnings
Thanks Digitall for reporting those
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index a52030677f..23a9eb2590 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -3846,7 +3846,7 @@ void Scene1337::process(Event &event) {
if (event.btnState != BTNSHIFT_RIGHT) {
subD183F(R2_GLOBALS._v5780E, 1);
event.handled = true;
- } else if (_unkFctPtr412 != NULL) {
+ } else if (_unkFctPtr412) {
FunctionPtrType tmpFctPtr = _unkFctPtr412;
_unkFctPtr412 = NULL;
(this->*tmpFctPtr)();
@@ -3854,7 +3854,7 @@ void Scene1337::process(Event &event) {
}
} else if (event.eventType == EVENT_KEYPRESS) {
if (event.kbd.keycode == Common::KEYCODE_SPACE) {
- if (_unkFctPtr412 != NULL) {
+ if (_unkFctPtr412) {
FunctionPtrType tmpFctPtr = _unkFctPtr412;
_unkFctPtr412 = NULL;
(this->*tmpFctPtr)();
@@ -4436,8 +4436,11 @@ void Scene1337::subC2C2F() {
for (int i = 0; i <= 3; i++) {
if (tmpRandIndx != 3) {
+ // The variables 'i' and 'j' are not used in the inner code of the loop.
+ // It's understandable for 'i', which helps making sure that tmpVal is used properly,
+ // but it's suspect for j
for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[j]._arr3[0]._field34 == 0) && (subC32B1(j, _arrunkObj1337[3]._arr1[randIndx]._field34))) {
+ if ((_arrunkObj1337[tmpRandIndx]._arr3[0]._field34 == 0) && (subC32B1(tmpRandIndx, _arrunkObj1337[3]._arr1[randIndx]._field34))) {
tmpVal = j;
}
}
@@ -5668,9 +5671,10 @@ void Scene1337::subCF979() {
for (int i = 0; i <= 3; i++) {
if (subC27F9(_arrunkObj1337[0]._arr1[i]._field34) != -1) {
+ // The variable 'j' is not used in the inner code of the loop. It's suspect
for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[j]._field34))) {
- subC3456(&_arrunkObj1337[0]._arr1[j], &_arrunkObj1337[2]._arr3[0]);
+ if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[i]._field34))) {
+ subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[2]._arr3[0]);
found = true;
}
}