[Scummvm-cvs-logs] scummvm master -> 2362a3f689a3a87b342339e274a2f29e5125ddf2

lordhoto lordhoto at gmail.com
Mon Dec 5 23:01:10 CET 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
bc0d9bd3a7 GUI: Simplify boolean parsing in our debugger.
2362a3f689 GUI: Add new line to error string in debugger.


Commit: bc0d9bd3a7830f8c67ef417c8af2e85c88666eaf
    https://github.com/scummvm/scummvm/commit/bc0d9bd3a7830f8c67ef417c8af2e85c88666eaf
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-12-05T14:00:34-08:00

Commit Message:
GUI: Simplify boolean parsing in our debugger.

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 13a347a..3878cc0 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -247,16 +247,11 @@ bool Debugger::parseCommand(const char *inputOrig) {
 					*(int32 *)_dvars[i].variable = atoi(param[1]);
 					DebugPrintf("(int)%s = %d\n", param[0], *(int32 *)_dvars[i].variable);
 					break;
-				case DVAR_BOOL:	{
-					Common::String value = Common::String(param[1]);
-					if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("false") ||
-						value == "1" || value == "0") {
-						*(bool *)_dvars[i].variable = (value.equalsIgnoreCase("true") || value == "1");
+				case DVAR_BOOL:
+					if (Common::parseBool(param[1], *(bool *)_dvars[i].variable))
 						DebugPrintf("(bool)%s = %s\n", param[0], *(bool *)_dvars[i].variable ? "true" : "false");
-					} else {
-						DebugPrintf("Invalid value for boolean variable. Valid values are \"true\", \"false\", \"1\", \"0\"");
-					}
-					}
+					else
+						DebugPrintf("Invalid value for boolean variable. Valid values are \"true\", \"false\", \"1\", \"0\", \"yes\", \"no\"");
 					break;
 				// Integer Array
 				case DVAR_INTARRAY: {


Commit: 2362a3f689a3a87b342339e274a2f29e5125ddf2
    https://github.com/scummvm/scummvm/commit/2362a3f689a3a87b342339e274a2f29e5125ddf2
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-12-05T14:00:34-08:00

Commit Message:
GUI: Add new line to error string in debugger.

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 3878cc0..26e62dc 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -251,7 +251,7 @@ bool Debugger::parseCommand(const char *inputOrig) {
 					if (Common::parseBool(param[1], *(bool *)_dvars[i].variable))
 						DebugPrintf("(bool)%s = %s\n", param[0], *(bool *)_dvars[i].variable ? "true" : "false");
 					else
-						DebugPrintf("Invalid value for boolean variable. Valid values are \"true\", \"false\", \"1\", \"0\", \"yes\", \"no\"");
+						DebugPrintf("Invalid value for boolean variable. Valid values are \"true\", \"false\", \"1\", \"0\", \"yes\", \"no\"\n");
 					break;
 				// Integer Array
 				case DVAR_INTARRAY: {






More information about the Scummvm-git-logs mailing list