From 2a6e56e078666a48d3e34b36c1500d44c429ecf0 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 21 Jan 2014 15:23:27 +0100 Subject: [PATCH] cmCacheManager: Consify version accessors. --- Source/cmCacheManager.h | 6 ++++-- Source/cmMakefile.cxx | 4 ++-- Source/cmMakefile.h | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 4b8c07d9d..f487e8e6b 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -145,8 +145,10 @@ public: const char* GetCacheValue(const char* key) const; /** Get the version of CMake that wrote the cache. */ - unsigned int GetCacheMajorVersion() { return this->CacheMajorVersion; } - unsigned int GetCacheMinorVersion() { return this->CacheMinorVersion; } + unsigned int GetCacheMajorVersion() const + { return this->CacheMajorVersion; } + unsigned int GetCacheMinorVersion() const + { return this->CacheMinorVersion; } bool NeedCacheCompatibility(int major, int minor); protected: diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6dc6a46ed..6266f825c 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -169,12 +169,12 @@ void cmMakefile::Initialize() this->CheckCMP0000 = false; } -unsigned int cmMakefile::GetCacheMajorVersion() +unsigned int cmMakefile::GetCacheMajorVersion() const { return this->GetCacheManager()->GetCacheMajorVersion(); } -unsigned int cmMakefile::GetCacheMinorVersion() +unsigned int cmMakefile::GetCacheMinorVersion() const { return this->GetCacheManager()->GetCacheMinorVersion(); } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index bf77e562c..4c7341ed5 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -63,8 +63,8 @@ public: * was used to write the currently loaded cache, note * this method will not work before the cache is loaded. */ - unsigned int GetCacheMajorVersion(); - unsigned int GetCacheMinorVersion(); + unsigned int GetCacheMajorVersion() const; + unsigned int GetCacheMinorVersion() const; /* Check for unused variables in this scope */ void CheckForUnusedVariables() const;