[Scummvm-git-logs] scummvm master -> 462f1c98597589a3baf241ab2c1bb4dba991374e
eriktorbjorn
eriktorbjorn at telia.com
Sun Aug 6 12:26:42 CEST 2017
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b4c1e86d9f JANITORIAL: Silence GCC warning
4fb0d1e56f JANITORIAL: Increase buffer size to fix potential overflow
462f1c9859 JANITORIAL: Silence more GCC 7 warnings
Commit: b4c1e86d9f8f51e67a2086301fab30a415b04581
https://github.com/scummvm/scummvm/commit/b4c1e86d9f8f51e67a2086301fab30a415b04581
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2017-08-06T11:51:57+02:00
Commit Message:
JANITORIAL: Silence GCC warning
Since case 64 was added for "MM C64 Costume Animation", and
considering the way it's written to only affect game version 0,
it is clearly an intentional fall through.
Changed paths:
engines/scumm/actor.cpp
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 5b7e144..e3f93e5 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -2467,6 +2467,7 @@ void Actor::animateActor(int anim) {
setDirection(dir);
break;
}
+ // fall through
default:
if (_vm->_game.version <= 2)
startAnimActor(anim / 4);
Commit: 4fb0d1e56f83ac7d5edd06b6d5a2e8019bbddf37
https://github.com/scummvm/scummvm/commit/4fb0d1e56f83ac7d5edd06b6d5a2e8019bbddf37
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2017-08-06T12:00:32+02:00
Commit Message:
JANITORIAL: Increase buffer size to fix potential overflow
Caught by GCC 7 (though the warning seemed misleading to me). Since
SoundDesc->name can potentially be 14 characters "%s_reg%03d.fla"
can be 25 characters, plus the terminating \0.
Changed paths:
engines/scumm/imuse_digi/dimuse_sndmgr.cpp
diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
index b2ff3aa..618d709 100644
--- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -662,7 +662,7 @@ int32 ImuseDigiSndMgr::getDataFromRegion(SoundDesc *soundDesc, int region, byte
} else if ((soundDesc->bundle) && (soundDesc->compressed)) {
*buf = (byte *)malloc(size);
assert(*buf);
- char fileName[24];
+ char fileName[26];
int offsetMs = (((offset * 8 * 10) / soundDesc->bits) / (soundDesc->channels * soundDesc->freq)) * 100;
sprintf(fileName, "%s_reg%03d", soundDesc->name, region);
if (scumm_stricmp(fileName, soundDesc->lastFileName) != 0) {
Commit: 462f1c98597589a3baf241ab2c1bb4dba991374e
https://github.com/scummvm/scummvm/commit/462f1c98597589a3baf241ab2c1bb4dba991374e
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2017-08-06T12:26:05+02:00
Commit Message:
JANITORIAL: Silence more GCC 7 warnings
There were all flagged as intentional fall throughs. I simply changed
the comments to something GCC would recognize.
Changed paths:
engines/avalanche/avalot.cpp
engines/bladerunner/script/ai/officer_leary.cpp
engines/cge/bitmap.cpp
engines/cge/events.cpp
engines/cge2/bitmap.cpp
engines/cine/main_loop.cpp
engines/cruise/script.cpp
engines/dm/champion.cpp
engines/dm/dungeonman.cpp
engines/dm/gfx.cpp
engines/dm/group.cpp
engines/dm/menus.cpp
engines/dm/movesens.cpp
engines/dm/sounds.cpp
engines/draci/walking.cpp
engines/gob/hotspots.cpp
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 0ffe7d3..85cdd9a 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -161,10 +161,11 @@ void AvalancheEngine::handleKeyDown(Common::Event &event) {
case Common::KEYCODE_END:
case Common::KEYCODE_KP5:
if (_alive && _avvyIsAwake) {
- _animation->handleMoveKey(event); // Fallthroughs are intended.
+ _animation->handleMoveKey(event);
drawDirection();
return;
}
+ // fall through
case Common::KEYCODE_BACKSPACE:
_parser->handleBackspace();
break;
diff --git a/engines/bladerunner/script/ai/officer_leary.cpp b/engines/bladerunner/script/ai/officer_leary.cpp
index 138a192..e55a956 100644
--- a/engines/bladerunner/script/ai/officer_leary.cpp
+++ b/engines/bladerunner/script/ai/officer_leary.cpp
@@ -434,7 +434,7 @@ bool AIScriptOfficerLeary::GoalChanged(int currentGoalNumber, int newGoalNumber)
AI_Movement_Track_Append(kActorOfficerLeary, 420, 10);
AI_Movement_Track_Append(kActorOfficerLeary, 35, 30);
AI_Movement_Track_Repeat(kActorOfficerLeary);
- //no break
+ // fall through
case 10:
AI_Movement_Track_Append(kActorOfficerLeary, 310, 0);
AI_Movement_Track_Append(kActorOfficerLeary, 307, 0);
diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp
index 536db5e..76ba48d 100644
--- a/engines/cge/bitmap.cpp
+++ b/engines/cge/bitmap.cpp
@@ -293,7 +293,7 @@ bool Bitmap::solidAt(int16 x, int16 y) {
switch (t) {
case kBmpEOI:
r--;
- // No break on purpose
+ // fall through
case kBmpSKP:
w = 0;
break;
diff --git a/engines/cge/events.cpp b/engines/cge/events.cpp
index 5d3d0a1..d7c065e 100644
--- a/engines/cge/events.cpp
+++ b/engines/cge/events.cpp
@@ -111,7 +111,7 @@ bool Keyboard::getKey(Common::Event &event) {
_vm->_commandHandler->addCommand(kCmdLevel, -1, keycode - Common::KEYCODE_0, NULL);
return false;
}
- // Fallthrough intended
+ // fall through
case Common::KEYCODE_5:
case Common::KEYCODE_6:
case Common::KEYCODE_7:
diff --git a/engines/cge2/bitmap.cpp b/engines/cge2/bitmap.cpp
index 0f442b8..590d9f0 100644
--- a/engines/cge2/bitmap.cpp
+++ b/engines/cge2/bitmap.cpp
@@ -301,7 +301,7 @@ bool Bitmap::solidAt(V2D pos) {
switch (t) {
case kBmpEOI:
r--;
- // No break on purpose
+ // fall through
case kBmpSKP:
w = 0;
break;
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index 19a2d8a..19cc848 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -171,7 +171,7 @@ static void processEvent(Common::Event &event) {
g_cine->getDebugger()->attach();
g_cine->getDebugger()->onFrame();
}
- // No Break to allow fallthrough to process 'd' without CTRL
+ // fall through
default:
lastKeyStroke = event.kbd.keycode;
break;
diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp
index 1f30871..aee3e8b 100644
--- a/engines/cruise/script.cpp
+++ b/engines/cruise/script.cpp
@@ -57,7 +57,7 @@ int32 opcodeType0() {
case 5:
index = saveOpcodeVar;
- // No break on purpose
+ // fall through
case 1: {
uint8 *address = 0;
int type = getByteFromScript();
@@ -137,7 +137,7 @@ int32 opcodeType1() {
case 5:
offset = saveOpcodeVar;
- //no break on purpose
+ // fall through
case 1: {
int var_A = 0;
@@ -227,7 +227,7 @@ int32 opcodeType2() {
switch (currentScriptOpcodeType) {
case 5:
index = saveOpcodeVar;
- // No break on purpose
+ // fall through
case 1: {
uint8* adresse = NULL;
int type = getByteFromScript();
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index 374f211..646e7ce 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -729,7 +729,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
switch (curIconIndex) {
case kDMIconIndiceContainerChestClosed:
inventory.closeChest();
- // No break on purpose
+ // fall through
case kDMIconIndiceScrollOpen:
case kDMIconIndiceScrollClosed:
setFlag(curChampion->_attributes, kDMAttributePanel);
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 2d0d65f..ab35477 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -935,7 +935,7 @@ T0172010_ClosedFakeWall:
}
aspectArray[kDMSquareAspectElement] = kDMElementTypeCorridor;
AL0307_uc_FootprintsAllowed = getFlag(AL0307_uc_Square, kDMSquareMaskFakeWallRandOrnamentOrFootprintsAllowed) ? 8 : 0;
- // No break on purpose
+ // fall through
case kDMElementTypeCorridor:
case kDMElementTypePit:
case kDMElementTypeTeleporter:
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 654cd04..7f31b29 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -1463,7 +1463,7 @@ void DisplayMan::drawSquareD3L(Direction dir, int16 posX, int16 posY) {
case kDMElementTypePit:
if (!squareAspect[kDMSquareAspectPitInvisible])
drawFloorPitOrStairsBitmap(kDMGraphicIdxFloorPitD3L, frameFloorPitD3L);
- // no break on purpose
+ // fall through
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
@@ -1546,7 +1546,7 @@ void DisplayMan::drawSquareD3R(Direction dir, int16 posX, int16 posY) {
case kDMElementTypePit:
if (!squareAspect[kDMSquareAspectPitInvisible])
drawFloorPitOrStairsBitmapFlippedHorizontally(kDMGraphicIdxFloorPitD3L, frameFloorPitD3R);
- // No break on purpose
+ // fall through
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
order = kDMCellOrderBackRightBackLeftFrontRightFrontLeft;
@@ -1626,7 +1626,7 @@ void DisplayMan::drawSquareD3C(Direction dir, int16 posX, int16 posY) {
case kDMElementTypePit:
if (!squareAspect[kDMSquareAspectPitInvisible])
drawFloorPitOrStairsBitmap(kDMGraphicIdxFloorPitD3C, frameFloorPitD3C);
- // No break on purpose
+ // fall through
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
@@ -1690,7 +1690,7 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) {
break;
case kDMElementTypeStairsSide:
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexSideD2L, frameStairsSideD2L);
- // No break on purpose
+ // fall through
case kDMElementTypeDoorSide:
order = kDMCellOrderBackRightFrontLeftFrontRight;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
@@ -1706,7 +1706,7 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) {
case kDMElementTypePit:
drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD2L : kDMGraphicIdxFloorPitD2L,
frameFloorPitD2L);
- // No break on purpose
+ // fall through
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
@@ -1775,7 +1775,7 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) {
break;
case kDMElementTypeStairsSide:
drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexSideD2L, frameStairsSideD2R);
- // No break on purpose
+ // fall through
case kDMElementTypeDoorSide:
order = kDMCellOrderBackLeftFrontRightFrontLeft;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
@@ -1793,7 +1793,7 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) {
case kDMElementTypePit:
drawFloorPitOrStairsBitmapFlippedHorizontally(
squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD2L : kDMGraphicIdxFloorPitD2L, frameFloorPitD2R);
- // No break on purpose
+ // fall through
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
order = kDMCellOrderBackRightBackLeftFrontRightFrontLeft;
@@ -1876,7 +1876,7 @@ void DisplayMan::drawSquareD2C(Direction dir, int16 posX, int16 posY) {
break;
case kDMElementTypePit:
drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD2C : kDMGraphicIdxFloorPitD2C, frameFloorPitD2C);
- // No break on purpose
+ // fall through
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
@@ -1944,7 +1944,7 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) {
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpSideD1L, frameStairsUpSideD1L);
else
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownSideD1L, frameStairsDownSideD1L);
- // No break on purpose
+ // fall through
case kDMElementTypeDoorSide:
order = kDMCellOrderBackRightFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
@@ -1961,7 +1961,7 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) {
break;
case kDMElementTypePit:
drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD1L : kDMGraphicIdxFloorPitD1L, frameFloorPitD1L);
- // No break on purpose
+ // fall through
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
order = kDMCellOrderBackRightFrontRight;
@@ -2029,7 +2029,7 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexDownSideD1L, frameStairsDownSideD1R);
- // No break on purpose
+ // fall through
case kDMElementTypeDoorSide:
order = kDMCellOrderBackLeftFrontLeft;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
@@ -2046,7 +2046,7 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) {
case kDMElementTypePit:
drawFloorPitOrStairsBitmapFlippedHorizontally(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD1L
: kDMGraphicIdxFloorPitD1L, frameFloorPitD1R);
- // No break on purpose
+ // fall through
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
order = kDMCellOrderBackLeftFrontLeft;
@@ -2134,7 +2134,7 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) {
break;
case kDMElementTypePit:
drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD1C : kDMGraphicIdxFloorPitD1C, frameFloorPitD1C);
- // No break on purpose
+ // fall through
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 43d5dc8..9bfeb1d 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -727,6 +727,7 @@ T0209005_AddEventAndReturn:
if (AL0446_i_Behavior2Or3 || (_vm->getRandomNumber(4))) /* BUG0_00 Useless code. Behavior cannot be 2 nor 3 because these values are never used. The actual condition is thus: if 3/4 chances then no reaction */
return;
} /* No 'break': proceed to instruction after the next 'case' below. Reaction is to move in a random direction to try and avoid other projectiles */
+ // fall through
case kDMEventTypeCreateReactionDangerOnSquare: /* This event is used when some creatures in the group were killed by a Poison Cloud or by a closing door or if Lord Chaos is surrounded by 3 Fluxcages. It causes the creature to move in a random direction to avoid the danger */
approachAfterReaction = (AL0447_i_Behavior == kDMBehaviorAttack); /* If the creature behavior is 'Attack' and it has to move to avoid danger then it will change its behavior to 'Approach' after the movement */
newGroupDirectionFound = false;
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 348bdfd..9c8e219 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -1154,7 +1154,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
break;
case kDMActionConfuse:
decrementCharges(curChampion);
- // No break on purpose
+ // fall through
case kDMActionWarCry:
case kDMActionCalm:
case kDMActionBrandish:
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index cb9f93a..410ede7 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -105,7 +105,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
case kDMSensorWallOrnClickWithSpecObjRemovedRotateSensors:
if (sensorCountToProcessPerCell[cellIdx]) /* If the sensor is not the last one of its type on the cell */
continue;
- // No break on purpose
+ // fall through
case kDMSensorWallOrnClickWithSpecObj:
case kDMSensorWallOrnClickWithSpecObjRemoved:
doNotTriggerSensor = ((sensorData == _vm->_objectMan->getObjectType(leaderHandObject)) == currentSensor->getAttrRevertEffectA());
diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp
index bd7d404..a4de3c3 100644
--- a/engines/dm/sounds.cpp
+++ b/engines/dm/sounds.cpp
@@ -43,7 +43,7 @@ SoundMan *SoundMan::getSoundMan(DMEngine *vm, const DMADGameDescription *gameVer
switch (gameVersion->_desc.platform) {
default:
warning("Unknown platform, using default Amiga SoundMan");
- // No break on purpose
+ // fall through
case Common::kPlatformAmiga:
return new SoundMan(vm);
case Common::kPlatformAtariST:
diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp
index 04cd929..36cf33c 100644
--- a/engines/draci/walking.cpp
+++ b/engines/draci/walking.cpp
@@ -751,7 +751,7 @@ Movement WalkingState::animationForSightDirection(SightDirection dir, const Comm
} else if (mouse.x > hero.x) {
return kStopRight;
}
- // fall-through here intentional
+ // fall through
default: {
// Find the last horizontal direction on the path.
int i = path.size() - 1;
diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp
index 7aad47b..0b47f43 100644
--- a/engines/gob/hotspots.cpp
+++ b/engines/gob/hotspots.cpp
@@ -1422,7 +1422,7 @@ void Hotspots::evaluateNew(uint16 i, uint16 *ids, InputDesc *inputs,
case 20:
inputId = i;
- // Fall through to case 2
+ // fall through
case kTypeClick:
key = _vm->_game->_script->readInt16();
ids[i] = _vm->_game->_script->readInt16();
More information about the Scummvm-git-logs
mailing list