aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorRobin Watts2008-11-29 18:01:16 +0000
committerRobin Watts2008-11-29 18:01:16 +0000
commit8f3b2e9b4d9f1f82682e1eed018153091cddee9f (patch)
treef2af64fa467e70a3ba25e9c615baa053e0818d88 /engines
parent362bdf87d78f611f3e308e7e9234831208b93d68 (diff)
downloadscummvm-rg350-8f3b2e9b4d9f1f82682e1eed018153091cddee9f.tar.gz
scummvm-rg350-8f3b2e9b4d9f1f82682e1eed018153091cddee9f.tar.bz2
scummvm-rg350-8f3b2e9b4d9f1f82682e1eed018153091cddee9f.zip
Remove warnings from NDS build.
svn-id: r35172
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/saveload.cpp4
-rw-r--r--engines/agos/script_s1.cpp2
-rw-r--r--engines/agos/zones.cpp18
-rw-r--r--engines/gob/sound/adlib.cpp4
-rw-r--r--engines/lure/hotspots.cpp2
-rw-r--r--engines/lure/menu.cpp4
-rw-r--r--engines/saga/actor.cpp8
-rw-r--r--engines/saga/interface.cpp2
-rw-r--r--engines/saga/music.cpp2
-rw-r--r--engines/saga/saveload.cpp4
-rw-r--r--engines/saga/sound.cpp2
-rw-r--r--engines/saga/sprite.cpp42
-rw-r--r--engines/scumm/resource_v2.cpp5
-rw-r--r--engines/scumm/saveload.cpp4
-rw-r--r--engines/sky/text.cpp4
15 files changed, 57 insertions, 50 deletions
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp
index e8fb2522b1..3aedbfb9f3 100644
--- a/engines/agi/saveload.cpp
+++ b/engines/agi/saveload.cpp
@@ -80,8 +80,8 @@ int AgiEngine::saveGame(const char *fileName, const char *description) {
tm curTime;
_system->getTimeAndDate(curTime);
- uint32 saveDate = (curTime.tm_mday & 0xFF) << 24 | ((curTime.tm_mon + 1) & 0xFF) << 16 | (curTime.tm_year + 1900) & 0xFFFF;
- uint16 saveTime = (curTime.tm_hour & 0xFF) << 8 | (curTime.tm_min) & 0xFF;
+ uint32 saveDate = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
+ uint16 saveTime = ((curTime.tm_hour & 0xFF) << 8) | ((curTime.tm_min) & 0xFF);
out->writeUint32BE(saveDate);
debugC(5, kDebugLevelMain | kDebugLevelSavegame, "Writing save date (%d)", saveDate);
diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp
index 145d4a2694..030a4e5d74 100644
--- a/engines/agos/script_s1.cpp
+++ b/engines/agos/script_s1.cpp
@@ -481,7 +481,7 @@ void AGOSEngine_Simon1::os1_getPathPosn() {
}
x_diff += y_diff /= 4;
- if (x_diff < best_dist || x_diff == best_dist && prev_i == i) {
+ if ((x_diff < best_dist) || ((x_diff == best_dist) && (prev_i == i))) {
best_dist = x_diff;
best_i = maxPath + 1 - i;
best_j = j;
diff --git a/engines/agos/zones.cpp b/engines/agos/zones.cpp
index e754baec10..79199c90f1 100644
--- a/engines/agos/zones.cpp
+++ b/engines/agos/zones.cpp
@@ -197,9 +197,9 @@ void AGOSEngine_Feeble::checkZonePtrs() {
uint count = ARRAYSIZE(_vgaBufferPointers);
VgaPointersEntry *vpe = _vgaBufferPointers;
do {
- if (vpe->vgaFile1 < _blockEnd && vpe->vgaFile1End > _block ||
- vpe->vgaFile2 < _blockEnd && vpe->vgaFile2End > _block ||
- vpe->sfxFile < _blockEnd && vpe->sfxFileEnd > _block) {
+ if (((vpe->vgaFile1 < _blockEnd) && (vpe->vgaFile1End > _block)) ||
+ ((vpe->vgaFile2 < _blockEnd) && (vpe->vgaFile2End > _block)) ||
+ ((vpe->sfxFile < _blockEnd) && (vpe->sfxFileEnd > _block))) {
vpe->vgaFile1 = NULL;
vpe->vgaFile1End = NULL;
vpe->vgaFile2 = NULL;
@@ -218,8 +218,8 @@ void AGOSEngine::checkNoOverWrite() {
vpe = &_vgaBufferPointers[_noOverWrite];
- if (_block <= vpe->vgaFile1 && _blockEnd >= vpe->vgaFile1 ||
- _vgaMemPtr <= vpe->vgaFile2 && _blockEnd >= vpe->vgaFile2) {
+ if (((_block <= vpe->vgaFile1) && (_blockEnd >= vpe->vgaFile1)) ||
+ ((_vgaMemPtr <= vpe->vgaFile2) && (_blockEnd >= vpe->vgaFile2))) {
_rejectBlock = true;
_vgaMemPtr = vpe->vgaFile1 + 0x5000;
} else {
@@ -232,8 +232,8 @@ void AGOSEngine::checkAnims(uint a) {
vpe = &_vgaBufferPointers[a];
- if (_block <= vpe->vgaFile1 && _blockEnd >= vpe->vgaFile1 ||
- _block <= vpe->vgaFile2 && _blockEnd >= vpe->vgaFile2) {
+ if (((_block <= vpe->vgaFile1) && (_blockEnd >= vpe->vgaFile1)) ||
+ ((_block <= vpe->vgaFile2) && (_blockEnd >= vpe->vgaFile2))) {
_rejectBlock = true;
_vgaMemPtr = vpe->vgaFile1 + 0x5000;
} else {
@@ -245,8 +245,8 @@ void AGOSEngine::checkZonePtrs() {
uint count = ARRAYSIZE(_vgaBufferPointers);
VgaPointersEntry *vpe = _vgaBufferPointers;
do {
- if (_block <= vpe->vgaFile1 && _blockEnd >= vpe->vgaFile1 ||
- _block <= vpe->vgaFile2 && _blockEnd >= vpe->vgaFile2) {
+ if (((_block <= vpe->vgaFile1) && (_blockEnd >= vpe->vgaFile1)) ||
+ ((_block <= vpe->vgaFile2) && (_blockEnd >= vpe->vgaFile2))) {
vpe->vgaFile1 = NULL;
vpe->vgaFile2 = NULL;
}
diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp
index b3d392ad1e..90f7852b33 100644
--- a/engines/gob/sound/adlib.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -165,8 +165,8 @@ void AdLib::reset() {
for (int i = 0; i < 9; i++) {
writeOPL(0xA0 | i, 0);
writeOPL(0xB0 | i, 0);
- writeOPL(0xE0 | _operators[i] , 0);
- writeOPL(0xE0 | _operators[i] + 3, 0);
+ writeOPL(0xE0 | _operators[i] , 0);
+ writeOPL(0xE0 |(_operators[i] + 3), 0);
}
// Authorize the control of the waveformes
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index 57863c0feb..8c9a20ba7e 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -728,7 +728,7 @@ void Hotspot::updateMovement2(CharacterMode value) {
}
void Hotspot::resetPosition() {
- setPosition(x() & 0xf8 | 5, y());
+ setPosition((x() & 0xf8) | 5, y());
setDirection(direction());
}
diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp
index 112e6116a2..5027e6967e 100644
--- a/engines/lure/menu.cpp
+++ b/engines/lure/menu.cpp
@@ -480,10 +480,10 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) {
byte whiteColour = isEGA ? EGA_DIALOG_WHITE_COLOUR : VGA_DIALOG_WHITE_COLOUR;
- uint16 oldX = mouse.x();
- uint16 oldY = mouse.y();
const uint16 yMiddle = FULL_SCREEN_HEIGHT / 2;
#ifndef LURE_CLICKABLE_MENUS
+ uint16 oldX = mouse.x();
+ uint16 oldY = mouse.y();
mouse.cursorOff();
mouse.setPosition(FULL_SCREEN_WIDTH / 2, yMiddle);
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index 96d901fbba..52c07faca3 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -925,8 +925,8 @@ uint16 Actor::hitTest(const Point &testPoint, bool skipProtagonist) {
CommonObjectOrderList::iterator drawOrderIterator;
CommonObjectDataPointer drawObject;
- int frameNumber;
- SpriteList *spriteList;
+ int frameNumber = 0;
+ SpriteList *spriteList = NULL;
createDrawOrderList();
@@ -1044,8 +1044,8 @@ void Actor::drawActors() {
CommonObjectOrderList::iterator drawOrderIterator;
CommonObjectDataPointer drawObject;
- int frameNumber;
- SpriteList *spriteList;
+ int frameNumber = 0;
+ SpriteList *spriteList = NULL;
Surface *backBuffer;
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 38d126c5d4..4f4c90fc9c 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -1243,7 +1243,7 @@ bool Interface::processTextInput(Common::KeyState keystate) {
_textInputPos = _textInputStringLength + 1;
break;
default:
- if (keystate.ascii <= 255 && isalnum(keystate.ascii) || (keystate.ascii == ' ') ||
+ if (((keystate.ascii <= 255) && (isalnum(keystate.ascii))) || (keystate.ascii == ' ') ||
(keystate.ascii == '-') || (keystate.ascii == '_')) {
if (_textInputStringLength < save_title_size - 1) {
ch[0] = keystate.ascii;
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 328dee3566..b4a8f23203 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -139,7 +139,9 @@ DigitalMusicInputStream::~DigitalMusicInputStream() {
}
void DigitalMusicInputStream::createCompressedStream() {
+#if defined(USE_MAD) || defined(USE_VORBIS) || defined(USE_FLAC)
uint numLoops = _looping ? 0 : 1;
+#endif
_memoryStream = _file->readStream(resourceData->size - 9);
switch (soundType) {
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 7e85338a8d..d84435fc5d 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -190,8 +190,8 @@ void SagaEngine::save(const char *fileName, const char *saveName) {
tm curTime;
_system->getTimeAndDate(curTime);
- uint32 saveDate = (curTime.tm_mday & 0xFF) << 24 | ((curTime.tm_mon + 1) & 0xFF) << 16 | (curTime.tm_year + 1900) & 0xFFFF;
- uint16 saveTime = (curTime.tm_hour & 0xFF) << 8 | (curTime.tm_min) & 0xFF;
+ uint32 saveDate = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
+ uint16 saveTime = ((curTime.tm_hour & 0xFF) << 8) | ((curTime.tm_min) & 0xFF);
out->writeUint32BE(saveDate);
out->writeUint16BE(saveTime);
diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp
index 1d41d39cf2..107b637167 100644
--- a/engines/saga/sound.cpp
+++ b/engines/saga/sound.cpp
@@ -92,7 +92,9 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int
buffer.size, buffer.frequency, flags, -1, volume);
} else {
Audio::AudioStream *stream = NULL;
+#if defined(USE_MAD) || defined(USE_VORBIS) || defined(USE_FLAC)
MemoryReadStream *tmp = NULL;
+#endif
switch (buffer.soundType) {
#ifdef USE_MAD
diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp
index a1f78e1b9f..879299e290 100644
--- a/engines/saga/sprite.cpp
+++ b/engines/saga/sprite.cpp
@@ -254,11 +254,11 @@ void Sprite::drawClip(Surface *ds, const Rect &clipRect, const Point &spritePoin
}
void Sprite::draw(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale) {
- const byte *spriteBuffer;
- int width;
- int height;
- int xAlign;
- int yAlign;
+ const byte *spriteBuffer = NULL;
+ int width = 0;
+ int height = 0;
+ int xAlign = 0;
+ int yAlign = 0;
Point spritePointer;
getScaledSpriteBuffer(spriteList, spriteNumber, scale, width, height, xAlign, yAlign, spriteBuffer);
@@ -270,11 +270,13 @@ void Sprite::draw(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int
}
void Sprite::draw(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Rect &screenRect, int scale) {
- const byte *spriteBuffer;
- int width;
- int height;
- int xAlign, spw;
- int yAlign, sph;
+ const byte *spriteBuffer = NULL;
+ int width = 0;
+ int height = 0;
+ int xAlign = 0;
+ int spw;
+ int yAlign = 0;
+ int sph;
Point spritePointer;
getScaledSpriteBuffer(spriteList, spriteNumber, scale, width, height, xAlign, yAlign, spriteBuffer);
@@ -292,13 +294,13 @@ void Sprite::draw(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int
}
bool Sprite::hitTest(SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, const Point &testPoint) {
- const byte *spriteBuffer;
+ const byte *spriteBuffer = NULL;
int i, j;
const byte *srcRowPointer;
- int width;
- int height;
- int xAlign;
- int yAlign;
+ int width = 0;
+ int height = 0;
+ int xAlign = 0;
+ int yAlign = 0;
Point spritePointer;
getScaledSpriteBuffer(spriteList, spriteNumber, scale, width, height, xAlign, yAlign, spriteBuffer);
@@ -319,17 +321,17 @@ bool Sprite::hitTest(SpriteList &spriteList, int spriteNumber, const Point &scre
}
void Sprite::drawOccluded(Surface *ds, const Rect &clipRect, SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, int depth) {
- const byte *spriteBuffer;
+ const byte *spriteBuffer = NULL;
int x, y;
byte *destRowPointer;
const byte *sourceRowPointer;
const byte *sourcePointer;
byte *destPointer;
byte *maskPointer;
- int width;
- int height;
- int xAlign;
- int yAlign;
+ int width = NULL;
+ int height = 0;
+ int xAlign = 0;
+ int yAlign = 0;
ClipData clipData;
diff --git a/engines/scumm/resource_v2.cpp b/engines/scumm/resource_v2.cpp
index 323aff849e..76e451183f 100644
--- a/engines/scumm/resource_v2.cpp
+++ b/engines/scumm/resource_v2.cpp
@@ -194,10 +194,11 @@ void ScummEngine_v2::readIndexFile() {
break;
case 0x132:
printf("C64 V1 game detected\n");
- if (_game.id == GID_MANIAC)
+ if (_game.id == GID_MANIAC) {
assert(_game.version == 0);
- else
+ } else {
assert(_game.version == 1);
+ }
readClassicIndexFile();
break;
case 0x032:
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 5fdd340fc9..577e338384 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -644,8 +644,8 @@ void ScummEngine::saveInfos(Common::WriteStream* file) {
tm curTime;
_system->getTimeAndDate(curTime);
- section.date = (curTime.tm_mday & 0xFF) << 24 | ((curTime.tm_mon + 1) & 0xFF) << 16 | (curTime.tm_year + 1900) & 0xFFFF;
- section.time = (curTime.tm_hour & 0xFF) << 8 | (curTime.tm_min) & 0xFF;
+ section.date = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
+ section.time = ((curTime.tm_hour & 0xFF) << 8) | ((curTime.tm_min) & 0xFF);
file->writeUint32BE(section.type);
file->writeUint32BE(section.version);
diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp
index 19080d8ff9..88e42954cb 100644
--- a/engines/sky/text.cpp
+++ b/engines/sky/text.cpp
@@ -376,12 +376,12 @@ void Text::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest, ui
dataBit = (data & 0x8000) != 0; //check data
data <<= 1;
- if (maskBit)
+ if (maskBit) {
if (dataBit)
*curPos = color;
else
*curPos = 240; //black edge
-
+ }
curPos++;
}
//advance a line