aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/scriptables/script_value.cpp
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2013-01-26 18:06:42 +0100
committerEinar Johan Trøan Sømåen2013-01-26 18:07:07 +0100
commit980dc4a456f55a8b6526d2bc6f7694a0b2d666b3 (patch)
treebef13619df90984b731795e72721da7d39089041 /engines/wintermute/base/scriptables/script_value.cpp
parent6ae97cdfbe88fa34363aabc46847b0c9a32eefe5 (diff)
downloadscummvm-rg350-980dc4a456f55a8b6526d2bc6f7694a0b2d666b3.tar.gz
scummvm-rg350-980dc4a456f55a8b6526d2bc6f7694a0b2d666b3.tar.bz2
scummvm-rg350-980dc4a456f55a8b6526d2bc6f7694a0b2d666b3.zip
WINTERMUTE: Replace all NULLs with nullptr.
Diffstat (limited to 'engines/wintermute/base/scriptables/script_value.cpp')
-rw-r--r--engines/wintermute/base/scriptables/script_value.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/engines/wintermute/base/scriptables/script_value.cpp b/engines/wintermute/base/scriptables/script_value.cpp
index ad8ab26e09..08b8ddd418 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()) {
@@ -244,7 +244,7 @@ bool ScValue::setProp(const char *name, ScValue *val, bool copyWhole, bool setAs
_valIter = _valObject.find(Name);
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;
}
}