From 3b985045cb8ec3c2bbd7d4c29c9838182c747b36 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 19 Jul 2007 00:16:27 +0000 Subject: [PATCH] fix gcc set corruption --- panda/src/pgraph/renderEffects.I | 5 ++- panda/src/pgraph/renderEffects.cxx | 50 ------------------------------ 2 files changed, 4 insertions(+), 51 deletions(-) diff --git a/panda/src/pgraph/renderEffects.I b/panda/src/pgraph/renderEffects.I index 5be7ad0676..d4f2f81862 100644 --- a/panda/src/pgraph/renderEffects.I +++ b/panda/src/pgraph/renderEffects.I @@ -106,7 +106,10 @@ compare_to(const Effect &other) const { if (_type != other._type) { return _type.get_index() - other._type.get_index(); } - return _effect - other._effect; + if (_effect != other._effect) { + return _effect < other._effect ? -1 : 1; + } + return 0; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraph/renderEffects.cxx b/panda/src/pgraph/renderEffects.cxx index e23e24425e..85423ca00d 100644 --- a/panda/src/pgraph/renderEffects.cxx +++ b/panda/src/pgraph/renderEffects.cxx @@ -662,13 +662,10 @@ return_new(RenderEffects *state) { // The state was inserted; save the iterator and return the // input state. state->_saved_entry = result.first; - // nassertr(validate_states(), pt_state); nassertr(_states->find(state) == state->_saved_entry, pt_state); return pt_state; } - // nassertr(validate_states(), *(result.first)); - // The state was not inserted; there must be an equivalent one // already in the set. Return that one. return *(result.first); @@ -688,56 +685,9 @@ release_new() { nassertv(_states_lock->debug_is_locked()); if (_saved_entry != _states->end()) { - /* - if (_states->find(this) != _saved_entry) { - nassertv(*_saved_entry == this); - cerr << "States wrong!\n"; - cerr << "validate = " << validate_states() << "\n"; - cerr << "this = " << this << ": " << *this << "\n"; - States::iterator fi = _states->find(this); - if (fi == _states->end()) { - cerr << " not found\n"; - } else { - cerr <<" found: " << (*fi) << ": " << *(*fi) << "\n"; - } - - if (!_states->empty()) { - States::iterator si; - si = _states->begin(); - cerr << (*si) << ": " << *(*si) << "\n"; - States::iterator ni = si; - ++ni; - if ((*si) == this) { - _states->erase(si); - si = ni; - } - while (ni != _states->end()) { - if (*(*si) < *(*ni)) { - cerr << " ok, " << (*(*ni) < *(*si)) << "\n"; - } else { - cerr << " **wrong! " << (*(*ni) < *(*si)) << "\n"; - } - si = ni; - cerr << (*si) << ": " << *(*si) << "\n"; - ++ni; - if ((*si) == this) { - _states->erase(si); - si = ni; - } - } - } - } - */ nassertv(_states->find(this) == _saved_entry); - // nassertv(validate_states()); _states->erase(_saved_entry); _saved_entry = _states->end(); - - /* - nassertd(validate_states()) { - cerr << "Removed " << this << ": " << *this << "\n"; - } - */ } }