diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-05-28 14:27:03 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2023-05-30 14:41:59 (GMT) |
commit | 4fc322bab421a83b12977aadc7dca247db8ae541 (patch) | |
tree | 3e57b548bd2326f3a848eb23ad66da33d28f60b5 /Source/cmSetCommand.cxx | |
parent | b0d1ddb7234950374977b83f8dbded806c15b356 (diff) | |
download | CMake-4fc322bab421a83b12977aadc7dca247db8ae541.zip CMake-4fc322bab421a83b12977aadc7dca247db8ae541.tar.gz CMake-4fc322bab421a83b12977aadc7dca247db8ae541.tar.bz2 |
AddCacheEntry: Suppress raw pointer usage
Diffstat (limited to 'Source/cmSetCommand.cxx')
-rw-r--r-- | Source/cmSetCommand.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index ce0cb25..040eb08 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -79,8 +79,8 @@ bool cmSetCommand(std::vector<std::string> const& args, bool force = false; // optional bool parentScope = false; cmStateEnums::CacheEntryType type = - cmStateEnums::STRING; // required if cache - const char* docstring = nullptr; // required if cache + cmStateEnums::STRING; // required if cache + cmValue docstring; // required if cache unsigned int ignoreLastArgs = 0; // look for PARENT_SCOPE argument @@ -131,7 +131,7 @@ bool cmSetCommand(std::vector<std::string> const& args, // ensure that the type is actually converting to a string. type = cmStateEnums::STRING; } - docstring = args[cacheStart + 2].c_str(); + docstring = cmValue{ args[cacheStart + 2] }; } // see if this is already in the cache @@ -150,8 +150,8 @@ bool cmSetCommand(std::vector<std::string> const& args, // if it is meant to be in the cache then define it in the cache if (cache) { - status.GetMakefile().AddCacheDefinition(variable, value, docstring, type, - force); + status.GetMakefile().AddCacheDefinition(variable, cmValue{ value }, + docstring, type, force); } else { // add the definition status.GetMakefile().AddDefinition(variable, value); |