[Scummvm-git-logs] scummvm master -> 30c366ee5db4c27e9d0ef94fd5786af55b1b0147

digitall 547637+digitall at users.noreply.github.com
Thu Oct 3 07:06:57 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:
30c366ee5d GUI: Add Missing Switch Default Cases


Commit: 30c366ee5db4c27e9d0ef94fd5786af55b1b0147
    https://github.com/scummvm/scummvm/commit/30c366ee5db4c27e9d0ef94fd5786af55b1b0147
Author: D G Turner (digitall at scummvm.org)
Date: 2019-10-03T06:03:46+01:00

Commit Message:
GUI: Add Missing Switch Default Cases

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

Changed paths:
    gui/ThemeEngine.cpp
    gui/console.cpp
    gui/debugger.cpp
    gui/dialog.cpp
    gui/launcher.cpp
    gui/onscreendialog.cpp
    gui/options.cpp
    gui/predictivedialog.cpp
    gui/saveload-dialog.cpp
    gui/saveload.cpp
    gui/unknown-game-dialog.cpp
    gui/widget.cpp
    gui/widgets/list.cpp
    gui/widgets/scrollcontainer.cpp
    gui/widgets/tab.cpp


diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index dd074cc..666b9b3 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -1082,6 +1082,9 @@ void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground b
 	case kDialogBackgroundDefault:
 		drawDD(kDDDefaultBackground, r);
 		break;
+
+	default:
+		// fallthrough intended
 	case kDialogBackgroundNone:
 		// no op
 		break;
@@ -1209,6 +1212,8 @@ void ThemeEngine::drawText(const Common::Rect &r, const Common::String &str, Wid
 				colorId = kTextColorNormalHover;
 				break;
 
+			default:
+				// fallthrough intended
 			case kStateEnabled:
 			case kStatePressed:
 				colorId = kTextColorNormal;
@@ -1230,6 +1235,8 @@ void ThemeEngine::drawText(const Common::Rect &r, const Common::String &str, Wid
 				colorId = kTextColorAlternativeHover;
 				break;
 
+			default:
+				// fallthrough intended
 			case kStateEnabled:
 			case kStatePressed:
 				colorId = kTextColorAlternative;
diff --git a/gui/console.cpp b/gui/console.cpp
index a47f5b9..41b7a73 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -489,12 +489,16 @@ void ConsoleDialog::insertIntoPrompt(const char* str) {
 void ConsoleDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
 	switch (cmd) {
 	case kSetPositionCmd:
-		int newPos = (int)data + _linesPerPage - 1 + _firstLineInBuffer;
-		if (newPos != _scrollLine) {
-			_scrollLine = newPos;
-			g_gui.scheduleTopDialogRedraw();
+		{
+			int newPos = (int)data + _linesPerPage - 1 + _firstLineInBuffer;
+			if (newPos != _scrollLine) {
+				_scrollLine = newPos;
+				g_gui.scheduleTopDialogRedraw();
+			}
 		}
 		break;
+	default:
+		break;
 	}
 }
 
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 2e8ae1c..ea8a699 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -403,6 +403,8 @@ void Debugger::splitCommand(Common::String &input, int &argc, const char **argv)
 		c = (byte)*p;
 
 		switch (state) {
+		default:
+			// fallthrough intended
 		case DULL:
 			// not in a word, not in a double quoted string
 			if (isspace(c))
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 781de33..99441e0 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -353,6 +353,8 @@ void Dialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
 	case kCloseCmd:
 		close();
 		break;
+	default:
+		break;
 	}
 }
 
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index b09f650..ac414e0 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -454,6 +454,8 @@ void LauncherDialog::recordGame(int item) {
 	MessageDialog alert(_("Do you want to load saved game?"),
 		_("Yes"), _("No"));
 	switch(recorderDialog.runModal(_domains[item])) {
+	default:
+		// fallthrough intended
 	case RecorderDialog::kRecordDialogClose:
 		break;
 	case RecorderDialog::kRecordDialogPlayback:
diff --git a/gui/onscreendialog.cpp b/gui/onscreendialog.cpp
index 8b338f5..7d348d7 100644
--- a/gui/onscreendialog.cpp
+++ b/gui/onscreendialog.cpp
@@ -153,6 +153,8 @@ void OnScreenDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
 	case kFastModeCmd:
 		g_eventRec.switchFastMode();
 		break;
+	default:
+		break;
 	}
 }
 
diff --git a/gui/options.cpp b/gui/options.cpp
index 8548cc9..772f946 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2350,6 +2350,8 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
 		case Cloud::kStorageBoxId:
 			url += "box";
 			break;
+		default:
+			break;
 		}
 
 		if (!g_system->openUrl(url)) {
diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp
index b01e495..b15bd5c 100644
--- a/gui/predictivedialog.cpp
+++ b/gui/predictivedialog.cpp
@@ -532,6 +532,8 @@ void PredictiveDialog::processButton(ButtonId button) {
 						_temp[x] = buttons[_currentCode[x] - '1'][_repeatcount[x]];
 				_temp[_currentCode.size()] = 0;
 				_currentWord = _temp;
+			default:
+				break;
 			}
 		} else if (button == kNextAct) { // next
 			if (_mode == kModePre) {
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index d0132d9..61fd392 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -84,6 +84,9 @@ void SaveLoadCloudSyncProgressDialog::handleCommand(CommandSender *sender, uint3
 	case kBackgroundSyncCmd:
 		_close = true;
 		break;
+
+	default:
+		break;
 	}
 
 	Dialog::handleCommand(sender, cmd, data);
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index a893f3c..6de8be9 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -51,6 +51,8 @@ void SaveLoadChooser::selectChooser(const MetaEngine &engine) {
 			_impl = new SaveLoadChooserGrid(_title, _saveMode);
 			break;
 
+		default:
+			// fallthrough intended
 		case kSaveLoadDialogList:
 #endif // !DISABLE_SAVELOADCHOOSER_GRID
 			_impl = new SaveLoadChooserSimple(_title, _buttonLabel, _saveMode);
diff --git a/gui/unknown-game-dialog.cpp b/gui/unknown-game-dialog.cpp
index 0aa8cc5..790f724 100644
--- a/gui/unknown-game-dialog.cpp
+++ b/gui/unknown-game-dialog.cpp
@@ -232,6 +232,8 @@ void UnknownGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32
 		for (uint i = 0; i < _textWidgets.size() ; i++)
 			_textWidgets[i]->setVisible(true);
 		break;
+	default:
+		break;
 	}
 }
 
diff --git a/gui/widget.cpp b/gui/widget.cpp
index f870eb5..3e37282 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -237,6 +237,8 @@ uint8 Widget::parseHotkey(const Common::String &label) {
 			else
 				state = 0;
 			break;
+		default:
+			break;
 		}
 	}
 
diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp
index cc5ea91..3ef365b 100644
--- a/gui/widgets/list.cpp
+++ b/gui/widgets/list.cpp
@@ -516,6 +516,8 @@ void ListWidget::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
 			((GUI::Dialog *)_boss)->setFocusWidget(this);
 		}
 		break;
+	default:
+		break;
 	}
 }
 
diff --git a/gui/widgets/scrollcontainer.cpp b/gui/widgets/scrollcontainer.cpp
index 389eed0..c136c57 100644
--- a/gui/widgets/scrollcontainer.cpp
+++ b/gui/widgets/scrollcontainer.cpp
@@ -111,6 +111,8 @@ void ScrollContainerWidget::handleCommand(CommandSender *sender, uint32 cmd, uin
 		reflowLayout();
 		g_gui.scheduleTopDialogRedraw();
 		break;
+	default:
+		break;
 	}
 }
 
diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp
index 8c136ba..0305b57 100644
--- a/gui/widgets/tab.cpp
+++ b/gui/widgets/tab.cpp
@@ -195,6 +195,9 @@ void TabWidget::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
 			setFirstVisible(_firstVisibleTab + 1, false);
 		}
 		break;
+
+	default:
+		break;
 	}
 }
 





More information about the Scummvm-git-logs mailing list