Use unsigned int for count

felipesanches-svg
Marius Kintel 2012-02-04 14:38:42 +01:00
parent cf3102f4fb
commit e725437a5a
2 changed files with 4 additions and 6 deletions

View File

@ -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);

View File

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