[Xquartz-changes] xserver: Branch 'master' - 10 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Wed Oct 14 17:31:21 PDT 2015


 Xext/security.c     |   24 ++++++++++++------------
 Xext/xres.c         |    8 ++++----
 dix/window.c        |    9 ++++-----
 glx/glxcmds.c       |    2 +-
 mi/miarc.c          |    2 +-
 os/osinit.c         |    5 +++--
 os/xdmauth.c        |    4 ++--
 os/xdmcp.c          |    1 +
 randr/rrtransform.c |   10 +++++-----
 9 files changed, 33 insertions(+), 32 deletions(-)

New commits:
commit 1f5e6c9a9a5ba66671963740039f46e9c8e9da1d
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:49:59 2015 -0700

    glx: Fix header length error checking in __glXDisp_RenderLarge
    
    glxcmds.c:2206:46: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare,Semantic
    Issue]
            if ((cmdlen = safe_pad(hdr->length)) < 0)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index cbd4ede..0416dac 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -2182,7 +2182,7 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
         __GLXrenderSizeData entry;
         int extra = 0;
         int left = (req->length << 2) - sz_xGLXRenderLargeReq;
-        size_t cmdlen;
+        int cmdlen;
         int err;
 
         /*
commit ad7649d4d00e87bfe176ead3fbda9c80e5b7c1bf
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:44:48 2015 -0700

    xdmcp: Declare XdmcpFatal _X_NORETURN
    
    xdmcp.c:1404:1: warning: function 'XdmcpFatal' could be declared with attribute 'noreturn'
    [-Wmissing-noreturn,Semantic Issue]
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/os/xdmcp.c b/os/xdmcp.c
index 7939b41..5bdcbe9 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -1399,6 +1399,7 @@ recv_alive_msg(unsigned length)
     }
 }
 
+_X_NORETURN
 static void
 XdmcpFatal(const char *type, ARRAY8Ptr status)
 {
commit 7b1400e9fd787c035f3c3fb5720987964f5a1ef3
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:39:10 2015 -0700

    osinit: Silence -Wunused-variable warnings
    
    osinit.c:161:24: warning: unused variable 'devnull' [-Wunused-variable,Unused Entity Issue]
        static const char *devnull = "/dev/null";
                           ^
    osinit.c:162:10: warning: unused variable 'fname' [-Wunused-variable,Unused Entity Issue]
        char fname[PATH_MAX];
             ^
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/os/osinit.c b/os/osinit.c
index ddd3fce..41a0aa7 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -158,8 +158,6 @@ void
 OsInit(void)
 {
     static Bool been_here = FALSE;
-    static const char *devnull = "/dev/null";
-    char fname[PATH_MAX];
 
     if (!been_here) {
 #if !defined(WIN32) || defined(__CYGWIN__)
@@ -219,6 +217,9 @@ OsInit(void)
 #endif
 
 #if !defined(XQUARTZ)    /* STDIN is already /dev/null and STDOUT/STDERR is managed by console_redirect.c */
+        static const char *devnull = "/dev/null";
+        char fname[PATH_MAX];
+
 # if defined(__APPLE__)
         int devnullfd = open(devnull, O_RDWR, 0);
         assert(devnullfd > 2);
commit 59869652b11b17d39e51841d0d204909038bff8b
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:36:03 2015 -0700

    dix: Silence -Wunused-variable warning by moving window.c off of legacy region defines
    
    window.c:223:15: warning: unused variable 'pScreen' [-Wunused-variable,Unused Entity Issue]
        ScreenPtr pScreen = pWin->drawable.pScreen;
                  ^
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/dix/window.c b/dix/window.c
index d57f320..69b5a7c 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -220,7 +220,6 @@ log_window_info(WindowPtr pWin, int depth)
     int i;
     const char *win_name, *visibility;
     BoxPtr rects;
-    ScreenPtr pScreen = pWin->drawable.pScreen;
 
     for (i = 0; i < (depth << 2); i++)
         ErrorF(" ");
@@ -240,7 +239,7 @@ log_window_info(WindowPtr pWin, int depth)
         ErrorF(" (%s compositing: pixmap %x)",
                (pWin->redirectDraw == RedirectDrawAutomatic) ?
                "automatic" : "manual",
-               (unsigned) pScreen->GetWindowPixmap(pWin)->drawable.id);
+               (unsigned) pWin->drawable.pScreen->GetWindowPixmap(pWin)->drawable.id);
 #endif
 
     switch (pWin->visibility) {
@@ -259,10 +258,10 @@ log_window_info(WindowPtr pWin, int depth)
     }
     ErrorF(", %s", visibility);
 
-    if (REGION_NOTEMPTY(pScreen, &pWin->clipList)) {
+    if (RegionNotEmpty(&pWin->clipList)) {
         ErrorF(", clip list:");
-        rects = REGION_RECTS(&pWin->clipList);
-        for (i = 0; i < REGION_NUM_RECTS(&pWin->clipList); i++)
+        rects = RegionRects(&pWin->clipList);
+        for (i = 0; i < RegionNumRects(&pWin->clipList); i++)
             ErrorF(" [(%d, %d) to (%d, %d)]",
                    rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);
         ErrorF("; extents [(%d, %d) to (%d, %d)]",
commit 8db3fa9eb4f3111c8d30f38d5a925bd416faa95a
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:29:10 2015 -0700

    security: Silence some benign -Wformat warnings
    
    XID may be either 'unsigned long' or 'unsigned int' depending on:
    
    typedef unsigned long CARD64;
    typedef unsigned int CARD32;
    typedef unsigned long long CARD64;
    typedef unsigned long CARD32;
    
    typedef unsigned long XID;
    typedef CARD32 XID;
    
    so when building with -Wformat, we get some warnings that are benign.  This silences them.
    
    security.c:215:52: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
          [-Wformat,Format String Issue]
        SecurityAudit("revoked authorization ID %d\n", pAuth->id);
                                                ~~     ^~~~~~~~~
                                                %lu
      CC       dpmsstubs.lo
    security.c:553:25: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
          [-Wformat,Format String Issue]
             client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
                            ^~~~~~~~~
    security.c:553:55: warning: format specifies type 'int' but the argument has type 'CARD32' (aka 'unsigned long')
          [-Wformat,Format String Issue]
             client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
                                                          ^~~~~~~~~~~~~~
    security.c:554:10: warning: format specifies type 'int' but the argument has type 'XID' (aka 'unsigned long')
          [-Wformat,Format String Issue]
             pAuth->group, eventMask);
             ^~~~~~~~~~~~
    security.c:554:24: warning: format specifies type 'int' but the argument has type 'Mask' (aka 'unsigned long')
          [-Wformat,Format String Issue]
             pAuth->group, eventMask);
                           ^~~~~~~~~
    security.c:781:19: warning: format specifies type 'unsigned int' but the argument has type 'Mask' (aka 'unsigned
    long')
          [-Wformat,Format String Issue]
                      requested, rec->id, cid,
                      ^~~~~~~~~
    security.c:781:30: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
          [-Wformat,Format String Issue]
                      requested, rec->id, cid,
                                 ^~~~~~~
    security.c:863:23: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
          [-Wformat,Format String Issue]
                          rec->pWin->drawable.id, wClient(rec->pWin)->index,
                          ^~~~~~~~~~~~~~~~~~~~~~
    security.c:893:31: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
          [-Wformat,Format String Issue]
                                  rec->pWin->drawable.id,
                                  ^~~~~~~~~~~~~~~~~~~~~~
    security.c:915:39: warning: format specifies type 'unsigned int' but the argument has type 'XID' (aka 'unsigned long')
          [-Wformat,Format String Issue]
                      rec->client->index, rec->pWin->drawable.id,
                                          ^~~~~~~~~~~~~~~~~~~~~~
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/Xext/security.c b/Xext/security.c
index cce7c46..04382ff 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -212,7 +212,7 @@ SecurityDeleteAuthorization(void *value, XID id)
                 CloseDownClient(clients[i]);
         }
 
-    SecurityAudit("revoked authorization ID %d\n", pAuth->id);
+    SecurityAudit("revoked authorization ID %lu\n", (unsigned long)pAuth->id);
     free(pAuth);
     return Success;
 
@@ -549,9 +549,9 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
     WriteToClient(client, authdata_len, pAuthdata);
 
     SecurityAudit
-        ("client %d generated authorization %d trust %d timeout %d group %d events %d\n",
-         client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
-         pAuth->group, eventMask);
+        ("client %d generated authorization %lu trust %d timeout %lu group %lu events %lu\n",
+         client->index, (unsigned long)pAuth->id, pAuth->trustLevel, (unsigned long)pAuth->timeout,
+         (unsigned long)pAuth->group, (unsigned long)eventMask);
 
     /* the request succeeded; don't call RemoveAuthorization or free pAuth */
     return Success;
@@ -776,9 +776,9 @@ SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata)
             return;
     }
 
-    SecurityAudit("Security: denied client %d access %x to resource 0x%x "
+    SecurityAudit("Security: denied client %d access %lx to resource 0x%lx "
                   "of client %d on request %s\n", rec->client->index,
-                  requested, rec->id, cid,
+                  (unsigned long)requested, (unsigned long)rec->id, cid,
                   SecurityLookupRequestName(rec->client));
     rec->status = BadAccess;    /* deny access */
 }
@@ -858,9 +858,9 @@ SecurityProperty(CallbackListPtr *pcbl, void *unused, void *calldata)
 
     if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
         SecurityAudit("Security: denied client %d access to property %s "
-                      "(atom 0x%x) window 0x%x of client %d on request %s\n",
+                      "(atom 0x%x) window 0x%lx of client %d on request %s\n",
                       rec->client->index, NameForAtom(name), name,
-                      rec->pWin->drawable.id, wClient(rec->pWin)->index,
+                      (unsigned long)rec->pWin->drawable.id, wClient(rec->pWin)->index,
                       SecurityLookupRequestName(rec->client));
         rec->status = BadAccess;
     }
@@ -887,10 +887,10 @@ SecuritySend(CallbackListPtr *pcbl, void *unused, void *calldata)
                 rec->events[i].u.u.type != ClientMessage) {
 
                 SecurityAudit("Security: denied client %d from sending event "
-                              "of type %s to window 0x%x of client %d\n",
+                              "of type %s to window 0x%lx of client %d\n",
                               rec->client->index,
                               LookupEventName(rec->events[i].u.u.type),
-                              rec->pWin->drawable.id,
+                              (unsigned long)rec->pWin->drawable.id,
                               wClient(rec->pWin)->index);
                 rec->status = BadAccess;
                 return;
@@ -911,8 +911,8 @@ SecurityReceive(CallbackListPtr *pcbl, void *unused, void *calldata)
         return;
 
     SecurityAudit("Security: denied client %d from receiving an event "
-                  "sent to window 0x%x of client %d\n",
-                  rec->client->index, rec->pWin->drawable.id,
+                  "sent to window 0x%lx of client %d\n",
+                  rec->client->index, (unsigned long)rec->pWin->drawable.id,
                   wClient(rec->pWin)->index);
     rec->status = BadAccess;
 }
commit fc07fe2a5939dbe926fcd9bb0e4175263845468b
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:18:55 2015 -0700

    xres: Silence -Wunused-function warnings when building !COMPOSITE or !RENDER
    
    xres.c:422:1: warning: unused function 'ResFindCompositeClientWindowPixmaps' [-Wunused-function,Unused Entity Issue]
    ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata)
    ^
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/Xext/xres.c b/Xext/xres.c
index 6b87c3d..83cc691 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -410,21 +410,21 @@ ResFindGCPixmaps(void *value, XID id, void *cdata)
         *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap);
 }
 
+#ifdef RENDER
 static void
 ResFindPicturePixmaps(void *value, XID id, void *cdata)
 {
-#ifdef RENDER
     ResFindResourcePixmaps(value, id, PictureType, cdata);
-#endif
 }
+#endif
 
+#ifdef COMPOSITE
 static void
 ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata)
 {
-#ifdef COMPOSITE
     ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata);
-#endif
 }
+#endif
 
 static int
 ProcXResQueryClientPixmapBytes(ClientPtr client)
commit acfb4fa51b2650329fb9ed9451252c2860196d1c
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:16:41 2015 -0700

    randr: Silence -Wshift-negative-value warnings
    
    rrtransform.c:199:23: warning: shifting a negative signed value is undefined [-Wshift-negative-value,Semantic Issue]
                rot_cos = F(-1);
                          ^~~~~
    rrtransform.c:114:14: note: expanded from macro 'F'
                    ^~~~~~~~~~~~~~
    ../render/picture.h:200:24: note: expanded from macro 'IntToxFixed'
                            ^~~~~~~~~~~~~~~~~~~~~~
    /opt/X11/include/pixman-1/pixman.h:130:56: note: expanded from macro 'pixman_int_to_fixed'
                                                               ~~~ ^
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/randr/rrtransform.c b/randr/rrtransform.c
index 26b0649..d32b43a 100644
--- a/randr/rrtransform.c
+++ b/randr/rrtransform.c
@@ -196,7 +196,7 @@ RRTransformCompute(int x,
             f_rot_sin = 0;
             f_rot_dx = width;
             f_rot_dy = height;
-            rot_cos = F(-1);
+            rot_cos = F(~0u);
             rot_sin = F(0);
             rot_dx = F(width);
             rot_dy = F(height);
@@ -207,7 +207,7 @@ RRTransformCompute(int x,
             f_rot_dx = 0;
             f_rot_dy = width;
             rot_cos = F(0);
-            rot_sin = F(-1);
+            rot_sin = F(~0u);
             rot_dx = F(0);
             rot_dy = F(width);
             break;
@@ -230,7 +230,7 @@ RRTransformCompute(int x,
         scale_dy = 0;
         if (rotation & RR_Reflect_X) {
             f_scale_x = -1;
-            scale_x = F(-1);
+            scale_x = F(~0u);
             if (rotation & (RR_Rotate_0 | RR_Rotate_180)) {
                 f_scale_dx = width;
                 scale_dx = F(width);
@@ -242,7 +242,7 @@ RRTransformCompute(int x,
         }
         if (rotation & RR_Reflect_Y) {
             f_scale_y = -1;
-            scale_y = F(-1);
+            scale_y = F(~0u);
             if (rotation & (RR_Rotate_0 | RR_Rotate_180)) {
                 f_scale_dy = height;
                 scale_dy = F(height);
commit b251f2a69f8079f7c7157fd17ae6ea8c2c0d8805
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:41:50 2015 -0700

    xdmauth: Correct miscall of abs() to instrad call labs()
    
    xdmauth.c:230:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of
    type
    'int'
          which may cause truncation of value [-Wabsolute-value,Semantic Issue]
            if (abs(now - client->time) > TwentyFiveMinutes) {
                ^
    xdmauth.c:230:13: note: use function 'labs' instead [Semantic Issue]
            if (abs(now - client->time) > TwentyFiveMinutes) {
                ^~~
                labs
    xdmauth.c:302:9: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type
    'int' which
          may cause truncation of value [-Wabsolute-value,Semantic Issue]
        if (abs(client->time - now) > TwentyMinutes) {
            ^
    xdmauth.c:302:9: note: use function 'labs' instead [Semantic Issue]
        if (abs(client->time - now) > TwentyMinutes) {
            ^~~
            labs
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/os/xdmauth.c b/os/xdmauth.c
index f11cbb9..482bc67 100644
--- a/os/xdmauth.c
+++ b/os/xdmauth.c
@@ -227,7 +227,7 @@ XdmClientAuthTimeout(long now)
     prev = 0;
     for (client = xdmClients; client; client = next) {
         next = client->next;
-        if (abs(now - client->time) > TwentyFiveMinutes) {
+        if (labs(now - client->time) > TwentyFiveMinutes) {
             if (prev)
                 prev->next = next;
             else
@@ -299,7 +299,7 @@ XdmAuthorizationValidate(unsigned char *plain, int length,
     }
     now += clockOffset;
     XdmClientAuthTimeout(now);
-    if (abs(client->time - now) > TwentyMinutes) {
+    if (labs(client->time - now) > TwentyMinutes) {
         free(client);
         if (reason)
             *reason = "Excessive XDM-AUTHORIZATION-1 time offset";
commit d822ab9b9f607b3e795fda8a14ede249eb125f1f
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:12:12 2015 -0700

    randr: Correct a miscall of abs() to instead call fabs()
    
    rrtransform.c:124:22: warning: using integer absolute value function 'abs' when
          argument is of floating point type [-Wabsolute-value,Semantic Issue]
                if ((v = abs(f_transform->m[j][i])) > max)
                         ^
    rrtransform.c:124:22: note: use function 'fabs' instead [Semantic Issue]
                if ((v = abs(f_transform->m[j][i])) > max)
                         ^~~
                         fabs
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/randr/rrtransform.c b/randr/rrtransform.c
index 6137f85..26b0649 100644
--- a/randr/rrtransform.c
+++ b/randr/rrtransform.c
@@ -121,7 +121,7 @@ RRTransformRescale(struct pixman_f_transform *f_transform, double limit)
 
     for (j = 0; j < 3; j++)
         for (i = 0; i < 3; i++)
-            if ((v = abs(f_transform->m[j][i])) > max)
+            if ((v = fabs(f_transform->m[j][i])) > max)
                 max = v;
     scale = limit / max;
     for (j = 0; j < 3; j++)
commit b30fc499be5ae5d9514e8c8143526a1e5f453206
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Oct 14 14:11:14 2015 -0700

    mi: Correct a miscall of abs() to instead call fabs()
    
    miarc.c:1714:9: warning: using integer absolute value function
    'abs' when
          argument is of floating point type [-Wabsolute-value,Semantic Issue]
        if (abs(parc->angle2) >= 360.0)
            ^
    miarc.c:1714:9: note: use function 'fabs' instead [Semantic Issue]
        if (abs(parc->angle2) >= 360.0)
            ^~~
            fabs
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/mi/miarc.c b/mi/miarc.c
index 5e854b3..2588ee4 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -1711,7 +1711,7 @@ miGetArcPts(SppArcPtr parc,     /* points to an arc */
         y1 = y2;
     }
     /* adjust the last point */
-    if (abs(parc->angle2) >= 360.0)
+    if (fabs(parc->angle2) >= 360.0)
         poly[cpt + i - 1] = poly[0];
     else {
         poly[cpt + i - 1].x = (miDcos(st + et) * parc->width / 2.0 + xc);


More information about the Xquartz-changes mailing list