aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2013-09-04 16:52:44 +0200
committerStrangerke2013-09-04 16:52:44 +0200
commit70aa840f0ba482271b8379685a40e59fb115fd8c (patch)
tree76356edfe1c4c9881e1642fd535a7fdfcbf2f210 /engines
parent41416f0c0529fe43040c640c83160aa076b7fc80 (diff)
downloadscummvm-rg350-70aa840f0ba482271b8379685a40e59fb115fd8c.tar.gz
scummvm-rg350-70aa840f0ba482271b8379685a40e59fb115fd8c.tar.bz2
scummvm-rg350-70aa840f0ba482271b8379685a40e59fb115fd8c.zip
AVALANCHE: Fix GCC warnings reported by GCC
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/avalanche.cpp27
-rw-r--r--engines/avalanche/avalot.cpp4
-rw-r--r--engines/avalanche/graphics.cpp2
-rw-r--r--engines/avalanche/parser.cpp2
4 files changed, 21 insertions, 14 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index a00701456e..564f9faee4 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -207,40 +207,37 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
} else {
if (!_gyro->dna.like2drink.empty())
_gyro->dna.like2drink.clear();
- uint16 like2drinkSize;
+ uint16 like2drinkSize = 0;
+ char actChr = ' ';
sz.syncAsUint16LE(like2drinkSize);
for (uint16 i = 0; i < like2drinkSize; i++) {
- char actChr;
sz.syncAsByte(actChr);
_gyro->dna.like2drink += actChr;
}
if (!_gyro->dna.favourite_song.empty())
_gyro->dna.favourite_song.clear();
- uint16 favourite_songSize;
+ uint16 favourite_songSize = 0;
sz.syncAsUint16LE(favourite_songSize);
for (uint16 i = 0; i < favourite_songSize; i++) {
- char actChr;
sz.syncAsByte(actChr);
_gyro->dna.favourite_song += actChr;
}
if (!_gyro->dna.worst_place_on_earth.empty())
_gyro->dna.worst_place_on_earth.clear();
- uint16 worst_place_on_earthSize;
+ uint16 worst_place_on_earthSize = 0;
sz.syncAsUint16LE(worst_place_on_earthSize);
for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
- char actChr;
sz.syncAsByte(actChr);
_gyro->dna.worst_place_on_earth += actChr;
}
if (!_gyro->dna.spare_evening.empty())
_gyro->dna.spare_evening.clear();
- uint16 spare_eveningSize;
+ uint16 spare_eveningSize = 0;
sz.syncAsUint16LE(spare_eveningSize);
for (uint16 i = 0; i < spare_eveningSize; i++) {
- char actChr;
sz.syncAsByte(actChr);
_gyro->dna.spare_evening += actChr;
}
@@ -285,20 +282,21 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
// }
//}
- byte spriteNum;
+ byte spriteNum = 0;
if (sz.isSaving()) {
- spriteNum = 0;
- for (byte i = 0; i < _trip->numtr; i++)
+ for (byte i = 0; i < _trip->numtr; i++) {
if (_trip->tr[i].quick)
spriteNum++;
+ }
}
sz.syncAsByte(spriteNum);
- if (sz.isLoading())
+ if (sz.isLoading()) {
for (byte i = 0; i < _trip->numtr; i++) { // Deallocate sprites.
if (_trip->tr[i].quick)
_trip->tr[i].done();
}
+ }
for (byte i = 0; i < spriteNum; i++) {
sz.syncAsByte(_trip->tr[i].whichsprite);
@@ -364,7 +362,7 @@ bool AvalancheEngine::saveGame(const int16 slot, const Common::String &desc) {
return false;
}
- char *signature = "AVAL";
+ const char *signature = "AVAL";
f->write(signature, 4);
// Write version. We can't restore from obsolete versions.
@@ -536,6 +534,9 @@ void AvalancheEngine::updateEvents() {
break;
case Common::EVENT_KEYDOWN:
_avalot->handleKeyDown(event);
+ break;
+ default:
+ break;
}
}
}
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index c791a77ed6..12bdbd0373 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -97,6 +97,8 @@ void Avalot::handleKeyDown(Common::Event &event) {
case Common::KEYCODE_KP1:
event.kbd.keycode = Common::KEYCODE_END;
break;
+ default:
+ break;
}
switch (event.kbd.keycode) {
@@ -120,6 +122,8 @@ void Avalot::handleKeyDown(Common::Event &event) {
case Common::KEYCODE_RETURN:
_vm->_parser->handleReturn();
break;
+ default:
+ break;
}
_vm->_lucerna->showrw();
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index b4ee2a7a3f..35ccd5ff2e 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -177,7 +177,7 @@ Common::Point Graphics::drawArc(::Graphics::Surface &surface, int16 x, int16 y,
int16 xTemp = xNext;
int16 yTemp = yNext;
// This is used by both sin and cos.
- double tempTerm = (j+delta)*convfac;
+ tempTerm = (j + delta) * convfac;
xNext = floor(xRadius*cos(tempTerm) + 0.5);
yNext = floor(yRadius*sin(tempTerm + pi) + 0.5);
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 67b893f32f..c8a04ae3ae 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -101,6 +101,8 @@ void Parser::handleFunctionKey(const Common::Event &event) {
case Common::KEYCODE_F7:
_vm->_lucerna->callverb(_vm->_acci->kVerbCodeOpen);
break;
+ default:
+ break;
}
}