[Scummvm-git-logs] scummvm master -> a45106412a9ead12ce2edaade717f61d9f2b5609

digitall 547637+digitall at users.noreply.github.com
Wed Nov 27 02:37:56 UTC 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:
a45106412a PRINCE: Fix Missing Default Switch Cases


Commit: a45106412a9ead12ce2edaade717f61d9f2b5609
    https://github.com/scummvm/scummvm/commit/a45106412a9ead12ce2edaade717f61d9f2b5609
Author: D G Turner (digitall at scummvm.org)
Date: 2019-11-27T02:34:35Z

Commit Message:
PRINCE: Fix Missing Default Switch Cases

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

Changed paths:
    engines/prince/draw.cpp
    engines/prince/hero.cpp
    engines/prince/mob.cpp
    engines/prince/prince.cpp


diff --git a/engines/prince/draw.cpp b/engines/prince/draw.cpp
index a924f99..275b66a 100644
--- a/engines/prince/draw.cpp
+++ b/engines/prince/draw.cpp
@@ -344,6 +344,8 @@ void PrinceEngine::showBackAnims() {
 							seq._data2 = _randomSource.getRandomNumber(seq._data - 1);
 							continue; // for bug in original game
 							break;
+						default:
+							break;
 						}
 					} else {
 						_backAnimList[i].backAnims[activeSubAnim]._frame++;
diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp
index 8ade649..f042400 100644
--- a/engines/prince/hero.cpp
+++ b/engines/prince/hero.cpp
@@ -534,6 +534,8 @@ int Hero::rotateHero(int oldDirection, int newDirection) {
 			return kMove_MLU;
 		case kHeroDirDown:
 			return kMove_MLD;
+		default:
+			break;
 		}
 		break;
 	case kHeroDirRight:
@@ -544,6 +546,8 @@ int Hero::rotateHero(int oldDirection, int newDirection) {
 			return kMove_MRU;
 		case kHeroDirDown:
 			return kMove_MRD;
+		default:
+			break;
 		}
 		break;
 	case kHeroDirUp:
@@ -554,6 +558,8 @@ int Hero::rotateHero(int oldDirection, int newDirection) {
 			return kMove_MUR;
 		case kHeroDirDown:
 			return kMove_MUD;
+		default:
+			break;
 		}
 		break;
 	case kHeroDirDown:
@@ -564,8 +570,12 @@ int Hero::rotateHero(int oldDirection, int newDirection) {
 			return kMove_MDR;
 		case kHeroDirUp:
 			return kMove_MDU;
+		default:
+			break;
 		}
 		break;
+	default:
+		break;
 	}
 	error("rotateHero - wrong directions - old %d, new %d", oldDirection, newDirection);
 }
@@ -585,6 +595,8 @@ void Hero::heroStanding() {
 	case kHeroDirDown:
 		_moveSetType = kMove_SD;
 		break;
+	default:
+		break;
 	}
 }
 
@@ -637,6 +649,8 @@ void Hero::showHero() {
 				case kHeroDirDown:
 					_moveSetType = kMove_TD;
 					break;
+				default:
+					break;
 				}
 				if (_phase < _moveSet[_moveSetType]->getPhaseCount() - 1) {
 					_phase++;
@@ -656,6 +670,8 @@ void Hero::showHero() {
 			case 1:
 				_moveSetType = kMove_BORED2;
 				break;
+			default:
+				break;
 			}
 			if (_moveSet[_moveSetType] != nullptr) {
 				if (_phase < _moveSet[_moveSetType]->getPhaseCount() - 1) {
@@ -899,6 +915,8 @@ void Hero::heroMoveGotIt(int x, int y, int dir) {
 	case kHeroDirDown:
 		_moveSetType = kMove_MD;
 		break;
+	default:
+		break;
 	}
 
 	if (_vm->_flags->getFlagValue(Flags::HEROFAST) || _state == kHeroStateRun) {
@@ -949,6 +967,8 @@ void Hero::scrollHero() {
 			_vm->_flags->setFlagValue(Flags::SCROLLVALUE, scrollValue - scrollValue2);
 		}
 		break;
+	default:
+		break;
 	}
 
 	int locationWidth = _vm->_sceneWidth;
diff --git a/engines/prince/mob.cpp b/engines/prince/mob.cpp
index de15991..5a369aa 100644
--- a/engines/prince/mob.cpp
+++ b/engines/prince/mob.cpp
@@ -237,6 +237,8 @@ int PrinceEngine::checkMob(Graphics::Surface *screen, Common::Array<Mob> &mobLis
 				case '\xfc':
 					mobName.setChar('\x82', i);
 					break;
+				default:
+					break;
 				}
 			}
 		}
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index cb314aa..8f6acd7 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -570,6 +570,8 @@ void PrinceEngine::keyHandler(Common::Event event) {
 	case Common::KEYCODE_ESCAPE:
 		_flags->setFlagValue(Flags::ESCAPED2, 1);
 		break;
+	default:
+		break;
 	}
 }
 
@@ -627,6 +629,8 @@ void PrinceEngine::correctStringDEU(char *s) {
 		case '\xfc':
 			*s = '\x82';
 			break;
+		default:
+			break;
 		}
 		s++;
 	}
@@ -1023,6 +1027,8 @@ void PrinceEngine::mouseWeirdo() {
 		case 3:
 			mousePos.y -= kCelStep;
 			break;
+		default:
+			break;
 		}
 		mousePos.x = CLIP(mousePos.x, (int16) 315, (int16) 639);
 		_flags->setFlagValue(Flags::MXFLAG, mousePos.x);




More information about the Scummvm-git-logs mailing list