aboutsummaryrefslogtreecommitdiff
path: root/gui/debugger.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2011-12-05 22:18:36 +0100
committerJohannes Schickel2011-12-05 23:00:34 +0100
commitbc0d9bd3a7830f8c67ef417c8af2e85c88666eaf (patch)
tree4739b426922b27dd96e77317f7cbbd068e8e14e9 /gui/debugger.cpp
parent8d1b07f0543372ee6923b87ba562f975681cc760 (diff)
downloadscummvm-rg350-bc0d9bd3a7830f8c67ef417c8af2e85c88666eaf.tar.gz
scummvm-rg350-bc0d9bd3a7830f8c67ef417c8af2e85c88666eaf.tar.bz2
scummvm-rg350-bc0d9bd3a7830f8c67ef417c8af2e85c88666eaf.zip
GUI: Simplify boolean parsing in our debugger.
Diffstat (limited to 'gui/debugger.cpp')
-rw-r--r--gui/debugger.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 13a347a9fa..3878cc00e3 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: {