From ea13ce5db204c484986965aea5bf4bbb31f04689 Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Mon, 10 May 2010 02:37:05 +0000 Subject: [PATCH] Remove iterators from BBLShift to remove a spurious(?) warning when running in g++'s debug mode. i.e. with -D_GLIBCXX_DEBUG git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@754 e59a4935-1847-0410-ae03-e826735625c1 --- src/to-sat/BitBlastNew.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/to-sat/BitBlastNew.cpp b/src/to-sat/BitBlastNew.cpp index 3ffa256..3a60152 100644 --- a/src/to-sat/BitBlastNew.cpp +++ b/src/to-sat/BitBlastNew.cpp @@ -739,13 +739,12 @@ ASTNode BitBlasterNew::BBBVLE(const BBNodeVec& left, const BBNodeVec& right, void BitBlasterNew::BBLShift(BBNodeVec& x, unsigned int shift) { // left shift x (destructively) within width. // loop backwards so that copy to self works correctly. (DON'T use STL insert!) - const BBNodeVec::iterator xbeg = x.begin(); - BBNodeVec::iterator xit = x.end() - 1; - for (; xit >= xbeg; xit--) { - if (xit - shift >= xbeg) - *xit = *(xit - shift); + for (int i =((int)x.size())-1; i >=0; i--) + { + if (i-(int)shift >= 0) + x[i] = x[i-(int)shift]; else - *xit = nf->getFalse(); // new LSB is zero. + x[i] = nf->getFalse(); // new LSB is zero. } } -- 2.47.3