[Cmake-commits] CMake branch, next, updated. v3.2.0-rc1-445-g6cd2d27
Stephen Kelly
steveire at gmail.com
Wed Feb 18 18:59:06 EST 2015
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 6cd2d2711b401c157d5c63d647a065bc97cca174 (commit)
via fa518feb6f9ebba7ed82c4e6d93574b8f6cc1b99 (commit)
via 777e43700164b2e334a4e615d42cad0282eb7761 (commit)
via db6150b7f37ea92e772b80dbbfdd40993b74ea68 (commit)
via 7aad0f5dc414c70a1bf3954e47ba985f746c0877 (commit)
via 8d8cf44ba0bac59ebe210dfd9d20df970795d410 (commit)
via 0c1550496eb9a3a2194d97a38947652e42ae1dde (commit)
via 20168c6965660704a736c112f859fd982ae96fc8 (commit)
via 6ef78aa78a51b1a1678f251bd14818acbba004d4 (commit)
via 925a00bb7f61f375432cc4b271cb71e7c53cd810 (commit)
from 08a867e5cdb2832180539d57f2ec28e4b0a4faba (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=6cd2d2711b401c157d5c63d647a065bc97cca174
commit 6cd2d2711b401c157d5c63d647a065bc97cca174
Merge: 08a867e fa518fe
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 18 18:59:04 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 18 18:59:04 2015 -0500
Merge topic 'use-algorithms' into next
fa518feb Remove unused.
777e4370 Replace loops with algorithms.
db6150b7 cmAlgorithms: Add cmReverseRange adaptor.
7aad0f5d cmAlgorithms: Add cmFindNot algorithm.
8d8cf44b cmRST: Replace two erase with a rotate and larger erase.
0c155049 cmAlgorithms: Update concept requirement to FowardIterator
20168c69 cmAlgorithms: Move cmRotate out of 'implementation detail' namespace.
6ef78aa7 cmRST: Move two algorithms beside each other.
925a00bb cmRST: Use std::min where appropriate.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa518feb6f9ebba7ed82c4e6d93574b8f6cc1b99
commit fa518feb6f9ebba7ed82c4e6d93574b8f6cc1b99
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 19 00:57:31 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 19 00:58:40 2015 +0100
Remove unused.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3ad3d64..2accf47 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2800,7 +2800,6 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const std::string& source,
}
if(this->WindowsShell)
{
- std::string::size_type pos = 0;
std::replace(result.begin(), result.end(), '/', '\\');
}
result = this->EscapeForShell(result, true, false, output == WATCOMQUOTE);
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=777e43700164b2e334a4e615d42cad0282eb7761
commit 777e43700164b2e334a4e615d42cad0282eb7761
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Feb 2 02:13:54 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 19 00:55:51 2015 +0100
Replace loops with algorithms.
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index 480da0d..b7330ce 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -484,19 +484,13 @@ void cmRST::UnindentLines(std::vector<std::string>& lines)
}
}
- // Drop leading blank lines.
- size_t leadingEmpty = 0;
- for(size_t i = 0; i < lines.size() && lines[i].empty(); ++i)
- {
- ++leadingEmpty;
- }
+ std::vector<std::string>::const_iterator it = lines.begin();
+ size_t leadingEmpty = std::distance(it, cmFindNot(lines, std::string()));
+
+ std::vector<std::string>::const_reverse_iterator rit = lines.rbegin();
+ size_t trailingEmpty = std::distance(rit,
+ cmFindNot(cmReverseRange(lines), std::string()));
- // Drop trailing blank lines.
- size_t trailingEmpty = 0;
- for(size_t i = lines.size(); i > 0 && lines[i-1].empty(); --i)
- {
- ++trailingEmpty;
- }
lines.erase(cmRotate(lines.begin(),
lines.begin() + leadingEmpty,
lines.end() - trailingEmpty), lines.end());
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db6150b7f37ea92e772b80dbbfdd40993b74ea68
commit db6150b7f37ea92e772b80dbbfdd40993b74ea68
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Feb 17 22:04:25 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 19 00:55:51 2015 +0100
cmAlgorithms: Add cmReverseRange adaptor.
Use it to implement list(REVERSE).
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 9721e3e..05cdfeb 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -297,4 +297,12 @@ typename Range::const_iterator cmFindNot(Range const& r, T const& t)
std::bind1st(std::not_equal_to<T>(), t));
}
+template<typename Range>
+ContainerAlgorithms::Range<typename Range::const_reverse_iterator>
+cmReverseRange(Range const& range)
+{
+ return ContainerAlgorithms::Range<typename Range::const_reverse_iterator>(
+ range.rbegin(), range.rend());
+}
+
#endif
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 0c6adfd..17617aa 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -390,8 +390,7 @@ bool cmListCommand
return false;
}
- std::reverse(varArgsExpanded.begin(), varArgsExpanded.end());
- std::string value = cmJoin(varArgsExpanded, ";");
+ std::string value = cmJoin(cmReverseRange(varArgsExpanded), ";");
this->Makefile->AddDefinition(listName, value.c_str());
return true;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7aad0f5dc414c70a1bf3954e47ba985f746c0877
commit 7aad0f5dc414c70a1bf3954e47ba985f746c0877
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 11 23:53:41 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 19 00:36:34 2015 +0100
cmAlgorithms: Add cmFindNot algorithm.
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 6f8711f..9721e3e 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -289,4 +289,12 @@ std::string cmWrap(std::string prefix, Range const& r, std::string suffix,
return prefix + cmJoin(r, (suffix + sep + prefix).c_str()) + suffix;
}
+
+template<typename Range, typename T>
+typename Range::const_iterator cmFindNot(Range const& r, T const& t)
+{
+ return std::find_if(r.begin(), r.end(),
+ std::bind1st(std::not_equal_to<T>(), t));
+}
+
#endif
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8d8cf44ba0bac59ebe210dfd9d20df970795d410
commit 8d8cf44ba0bac59ebe210dfd9d20df970795d410
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jan 30 00:03:24 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 19 00:36:33 2015 +0100
cmRST: Replace two erase with a rotate and larger erase.
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index 14e8ad9..480da0d 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -497,6 +497,7 @@ void cmRST::UnindentLines(std::vector<std::string>& lines)
{
++trailingEmpty;
}
- lines.erase(lines.begin(), lines.begin()+leadingEmpty);
- lines.erase(lines.end()-trailingEmpty, lines.end());
+ lines.erase(cmRotate(lines.begin(),
+ lines.begin() + leadingEmpty,
+ lines.end() - trailingEmpty), lines.end());
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c1550496eb9a3a2194d97a38947652e42ae1dde
commit 0c1550496eb9a3a2194d97a38947652e42ae1dde
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Feb 17 21:59:26 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 19 00:36:33 2015 +0100
cmAlgorithms: Update concept requirement to FowardIterator
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index f480b86..6f8711f 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -81,14 +81,14 @@ private:
const std::string m_test;
};
-template<typename BiDirIt>
-BiDirIt cmRotate(BiDirIt first, BiDirIt middle, BiDirIt last)
+template<typename FwdIt>
+FwdIt cmRotate(FwdIt first, FwdIt middle, FwdIt last)
{
- typename std::iterator_traits<BiDirIt>::difference_type dist =
- std::distance(first, middle);
+ typename std::iterator_traits<FwdIt>::difference_type dist =
+ std::distance(middle, last);
std::rotate(first, middle, last);
- std::advance(last, -dist);
- return last;
+ std::advance(first, dist);
+ return first;
}
namespace ContainerAlgorithms {
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20168c6965660704a736c112f859fd982ae96fc8
commit 20168c6965660704a736c112f859fd982ae96fc8
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Feb 15 23:39:38 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 19 00:36:33 2015 +0100
cmAlgorithms: Move cmRotate out of 'implementation detail' namespace.
This should be generally usable in cmake.
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 54dc14a..f480b86 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -81,6 +81,16 @@ private:
const std::string m_test;
};
+template<typename BiDirIt>
+BiDirIt cmRotate(BiDirIt first, BiDirIt middle, BiDirIt last)
+{
+ typename std::iterator_traits<BiDirIt>::difference_type dist =
+ std::distance(first, middle);
+ std::rotate(first, middle, last);
+ std::advance(last, -dist);
+ return last;
+}
+
namespace ContainerAlgorithms {
template<typename T>
@@ -138,20 +148,10 @@ private:
const_iterator End;
};
-template<typename BiDirIt>
-BiDirIt Rotate(BiDirIt first, BiDirIt middle, BiDirIt last)
-{
- typename std::iterator_traits<BiDirIt>::difference_type dist =
- std::distance(first, middle);
- std::rotate(first, middle, last);
- std::advance(last, -dist);
- return last;
-}
-
template<typename Iter>
Iter RemoveN(Iter i1, Iter i2, size_t n)
{
- return ContainerAlgorithms::Rotate(i1, i1 + n, i2);
+ return cmRotate(i1, i1 + n, i2);
}
template<typename Range>
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ef78aa78a51b1a1678f251bd14818acbba004d4
commit 6ef78aa78a51b1a1678f251bd14818acbba004d4
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jan 30 00:01:06 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 19 00:36:33 2015 +0100
cmRST: Move two algorithms beside each other.
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index da72ab7..14e8ad9 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -490,7 +490,6 @@ void cmRST::UnindentLines(std::vector<std::string>& lines)
{
++leadingEmpty;
}
- lines.erase(lines.begin(), lines.begin()+leadingEmpty);
// Drop trailing blank lines.
size_t trailingEmpty = 0;
@@ -498,5 +497,6 @@ void cmRST::UnindentLines(std::vector<std::string>& lines)
{
++trailingEmpty;
}
+ lines.erase(lines.begin(), lines.begin()+leadingEmpty);
lines.erase(lines.end()-trailingEmpty, lines.end());
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=925a00bb7f61f375432cc4b271cb71e7c53cd810
commit 925a00bb7f61f375432cc4b271cb71e7c53cd810
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 11 23:43:55 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Feb 19 00:36:33 2015 +0100
cmRST: Use std::min where appropriate.
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index d20d999..da72ab7 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -463,10 +463,7 @@ void cmRST::UnindentLines(std::vector<std::string>& lines)
}
// Truncate indentation to match that on this line.
- if(line.size() < indentEnd)
- {
- indentEnd = line.size();
- }
+ indentEnd = std::min(indentEnd, line.size());
for(std::string::size_type j = 0; j != indentEnd; ++j)
{
if(line[j] != indentText[j])
-----------------------------------------------------------------------
Summary of changes:
Source/cmAlgorithms.h | 38 +++++++++++++++++++++++++++-----------
Source/cmListCommand.cxx | 3 +--
Source/cmLocalGenerator.cxx | 1 -
Source/cmRST.cxx | 28 ++++++++++------------------
4 files changed, 38 insertions(+), 32 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list