From d83ef53a1293899c0ab58aca184b7d5866051876 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 17 Mar 2014 15:27:01 +0100 Subject: Rename local 'dir_max' variables to 'dir' The code is not computing the maximum length directory, as is the case in cmLocalVisualStudioGenerator::ComputeLongestObjectDirectory. --- Source/cmGlobalNinjaGenerator.cxx | 12 ++++++------ Source/cmGlobalUnixMakefileGenerator3.cxx | 12 ++++++------ Source/cmLocalUnixMakefileGenerator3.cxx | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 49ce1b5..88f1b08 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -639,12 +639,12 @@ void cmGlobalNinjaGenerator cmTarget* target = gt->Target; // Compute full path to object file directory for this target. - std::string dir_max; - dir_max += gt->Makefile->GetCurrentOutputDirectory(); - dir_max += "/"; - dir_max += gt->LocalGenerator->GetTargetDirectory(*target); - dir_max += "/"; - gt->ObjectDirectory = dir_max; + std::string dir; + dir += gt->Makefile->GetCurrentOutputDirectory(); + dir += "/"; + dir += gt->LocalGenerator->GetTargetDirectory(*target); + dir += "/"; + gt->ObjectDirectory = dir; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 4632071..e37ee10 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -111,12 +111,12 @@ cmGlobalUnixMakefileGenerator3 cmTarget* target = gt->Target; // Compute full path to object file directory for this target. - std::string dir_max; - dir_max += gt->Makefile->GetCurrentOutputDirectory(); - dir_max += "/"; - dir_max += gt->LocalGenerator->GetTargetDirectory(*target); - dir_max += "/"; - gt->ObjectDirectory = dir_max; + std::string dir; + dir += gt->Makefile->GetCurrentOutputDirectory(); + dir += "/"; + dir += gt->LocalGenerator->GetTargetDirectory(*target); + dir += "/"; + gt->ObjectDirectory = dir; } void cmGlobalUnixMakefileGenerator3::Configure() diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 2d36089..6e2e6a8 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -202,11 +202,11 @@ GetLocalObjectFiles(std::map &localObjectFiles) std::vector objectSources; gt->GetObjectSources(objectSources); // Compute full path to object file directory for this target. - std::string dir_max; - dir_max += gt->Makefile->GetCurrentOutputDirectory(); - dir_max += "/"; - dir_max += this->GetTargetDirectory(*gt->Target); - dir_max += "/"; + std::string dir; + dir += gt->Makefile->GetCurrentOutputDirectory(); + dir += "/"; + dir += this->GetTargetDirectory(*gt->Target); + dir += "/"; // Compute the name of each object file. for(std::vector::iterator si = objectSources.begin(); @@ -215,7 +215,7 @@ GetLocalObjectFiles(std::map &localObjectFiles) cmSourceFile const* sf = *si; bool hasSourceExtension = true; std::string objectName = this->GetObjectFileNameWithoutTarget(*sf, - dir_max, + dir, &hasSourceExtension); if(cmSystemTools::FileIsFullPath(objectName.c_str())) { -- cgit v0.12 From 2e0611f981f17889cb701db2ffd9436c771bb7e1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 17 Mar 2014 15:29:49 +0100 Subject: cmGeneratorExpression: Remove unused include. --- Source/cmGeneratorExpression.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 5b97e8b..d0a6aef 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -16,8 +16,6 @@ #include "cmStandardIncludes.h" #include "cmListFileCache.h" -#include - #include #include -- cgit v0.12 From c3a2f78b5a322bd14123cb301dc62dc3b58073b5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 17 Mar 2014 15:32:19 +0100 Subject: Makefiles: Remove duplicate code. The cmGlobalUnixMakefileGenerator3::ProgressMapCompare struct is logically equivalent to cmStrictTargetComparison. --- Source/cmGlobalUnixMakefileGenerator3.cxx | 15 --------------- Source/cmGlobalUnixMakefileGenerator3.h | 4 +--- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index e37ee10..3aa293e 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -958,21 +958,6 @@ cmGlobalUnixMakefileGenerator3::RecordTargetProgress( } //---------------------------------------------------------------------------- -bool -cmGlobalUnixMakefileGenerator3::ProgressMapCompare -::operator()(cmTarget const* l, cmTarget const* r) const -{ - // Order by target name. - if(int c = strcmp(l->GetName().c_str(), r->GetName().c_str())) - { - return c < 0; - } - // Order duplicate targets by binary directory. - return strcmp(l->GetMakefile()->GetCurrentOutputDirectory(), - r->GetMakefile()->GetCurrentOutputDirectory()) < 0; -} - -//---------------------------------------------------------------------------- void cmGlobalUnixMakefileGenerator3::TargetProgress ::WriteProgressVariables(unsigned long total, unsigned long ¤t) diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index d003789..f44dd12 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -185,10 +185,8 @@ protected: std::vector Marks; void WriteProgressVariables(unsigned long total, unsigned long& current); }; - struct ProgressMapCompare { bool operator()(cmTarget const*, - cmTarget const*) const; }; typedef std::map ProgressMapType; + cmStrictTargetComparison> ProgressMapType; ProgressMapType ProgressMap; size_t CountProgressMarksInTarget(cmTarget const* target, -- cgit v0.12 From 10e6f1e716758c5ad5dcb63a5c69551ff3b9f6ff Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 17 Mar 2014 15:33:54 +0100 Subject: cmMakefile: Fix typo in comment. --- Source/cmMakefile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 58625fb..f312399 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2071,7 +2071,7 @@ cmMakefile::LinearGetSourceFileWithOutput(const std::string& name) const // does this source file have a custom command? if ((*i)->GetCustomCommand()) { - // is the output of the custom command match the source files name + // Does the output of the custom command match the source file name? const std::vector& outputs = (*i)->GetCustomCommand()->GetOutputs(); for(std::vector::const_iterator o = outputs.begin(); -- cgit v0.12 From 19012b4652953ea8d8a470d1790419b1d8682850 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 17 Mar 2014 15:34:53 +0100 Subject: cmMakefile: Fix style. Use this-> for member access. --- Source/cmMakefile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index f312399..f390237 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2101,7 +2101,7 @@ cmSourceFile *cmMakefile::GetSourceFileWithOutput( // linear-time search for an output with a matching suffix. if(!cmSystemTools::FileIsFullPath(name.c_str())) { - return LinearGetSourceFileWithOutput(name); + return this->LinearGetSourceFileWithOutput(name); } // Otherwise we use an efficient lookup map. OutputToSourceMap::const_iterator o = this->OutputToSource.find(name); -- cgit v0.12