From ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Thu, 26 Jul 2012 15:59:26 +0200 Subject: WINTERMUTE: Run Astyle with add-braces to break one-line statements into easier-to-read-code. --- engines/wintermute/base/base.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'engines/wintermute/base/base.cpp') diff --git a/engines/wintermute/base/base.cpp b/engines/wintermute/base/base.cpp index b81261cdaf..687d2d52e6 100644 --- a/engines/wintermute/base/base.cpp +++ b/engines/wintermute/base/base.cpp @@ -56,16 +56,19 @@ BaseClass::~BaseClass() { ////////////////////////////////////////////////////////////////////////// const char *BaseClass::getEditorProp(const char *propName, const char *initVal) { _editorPropsIter = _editorProps.find(propName); - if (_editorPropsIter != _editorProps.end()) + if (_editorPropsIter != _editorProps.end()) { return _editorPropsIter->_value.c_str(); - //return _editorPropsIter->second.c_str(); // <- TODO Clean - else return initVal; + } else { + return initVal; + } } ////////////////////////////////////////////////////////////////////////// bool BaseClass::setEditorProp(const char *propName, const char *propValue) { - if (propName == NULL) return STATUS_FAILED; + if (propName == NULL) { + return STATUS_FAILED; + } if (propValue == NULL) { _editorProps.erase(propName); @@ -91,8 +94,9 @@ bool BaseClass::parseEditorProperty(byte *buffer, bool complete) { TOKEN_TABLE_END - if (!_gameRef->_editorMode) + if (!_gameRef->_editorMode) { return STATUS_OK; + } byte *params; @@ -115,15 +119,21 @@ bool BaseClass::parseEditorProperty(byte *buffer, bool complete) { case TOKEN_NAME: delete[] propName; propName = new char[strlen((char *)params) + 1]; - if (propName) strcpy(propName, (char *)params); - else cmd = PARSERR_GENERIC; + if (propName) { + strcpy(propName, (char *)params); + } else { + cmd = PARSERR_GENERIC; + } break; case TOKEN_VALUE: delete[] propValue; propValue = new char[strlen((char *)params) + 1]; - if (propValue) strcpy(propValue, (char *)params); - else cmd = PARSERR_GENERIC; + if (propValue) { + strcpy(propValue, (char *)params); + } else { + cmd = PARSERR_GENERIC; + } break; } -- cgit v1.2.3