From 43557c3a3d7b6f497fbb9c06da197f500139c301 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Fri, 20 Feb 2004 04:38:34 +0000 Subject: [PATCH] Bug 229897. Fix build warning on brad. r+sr=roc, patch by Serge Gautherie --- gfx/src/nsRegionImpl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gfx/src/nsRegionImpl.cpp b/gfx/src/nsRegionImpl.cpp index bc078d04f28..555808425f9 100644 --- a/gfx/src/nsRegionImpl.cpp +++ b/gfx/src/nsRegionImpl.cpp @@ -112,7 +112,7 @@ nsresult nsRegionImpl::GetRects (nsRegionRectSet **aRects) nsRegionRectSet* pRegionSet = *aRects; PRUint32 NumRects = mRegion.GetNumRects (); - if (pRegionSet == nsnull) // Not yet allocated + if (!pRegionSet) // Not yet allocated { PRUint8* pBuf = new PRUint8 [sizeof (nsRegionRectSet) + NumRects * sizeof (nsRegionRect)]; pRegionSet = NS_REINTERPRET_CAST (nsRegionRectSet*, pBuf); @@ -135,14 +135,14 @@ nsresult nsRegionImpl::GetRects (nsRegionRectSet **aRects) nsRegionRect* pDest = &pRegionSet->mRects [0]; const nsRect* pSrc; - while (pSrc = ri.Next ()) + while ((pSrc = ri.Next ()) != nsnull) { pDest->x = pSrc->x; pDest->y = pSrc->y; pDest->width = pSrc->width; pDest->height = pSrc->height; - pDest++; + ++pDest; } return NS_OK;