From e725437a5a083ba5fa9e1c53af27f6e84027d656 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sat, 4 Feb 2012 14:38:42 +0100 Subject: Use unsigned int for count diff --git a/src/csgtermnormalizer.cc b/src/csgtermnormalizer.cc index b63ae05..0e7a759 100644 --- a/src/csgtermnormalizer.cc +++ b/src/csgtermnormalizer.cc @@ -15,7 +15,7 @@ shared_ptr CSGTermNormalizer::normalize(const shared_ptr &root if (temp == n) break; temp = n; - int num = count(temp); + unsigned int num = count(temp); #ifdef DEBUG PRINTB("Normalize count: %d\n", num); #endif @@ -148,7 +148,7 @@ bool CSGTermNormalizer::normalize_tail(shared_ptr &term) return false; } -int CSGTermNormalizer::count(const shared_ptr &term) const +unsigned int CSGTermNormalizer::count(const shared_ptr &term) const { if (!term) return 0; return term->type == CSGTerm::TYPE_PRIMITIVE ? 1 : 0 + count(term->left) + count(term->right); diff --git a/src/csgtermnormalizer.h b/src/csgtermnormalizer.h index 2aab3a4..e5a2eca 100644 --- a/src/csgtermnormalizer.h +++ b/src/csgtermnormalizer.h @@ -6,7 +6,7 @@ class CSGTermNormalizer { public: - CSGTermNormalizer() : counter(0) {} + CSGTermNormalizer() {} ~CSGTermNormalizer() {} shared_ptr normalize(const shared_ptr &term, size_t limit); @@ -14,9 +14,7 @@ public: private: shared_ptr normalizePass(shared_ptr term) ; bool normalize_tail(shared_ptr &term); - int count(const shared_ptr &term) const; - - int counter; + unsigned int count(const shared_ptr &term) const; }; #endif -- cgit v0.10.1