From d1ac6ffd4aa4cc54dbf4b0bf59045576af4c1033 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Feb 2014 10:48:59 +0100 Subject: [PATCH 1/2] cmMakefile: Fix minor indentation inconsistency. --- Source/cmMakefile.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 55a9d5cd2..1bcee2ca8 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1573,8 +1573,8 @@ void cmMakefile::InitializeFromParent() const std::vector parentIncludes = parent->GetIncludeDirectoriesEntries(); this->IncludeDirectoriesEntries.insert(this->IncludeDirectoriesEntries.end(), - parentIncludes.begin(), - parentIncludes.end()); + parentIncludes.begin(), + parentIncludes.end()); const std::vector parentOptions = parent->GetCompileOptionsEntries(); @@ -1585,8 +1585,8 @@ void cmMakefile::InitializeFromParent() const std::vector parentDefines = parent->GetCompileDefinitionsEntries(); this->CompileDefinitionsEntries.insert(this->CompileDefinitionsEntries.end(), - parentDefines.begin(), - parentDefines.end()); + parentDefines.begin(), + parentDefines.end()); this->SystemIncludeDirectories = parent->SystemIncludeDirectories; From f054201d12fa385f48abd967840c0d92595ca058 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Feb 2014 10:52:09 +0100 Subject: [PATCH 2/2] cmMakefile: Return containers by const reference. They are not implicitly shared. --- Source/cmMakefile.cxx | 6 +++--- Source/cmMakefile.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1bcee2ca8..f248c57e7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1570,19 +1570,19 @@ void cmMakefile::InitializeFromParent() // Initialize definitions with the closure of the parent scope. this->Internal->VarStack.top() = parent->Internal->VarStack.top().Closure(); - const std::vector parentIncludes = + const std::vector& parentIncludes = parent->GetIncludeDirectoriesEntries(); this->IncludeDirectoriesEntries.insert(this->IncludeDirectoriesEntries.end(), parentIncludes.begin(), parentIncludes.end()); - const std::vector parentOptions = + const std::vector& parentOptions = parent->GetCompileOptionsEntries(); this->CompileOptionsEntries.insert(this->CompileOptionsEntries.end(), parentOptions.begin(), parentOptions.end()); - const std::vector parentDefines = + const std::vector& parentDefines = parent->GetCompileDefinitionsEntries(); this->CompileDefinitionsEntries.insert(this->CompileDefinitionsEntries.end(), parentDefines.begin(), diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 66a33bb46..45f3b9f4a 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -853,15 +853,15 @@ public: /** Set whether or not to report a CMP0000 violation. */ void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; } - std::vector GetIncludeDirectoriesEntries() const + const std::vector& GetIncludeDirectoriesEntries() const { return this->IncludeDirectoriesEntries; } - std::vector GetCompileOptionsEntries() const + const std::vector& GetCompileOptionsEntries() const { return this->CompileOptionsEntries; } - std::vector GetCompileDefinitionsEntries() const + const std::vector& GetCompileDefinitionsEntries() const { return this->CompileDefinitionsEntries; }