[Cmake-commits] CMake branch, next, updated. v3.1.0-rc1-178-g5117767

Chuck Atkins chuck.atkins at kitware.com
Tue Oct 28 19:07:27 EDT 2014


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  51177678a0dea12229af368bfc6bf0f75b6090fc (commit)
       via  96a701f6b628729dfab23fdad7c54eccb67f5a2d (commit)
       via  fc22f0fe91b497979da1fa4c754ce4f615a00001 (commit)
      from  809282e9a42b76d6f197ef8aeaa20363769a7881 (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=51177678a0dea12229af368bfc6bf0f75b6090fc
commit 51177678a0dea12229af368bfc6bf0f75b6090fc
Merge: 809282e 96a701f
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Tue Oct 28 19:07:25 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Oct 28 19:07:25 2014 -0400

    Merge topic 'refactor-search-path-construction' into next
    
    96a701f6 Add workaround for VS6.
    fc22f0fe Add buffer over/under-flow protection for string hashing


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96a701f6b628729dfab23fdad7c54eccb67f5a2d
commit 96a701f6b628729dfab23fdad7c54eccb67f5a2d
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Tue Oct 28 16:51:38 2014 -0400
Commit:     Chuck Atkins <chuck.atkins at kitware.com>
CommitDate: Tue Oct 28 19:06:00 2014 -0400

    Add workaround for VS6.
    
    VS6 fails to lookup protected class definitions in a parent class.  The
    workaround is to make them public instead only when compiling for VS6.

diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 3fefc8d..e65b2fc 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -33,6 +33,10 @@ public:
 protected:
   friend class cmSearchPath;
 
+/* VS6 is broken and can't pass protected class definitions to child classes */
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+public:
+#endif
   /** Used to define groups of path labels */
   class PathGroup : public cmPathLabel
   {
@@ -57,6 +61,9 @@ protected:
     static PathLabel CMakeSystem;
     static PathLabel Guess;
   };
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+protected:
+#endif
 
   enum RootPathMode { RootPathModeNever,
                       RootPathModeOnly,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc22f0fe91b497979da1fa4c754ce4f615a00001
commit fc22f0fe91b497979da1fa4c754ce4f615a00001
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Tue Oct 28 19:05:09 2014 -0400
Commit:     Chuck Atkins <chuck.atkins at kitware.com>
CommitDate: Tue Oct 28 19:06:00 2014 -0400

    Add buffer over/under-flow protection for string hashing

diff --git a/Source/cmPathLabel.cxx b/Source/cmPathLabel.cxx
index 38446f5..f9bbb7a 100644
--- a/Source/cmPathLabel.cxx
+++ b/Source/cmPathLabel.cxx
@@ -16,15 +16,16 @@
 cmPathLabel::cmPathLabel(const std::string& label)
 : Label(label), Hash(0)
 {
+  // Use a Jenkeins one-at-a-time hash with under/over-flow protection
   for(size_t i = 0; i < this->Label.size(); ++i)
     {
     this->Hash += this->Label[i];
-    this->Hash += (this->Hash << 10);
-    this->Hash ^= (this->Hash >> 6);
+    this->Hash += ((this->Hash & 0x003FFFFF) << 10);
+    this->Hash ^= ((this->Hash & 0xFFFFFFC0) >> 6);
     }
-  this->Hash += (this->Hash << 3);
-  this->Hash ^= (this->Hash >> 11);
-  this->Hash += (this->Hash << 15);
+  this->Hash += ((this->Hash & 0x1FFFFFFF) << 3);
+  this->Hash ^= ((this->Hash & 0xFFFFF800) >> 11);
+  this->Hash += ((this->Hash & 0x0001FFFF) << 15);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmPathLabel.h b/Source/cmPathLabel.h
index 3cc9372..1d4e181 100644
--- a/Source/cmPathLabel.h
+++ b/Source/cmPathLabel.h
@@ -26,19 +26,19 @@ class cmPathLabel
 public:
   cmPathLabel(const std::string& label);
 
-  // The compatison operators are only for quick sorting and searching and
+  // The comparison operators are only for quick sorting and searching and
   // in no way imply any lexicographical order of the label
   bool operator < (const cmPathLabel& l) const;
   bool operator == (const cmPathLabel& l) const;
 
   const std::string& GetLabel() const { return this->Label; }
-  const int& GetHash() const { return this->Hash; }
+  const unsigned int& GetHash() const { return this->Hash; }
 
 protected:
   cmPathLabel();
 
   std::string Label;
-  int Hash;
+  unsigned int Hash;
 };
 
 #endif

-----------------------------------------------------------------------

Summary of changes:
 Source/cmPathLabel.cxx |   11 ++++++-----
 Source/cmPathLabel.h   |    6 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list