diff options
| author | Einar Johan Trøan Sømåen | 2012-07-26 15:59:26 +0200 | 
|---|---|---|
| committer | Einar Johan Trøan Sømåen | 2012-07-26 15:59:26 +0200 | 
| commit | ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d (patch) | |
| tree | 8dfaee0ba16e18a8e3772dd5afc9123d5c4e78d2 /engines/wintermute/base/base.cpp | |
| parent | 38507fa9895620639d8733dbb4e085dfb2282a33 (diff) | |
| download | scummvm-rg350-ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d.tar.gz scummvm-rg350-ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d.tar.bz2 scummvm-rg350-ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d.zip | |
WINTERMUTE: Run Astyle with add-braces to break one-line statements into easier-to-read-code.
Diffstat (limited to 'engines/wintermute/base/base.cpp')
| -rw-r--r-- | engines/wintermute/base/base.cpp | 28 | 
1 files changed, 19 insertions, 9 deletions
| 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;
  		}
 | 
