[Scummvm-git-logs] scummvm master -> 4b6cb6878488577eb0c047e3baea412eb98d02c2

digitall 547637+digitall at users.noreply.github.com
Sat Nov 16 11:14:38 CET 2019


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:
4b6cb68784 DM: Fix Missing Default Switch Cases


Commit: 4b6cb6878488577eb0c047e3baea412eb98d02c2
    https://github.com/scummvm/scummvm/commit/4b6cb6878488577eb0c047e3baea412eb98d02c2
Author: D G Turner (digitall at scummvm.org)
Date: 2019-11-16T10:10:45Z

Commit Message:
DM: Fix Missing Default Switch Cases

These are flagged by GCC if -Wswitch-default is enabled.

Changed paths:
    engines/dm/dungeonman.cpp
    engines/dm/eventman.cpp
    engines/dm/group.cpp
    engines/dm/menus.cpp
    engines/dm/movesens.cpp
    engines/dm/objectman.cpp
    engines/dm/projexpl.cpp
    engines/dm/sounds.cpp
    engines/dm/timeline.cpp


diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 23648e9..7f66253 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -992,6 +992,8 @@ T0172010_ClosedFakeWall:
 		if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal) && (--AL0307_uc_ScentOrdinal >= championMan._party._firstScentIndex) && (AL0307_uc_ScentOrdinal < championMan._party._lastScentIndex))
 			setFlag(aspectArray[kDMSquareAspectFloorOrn], kDMMaskFootprints);
 		break;
+	default:
+		break;
 	}
 	aspectArray[kDMSquareAspectFirstGroupOrObject] = curThing.toUint16();
 }
@@ -1507,6 +1509,8 @@ Thing DungeonMan::getDiscardThing(uint16 thingType) {
 								setCurrentMap(mapIndex);
 								_vm->_moveSens->getMoveResult(squareThing, currMapX, currMapY, kDMMapXNotOnASquare, 0);
 								break;
+							default:
+								break;
 							}
 							setCurrentMap(currentMapIdx);
 							lastDiscardedThingMapIndex[thingType] = mapIndex;
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 1d914bb..96309c4 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -573,6 +573,8 @@ void EventManager::buildpointerScreenArea(int16 mousePosX, int16 mousePosY) {
 		case k3_pointerTypeHand:
 			setMousePointerFromSpriteData(bitmapHanPointer);
 			break;
+		default:
+			break;
 		}
 	}
 	_previousMousePointerType = _mousePointerType;
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index f36a8dd..9b65322 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -355,6 +355,9 @@ bool GroupMan::isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 srcMapY,
 		SWAP(srcMapX, srcMapY);
 		SWAP(destMapX, destMapY);
 		break;
+	case kDMDirWest:
+	default:
+		break;
 	}
 	return ((srcMapX -= (destMapX - 1)) > 0) && ((((srcMapY -= destMapY) < 0) ? -srcMapY : srcMapY) <= srcMapX);
 }
@@ -1500,6 +1503,10 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
 					break;
 				case 3:
 					projectileThing = _vm->_thingExplOpenDoor;
+					break;
+				default:
+					projectileThing = _vm->_thingNone;
+					break;
 				}
 			}
 			break;
@@ -2068,6 +2075,9 @@ void GroupMan::fuseAction(uint16 mapX, uint16 mapY) {
 						break;
 					case 3:
 						destMapY++;
+						break;
+					default:
+						break;
 					}
 					break;
 				}
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index f547bbe..56836e5 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -694,6 +694,9 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
 			break;
 		}
 		}
+		break;
+	default:
+		break;
 	}
 	championMan.addSkillExperience(champIndex, curSpell->_skillIndex, experience);
 	championMan.disableAction(champIndex, curSpell->getDuration());
@@ -1352,6 +1355,8 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
 		if (actionPerformed)
 			_vm->_timeline->_events[curChampion->_enableActionEventIndex]._Bu._slotOrdinal = _vm->indexToOrdinal(kDMSlotActionHand);
 		break;
+	default:
+		break;
 	}
 
 	if (setDirectionFl) {
@@ -1522,13 +1527,17 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac
 		switch (viewCell) {
 		case kDMViewCellBackRight: /* Champion is on the back right of the square and tries to attack a creature in the front right of its square */
 		case kDMViewCellBackLeft: /* Champion is on the back left of the square and tries to attack a creature in the front left of its square */
-			uint16 cellDelta = (viewCell == kDMViewCellBackRight) ? 3 : 1;
-			/* Check if there is another champion in front */
-			if (_vm->_championMan->getIndexInCell(_vm->normalizeModulo4(championCell + cellDelta)) != kDMChampionNone) {
-				_actionDamage = kDMDamageCantReach;
-				return false;
+			{
+				uint16 cellDelta = (viewCell == kDMViewCellBackRight) ? 3 : 1;
+				/* Check if there is another champion in front */
+				if (_vm->_championMan->getIndexInCell(_vm->normalizeModulo4(championCell + cellDelta)) != kDMChampionNone) {
+					_actionDamage = kDMDamageCantReach;
+					return false;
+				}
 			}
 			break;
+		default:
+			break;
 		}
 
 		if ((actionIndex == kDMActionDisrupt) && !getFlag(dungeon.getCreatureAttributes(_actionTargetGroupThing), kDMCreatureMaskNonMaterial))
@@ -1578,6 +1587,8 @@ bool MenuMan::isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, in
 		frightAmount = 12;
 		experience = 45;
 		break;
+	default:
+		break;
 	}
 
 	frightAmount += championMan.getSkillLevel(champIndex, kDMSkillInfluence);
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 1dc36f7..2eae1cb 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -615,6 +615,7 @@ int16 MovesensMan::getSound(CreatureType creatureType) {
 	case kDMCreatureTypeLordChaos:
 	case kDMCreatureTypeLordOrder:
 	case kDMCreatureTypeGreyLord:
+	default:
 		return 35;
 	case kDMCreatureTypeGiggler:
 	case kDMCreatureTypeStoneGolem:
@@ -969,30 +970,35 @@ void MovesensMan::processRotationEffect() {
 	switch (_sensorRotationEffect) {
 	case kDMSensorEffectClear:
 	case kDMSensorEffectToggle:
-		Thing firstSensorThing = dungeon.getSquareFirstThing(_sensorRotationEffMapX, _sensorRotationEffMapY);
-		while ((firstSensorThing.getType() != kDMThingTypeSensor)
-			|| ((_sensorRotationEffCell != kDMCellAny) && (firstSensorThing.getCell() != _sensorRotationEffCell))) {
-			firstSensorThing = dungeon.getNextThing(firstSensorThing);
-		}
-		Sensor *firstSensor = (Sensor *)dungeon.getThingData(firstSensorThing);
-		Thing lastSensorThing = firstSensor->getNextThing();
-		while ((lastSensorThing != _vm->_thingEndOfList)
-		    && ((lastSensorThing.getType() != kDMThingTypeSensor)
+		{
+			Thing firstSensorThing = dungeon.getSquareFirstThing(_sensorRotationEffMapX, _sensorRotationEffMapY);
+			while ((firstSensorThing.getType() != kDMThingTypeSensor)
+				|| ((_sensorRotationEffCell != kDMCellAny) && (firstSensorThing.getCell() != _sensorRotationEffCell))) {
+				firstSensorThing = dungeon.getNextThing(firstSensorThing);
+			}
+			Sensor *firstSensor = (Sensor *)dungeon.getThingData(firstSensorThing);
+			Thing lastSensorThing = firstSensor->getNextThing();
+			while ((lastSensorThing != _vm->_thingEndOfList)
+				&& ((lastSensorThing.getType() != kDMThingTypeSensor)
 				|| ((_sensorRotationEffCell != kDMCellAny) && (lastSensorThing.getCell() != _sensorRotationEffCell)))) {
+				lastSensorThing = dungeon.getNextThing(lastSensorThing);
+			}
+			if (lastSensorThing == _vm->_thingEndOfList)
+				break;
+			dungeon.unlinkThingFromList(firstSensorThing, Thing(0), _sensorRotationEffMapX, _sensorRotationEffMapY);
+			Sensor *lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
 			lastSensorThing = dungeon.getNextThing(lastSensorThing);
+			while (((lastSensorThing != _vm->_thingEndOfList) && (lastSensorThing.getType() == kDMThingTypeSensor))) {
+				if ((_sensorRotationEffCell == kDMCellAny) || (lastSensorThing.getCell() == _sensorRotationEffCell))
+					lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
+				lastSensorThing = dungeon.getNextThing(lastSensorThing);
+			}
+			firstSensor->setNextThing(lastSensor->getNextThing());
+			lastSensor->setNextThing(firstSensorThing);
 		}
-		if (lastSensorThing == _vm->_thingEndOfList)
-			break;
-		dungeon.unlinkThingFromList(firstSensorThing, Thing(0), _sensorRotationEffMapX, _sensorRotationEffMapY);
-		Sensor *lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
-		lastSensorThing = dungeon.getNextThing(lastSensorThing);
-		while (((lastSensorThing != _vm->_thingEndOfList) && (lastSensorThing.getType() == kDMThingTypeSensor))) {
-			if ((_sensorRotationEffCell == kDMCellAny) || (lastSensorThing.getCell() == _sensorRotationEffCell))
-				lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
-			lastSensorThing = dungeon.getNextThing(lastSensorThing);
-		}
-		firstSensor->setNextThing(lastSensor->getNextThing());
-		lastSensor->setNextThing(firstSensorThing);
+		break;
+	default:
+		break;
 	}
 	_sensorRotationEffect = kDMSensorEffectNone;
 }
diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp
index 66c6761..e04f693 100644
--- a/engines/dm/objectman.cpp
+++ b/engines/dm/objectman.cpp
@@ -178,6 +178,8 @@ IconIndice ObjectMan::getIconIndex(Thing thing) {
 				if (((Weapon*)junkThing)->getChargeCount())
 					iconIndex++;
 				break;
+			default:
+				break;
 			}
 		}
 	}
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 312cdc0..3bcceb3 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -193,6 +193,8 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
 		}
 		}
 		break;
+	default:
+		break;
 	}
 	if (championAttack && _projectilePoisonAttack && _vm->getRandomNumber(2)
 	&& _vm->_championMan->addPendingDamageAndWounds_getDamage(championIndex, attack, kDMWoundHead | kDMWoundTorso, _projectileAttackType))
@@ -550,6 +552,8 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
 			AddEventFl = true;
 		}
 		break;
+	default:
+		break;
 	}
 	if (AddEventFl) {
 		TimelineEvent newEvent;
diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp
index a4de3c3..6da816b 100644
--- a/engines/dm/sounds.cpp
+++ b/engines/dm/sounds.cpp
@@ -180,6 +180,8 @@ bool SoundMan::soundGetVolume(int16 mapX, int16 mapY, uint8 *leftVolume, uint8 *
 		rightVolumeColumnIndex = -(mapY - _vm->_dungeonMan->_partyMapY);
 		lineIndex = mapX - _vm->_dungeonMan->_partyMapX;
 		break;
+	default:
+		break;
 	}
 
 	if ((rightVolumeColumnIndex < -12) || (rightVolumeColumnIndex > 12)) /* Sound is not audible if source is more than 12 squares away from the party */
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
index 7ee1a46..331e296 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -794,6 +794,9 @@ T0252001:
 					break;
 				case 3:
 					mapY++;
+					break;
+				default:
+					break;
 				}
 				if (_vm->_groupMan->isSquareACorridorTeleporterPitOrDoor(mapX, mapY))
 					goto T0252001;
@@ -953,6 +956,9 @@ T0255002:
 		break;
 	case 0:
 		_vm->_championMan->viAltarRebirth(event->_priority);
+		break;
+	default:
+		break;
 	}
 }
 





More information about the Scummvm-git-logs mailing list