summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmCPluginAPI.cxx4
-rw-r--r--Source/cmCacheManager.cxx7
-rw-r--r--Source/cmCacheManager.h4
-rw-r--r--Source/cmPropertyMap.cxx4
-rw-r--r--Source/cmPropertyMap.h2
-rw-r--r--Source/cmSetPropertyCommand.cxx4
-rw-r--r--Source/cmSourceFile.h3
7 files changed, 10 insertions, 18 deletions
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 13ccf4f..655f4bc 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -628,8 +628,8 @@ static void CCONV cmSourceFileSetProperty(void* arg, const char* prop,
{
cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
if (cmSourceFile* rsf = sf->RealSourceFile) {
- if (value == nullptr) {
- rsf->SetProperty(prop, nullptr);
+ if (!value) {
+ rsf->RemoveProperty(prop);
} else {
rsf->SetProperty(prop, value);
}
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 0c6b225..5c25cb9 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -597,15 +597,14 @@ void cmCacheManager::CacheEntry::SetProperty(const std::string& p, bool v)
this->SetProperty(p, v ? std::string{ "ON" } : std::string{ "OFF" });
}
-void cmCacheManager::CacheEntry::SetProperty(const std::string& prop,
- std::nullptr_t)
+void cmCacheManager::CacheEntry::RemoveProperty(const std::string& prop)
{
if (prop == "TYPE") {
this->Type = cmState::StringToCacheEntryType("STRING");
} else if (prop == "VALUE") {
- this->Value = "";
+ this->Value.clear();
} else {
- this->Properties.SetProperty(prop, cmValue{ nullptr });
+ this->Properties.RemoveProperty(prop);
}
}
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 5268248..ae32759 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -41,7 +41,7 @@ class cmCacheManager
bool GetPropertyAsBool(const std::string& property) const;
void SetProperty(const std::string& property, const std::string& value);
void SetProperty(const std::string& property, bool value);
- void SetProperty(const std::string& property, std::nullptr_t);
+ void RemoveProperty(const std::string& property);
void AppendProperty(const std::string& property, const std::string& value,
bool asString = false);
@@ -144,7 +144,7 @@ public:
std::string const& propName)
{
if (auto* entry = this->GetCacheEntry(key)) {
- entry->SetProperty(propName, nullptr);
+ entry->RemoveProperty(propName);
}
}
diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx
index 568a3d2..5bb769a 100644
--- a/Source/cmPropertyMap.cxx
+++ b/Source/cmPropertyMap.cxx
@@ -10,10 +10,6 @@ void cmPropertyMap::Clear()
this->Map_.clear();
}
-void cmPropertyMap::SetProperty(const std::string& name, std::nullptr_t)
-{
- this->Map_.erase(name);
-}
void cmPropertyMap::SetProperty(const std::string& name, cmValue value)
{
if (!value) {
diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h
index 23b50a5..3cd90ec 100644
--- a/Source/cmPropertyMap.h
+++ b/Source/cmPropertyMap.h
@@ -4,7 +4,6 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <cstddef>
#include <string>
#include <unordered_map>
#include <utility>
@@ -26,7 +25,6 @@ public:
// -- Properties
//! Set the property value
- void SetProperty(const std::string& name, std::nullptr_t);
void SetProperty(const std::string& name, cmValue value);
void SetProperty(const std::string& name, const std::string& value)
{
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index f9afed8..60610a4 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -348,7 +348,7 @@ bool HandleAndValidateSourceFilePropertyGENERATED(
sf->AppendProperty("GENERATED", propertyValue, true);
break;
case PropertyOp::Remove:
- sf->SetProperty("GENERATED", nullptr);
+ sf->RemoveProperty("GENERATED");
break;
case PropertyOp::Set:
sf->SetProperty("GENERATED", propertyValue);
@@ -703,7 +703,7 @@ bool HandleSource(cmSourceFile* sf, const std::string& propertyName,
sf->AppendProperty(propertyName, propertyValue, appendAsString);
} else {
if (remove) {
- sf->SetProperty(propertyName, nullptr);
+ sf->RemoveProperty(propertyName);
} else {
sf->SetProperty(propertyName, propertyValue);
}
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 3f070a7..be2023f 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -4,7 +4,6 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <cstddef>
#include <memory>
#include <string>
#include <vector>
@@ -43,7 +42,7 @@ public:
//! Set/Get a property of this source file
void SetProperty(const std::string& prop, cmValue value);
- void SetProperty(const std::string& prop, std::nullptr_t)
+ void RemoveProperty(const std::string& prop)
{
this->SetProperty(prop, cmValue{ nullptr });
}