From 58d1bcc3e7f7aca20b1db3bef019f742ebd6c474 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 20 Aug 2016 10:17:53 +0200 Subject: DM: Silent a couple of CppCheck warnings --- engines/dm/champion.cpp | 2 +- engines/dm/dialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/dm') diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 6e92915851..caf61ef629 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -721,7 +721,6 @@ int16 ChampionMan::f321_addPendingDamageAndWounds_getDamage(int16 champIndex, in if (!curChampion->_currHealth) return 0; - bool skipScaling = false; if (attackType != k0_attackType_NORMAL) { uint16 defense = 0; uint16 woundCount = 0; @@ -734,6 +733,7 @@ int16 ChampionMan::f321_addPendingDamageAndWounds_getDamage(int16 champIndex, in if (woundCount) defense /= woundCount; + bool skipScaling = false; switch (attackType) { case k6_attackType_PSYCHIC: { diff --git a/engines/dm/dialog.cpp b/engines/dm/dialog.cpp index 900ff76df6..53513b7e7a 100644 --- a/engines/dm/dialog.cpp +++ b/engines/dm/dialog.cpp @@ -154,7 +154,7 @@ bool DialogMan::f426_isMessageOnTwoLines(char* str, char* part1, char* part2) { strcpy(part1, str); uint16 splitPosition = strLength >> 1; - while ((part1[splitPosition] != ' ') && (splitPosition < strLength)) + while ((splitPosition < strLength) && (part1[splitPosition] != ' ')) splitPosition++; part1[splitPosition] = '\0'; -- cgit v1.2.3