aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel
diff options
context:
space:
mode:
authorPaul Gilbert2010-10-15 08:52:22 +0000
committerPaul Gilbert2010-10-15 08:52:22 +0000
commit168670acb2924b64df59452a34c15888c62b4a4f (patch)
tree2a25ddabeac442ac4900819e254609b5be8f0a70 /engines/tinsel
parent764eaa554ce2633e9a927f7264ff3ca57ee5650d (diff)
downloadscummvm-rg350-168670acb2924b64df59452a34c15888c62b4a4f.tar.gz
scummvm-rg350-168670acb2924b64df59452a34c15888c62b4a4f.tar.bz2
scummvm-rg350-168670acb2924b64df59452a34c15888c62b4a4f.zip
TINSEL: Fix for #3087863 - Code analysis warnings
svn-id: r53471
Diffstat (limited to 'engines/tinsel')
-rw-r--r--engines/tinsel/debugger.cpp3
-rw-r--r--engines/tinsel/graphics.cpp6
-rw-r--r--engines/tinsel/rince.cpp4
3 files changed, 7 insertions, 6 deletions
diff --git a/engines/tinsel/debugger.cpp b/engines/tinsel/debugger.cpp
index f422c88e94..5d8b22116d 100644
--- a/engines/tinsel/debugger.cpp
+++ b/engines/tinsel/debugger.cpp
@@ -57,7 +57,8 @@ int strToInt(const char *s) {
// Hexadecimal string
uint tmp;
- sscanf(s, "%xh", &tmp);
+ if (!sscanf(s, "%xh", &tmp))
+ tmp = 0;
return (int)tmp;
}
diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp
index 48270d94e3..aefc6e6144 100644
--- a/engines/tinsel/graphics.cpp
+++ b/engines/tinsel/graphics.cpp
@@ -66,8 +66,8 @@ uint8* psxPJCRLEUnwinder(uint16 imageWidth, uint16 imageHeight, uint8 *srcIdx) {
return NULL;
// Calculate needed index numbers, align width and height not next multiple of four
- imageWidth = imageWidth % 4 ? ((imageWidth / 4) + 1) * 4 : imageWidth;
- imageHeight = imageHeight % 4 ? ((imageHeight / 4) + 1) * 4 : imageHeight;
+ imageWidth = (imageWidth % 4) ? ((imageWidth / 4) + 1) * 4 : imageWidth;
+ imageHeight = (imageHeight % 4) ? ((imageHeight / 4) + 1) * 4 : imageHeight;
destinationBuffer = (uint8*)malloc((imageWidth * imageHeight) / 8);
dstIdx = destinationBuffer;
remainingBlocks = (imageWidth * imageHeight) / 16;
@@ -297,7 +297,7 @@ static void PsxDrawTiles(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply
} else {
for (int xp = boxBounds.left; xp <= boxBounds.right; ++xp) {
// Extract pixel value from byte
- byte pixValue = (*(p + (xp / 2)) & (xp % 2 ? 0xf0 : 0x0f)) >> (xp % 2 ? 4 : 0);
+ byte pixValue = (*(p + (xp / 2)) & ((xp % 2) ? 0xf0 : 0x0f)) >> ((xp % 2) ? 4 : 0);
if (pixValue || !transparency)
*(tempDest + SCREEN_WIDTH * (yp - boxBounds.top) + (xp - boxBounds.left)) = psxMapperTable[pixValue];
}
diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp
index cfffe88587..17b2bf4ddc 100644
--- a/engines/tinsel/rince.cpp
+++ b/engines/tinsel/rince.cpp
@@ -361,8 +361,8 @@ static void InitMover(PMOVER pMover) {
pMover->Tline = 0;
- if (pMover->direction != FORWARD || pMover->direction != AWAY
- || pMover->direction != LEFTREEL || pMover->direction != RIGHTREEL)
+ if (pMover->direction != FORWARD && pMover->direction != AWAY
+ && pMover->direction != LEFTREEL && pMover->direction != RIGHTREEL)
pMover->direction = FORWARD;
if (pMover->scale < 0 || pMover->scale > TOTAL_SCALES)