summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-02-04 13:38:42 (GMT)
committerMarius Kintel <marius@kintel.net>2012-02-04 13:38:42 (GMT)
commite725437a5a083ba5fa9e1c53af27f6e84027d656 (patch)
tree385c357c9a9612e3cbf4d01802d10d5750cc90f3
parentcf3102f4fbea2985ff4d824776b36ea90e919b73 (diff)
Use unsigned int for count
-rw-r--r--src/csgtermnormalizer.cc4
-rw-r--r--src/csgtermnormalizer.h6
2 files changed, 4 insertions, 6 deletions
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<CSGTerm> CSGTermNormalizer::normalize(const shared_ptr<CSGTerm> &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<CSGTerm> &term)
return false;
}
-int CSGTermNormalizer::count(const shared_ptr<CSGTerm> &term) const
+unsigned int CSGTermNormalizer::count(const shared_ptr<CSGTerm> &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<class CSGTerm> normalize(const shared_ptr<CSGTerm> &term, size_t limit);
@@ -14,9 +14,7 @@ public:
private:
shared_ptr<CSGTerm> normalizePass(shared_ptr<CSGTerm> term) ;
bool normalize_tail(shared_ptr<CSGTerm> &term);
- int count(const shared_ptr<CSGTerm> &term) const;
-
- int counter;
+ unsigned int count(const shared_ptr<CSGTerm> &term) const;
};
#endif
contact: Jan Huwald // Impressum