Changeset 10765 for code/branches/cpp11_v2/src/libraries/core/LuaState.cc
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/LuaState.cc
r10265 r10765 48 48 LuaState::LuaState() 49 49 : bIsRunning_(false) 50 , includeParseFunction_( NULL)50 , includeParseFunction_(nullptr) 51 51 { 52 52 // Create new lua state and configure it … … 84 84 shared_ptr<ResourceInfo> sourceInfo = Resource::getInfo(sourceFileInfo_->path + filename); 85 85 // Continue search in root directories 86 if (sourceInfo == NULL&& !sourceFileInfo_->path.empty())86 if (sourceInfo == nullptr && !sourceFileInfo_->path.empty()) 87 87 sourceInfo = Resource::getInfo(filename); 88 88 return sourceInfo; … … 92 92 { 93 93 shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename); 94 if (sourceInfo != NULL)94 if (sourceInfo != nullptr) 95 95 return this->includeString(Resource::open(sourceInfo)->getAsString(), sourceInfo); 96 96 else … … 105 105 // Parse string with provided include parser (otherwise don't preparse at all) 106 106 std::string luaInput; 107 if (includeParseFunction_ != NULL)107 if (includeParseFunction_ != nullptr) 108 108 luaInput = (*includeParseFunction_)(code); 109 109 else 110 110 luaInput = code; 111 111 112 if (sourceFileInfo != NULL)112 if (sourceFileInfo != nullptr) 113 113 { 114 114 // Also fill a map with the actual source code. This is just for the include* commands … … 119 119 bool returnValue = this->doString(luaInput, sourceFileInfo); 120 120 121 if (sourceFileInfo != NULL)121 if (sourceFileInfo != nullptr) 122 122 { 123 123 // Delete source code entry 124 if (sourceFileInfo != NULL)124 if (sourceFileInfo != nullptr) 125 125 this->sourceCodeMap_.erase(sourceFileInfo->filename); 126 126 } … … 132 132 { 133 133 shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename); 134 if (sourceInfo != NULL)134 if (sourceInfo != nullptr) 135 135 return this->doString(Resource::open(sourceInfo)->getAsString(), sourceInfo); 136 136 else … … 146 146 shared_ptr<ResourceInfo> oldSourceFileInfo = sourceFileInfo_; 147 147 // Only override if sourceFileInfo provides useful information 148 if (sourceFileInfo != NULL)148 if (sourceFileInfo != nullptr) 149 149 sourceFileInfo_ = sourceFileInfo; 150 150 151 151 std::string chunkname; 152 if (sourceFileInfo != NULL)152 if (sourceFileInfo != nullptr) 153 153 { 154 154 // Provide lua_load with the filename for debug purposes … … 286 286 { 287 287 shared_ptr<ResourceInfo> info = this->getFileInfo(filename); 288 if (info == NULL)288 if (info == nullptr) 289 289 return false; 290 290 else … … 301 301 return it->second; 302 302 shared_ptr<ResourceInfo> info = Resource::getInfo(filename); 303 if (info == NULL)303 if (info == nullptr) 304 304 return ""; 305 305 else
Note: See TracChangeset
for help on using the changeset viewer.