diff options
author | Strangerke | 2013-09-04 16:52:44 +0200 |
---|---|---|
committer | Strangerke | 2013-09-04 16:52:44 +0200 |
commit | 70aa840f0ba482271b8379685a40e59fb115fd8c (patch) | |
tree | 76356edfe1c4c9881e1642fd535a7fdfcbf2f210 /engines/avalanche/avalanche.cpp | |
parent | 41416f0c0529fe43040c640c83160aa076b7fc80 (diff) | |
download | scummvm-rg350-70aa840f0ba482271b8379685a40e59fb115fd8c.tar.gz scummvm-rg350-70aa840f0ba482271b8379685a40e59fb115fd8c.tar.bz2 scummvm-rg350-70aa840f0ba482271b8379685a40e59fb115fd8c.zip |
AVALANCHE: Fix GCC warnings reported by GCC
Diffstat (limited to 'engines/avalanche/avalanche.cpp')
-rw-r--r-- | engines/avalanche/avalanche.cpp | 27 |
1 files changed, 14 insertions, 13 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; } } } |