Commit b8017065 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

nxagent: handle RegionNil macro as Boolean

just as the rest of the Xserver is alsow doing
parent 06833b96
......@@ -396,7 +396,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
* The bitmap to synchronize is clipped.
*/
if (RegionNil(clipRegion) == 1)
if (RegionNil(clipRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: The bitmap region [%d,%d,%d,%d] is not viewable. "
......@@ -418,7 +418,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
}
else
{
if (pRegion != NullRegion && RegionNil(pRegion) == 1)
if (pRegion != NullRegion && RegionNil(pRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: Region [%d,%d,%d,%d] is nil. Skipping synchronization.\n",
......@@ -451,7 +451,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
RegionIntersect(clipRegion, clipRegion, nxagentCorruptedRegion(pDrawable));
if (RegionNil(clipRegion) == 1)
if (RegionNil(clipRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: The corrupted region [%d,%d,%d,%d] is not viewable "
......@@ -473,7 +473,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
{
RegionIntersect(clipRegion, clipRegion, pRegion);
if (RegionNil(clipRegion) == 1)
if (RegionNil(clipRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentSynchronizeRegion: Region requested [%d,%d,%d,%d] already "
......@@ -888,7 +888,7 @@ nxagentSynchronizeRegionStop:
if (pDrawable -> type == DRAWABLE_PIXMAP &&
nxagentIsCorruptedBackground((PixmapPtr) pDrawable) == 1 &&
RegionNil(&exposeRegion) == 0)
!RegionNil(&exposeRegion))
{
struct nxagentExposeBackground eb = {
.pBackground = (PixmapPtr) pDrawable,
......@@ -994,7 +994,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea
pBox -> x2 - pBox -> x1, pBox -> y2 - pBox -> y1);
if (RegionNil(pRegion) == 1)
if (RegionNil(pRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentSynchronizeBox: Resulting region [%d,%d,%d,%d] is nil. Skipping synchronization.\n",
......@@ -1441,7 +1441,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
* clipmask.
*/
if (RegionNil(pRegion) == 0 &&
if (!RegionNil(pRegion) &&
pGC != NULL && pGC -> clientClip != NULL &&
pGC -> clientClipType == CT_REGION)
{
......@@ -1478,7 +1478,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion)
{
if (pRegion != NullRegion && RegionNil(pRegion) == 1)
if (pRegion != NullRegion && RegionNil(pRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentMarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n",
......@@ -1552,7 +1552,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion)
void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion)
{
if (pRegion != NullRegion && RegionNil(pRegion) == 1)
if (pRegion != NullRegion && RegionNil(pRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentUnmarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n",
......@@ -2001,7 +2001,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel)
unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion)
{
if (RegionNil(pRegion) == 1)
if (RegionNil(pRegion))
{
return nxagentGetDrawableColor(pDrawable);
}
......@@ -2055,7 +2055,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion)
return;
}
if (pRegion == NullRegion || RegionNil(pRegion) == 1)
if (pRegion == NullRegion || RegionNil(pRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentClearRegion: The region is empty. Exiting.\n");
......@@ -2145,7 +2145,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion)
void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion)
{
if (RegionNil(pRegion) == 1)
if (RegionNil(pRegion))
{
return;
}
......@@ -2328,7 +2328,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2)
nxagentFreeRegion(clipRegion);
if (RegionNil(&visRegion) == 1)
if (RegionNil(&visRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentCorruptedRegionOnWindow: The corrupted region of window at [%p] is hidden.\n",
......@@ -2455,7 +2455,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
RegionIntersect(pClipRegion, pClipRegion, nxagentCorruptedRegion(pDrawable));
if (RegionNil(pClipRegion) == 1)
if (RegionNil(pClipRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentCreateDrawableBitmap: The corrupted region is not visible. Skipping bitmap creation.\n");
......@@ -2780,14 +2780,14 @@ void nxagentUnmarkExposedRegion(WindowPtr pWin, RegionPtr pRegion, RegionPtr pOt
{
RegionRec clipRegion;
if (pRegion != NullRegion && RegionNil(pRegion) == 0 &&
if (pRegion != NullRegion && !RegionNil(pRegion) &&
nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized)
{
RegionInit(&clipRegion, NullBox, 1);
RegionCopy(&clipRegion, pRegion);
if (pOther != NullRegion && RegionNil(pOther) == 0)
if (pOther != NullRegion && !RegionNil(pOther))
{
RegionUnion(&clipRegion, &clipRegion, pOther);
}
......@@ -2871,7 +2871,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt
RegionSubtract(&expose, &expose, nxagentCorruptedRegion((DrawablePtr) pWin));
if (RegionNil(&pWin -> clipList) != 0)
if (RegionNil(&pWin -> clipList))
{
#ifdef TEST
fprintf(stderr, "nxagentSendBackgroundExpose: Exposures deferred because the window "
......@@ -2897,7 +2897,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt
pBackingStore = (miBSWindowPtr)pWin->backStorage;
if ((pBackingStore != NULL) && (RegionNil(&pBackingStore->SavedRegion) == 0))
if ((pBackingStore != NULL) && !RegionNil(&pBackingStore->SavedRegion))
{
RegionTranslate(&expose, -pWin -> drawable.x, -pWin -> drawable.y);
......@@ -2931,7 +2931,7 @@ void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2)
struct nxagentExposeBackground *pPair = p2;
if (RegionNil(pPair -> pExpose) != 0)
if (RegionNil(pPair -> pExpose))
{
return;
}
......
......@@ -4065,7 +4065,7 @@ void nxagentSynchronizeExpose(void)
(nxagentExposeQueueHead.remoteRegion),
(nxagentExposeQueueHead.localRegion));
if (RegionNil(nxagentExposeQueueHead.remoteRegion) == 0 &&
if (!RegionNil(nxagentExposeQueueHead.remoteRegion) &&
((pWin -> eventMask|wOtherEventMasks(pWin)) & ExposureMask))
{
#ifdef TEST
......
......@@ -301,7 +301,7 @@ FIXME: The popup could be synchronized with one single put image,
RegionIntersect(&corruptedRegion,
pSrcRegion, nxagentCorruptedRegion(pSrcDrawable));
if (RegionNil(&corruptedRegion) == 0)
if (!RegionNil(&corruptedRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n",
......@@ -422,17 +422,17 @@ FIXME: The popup could be synchronized with one single put image,
* corrupted region.
*/
if (RegionNil(pClipRegion) == 0)
if (!RegionNil(pClipRegion))
{
nxagentUnmarkCorruptedRegion(pDstDrawable, pClipRegion);
}
if (RegionNil(pCorruptedRegion) == 0)
if (!RegionNil(pCorruptedRegion))
{
nxagentMarkCorruptedRegion(pDstDrawable, pCorruptedRegion);
}
if (RegionNil(pClipRegion) == 0)
if (!RegionNil(pClipRegion))
{
Bool pClipRegionFree = True;
......@@ -550,7 +550,7 @@ FIXME: The popup could be synchronized with one single put image,
RegionIntersect(&corruptedRegion,
pSrcRegion, nxagentCorruptedRegion(pSrcDrawable));
if (RegionNil(&corruptedRegion) == 0)
if (!RegionNil(&corruptedRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n",
......@@ -996,7 +996,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
RegionIntersect(&corruptedRegion,
pSrcRegion, nxagentCorruptedRegion(pSrcDrawable));
if (RegionNil(&corruptedRegion) == 0)
if (!RegionNil(&corruptedRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentCopyPlane: Forcing the synchronization of source drawable at [%p].\n",
......
......@@ -544,7 +544,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
pRegion = nxagentCreateRegion(pDrawable, pGC, dstX, dstY, dstWidth, dstHeight);
if (RegionNil(pRegion) == 1)
if (RegionNil(pRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on fully clipped "
......@@ -987,7 +987,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
clipRegion = nxagentCreateRegion(pDrawable, pGC, x, y, w, h);
}
if (clipRegion == NullRegion || RegionNil(clipRegion) == 0)
if (clipRegion == NullRegion || !RegionNil(clipRegion))
{
nxagentPutSubImage(pDrawable, pGC, depth, x, y, w, h,
leftPad, format, data, pVisual);
......
......@@ -1314,7 +1314,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
RegionPtr pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1,
glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1);
if (RegionNil(pRegion) == 1)
if (RegionNil(pRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n",
......
......@@ -2903,7 +2903,7 @@ int nxagentShadowSendUpdates(int *suspended)
{
*suspended = 0;
if (RegionNil(&nxagentShadowUpdateRegion) == 1)
if (RegionNil(&nxagentShadowUpdateRegion))
{
return 0;
}
......
......@@ -612,7 +612,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion)
RegionIntersect(&tmpRegion, pResource -> region, pRegion);
if (RegionNil(&tmpRegion) == 0)
if (!RegionNil(&tmpRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid "
......@@ -1074,7 +1074,7 @@ void nxagentHandleEndSplitEvent(int resource)
if (pResource -> drawable != NULL &&
pResource -> region != NullRegion)
{
if (RegionNil(pResource -> region) == 0)
if (!RegionNil(pResource -> region))
{
RegionSubtract(
nxagentCorruptedRegion(pResource -> drawable),
......
......@@ -2195,7 +2195,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
RegionUnion(&temp, &temp, other_exposed);
}
if (RegionNil(&temp) == 0)
if (!RegionNil(&temp))
{
RegionTranslate(&temp,
-(pWin -> drawable.x), -(pWin -> drawable.y));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment