diff options
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 92e47f7..5957b5b 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -63,12 +63,12 @@ const char* cmState::GetTargetTypeName(cmStateEnums::TargetType targetType) return "UNKNOWN_LIBRARY"; } assert(false && "Unexpected target type"); - return CM_NULLPTR; + return nullptr; } const char* cmCacheEntryTypes[] = { "BOOL", "PATH", "FILEPATH", "STRING", "INTERNAL", "STATIC", - "UNINITIALIZED", CM_NULLPTR }; + "UNINITIALIZED", nullptr }; const char* cmState::CacheEntryTypeToString(cmStateEnums::CacheEntryType type) { @@ -132,7 +132,7 @@ const char* cmState::GetCacheEntryValue(std::string const& key) const { cmCacheManager::CacheEntry* e = this->CacheManager->GetCacheEntry(key); if (!e) { - return CM_NULLPTR; + return nullptr; } return e->Value.c_str(); } @@ -188,7 +188,7 @@ const char* cmState::GetCacheEntryProperty(std::string const& key, cmCacheManager::CacheIterator it = this->CacheManager->GetCacheIterator(key.c_str()); if (!it.PropertyExists(propertyName)) { - return CM_NULLPTR; + return nullptr; } return it.GetProperty(propertyName); } @@ -224,7 +224,7 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, std::string const& propertyName) { this->CacheManager->GetCacheIterator(key.c_str()) - .SetProperty(propertyName, (void*)CM_NULLPTR); + .SetProperty(propertyName, nullptr); } cmStateSnapshot cmState::Reset() @@ -303,7 +303,7 @@ cmPropertyDefinition const* cmState::GetPropertyDefinition( this->PropertyDefinitions.find(scope)->second; return &defs.find(name)->second; } - return CM_NULLPTR; + return nullptr; } bool cmState::IsPropertyDefined(const std::string& name, @@ -436,7 +436,7 @@ cmCommand* cmState::GetCommand(std::string const& name) const if (pos != this->BuiltinCommands.end()) { return pos->second; } - return CM_NULLPTR; + return nullptr; } std::vector<std::string> cmState::GetCommandNames() const @@ -444,15 +444,11 @@ std::vector<std::string> cmState::GetCommandNames() const std::vector<std::string> commandNames; commandNames.reserve(this->BuiltinCommands.size() + this->ScriptedCommands.size()); - for (std::map<std::string, cmCommand*>::const_iterator cmds = - this->BuiltinCommands.begin(); - cmds != this->BuiltinCommands.end(); ++cmds) { - commandNames.push_back(cmds->first); + for (auto const& bc : this->BuiltinCommands) { + commandNames.push_back(bc.first); } - for (std::map<std::string, cmCommand*>::const_iterator cmds = - this->ScriptedCommands.begin(); - cmds != this->ScriptedCommands.end(); ++cmds) { - commandNames.push_back(cmds->first); + for (auto const& sc : this->ScriptedCommands) { + commandNames.push_back(sc.first); } std::sort(commandNames.begin(), commandNames.end()); commandNames.erase(std::unique(commandNames.begin(), commandNames.end()), |