Skip to content

Commit

Permalink
Use unsigned int for count
Browse files Browse the repository at this point in the history
  • Loading branch information
kintel committed Feb 4, 2012
1 parent cf3102f commit e725437
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/csgtermnormalizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions src/csgtermnormalizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@
class CSGTermNormalizer
{
public:
CSGTermNormalizer() : counter(0) {}
CSGTermNormalizer() {}
~CSGTermNormalizer() {}

shared_ptr<class CSGTerm> normalize(const shared_ptr<CSGTerm> &term, size_t limit);

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

0 comments on commit e725437

Please sign in to comment.