diff options
Diffstat (limited to 'engines/wintermute/base/scriptables/script_ext_file.cpp')
-rw-r--r-- | engines/wintermute/base/scriptables/script_ext_file.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp index a1d39c5d0a..29e032a759 100644 --- a/engines/wintermute/base/scriptables/script_ext_file.cpp +++ b/engines/wintermute/base/scriptables/script_ext_file.cpp @@ -52,13 +52,13 @@ SXFile::SXFile(BaseGame *inGame, ScStack *stack) : BaseScriptable(inGame) { stack->correctParams(1); ScValue *val = stack->pop(); - _filename = NULL; + _filename = nullptr; if (!val->isNULL()) { BaseUtils::setString(&_filename, val->getString()); } - _readFile = NULL; - _writeFile = NULL; + _readFile = nullptr; + _writeFile = nullptr; _mode = 0; _textMode = false; @@ -73,7 +73,7 @@ SXFile::~SXFile() { ////////////////////////////////////////////////////////////////////////// void SXFile::cleanup() { delete[] _filename; - _filename = NULL; + _filename = nullptr; close(); } @@ -82,12 +82,12 @@ void SXFile::cleanup() { void SXFile::close() { if (_readFile) { BaseFileManager::getEngineInstance()->closeFile(_readFile); - _readFile = NULL; + _readFile = nullptr; } if (_writeFile) { _writeFile->finalize(); delete _writeFile; - _writeFile = NULL; + _writeFile = nullptr; } _mode = 0; _textMode = false; @@ -701,13 +701,13 @@ bool SXFile::scSetProperty(const char *name, ScValue *value) { ////////////////////////////////////////////////////////////////////////// // Length ////////////////////////////////////////////////////////////////////////// - if (strcmp(name, "Length")==0){ + if (strcmp(name, "Length")==0) { int origLength = _length; _length = max(value->getInt(0), 0); char propName[20]; - if (_length < OrigLength){ - for(int i=_length; i<OrigLength; i++){ + if (_length < OrigLength) { + for(int i=_length; i<OrigLength; i++) { sprintf(PropName, "%d", i); _values->DeleteProp(PropName); } @@ -778,8 +778,8 @@ bool SXFile::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(pos)); // try to re-open file if needed - _writeFile = NULL; - _readFile = NULL; + _writeFile = nullptr; + _readFile = nullptr; if (_mode != 0) { // open for reading |