mirror of https://github.com/vitalif/openscad
Use unsigned int for count
parent
cf3102f4fb
commit
e725437a5a
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue