aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2012-06-14 08:08:13 +0200
committerStrangerke2012-06-14 08:08:13 +0200
commitd4e9aa78aba58ba96d99595410fd46dd351b8aca (patch)
treef681c889fd1dc3a3620c44871cda15a383e62dfd /engines
parent42a322d671a27406a9dd993f82675dda0ee4780b (diff)
downloadscummvm-rg350-d4e9aa78aba58ba96d99595410fd46dd351b8aca.tar.gz
scummvm-rg350-d4e9aa78aba58ba96d99595410fd46dd351b8aca.tar.bz2
scummvm-rg350-d4e9aa78aba58ba96d99595410fd46dd351b8aca.zip
TONY: Silent more CppCheck warnings
Diffstat (limited to 'engines')
-rw-r--r--engines/tony/gfxcore.h7
-rw-r--r--engines/tony/loc.cpp18
-rw-r--r--engines/tony/mpal/expr.cpp22
-rw-r--r--engines/tony/mpal/mpal.cpp4
-rw-r--r--engines/tony/window.cpp8
5 files changed, 32 insertions, 27 deletions
diff --git a/engines/tony/gfxcore.h b/engines/tony/gfxcore.h
index 9a00ed1646..4461f41271 100644
--- a/engines/tony/gfxcore.h
+++ b/engines/tony/gfxcore.h
@@ -112,11 +112,13 @@ public:
_task = NULL;
_src.setEmpty();
_dst.setEmpty();
+ _bStretch = false;
}
RMGfxPrimitive(RMGfxTask *task) {
_task = task;
_bFlag = 0;
+ _bStretch = false;
}
RMGfxPrimitive(RMGfxTask *task, const RMRect &src, RMRect &dst) {
@@ -132,6 +134,7 @@ public:
_src.topLeft() = src;
_dst = dst;
_bFlag = 0;
+ _bStretch = false;
}
RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMPoint &dst) {
@@ -139,6 +142,7 @@ public:
_src.topLeft() = src;
_dst.topLeft() = dst;
_bFlag = 0;
+ _bStretch = false;
}
RMGfxPrimitive(RMGfxTask *task, const RMRect &src, RMPoint &dst) {
@@ -146,6 +150,7 @@ public:
_src = src;
_dst.topLeft() = dst;
_bFlag = 0;
+ _bStretch = false;
}
RMGfxPrimitive(RMGfxTask *task, const RMRect &dst) {
@@ -153,6 +158,7 @@ public:
_dst = dst;
_src.setEmpty();
_bFlag = 0;
+ _bStretch = false;
}
RMGfxPrimitive(RMGfxTask *task, const RMPoint &dst) {
@@ -160,6 +166,7 @@ public:
_dst.topLeft() = dst;
_src.setEmpty();
_bFlag = 0;
+ _bStretch = false;
}
virtual ~RMGfxPrimitive() { }
diff --git a/engines/tony/loc.cpp b/engines/tony/loc.cpp
index b2bf3b3565..0b8398c541 100644
--- a/engines/tony/loc.cpp
+++ b/engines/tony/loc.cpp
@@ -710,14 +710,13 @@ void RMItem::setStatus(int nStatus) {
}
void RMItem::setPattern(int nPattern, bool bPlayP0) {
- int i;
-
assert(nPattern >= 0 && nPattern <= _nPatterns);
- if (_sfx)
+ if (_sfx) {
if (_nCurPattern > 0)
_patterns[_nCurPattern].stopSfx(_sfx);
-
+ }
+
// Remember the current pattern
_nCurPattern = nPattern;
@@ -728,10 +727,12 @@ void RMItem::setPattern(int nPattern, bool bPlayP0) {
_nCurSprite = -1;
// Look for the sound effect for pattern 0
- if (bPlayP0)
- for (i = 0; i < _nSfx; i++)
+ if (bPlayP0) {
+ for (int i = 0; i < _nSfx; i++) {
if (strcmp(_sfx[i]._name, "p0") == 0)
_sfx[i].play();
+ }
+ }
}
}
@@ -783,6 +784,8 @@ RMItem::RMItem() {
_bPal = 0;
_nCurSprite = 0;
+ _bIsActive = false;
+
_hEndPattern = CoroScheduler.createEvent(false, false);
}
@@ -1967,11 +1970,8 @@ bool RMLocation::load(const char *lpszFileName) {
* @returns True if succeeded OK, false in case of error.
*/
bool RMLocation::load(Common::File &file) {
- int size;
bool bRet;
- // Get the file size
- size = file.size();
file.seek(0);
RMFileStreamSlow fs;
diff --git a/engines/tony/mpal/expr.cpp b/engines/tony/mpal/expr.cpp
index 516da98bb1..52751120f6 100644
--- a/engines/tony/mpal/expr.cpp
+++ b/engines/tony/mpal/expr.cpp
@@ -124,8 +124,8 @@ static byte *duplicateExpression(HGLOBAL h) {
two->val.pson = duplicateExpression(two->val.son);
}
- one++;
- two++;
+ ++one;
+ ++two;
}
globalUnlock(h);
@@ -183,23 +183,23 @@ static void solve(LPEXPRESSION one, int num) {
int j;
while (num > 1) {
- two=one + 1;
+ two = one + 1;
if ((two->symbol == 0) || (one->symbol & 0xF0) <= (two->symbol & 0xF0)) {
- two->val.num = Compute(one->val.num, two->val.num,one->symbol);
+ two->val.num = Compute(one->val.num, two->val.num, one->symbol);
copyMemory(one, two, (num - 1) * sizeof(EXPRESSION));
- num--;
+ --num;
} else {
j = 1;
three = two + 1;
while ((three->symbol != 0) && (two->symbol & 0xF0) > (three->symbol & 0xF0)) {
- two++;
- three++;
- j++;
+ ++two;
+ ++three;
+ ++j;
}
three->val.num = Compute(two->val.num, three->val.num, two->symbol);
copyMemory(two, three, (num - j - 1) * sizeof(EXPRESSION));
- num--;
+ --num;
}
}
}
@@ -390,8 +390,8 @@ bool compareExpressions(HGLOBAL h1, HGLOBAL h2) {
break;
}
- one++;
- two++;
+ ++one;
+ ++two;
}
globalUnlock(h1);
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index 3b798b8071..92ece3b0b4 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -1565,7 +1565,7 @@ void mpalFree() {
* method that returns numeric results.
*/
uint32 mpalQueryDWORD(uint16 wQueryType, ...) {
- int x, y, z;
+ int x, y;
Common::String buf;
uint32 dwRet = 0;
char *n;
@@ -1718,7 +1718,7 @@ uint32 mpalQueryDWORD(uint16 wQueryType, ...) {
lockItems();
lockVar();
x = GETARG(uint32);
- z = GETARG(uint32);
+ int z = GETARG(uint32);
y = itemGetOrderFromNum(z);
if (y != -1) {
dwRet = doAction(x, y, GETARG(uint32));
diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp
index db21be0ded..3b60e480f6 100644
--- a/engines/tony/window.cpp
+++ b/engines/tony/window.cpp
@@ -214,10 +214,7 @@ void RMSnapshot::grabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) {
int dimx = RM_SX / dezoom;
int dimy = RM_SY / dezoom;
- int u, v, curv;
-
uint32 k = 0;
- int sommar, sommab, sommag;
uint16 *cursrc;
if (lpDestBuf == NULL)
@@ -247,10 +244,11 @@ void RMSnapshot::grabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) {
for (int y = 0; y < dimy; y++) {
for (int x = 0; x < dimx; x++) {
cursrc = &src[RM_SKIPX + x * dezoom];
+ int sommar, sommab, sommag, curv;
sommar = sommab = sommag = 0;
- for (v = 0; v < dezoom; v++) {
- for (u = 0; u < dezoom; u++) {
+ for (int v = 0; v < dezoom; v++) {
+ for (int u = 0; u < dezoom; u++) {
if (lpDestBuf == NULL)
curv = -v;
else