[Scummvm-git-logs] scummvm master -> 80522f1187a8af827f018c8714cb07ee109182e3

digitall 547637+digitall at users.noreply.github.com
Thu Oct 17 22:46:45 CEST 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:
80522f1187 DIRECTOR: Fix Missing Default Switch Cases


Commit: 80522f1187a8af827f018c8714cb07ee109182e3
    https://github.com/scummvm/scummvm/commit/80522f1187a8af827f018c8714cb07ee109182e3
Author: D G Turner (digitall at scummvm.org)
Date: 2019-10-17T21:43:00+01:00

Commit Message:
DIRECTOR: Fix Missing Default Switch Cases

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

Changed paths:
    engines/director/frame.cpp
    engines/director/images.cpp
    engines/director/lingo/lingo-funcs.cpp
    engines/director/lingo/lingo-lex.cpp
    engines/director/score.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index fe0f256..15463c0 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -587,6 +587,8 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
 				case 7:
 					castType = kCastText;
 					break;
+				default:
+					break;
 				}
 			} else {
 				if (!_vm->getCurrentScore()->_castTypes.contains(_sprites[i]->_castId)) {
@@ -708,6 +710,9 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
 	case kTypeRadio:
 		warning("STUB: renderButton: kTypeRadio");
 		break;
+	default:
+		warning("renderButton: Unknown buttonType");
+		break;
 	}
 }
 
@@ -743,7 +748,6 @@ void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics
 void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textSize) {
 	TextCast *textCast = _sprites[spriteId]->_buttonCast != nullptr ? (TextCast*)_sprites[spriteId]->_buttonCast : _sprites[spriteId]->_textCast;
 
-
 	int x = _sprites[spriteId]->_startPoint.x; // +rectLeft;
 	int y = _sprites[spriteId]->_startPoint.y; // +rectTop;
 	int height = textCast->initialRect.height(); //_sprites[spriteId]->_height;
@@ -829,6 +833,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
 
 	switch (textCast->textAlign) {
 	case kTextAlignLeft:
+	default:
 		break;
 	case kTextAlignCenter:
 		textX = (width / 2) - (textSurface->w / 2) + (padding / 2) + borderSize;
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 4574165..007dc8a 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -226,9 +226,10 @@ BITDDecoderV4::BITDDecoderV4(int w, int h, uint16 bitsPerPixel) {
 	case 32:
 		//pf = Graphics::PixelFormat::PixelFormat(bitsPerPixel / 8, 8, 8, 8, 8, 24, 16, 8, 0);
 		break;
+	default:
+		break;
 	}
 
-
 	// HACK: Create a padded surface by adjusting w after create()
 	_surface->create(pitch, h, pf);
 	_surface->w = w;
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index dbd637a..e177128 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -327,6 +327,7 @@ void Lingo::func_cursor(int c) {
 	switch (c) {
 	case 0:
 	case -1:
+	default:
 		_vm->getMacWindowManager()->pushArrowCursor();
 		break;
 	case 1:
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp
index 7b98269..0458c27 100644
--- a/engines/director/lingo/lingo-lex.cpp
+++ b/engines/director/lingo/lingo-lex.cpp
@@ -1644,6 +1644,9 @@ case YY_STATE_EOF(INITIAL):
 
 		else switch ( yy_get_next_buffer(  ) )
 			{
+			default:
+				break;
+
 			case EOB_ACT_END_OF_FILE:
 				{
 				(yy_did_buffer_switch_on_eof) = 0;
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 30cbe1d..33e48f2 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -895,6 +895,7 @@ void Score::dumpScript(const char *script, ScriptType type, uint16 id) {
 
 	switch (type) {
 	case kNoneScript:
+	default:
 		error("Incorrect dumpScript() call");
 	case kFrameScript:
 		typeName = "frame";





More information about the Scummvm-git-logs mailing list