[Scummvm-git-logs] scummvm master -> 3f91accbd74b3fae474f22e114c73308fd954fef

digitall dgturner at iee.org
Mon Jul 30 14:59:06 CEST 2018


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:
3f91accbd7 DM: Fix Possible Uninitialized Variable Usage Compiler Warnings.


Commit: 3f91accbd74b3fae474f22e114c73308fd954fef
    https://github.com/scummvm/scummvm/commit/3f91accbd74b3fae474f22e114c73308fd954fef
Author: D G Turner (digitall at scummvm.org)
Date: 2018-07-30T14:07:23+01:00

Commit Message:
DM: Fix Possible Uninitialized Variable Usage Compiler Warnings.

Changed paths:
    engines/dm/gfx.cpp
    engines/dm/projexpl.cpp


diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index f75e7eb..f728ffd 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -3203,6 +3203,7 @@ void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Dir
 	byte *bitmapGreenAnt = nullptr;
 	do {
 		/* Draw objects */
+		ActiveGroup *activeGroup = nullptr;
 		if (L0135_B_DrawAlcoveObjects) {
 			AL_2_viewCell = kDMViewCellAlcove; /* Index of coordinates to draw objects in alcoves */
 			cellYellowBear = _vm->returnOppositeDir(directionParam); /* Alcove is on the opposite direction of the viewing direction */
@@ -3360,7 +3361,6 @@ T0115015_DrawProjectileAsObject:
 		if ((groupThing == _vm->_thingNone) || drawCreaturesCompleted)
 			goto T0115129_DrawProjectiles; /* Skip code to draw creatures */
 
-		ActiveGroup *activeGroup;
 		if (group == nullptr) { /* If all creature data and info has not already been gathered */
 			group = (Group *)dungeon.getThingData(groupThing);
 			activeGroup = &_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()];
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 0738cf6..312cdc0 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -482,6 +482,7 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
 	CreatureInfo *creatureInfo = nullptr;
 
 	CreatureType creatureType;
+	creatureType = kDMCreatureTypeGiantScorpion; // Value of 0 as default to avoid possible uninitialized usage
 	if (groupThing != _vm->_thingEndOfList) {
 		group = (Group *)_vm->_dungeonMan->getThingData(groupThing);
 		creatureType = group->_type;





More information about the Scummvm-git-logs mailing list