diff options
Diffstat (limited to 'engines/wintermute/base/scriptables/script_value.cpp')
-rw-r--r-- | engines/wintermute/base/scriptables/script_value.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/engines/wintermute/base/scriptables/script_value.cpp b/engines/wintermute/base/scriptables/script_value.cpp index 0bc7ab5807..46d6c25d44 100644 --- a/engines/wintermute/base/scriptables/script_value.cpp +++ b/engines/wintermute/base/scriptables/script_value.cpp @@ -49,9 +49,9 @@ ScValue::ScValue(BaseGame *inGame) : BaseClass(inGame) { _valBool = false; _valInt = 0; _valFloat = 0.0f; - _valNative = NULL; - _valString = NULL; - _valRef = NULL; + _valNative = nullptr; + _valString = nullptr; + _valRef = nullptr; _persistent = false; _isConstVar = false; } @@ -64,9 +64,9 @@ ScValue::ScValue(BaseGame *inGame, bool val) : BaseClass(inGame) { _valInt = 0; _valFloat = 0.0f; - _valNative = NULL; - _valString = NULL; - _valRef = NULL; + _valNative = nullptr; + _valString = nullptr; + _valRef = nullptr; _persistent = false; _isConstVar = false; } @@ -79,9 +79,9 @@ ScValue::ScValue(BaseGame *inGame, int val) : BaseClass(inGame) { _valFloat = 0.0f; _valBool = false; - _valNative = NULL; - _valString = NULL; - _valRef = NULL; + _valNative = nullptr; + _valString = nullptr; + _valRef = nullptr; _persistent = false; _isConstVar = false; } @@ -94,9 +94,9 @@ ScValue::ScValue(BaseGame *inGame, double val) : BaseClass(inGame) { _valInt = 0; _valBool = false; - _valNative = NULL; - _valString = NULL; - _valRef = NULL; + _valNative = nullptr; + _valString = nullptr; + _valRef = nullptr; _persistent = false; _isConstVar = false; } @@ -105,14 +105,14 @@ ScValue::ScValue(BaseGame *inGame, double val) : BaseClass(inGame) { ////////////////////////////////////////////////////////////////////////// ScValue::ScValue(BaseGame *inGame, const char *val) : BaseClass(inGame) { _type = VAL_STRING; - _valString = NULL; + _valString = nullptr; setStringVal(val); _valBool = false; _valInt = 0; _valFloat = 0.0f; - _valNative = NULL; - _valRef = NULL; + _valNative = nullptr; + _valRef = nullptr; _persistent = false; _isConstVar = false; } @@ -131,7 +131,7 @@ void ScValue::cleanup(bool ignoreNatives) { _valNative->_refCount--; if (_valNative->_refCount <= 0) { delete _valNative; - _valNative = NULL; + _valNative = nullptr; } } } @@ -142,9 +142,9 @@ void ScValue::cleanup(bool ignoreNatives) { _valBool = false; _valInt = 0; _valFloat = 0.0f; - _valNative = NULL; - _valString = NULL; - _valRef = NULL; + _valNative = nullptr; + _valString = nullptr; + _valRef = nullptr; _persistent = false; _isConstVar = false; } @@ -176,13 +176,13 @@ ScValue *ScValue::getProp(const char *name) { return _gameRef->_scValue; } - ScValue *ret = NULL; + ScValue *ret = nullptr; if (_type == VAL_NATIVE && _valNative) { ret = _valNative->scGetProperty(name); } - if (ret == NULL) { + if (ret == nullptr) { _valIter = _valObject.find(name); if (_valIter != _valObject.end()) { ret = _valIter->_value; @@ -200,7 +200,7 @@ bool ScValue::deleteProp(const char *name) { _valIter = _valObject.find(name); if (_valIter != _valObject.end()) { delete _valIter->_value; - _valIter->_value = NULL; + _valIter->_value = nullptr; } return STATUS_OK; @@ -220,7 +220,7 @@ bool ScValue::setProp(const char *name, ScValue *val, bool copyWhole, bool setAs } if (DID_FAIL(ret)) { - ScValue *newVal = NULL; + ScValue *newVal = nullptr; _valIter = _valObject.find(name); if (_valIter != _valObject.end()) { @@ -242,9 +242,9 @@ bool ScValue::setProp(const char *name, ScValue *val, bool copyWhole, bool setAs /* _valIter = _valObject.find(Name); - if (_valIter != _valObject.end()){ + if (_valIter != _valObject.end()) { delete _valIter->_value; - _valIter->_value = NULL; + _valIter->_value = nullptr; } ScValue* val = new ScValue(_gameRef); val->Copy(Val, CopyWhole); @@ -451,11 +451,11 @@ void ScValue::setString(const Common::String &val) { void ScValue::setStringVal(const char *val) { if (_valString) { delete[] _valString; - _valString = NULL; + _valString = nullptr; } - if (val == NULL) { - _valString = NULL; + if (val == nullptr) { + _valString = nullptr; return; } @@ -479,7 +479,7 @@ void ScValue::setNULL() { delete _valNative; } } - _valNative = NULL; + _valNative = nullptr; deleteProps(); _type = VAL_NULL; @@ -493,7 +493,7 @@ void ScValue::setNative(BaseScriptable *val, bool persistent) { return; } - if (val == NULL) { + if (val == nullptr) { setNULL(); } else { if (_valNative && !_persistent) { @@ -502,7 +502,7 @@ void ScValue::setNative(BaseScriptable *val, bool persistent) { if (_valNative != val) { delete _valNative; } - _valNative = NULL; + _valNative = nullptr; } } @@ -693,7 +693,7 @@ BaseScriptable *ScValue::getNative() { if (_type == VAL_NATIVE) { return _valNative; } else { - return NULL; + return nullptr; } } @@ -714,7 +714,7 @@ void ScValue::copy(ScValue *orig, bool copyWhole) { if (_valNative != orig->_valNative) { delete _valNative; } - _valNative = NULL; + _valNative = nullptr; } } @@ -827,7 +827,7 @@ bool ScValue::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_valRef)); persistMgr->transfer(TMEMBER(_valString)); - /* + /* // TODO: Convert to Debug-statements. FILE* f = fopen("c:\\val.log", "a+"); switch(_type) { |