[mathic] 41/62: Removed mutable references to allow compilation on gcc 4.6.3.

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 821b20622607a243e5e485506c56d02f2fe92957
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date:   Wed Oct 17 16:45:55 2012 +0200

    Removed mutable references to allow compilation on gcc 4.6.3.
---
 src/mathic/BitTriangle.h |  1 +
 src/mathic/GeoFront.h    | 14 +++++++-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/mathic/BitTriangle.h b/src/mathic/BitTriangle.h
index 3ab4070..9c1ce63 100755
--- a/src/mathic/BitTriangle.h
+++ b/src/mathic/BitTriangle.h
@@ -3,6 +3,7 @@
 
 #include "stdinc.h"
 #include <vector>
+#include <memory>
 
 namespace mathic {
   // Object that stores a triangular 2-dimensional array of bits. For example:
diff --git a/src/mathic/GeoFront.h b/src/mathic/GeoFront.h
index 194a63a..68c92ba 100755
--- a/src/mathic/GeoFront.h
+++ b/src/mathic/GeoFront.h
@@ -38,7 +38,7 @@ namespace mathic {
 	/** A reference is kept to entryCountRef so that it can be updated
 		in the event of a deduplication. */
   GeoFront(const C& conf, size_t& entryCountRef):
-	_cachedMaxBucket(0), _entryCountRef(entryCountRef), _conf(conf) {
+	_cachedMaxBucket(0), _entryCountRef(&entryCountRef), _conf(conf) {
 	  MATHIC_ASSERT(!C::trackFront);
 	}
 
@@ -50,7 +50,7 @@ namespace mathic {
 	void bucketsInvalidated(Bucket* oldBegin, Bucket* newBegin) {
 	  _cachedMaxBucket = 0;
 	}
-	bool empty() const {return _entryCountRef == 0;}
+	bool empty() const {return *_entryCountRef == 0;}
 
 	void insert(Bucket* bucket) {_cachedMaxBucket = 0;}
 	void remove(Bucket* bucket) {_cachedMaxBucket = 0;}
@@ -73,7 +73,7 @@ namespace mathic {
 	const Bucket* computeMax(Bucket* bucketBegin, Bucket* bucketEnd) const;
 
 	mutable const Bucket* _cachedMaxBucket;
-	mutable size_t& _entryCountRef;
+	size_t* _entryCountRef;
 	const C& _conf;
   };
 
@@ -113,7 +113,7 @@ namespace mathic {
 		mb->setEntry(mb->end() - 1,
 					 _conf.deduplicate(mb->back(), it->back()));
 		const_cast<B*>(it)->pop_back();
-		--_entryCountRef;
+		--*_entryCountRef;
 		continue;
 	  }
 	  maxBucket = it;
@@ -177,7 +177,7 @@ namespace mathic {
 	Bucket** _bucketBegin;
 	Bucket** _bucketEnd;
     Bucket** _bucketCapacityEnd;
-	mutable size_t& _entryCountRef;
+	size_t* _entryCountRef;
 	const C& _conf;
   };
 
@@ -196,7 +196,7 @@ namespace mathic {
 	_bucketBegin(0),
 	_bucketEnd(0),
     _bucketCapacityEnd(0),
-	_entryCountRef(entryCountRef),
+	_entryCountRef(&entryCountRef),
 	_conf(conf) {
     MATHIC_ASSERT(C::trackFront);
   }
@@ -290,7 +290,7 @@ namespace mathic {
 		otherBucket.setEntry(otherBucket.end() - 1,
 							 _conf.deduplicate(bucket->back(), otherBucket.back()));
 		bucket->pop_back();
-		--_entryCountRef;
+		--*_entryCountRef;
 		if (bucket->empty()) {
 		  bucket->_frontPos = pos;
 		  remove(bucket);

-- 
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