[mathic] 40/62: Fixed overflow issue that would only happen on 64 bit compiles with hash tables with more than 2^31 buckets.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Wed Apr 1 11:36:22 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository mathic.

commit 79a1ae55d489c4a66242fd8b5987b152e5877175
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date:   Fri Oct 12 18:40:15 2012 +0200

    Fixed overflow issue that would only happen on 64 bit compiles with hash tables with more than 2^31 buckets.
---
 src/mathic/HashTable.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mathic/HashTable.h b/src/mathic/HashTable.h
index 8a20b6e..b0cde83 100755
--- a/src/mathic/HashTable.h
+++ b/src/mathic/HashTable.h
@@ -145,8 +145,8 @@ namespace mathic {
   template<class C>
   HashTable<C>::HashTable(const Configuration &conf, unsigned int nbits):
     mLogTableSize(nbits),
-    mTableSize(1 << nbits),
-    mHashMask((1 << nbits) - 1),
+    mTableSize(static_cast<size_t>(1) << nbits),
+    mHashMask((static_cast<size_t>(1) << nbits) - 1),
     mNodeCount(0),
     mBinCount(0),
     mRebuildThreshold(0.1),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathic.git



More information about the debian-science-commits mailing list