From 0d78ad871e85a74a2a7eac2f2a2ff94776f35e77 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 7 Jul 2014 10:15:32 +0100 Subject: DBG_ASSERT->assert when followed by dereference Change-Id: Ic1c999ffdc391ea01be5711721e7c9e63179473e --- sot/source/sdstor/stgavl.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sot') diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx index 3cb48c2a1da9..93869ac9b042 100644 --- a/sot/source/sdstor/stgavl.cxx +++ b/sot/source/sdstor/stgavl.cxx @@ -131,7 +131,7 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode* pNew ) StgAvlNode* StgAvlNode::RotLL() { - OSL_ENSURE( pLeft, "The pointer is not allowed to be NULL!" ); + assert(pLeft && "The pointer is not allowed to be NULL!"); StgAvlNode *pHeavy = pLeft; pLeft = pHeavy->pRight; pHeavy->pRight = this; @@ -172,10 +172,9 @@ StgAvlNode* StgAvlNode::RotLR() } // perform RR rotation and return new root - StgAvlNode* StgAvlNode::RotRR() { - OSL_ENSURE( pRight, "The pointer is not allowed to be NULL!" ); + assert(pRight && "The pointer is not allowed to be NULL!" ); StgAvlNode* pHeavy = pRight; pRight = pHeavy->pLeft; pHeavy->pLeft = this; @@ -184,10 +183,9 @@ StgAvlNode* StgAvlNode::RotRR() } // perform the RL rotation and return the new root - StgAvlNode* StgAvlNode::RotRL() { - OSL_ENSURE( pRight && pRight->pLeft, "The pointer is not allowed to be NULL!" ); + assert(pRight && pRight->pLeft && "The pointer is not allowed to be NULL!"); StgAvlNode* pHeavy = pRight; StgAvlNode* pNewRoot = pHeavy->pLeft; pHeavy->pLeft = pNewRoot->pRight; @@ -297,7 +295,8 @@ bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns ) short nRes = (*pRoot)->Locate( pIns, &pPivot, &pParent, &pPrev ); if( !nRes ) return false; - OSL_ENSURE( pPivot && pPrev, "The pointers may not be NULL!" ); + + assert(pPivot && pPrev && "The pointers may not be NULL!"); // add new node if( nRes < 0 ) -- cgit