From de252b87932a0f55597055be1365027ac86793fa Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Tue, 18 Mar 2003 01:22:17 +0000 Subject: [PATCH] changed to nassertv and print_to to ouput --- panda/src/putil/uniqueIdAllocator.cxx | 14 +++++++------- panda/src/putil/uniqueIdAllocator.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/panda/src/putil/uniqueIdAllocator.cxx b/panda/src/putil/uniqueIdAllocator.cxx index 71f77864a2..9b03844db8 100644 --- a/panda/src/putil/uniqueIdAllocator.cxx +++ b/panda/src/putil/uniqueIdAllocator.cxx @@ -57,9 +57,9 @@ UniqueIdAllocator(U32 min, U32 max) : _min(min), _max(max) { uniqueIdAllocator_debug("UniqueIdAllocator("< 0. + nassertv(_size); // size must be > 0. _table=new U32[_size]; - assert(_table); // This should be redundant if new throws an exception. + nassertv(_table); // This should be redundant if new throws an exception. for (U32 i=0; i<_size; ++i) { _table[i]=i+1; } @@ -97,7 +97,7 @@ allocate() { } U32 id=_min+_next_free; _next_free=_table[_next_free]; - assert(_table[id-_min]=-2); // this assignment is debug only. + nassertr(_table[id-_min]=-2, -1); // this assignment is debug only. --_free; uniqueIdAllocator_debug("allocate() returning "<=_min); // Attempt to free out-of-range id. - assert(index<=_max); // Attempt to free out-of-range id. + nassertv(index>=_min); // Attempt to free out-of-range id. + nassertv(index<=_max); // Attempt to free out-of-range id. index=index-_min; // Convert to _table index. - assert(_table[index]==-2); // Attempt to free non-allocated id. + nassertv(_table[index]==-2); // Attempt to free non-allocated id. _table[index]=-1; // Mark this element as the end of the list. _table[_last_free]=index; if (_next_free==-1) { @@ -146,7 +146,7 @@ percent_used() const { // Description: ...intended for debugging only. //////////////////////////////////////////////////////////////////// void UniqueIdAllocator:: -print_to(ostream& os, bool verbose) const { +output(ostream& os, bool verbose) const { os <<"[_next_free: "<