This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 8cdf6ac28f5690957d7af9b05e86e77c6ef64e4b (commit) via 17f4f4013a2e58dae40e4c4320474be5da433d09 (commit) via f5a82d68e50734734a78a92e6061dd8fe5cb1219 (commit) via f5397959857709e4d429029aa68a13ec2b19e70a (commit) from f0eb914254495717767db0e358f5ee51c512cbee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8cdf6ac28f5690957d7af9b05e86e77c6ef64e4b commit 8cdf6ac28f5690957d7af9b05e86e77c6ef64e4b Merge: f0eb914 17f4f40 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Mon Oct 21 19:19:34 2013 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Mon Oct 21 19:19:34 2013 -0400 Merge topic 'cmarray-templates' into next 17f4f40 Genex: Use cmArraySize for targetPolicyWhitelist f5a82d6 Genex: Remove use of TransitiveWhitelistCompare f539795 Add some templates for cleaner array iteration. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17f4f4013a2e58dae40e4c4320474be5da433d09 commit 17f4f4013a2e58dae40e4c4320474be5da433d09 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 22 01:14:03 2013 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Tue Oct 22 01:18:58 2013 +0200 Genex: Use cmArraySize for targetPolicyWhitelist For better readability. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index bc873e0..d13d0dd 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1101,10 +1101,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode context->HadContextSensitiveCondition = true; - for (size_t i = 1; - i < (sizeof(targetPolicyWhitelist) / - sizeof(*targetPolicyWhitelist)); - ++i) + for (size_t i = 1; i < cmArraySize(targetPolicyWhitelist); ++i) { const char *policy = targetPolicyWhitelist[i]; if (parameters.front() == policy) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f5a82d68e50734734a78a92e6061dd8fe5cb1219 commit f5a82d68e50734734a78a92e6061dd8fe5cb1219 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 22 01:12:24 2013 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Tue Oct 22 01:18:45 2013 +0200 Genex: Remove use of TransitiveWhitelistCompare Replace with generic solution based on cmArray* for better readability. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 7fd0fdc..bc873e0 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -704,17 +704,6 @@ std::string getLinkedTargetsContent(const std::vector<std::string> &libraries, } //---------------------------------------------------------------------------- -struct TransitiveWhitelistCompare -{ - explicit TransitiveWhitelistCompare(const std::string &needle) - : Needle(needle) {} - bool operator() (const char *item) - { return strcmp(item, this->Needle.c_str()) == 0; } -private: - std::string Needle; -}; - -//---------------------------------------------------------------------------- static const struct TargetPropertyNode : public cmGeneratorExpressionNode { TargetPropertyNode() {} @@ -864,8 +853,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode return std::string(); case cmGeneratorExpressionDAGChecker::ALREADY_SEEN: for (size_t i = 1; - i < (sizeof(targetPropertyTransitiveWhitelist) / - sizeof(*targetPropertyTransitiveWhitelist)); + i < cmArraySize(targetPropertyTransitiveWhitelist); ++i) { if (targetPropertyTransitiveWhitelist[i] == propertyName) @@ -928,12 +916,13 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode cmTarget *headTarget = context->HeadTarget ? context->HeadTarget : target; - const char **transBegin = targetPropertyTransitiveWhitelist + 1; - const char **transEnd = targetPropertyTransitiveWhitelist - + (sizeof(targetPropertyTransitiveWhitelist) / - sizeof(*targetPropertyTransitiveWhitelist)); + const char * const *transBegin = + cmArrayBegin(targetPropertyTransitiveWhitelist) + 1; + const char * const *transEnd = + cmArrayEnd(targetPropertyTransitiveWhitelist); + if (std::find_if(transBegin, transEnd, - TransitiveWhitelistCompare(propertyName)) != transEnd) + cmStrCmp(propertyName)) != transEnd) { std::vector<std::string> libs; @@ -949,7 +938,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } } else if (std::find_if(transBegin, transEnd, - TransitiveWhitelistCompare(interfacePropertyName)) != transEnd) + cmStrCmp(interfacePropertyName)) != transEnd) { const cmTarget::LinkImplementation *impl = target->GetLinkImplementation( context->Config, @@ -996,8 +985,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } for (size_t i = 1; - i < (sizeof(targetPropertyTransitiveWhitelist) / - sizeof(*targetPropertyTransitiveWhitelist)); + i < cmArraySize(targetPropertyTransitiveWhitelist); ++i) { if (targetPropertyTransitiveWhitelist[i] == interfacePropertyName) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f5397959857709e4d429029aa68a13ec2b19e70a commit f5397959857709e4d429029aa68a13ec2b19e70a Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 22 01:02:49 2013 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Tue Oct 22 01:09:16 2013 +0200 Add some templates for cleaner array iteration. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index d09b304..1df8327 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -377,6 +377,24 @@ static thisClass* SafeDownCast(cmObject *c) \ return 0;\ } +template<typename T, size_t N> +const T* cmArrayBegin(const T (&a)[N]) { return a; } +template<typename T, size_t N> +const T* cmArrayEnd(const T (&a)[N]) { return a + N; } +template<typename T, size_t N> +size_t cmArraySize(const T (&)[N]) { return N; } + +struct cmStrCmp { + cmStrCmp(const char *test) : m_test(test) {} + cmStrCmp(std::string &test) : m_test(test.c_str()) {} + + bool operator()(const char * input) + { + return strcmp(input, m_test) == 0; + } +private: + const char *m_test; +}; #endif ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorExpressionEvaluator.cxx | 35 ++++++++-------------------- Source/cmStandardIncludes.h | 18 +++++++++++++++ 2 files changed, 28 insertions(+), 25 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits