From fc5a0deb8915bb5bfc85626751539920752b386b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 8 May 2015 17:54:53 +0200 Subject: SHERLOCK: Fix some more GCC warnings --- engines/sherlock/journal.cpp | 2 +- engines/sherlock/objects.cpp | 7 +++++-- engines/sherlock/people.cpp | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'engines/sherlock') diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp index 26aaa7a1a0..0c8864c302 100644 --- a/engines/sherlock/journal.cpp +++ b/engines/sherlock/journal.cpp @@ -1125,7 +1125,7 @@ int Journal::getFindName(bool printError) { if (events.kbHit()) { Common::KeyState keyState = events.getKey(); - if (keyState.keycode == Common::KEYCODE_BACKSPACE && name.c_str() > 0) { + if ((keyState.keycode == Common::KEYCODE_BACKSPACE) && (name.c_str() > 0)) { screen.vgaBar(Common::Rect(xp - screen.charWidth(name.lastChar()), yp, xp + 8, yp + 9), BUTTON_MIDDLE); xp -= screen.charWidth(name.lastChar()); screen.vgaBar(Common::Rect(xp, yp, xp + 8, yp + 9), INV_FOREGROUND); diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp index 40c8b954cb..488d1fcf83 100644 --- a/engines/sherlock/objects.cpp +++ b/engines/sherlock/objects.cpp @@ -242,8 +242,8 @@ void Sprite::checkSprite() { // Invert percentage palPercent = 100 - palPercent; - for (int idx = palStart; idx < (palStart + palLength); ++idx) - screen._sMap[idx] = screen._cMap[idx] * palPercent / 100; + for (int i = palStart; i < (palStart + palLength); ++i) + screen._sMap[i] = screen._cMap[i] * palPercent / 100; events.pollEvents(); screen.setPalette(screen._sMap); @@ -352,6 +352,9 @@ void Sprite::checkSprite() { case DELTA: _position.x += 200; break; + + default: + break; } } } diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp index 0a3ef693a8..acc660b0c0 100644 --- a/engines/sherlock/people.cpp +++ b/engines/sherlock/people.cpp @@ -333,12 +333,12 @@ void People::setWalking() { // See whether the major movement is horizontal or vertical if (delta.x >= delta.y) { // Set the initial frame sequence for the left and right, as well - // as settting the delta x depending on direction + // as setting the delta x depending on direction if (_walkDest.x < (_player._position.x / 100)) { - _player._sequenceNumber = map._active ? MAP_LEFT : WALK_LEFT; + _player._sequenceNumber = (int) (map._active ? MAP_LEFT : WALK_LEFT); _player._delta.x = speed.x * -100; } else { - _player._sequenceNumber = map._active ? MAP_RIGHT : WALK_RIGHT; + _player._sequenceNumber = (int) (map._active ? MAP_RIGHT : WALK_RIGHT); _player._delta.x = speed.x * 100; } -- cgit v1.2.3