[X2Go-Commits] [nx-libs] 97/429: nxagent: handle RegionNil macro as Boolean

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:36:12 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit b8017065de448d461d75f6c2891a961f4bb85b7a
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Wed Dec 30 23:52:32 2020 +0100

    nxagent: handle RegionNil macro as Boolean
    
    just as the rest of the Xserver is alsow doing
---
 nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 38 +++++++++++++--------------
 nx-X11/programs/Xserver/hw/nxagent/Events.c   |  2 +-
 nx-X11/programs/Xserver/hw/nxagent/GCOps.c    | 12 ++++-----
 nx-X11/programs/Xserver/hw/nxagent/Image.c    |  4 +--
 nx-X11/programs/Xserver/hw/nxagent/Render.c   |  2 +-
 nx-X11/programs/Xserver/hw/nxagent/Screen.c   |  2 +-
 nx-X11/programs/Xserver/hw/nxagent/Split.c    |  4 +--
 nx-X11/programs/Xserver/hw/nxagent/Window.c   |  2 +-
 8 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
index 5317d0509..c335e7ed9 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
@@ -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;
   }
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index f371363a6..256c7c241 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -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
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
index 093e16a77..d29558cb2 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
@@ -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",
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c
index 2e0c901ef..eb4085ef3 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Image.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c
@@ -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);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c
index 44d52f8e0..1ea076bfd 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Render.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c
@@ -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",
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 137f0eb58..077457f0e 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -2903,7 +2903,7 @@ int nxagentShadowSendUpdates(int *suspended)
 {
   *suspended = 0;
 
-  if (RegionNil(&nxagentShadowUpdateRegion) == 1)
+  if (RegionNil(&nxagentShadowUpdateRegion))
   {
     return 0;
   }
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c
index 60af4a0d6..2e2b130fe 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Split.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c
@@ -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),
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index 2a872c812..fcff4c6d0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -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));

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list