Commit 3742bb0d authored by Ben Boeckel's avatar Ben Boeckel Committed by Brad King

stringapi: Use strings for variable names

Variable names are always generated by CMake and should never be NULL.
parent ec97ed7d
......@@ -972,7 +972,7 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName)
}
//----------------------------------------------------------------------
void cmCPackGenerator::SetOptionIfNotSet(const char* op,
void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
const char* value)
{
const char* def = this->MakefileMap->GetDefinition(op);
......@@ -984,12 +984,8 @@ void cmCPackGenerator::SetOptionIfNotSet(const char* op,
}
//----------------------------------------------------------------------
void cmCPackGenerator::SetOption(const char* op, const char* value)
void cmCPackGenerator::SetOption(const std::string& op, const char* value)
{
if ( !op )
{
return;
}
if ( !value )
{
this->MakefileMap->RemoveDefinition(op);
......@@ -1176,19 +1172,19 @@ int cmCPackGenerator::InitializeInternal()
}
//----------------------------------------------------------------------
bool cmCPackGenerator::IsSet(const char* name) const
bool cmCPackGenerator::IsSet(const std::string& name) const
{
return this->MakefileMap->IsSet(name);
}
//----------------------------------------------------------------------
bool cmCPackGenerator::IsOn(const char* name) const
bool cmCPackGenerator::IsOn(const std::string& name) const
{
return cmSystemTools::IsOn(GetOption(name));
}
//----------------------------------------------------------------------
const char* cmCPackGenerator::GetOption(const char* op) const
const char* cmCPackGenerator::GetOption(const std::string& op) const
{
const char* ret = this->MakefileMap->GetDefinition(op);
if(!ret)
......
......@@ -99,12 +99,12 @@ public:
virtual ~cmCPackGenerator();
//! Set and get the options
void SetOption(const char* op, const char* value);
void SetOptionIfNotSet(const char* op, const char* value);
const char* GetOption(const char* op) const;
void SetOption(const std::string& op, const char* value);
void SetOptionIfNotSet(const std::string& op, const char* value);
const char* GetOption(const std::string& op) const;
std::vector<std::string> GetOptions() const;
bool IsSet(const char* name) const;
bool IsOn(const char* name) const;
bool IsSet(const std::string& name) const;
bool IsOn(const std::string& name) const;
//! Set the logger
void SetLogger(cmCPackLog* log) { this->Logger = log; }
......
......@@ -30,12 +30,8 @@ cmCTestGenericHandler::~cmCTestGenericHandler()
}
//----------------------------------------------------------------------
void cmCTestGenericHandler::SetOption(const char* op, const char* value)
void cmCTestGenericHandler::SetOption(const std::string& op, const char* value)
{
if ( !op )
{
return;
}
if ( !value )
{
cmCTestGenericHandler::t_StringToString::iterator remit
......@@ -51,14 +47,10 @@ void cmCTestGenericHandler::SetOption(const char* op, const char* value)
}
//----------------------------------------------------------------------
void cmCTestGenericHandler::SetPersistentOption(const char* op,
void cmCTestGenericHandler::SetPersistentOption(const std::string& op,
const char* value)
{
this->SetOption(op, value);
if ( !op )
{
return;
}
if ( !value )
{
cmCTestGenericHandler::t_StringToString::iterator remit
......@@ -88,7 +80,7 @@ void cmCTestGenericHandler::Initialize()
}
//----------------------------------------------------------------------
const char* cmCTestGenericHandler::GetOption(const char* op)
const char* cmCTestGenericHandler::GetOption(const std::string& op)
{
cmCTestGenericHandler::t_StringToString::iterator remit
= this->Options.find(op);
......
......@@ -74,9 +74,9 @@ public:
typedef std::map<cmStdString,cmStdString> t_StringToString;
void SetPersistentOption(const char* op, const char* value);
void SetOption(const char* op, const char* value);
const char* GetOption(const char* op);
void SetPersistentOption(const std::string& op, const char* value);
void SetOption(const std::string& op, const char* value);
const char* GetOption(const std::string& op);
void SetCommand(cmCTestCommand* command)
{
......
......@@ -19,9 +19,10 @@
#include "cmCursesDummyWidget.h"
#include "../cmSystemTools.h"
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key,
int labelwidth,
int entrywidth) :
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
const std::string& key,
int labelwidth,
int entrywidth) :
Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
{
this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
......@@ -31,7 +32,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key,
}
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
const char* key, const cmCacheManager::CacheIterator& it, bool isNew,
const std::string& key, const cmCacheManager::CacheIterator& it, bool isNew,
int labelwidth, int entrywidth)
: Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
{
......
......@@ -18,8 +18,9 @@
class cmCursesCacheEntryComposite
{
public:
cmCursesCacheEntryComposite(const char* key, int labelwidth, int entrywidth);
cmCursesCacheEntryComposite(const char* key,
cmCursesCacheEntryComposite(const std::string& key, int labelwidth,
int entrywidth);
cmCursesCacheEntryComposite(const std::string& key,
const cmCacheManager::CacheIterator& it,
bool isNew, int labelwidth, int entrywidth);
~cmCursesCacheEntryComposite();
......
......@@ -84,9 +84,9 @@ cmCursesMainForm::~cmCursesMainForm()
}
// See if a cache entry is in the list of entries in the ui.
bool cmCursesMainForm::LookForCacheEntry(const char* key)
bool cmCursesMainForm::LookForCacheEntry(const std::string& key)
{
if (!key || !this->Entries)
if (!this->Entries)
{
return false;
}
......@@ -94,7 +94,7 @@ bool cmCursesMainForm::LookForCacheEntry(const char* key)
std::vector<cmCursesCacheEntryComposite*>::iterator it;
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{
if (!strcmp(key, (*it)->Key.c_str()))
if (key == (*it)->Key)
{
return true;
}
......@@ -146,7 +146,7 @@ void cmCursesMainForm::InitializeUI()
this->CMakeInstance->GetCacheManager()->NewIterator();
!i.IsAtEnd(); i.Next())
{
const char* key = i.GetName();
std::string key = i.GetName();
if ( i.GetType() == cmCacheManager::INTERNAL ||
i.GetType() == cmCacheManager::STATIC ||
i.GetType() == cmCacheManager::UNINITIALIZED )
......@@ -168,7 +168,7 @@ void cmCursesMainForm::InitializeUI()
this->CMakeInstance->GetCacheManager()->NewIterator();
!i.IsAtEnd(); i.Next())
{
const char* key = i.GetName();
std::string key = i.GetName();
if ( i.GetType() == cmCacheManager::INTERNAL ||
i.GetType() == cmCacheManager::STATIC ||
i.GetType() == cmCacheManager::UNINITIALIZED )
......
......@@ -51,7 +51,7 @@ public:
* Returns true if an entry with the given key is in the
* list of current composites.
*/
bool LookForCacheEntry(const char* key);
bool LookForCacheEntry(const std::string& key);
enum {
MIN_WIDTH = 65,
......
......@@ -2593,13 +2593,9 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
}
//----------------------------------------------------------------------
void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def,
void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
VectorOfStrings& vec)
{
if ( !def)
{
return;
}
const char* dval = mf->GetDefinition(def);
if ( !dval )
{
......@@ -2620,12 +2616,9 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def,
}
//----------------------------------------------------------------------
void cmCTest::PopulateCustomInteger(cmMakefile* mf, const char* def, int& val)
void cmCTest::PopulateCustomInteger(cmMakefile* mf, const std::string& def,
int& val)
{
if ( !def)
{
return;
}
const char* dval = mf->GetDefinition(def);
if ( !dval )
{
......@@ -2702,7 +2695,7 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
}
//----------------------------------------------------------------------
std::string cmCTest::GetCTestConfiguration(const char *name)
std::string cmCTest::GetCTestConfiguration(const std::string& name)
{
if ( this->CTestConfigurationOverwrites.find(name) !=
this->CTestConfigurationOverwrites.end() )
......@@ -2877,7 +2870,7 @@ void cmCTest::SetConfigType(const char* ct)
//----------------------------------------------------------------------
bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
const char* dconfig, const char* cmake_var)
const char* dconfig, const std::string& cmake_var)
{
const char* ctvar;
ctvar = mf->GetDefinition(cmake_var);
......
......@@ -172,7 +172,7 @@ public:
std::string GetTestModelString();
static int GetTestModelFromString(const char* str);
static std::string CleanString(const std::string& str);
std::string GetCTestConfiguration(const char *name);
std::string GetCTestConfiguration(const std::string& name);
void SetCTestConfiguration(const char *name, const char* value);
void EmptyCTestConfiguration();
......@@ -185,9 +185,9 @@ public:
//! Set the notes files to be created.
void SetNotesFiles(const char* notes);
void PopulateCustomVector(cmMakefile* mf, const char* definition,
void PopulateCustomVector(cmMakefile* mf, const std::string& definition,
VectorOfStrings& vec);
void PopulateCustomInteger(cmMakefile* mf, const char* def,
void PopulateCustomInteger(cmMakefile* mf, const std::string& def,
int& val);
///! Get the current time as string
......@@ -332,7 +332,7 @@ public:
* Set the CTest variable from CMake variable
*/
bool SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
const char* dconfig, const char* cmake_var);
const char* dconfig, const std::string& cmake_var);
//! Make string safe to be send as an URL
static std::string MakeURLSafe(const std::string&);
......
......@@ -650,7 +650,7 @@ void cmCacheManager::OutputHelpString(std::ostream& fout,
}
}
void cmCacheManager::RemoveCacheEntry(const char* key)
void cmCacheManager::RemoveCacheEntry(const std::string& key)
{
CacheEntryMap::iterator i = this->Cache.find(key);
if(i != this->Cache.end())
......@@ -660,7 +660,8 @@ void cmCacheManager::RemoveCacheEntry(const char* key)
}
cmCacheManager::CacheEntry *cmCacheManager::GetCacheEntry(const char* key)
cmCacheManager::CacheEntry *cmCacheManager::GetCacheEntry(
const std::string& key)
{
CacheEntryMap::iterator i = this->Cache.find(key);
if(i != this->Cache.end())
......@@ -676,7 +677,7 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(
return CacheIterator(*this, key);
}
const char* cmCacheManager::GetCacheValue(const char* key) const
const char* cmCacheManager::GetCacheValue(const std::string& key) const
{
CacheEntryMap::const_iterator i = this->Cache.find(key);
if(i != this->Cache.end() &&
......@@ -708,7 +709,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
}
void cmCacheManager::AddCacheEntry(const char* key,
void cmCacheManager::AddCacheEntry(const std::string& key,
const char* value,
const char* helpString,
CacheEntryType type)
......@@ -767,7 +768,7 @@ void cmCacheManager::CacheIterator::Begin()
this->Position = this->Container.Cache.begin();
}
bool cmCacheManager::CacheIterator::Find(const char* key)
bool cmCacheManager::CacheIterator::Find(const std::string& key)
{
this->Position = this->Container.Cache.find(key);
return !this->IsAtEnd();
......
......@@ -53,7 +53,7 @@ public:
{
public:
void Begin();
bool Find(const char*);
bool Find(const std::string&);
bool IsAtEnd() const;
void Next();
const char *GetName() const {
......@@ -129,7 +129,7 @@ public:
cmCacheManager::CacheIterator GetCacheIterator(const char *key=0);
///! Remove an entry from the cache
void RemoveCacheEntry(const char* key);
void RemoveCacheEntry(const std::string& key);
///! Get the number of entries in the cache
int GetSize() {
......@@ -142,7 +142,7 @@ public:
CacheEntryType& type);
///! Get a value from the cache given a key
const char* GetCacheValue(const char* key) const;
const char* GetCacheValue(const std::string& key) const;
/** Get the version of CMake that wrote the cache. */
unsigned int GetCacheMajorVersion() const
......@@ -153,11 +153,11 @@ public:
protected:
///! Add an entry into the cache
void AddCacheEntry(const char* key, const char* value,
void AddCacheEntry(const std::string& key, const char* value,
const char* helpString, CacheEntryType type);
///! Get a cache entry object for a key
CacheEntry *GetCacheEntry(const char *key);
CacheEntry *GetCacheEntry(const std::string& key);
///! Clean out the CMakeFiles directory if no CMakeCache.txt
void CleanCMakeFiles(const char* path);
......
......@@ -28,7 +28,7 @@ void cmDefinitions::Reset(cmDefinitions* parent)
//----------------------------------------------------------------------------
cmDefinitions::Def const&
cmDefinitions::GetInternal(const char* key)
cmDefinitions::GetInternal(const std::string& key)
{
MapType::const_iterator i = this->Map.find(key);
if(i != this->Map.end())
......@@ -46,7 +46,7 @@ cmDefinitions::GetInternal(const char* key)
//----------------------------------------------------------------------------
cmDefinitions::Def const&
cmDefinitions::SetInternal(const char* key, Def const& def)
cmDefinitions::SetInternal(const std::string& key, Def const& def)
{
if(this->Up || def.Exists)
{
......@@ -71,14 +71,14 @@ cmDefinitions::SetInternal(const char* key, Def const& def)
}
//----------------------------------------------------------------------------
const char* cmDefinitions::Get(const char* key)
const char* cmDefinitions::Get(const std::string& key)
{
Def const& def = this->GetInternal(key);
return def.Exists? def.c_str() : 0;
}
//----------------------------------------------------------------------------
const char* cmDefinitions::Set(const char* key, const char* value)
const char* cmDefinitions::Set(const std::string& key, const char* value)
{
Def const& def = this->SetInternal(key, Def(value));
return def.Exists? def.c_str() : 0;
......
......@@ -35,10 +35,10 @@ public:
/** Get the value associated with a key; null if none.
Store the result locally if it came from a parent. */
const char* Get(const char* key);
const char* Get(const std::string& key);
/** Set (or unset if null) a value associated with a key. */
const char* Set(const char* key, const char* value);
const char* Set(const std::string& key, const char* value);
/** Get the set of all local keys. */
std::set<cmStdString> LocalKeys() const;
......@@ -69,8 +69,8 @@ private:
MapType Map;
// Internal query and update methods.
Def const& GetInternal(const char* key);
Def const& SetInternal(const char* key, Def const& def);
Def const& GetInternal(const std::string& key);
Def const& SetInternal(const std::string& key, Def const& def);
// Implementation of Closure() method.
struct ClosureTag {};
......
......@@ -151,7 +151,7 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
//----------------------------------------------------------------------------
void cmExportFileGenerator::PopulateInterfaceProperty(
const std::string& propName,
const cmStdString& outputName,
const std::string& outputName,
cmTarget *target,
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap &properties,
......
......@@ -174,7 +174,7 @@ protected:
std::set<cmTarget*> ExportedTargets;
private:
void PopulateInterfaceProperty(const std::string&, const cmStdString&,
void PopulateInterfaceProperty(const std::string&, const std::string&,
cmTarget *target,
cmGeneratorExpression::PreprocessContext,
ImportPropertyMap &properties,
......
......@@ -268,7 +268,7 @@ void cmFindBase::AddPrefixPaths(std::vector<std::string> const& in_paths,
}
//----------------------------------------------------------------------------
void cmFindBase::AddCMakePrefixPath(const char* variable)
void cmFindBase::AddCMakePrefixPath(const std::string& variable)
{
// Get a path from a CMake variable.
if(const char* varPath = this->Makefile->GetDefinition(variable))
......@@ -280,11 +280,11 @@ void cmFindBase::AddCMakePrefixPath(const char* variable)
}
//----------------------------------------------------------------------------
void cmFindBase::AddEnvPrefixPath(const char* variable)
void cmFindBase::AddEnvPrefixPath(const std::string& variable)
{
// Get a path from the environment.
std::vector<std::string> tmp;
cmSystemTools::GetPath(tmp, variable);
cmSystemTools::GetPath(tmp, variable.c_str());
this->AddPrefixPaths(tmp, EnvPath);
}
......
......@@ -63,8 +63,8 @@ private:
void AddUserGuessPath();
// Helpers.
void AddCMakePrefixPath(const char* variable);
void AddEnvPrefixPath(const char* variable);
void AddCMakePrefixPath(const std::string& variable);
void AddEnvPrefixPath(const std::string& variable);
void AddPrefixPaths(std::vector<std::string> const& in_paths,
PathType pathType);
};
......
......@@ -374,7 +374,7 @@ void cmFindCommon::AddUserPath(std::string const& p,
}
//----------------------------------------------------------------------------
void cmFindCommon::AddCMakePath(const char* variable)
void cmFindCommon::AddCMakePath(const std::string& variable)
{
// Get a path from a CMake variable.
if(const char* varPath = this->Makefile->GetDefinition(variable))
......
......@@ -63,7 +63,7 @@ protected:
void AddPathSuffix(std::string const& arg);
void AddUserPath(std::string const& p,
std::vector<std::string>& paths);
void AddCMakePath(const char* variable);
void AddCMakePath(const std::string& variable);
void AddEnvPath(const char* variable);
void AddPathsInternal(std::vector<std::string> const& in_paths,
PathType pathType);
......
......@@ -535,7 +535,8 @@ void cmFindPackageCommand::SetModuleVariables(const std::string& components)
}
//----------------------------------------------------------------------------
void cmFindPackageCommand::AddFindDefinition(const char* var, const char* val)
void cmFindPackageCommand::AddFindDefinition(const std::string& var,
const char* val)
{
if(const char* old = this->Makefile->GetDefinition(var))
{
......
......@@ -57,7 +57,7 @@ private:
void AppendToFoundProperty(bool found);
void SetModuleVariables(const std::string& components);
bool FindModule(bool& found);
void AddFindDefinition(const char* var, const char* val);
void AddFindDefinition(const std::string& var, const char* val);
void RestoreFindDefinitions();
bool HandlePackageMode();
bool FindConfig();
......
......@@ -593,7 +593,7 @@ namespace
if (argP1 != newArgs.end() && argP2 != newArgs.end() &&
*(argP1) == "MATCHES")
{
def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile);
def = cmIfCommand::GetVariableOrString(*arg, makefile);
const char* rex = (argP2)->c_str();
cmStringCommand::ClearMatches(makefile);
cmsys::RegularExpression regEntry;
......@@ -634,8 +634,8 @@ namespace
(*(argP1) == "LESS" || *(argP1) == "GREATER" ||
*(argP1) == "EQUAL"))
{
def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile);
def2 = cmIfCommand::GetVariableOrString((argP2)->c_str(), makefile);
def = cmIfCommand::GetVariableOrString(*arg, makefile);
def2 = cmIfCommand::GetVariableOrString(*argP2, makefile);
double lhs;
double rhs;
bool result;
......@@ -665,8 +665,8 @@ namespace
*(argP1) == "STREQUAL" ||
*(argP1) == "STRGREATER"))
{
def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile);
def2 = cmIfCommand::GetVariableOrString((argP2)->c_str(), makefile);
def = cmIfCommand::GetVariableOrString(*arg, makefile);
def2 = cmIfCommand::GetVariableOrString(*argP2, makefile);
int val = strcmp(def,def2);
bool result;
if (*(argP1) == "STRLESS")
......@@ -689,8 +689,8 @@ namespace
(*(argP1) == "VERSION_LESS" || *(argP1) == "VERSION_GREATER" ||
*(argP1) == "VERSION_EQUAL"))
{
def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile);
def2 = cmIfCommand::GetVariableOrString((argP2)->c_str(), makefile);
def = cmIfCommand::GetVariableOrString(*arg, makefile);
def2 = cmIfCommand::GetVariableOrString(*argP2, makefile);
cmSystemTools::CompareOp op = cmSystemTools::OP_EQUAL;
if(*argP1 == "VERSION_LESS")
{
......@@ -907,13 +907,13 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
}
//=========================================================================
const char* cmIfCommand::GetVariableOrString(const char* str,
const char* cmIfCommand::GetVariableOrString(const std::string& str,
const cmMakefile* mf)
{
const char* def = mf->GetDefinition(str);
if(!def)
{
def = str;
def = str.c_str();
}
return def;
}
......@@ -79,7 +79,7 @@ public:
// Get a definition from the makefile. If it doesn't exist,
// return the original string.
static const char* GetVariableOrString(const char* str,
static const char* GetVariableOrString(const std::string& str,
const cmMakefile* mf);
cmTypeMacro(cmIfCommand, cmCommand);
......
......@@ -74,12 +74,9 @@ bool cmListCommand
}
//----------------------------------------------------------------------------
bool cmListCommand::GetListString(std::string& listString, const char* var)
bool cmListCommand::GetListString(std::string& listString,
const std::string& var)
{
if ( !var )
{
return false;
}
// get the old value
const char* cacheValue
= this->Makefile->GetDefinition(var);
......@@ -92,7 +89,8 @@ bool cmListCommand::GetListString(std::string& listString, const char* var)
}
//----------------------------------------------------------------------------
bool cmListCommand::GetList(std::vector<std::string>& list, const char* var)
bool cmListCommand::GetList(std::vector<std::string>& list,
const std::string& var)
{
std::string listString;
if ( !this->GetListString(listString, var) )
......
......@@ -60,8 +60,8 @@ protected:
bool HandleReverseCommand(std::vector<std::string> const& args);
bool GetList(std::vector<std::string>& list, const char* var);
bool GetListString(std::string& listString, const char* var);
bool GetList(std::vector<std::string>& list, const std::string& var);
bool GetListString(std::string& listString, const std::string& var);
};
......
......@@ -2324,7 +2324,7 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
//----------------------------------------------------------------------------
void cmLocalGenerator::AddConfigVariableFlags(std::string& flags,
const char* var,
const std::string& var,
const char* config)
{
// Add the flags from the variable itself.
......
......@@ -145,7 +145,7 @@ public:
std::string const& lang, const char *config);
void AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
const char *lang);
void AddConfigVariableFlags(std::string& flags, const char* var,
void AddConfigVariableFlags(std::string& flags, const std::string& var,
const char* config);
///! Append flags to a string.
virtual void AppendFlags(std::string& flags, const char* newFlags);
......
......@@ -1769,7 +1769,7 @@ cmMakefile::AddSystemIncludeDirectories(const std::set<cmStdString> &incs)
}
}
void cmMakefile::AddDefinition(const char* name, const char* value)
void cmMakefile::AddDefinition(const std::string& name, const char* value)
{
if (!value )
{
......@@ -1798,14 +1798,14 @@ void cmMakefile::AddDefinition(const char* name, const char* value)
}
void cmMakefile::AddCacheDefinition(const char* name, const char* value,
void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
const char* doc,
cmCacheManager::CacheEntryType type,
bool force)
{
const char* val = value;
cmCacheManager::CacheIterator it =
this->GetCacheManager()->GetCacheIterator(name);
this->GetCacheManager()->GetCacheIterator(name.c_str());
if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) &&
it.Initialized())
{
......@@ -1845,7 +1845,7 @@ void cmMakefile::AddCacheDefinition(const char* name, const char* value,
}
void cmMakefile::AddDefinition(const char* name, bool value)
void cmMakefile::AddDefinition(const std::string& name, bool value)
{
this->Internal->VarStack.top().Set(name, value? "ON" : "OFF");
if (this->Internal->VarUsageStack.size() &&
......@@ -1880,12 +1880,12 @@ void cmMakefile::CheckForUnusedVariables() const
}
}
void cmMakefile::MarkVariableAsUsed(const char* var)
void cmMakefile::MarkVariableAsUsed(const std::string& var)
{
this->Internal->VarUsageStack.top().insert(var);
}
bool cmMakefile::VariableInitialized(const char* var) const
bool cmMakefile::VariableInitialized(const std::string& var) const
{
if(this->Internal->VarInitStack.top().find(var) !=
this->Internal->VarInitStack.top().end())
......@@ -1895,7 +1895,7 @@ bool cmMakefile::VariableInitialized(const char* var) const
return false;
}
bool cmMakefile::VariableUsed(const char* var) const
bool cmMakefile::VariableUsed(const std::string& var) const
{
if(this->Internal->VarUsageStack.top().find(var) !=
this->Internal->VarUsageStack.top().end())
......@@ -1905,7 +1905,8 @@ bool cmMakefile::VariableUsed(const char* var) const
return false;
}