[Scummvm-git-logs] scummvm master -> 95bf4b15b355214d754f16642d203c6baddf1f2f

digitall noreply at scummvm.org
Mon Feb 6 03:57:49 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
95bf4b15b3 EFH: Fix Most Remaining GCC Compiler Warnings


Commit: 95bf4b15b355214d754f16642d203c6baddf1f2f
    https://github.com/scummvm/scummvm/commit/95bf4b15b355214d754f16642d203c6baddf1f2f
Author: D G Turner (digitall at scummvm.org)
Date: 2023-02-06T03:57:01Z

Commit Message:
EFH: Fix Most Remaining GCC Compiler Warnings

Two warnings of -Wcast-qual remain, but these are problematic to fix
with major refactoring of script parser.

Changed paths:
    engines/efh/efh.cpp
    engines/efh/fight.cpp
    engines/efh/menu.cpp
    engines/efh/script.cpp
    engines/efh/sound.cpp


diff --git a/engines/efh/efh.cpp b/engines/efh/efh.cpp
index 5c167b68172..442ea75beb2 100644
--- a/engines/efh/efh.cpp
+++ b/engines/efh/efh.cpp
@@ -1309,7 +1309,7 @@ int8 EfhEngine::checkMonsterMoveCollisionAndTileTexture(int16 monsterId) {
 
 	int16 maxSize = _largeMapFlag ? 63 : 23;
 	MapMonster *curMapMonster = &_mapMonsters[_techId][monsterId];
-	if (curMapMonster->_posX < 0 || curMapMonster->_posY < 0 || curMapMonster->_posX > maxSize || curMapMonster->_posY > maxSize)
+	if (curMapMonster->_posX > maxSize || curMapMonster->_posY > maxSize)
 		return 0;
 
 	if (curMapMonster->_posX == _mapPosX && curMapMonster->_posY == _mapPosY)
diff --git a/engines/efh/fight.cpp b/engines/efh/fight.cpp
index c36361fb05b..5c591442758 100644
--- a/engines/efh/fight.cpp
+++ b/engines/efh/fight.cpp
@@ -982,10 +982,10 @@ int16 EfhEngine::determineTeamTarget(int16 charId, int16 unkFied18Val, bool chec
 	case 3:
 	case 2:
 		++realRange;
-		// no break on purpose
+		// fall through
 	case 1:
 		++realRange;
-		// no break on purpose
+		// fall through
 	case 0:
 		++realRange;
 		break;
@@ -1495,6 +1495,8 @@ bool EfhEngine::checkSpecialItemsOnCurrentPlace(int16 itemId) {
 	case 1:
 		if ((itemId >= 0x58 && itemId <= 0x68) || (itemId >= 0x86 && itemId <= 0x89) || (itemId >= 0x74 && itemId <= 0x76) || itemId == 0x8C)
 			retVal = false;
+		// fall through
+		// FIXME: Is this intentional?
 	case 2:
 		if ((itemId >= 0x61 && itemId <= 0x63) || (itemId >= 0x74 && itemId <= 0x76) || (itemId >= 0x86 && itemId <= 0x89) || itemId == 0x5B || itemId == 0x5E || itemId == 0x66 || itemId == 0x68 || itemId == 0x8C)
 			retVal = false;
diff --git a/engines/efh/menu.cpp b/engines/efh/menu.cpp
index a939521a005..2b2a8c4410b 100644
--- a/engines/efh/menu.cpp
+++ b/engines/efh/menu.cpp
@@ -1269,7 +1269,7 @@ int16 EfhEngine::useObject(int16 charId, int16 objectId, int16 teamMonsterId, in
 			uint8 varAE = _items[itemId]._defenseType;
 			uint8 effectPoints = getRandom(_items[itemId]._field19_mapPosX_or_maxDeltaPoints);
 			_npcBuf[_teamChar[teamCharId]._id]._activeScore[varAE] -= effectPoints;
-			if (_npcBuf[_teamChar[teamCharId]._id]._activeScore[varAE] > 20 || _npcBuf[_teamChar[teamCharId]._id]._activeScore[varAE] < 0) {
+			if (_npcBuf[_teamChar[teamCharId]._id]._activeScore[varAE] > 20) {
 				_npcBuf[_teamChar[teamCharId]._id]._activeScore[varAE] = 1;
 			}
 			if (effectPoints > 1)
diff --git a/engines/efh/script.cpp b/engines/efh/script.cpp
index 02710da2989..1495d9e9c23 100644
--- a/engines/efh/script.cpp
+++ b/engines/efh/script.cpp
@@ -477,7 +477,7 @@ int16 EfhEngine::script_parse(Common::String stringBuffer, int16 posX, int16 pos
 		}
 	}
 
-	if (curLine.size() >= 0 && curLineNb < numbLines && !noTextFlag)
+	if (curLineNb < numbLines && !noTextFlag)
 		displayStringAtTextPos(curLine);
 
 	if (joiningNpcId != 0xFF) {
diff --git a/engines/efh/sound.cpp b/engines/efh/sound.cpp
index e0b0181cabe..757cc4268b7 100644
--- a/engines/efh/sound.cpp
+++ b/engines/efh/sound.cpp
@@ -24,7 +24,7 @@
 namespace Efh {
 
 void EfhEngine::songDelay(int delay) {
-	debugC(3, kDebugEngine, "songDelay %ld", delay);
+	debugC(3, kDebugEngine, "songDelay %d", delay);
 
 	int remainingDelay = delay / 2;
 	while (remainingDelay > 0 && !shouldQuit()) {




More information about the Scummvm-git-logs mailing list