xserver: Branch 'master' - 10 commits
Adam Jackson
ajax at kemper.freedesktop.org
Mon Oct 19 08:53:52 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 | 2 ++
os/xdmauth.c | 4 ++--
os/xdmcp.c | 1 +
randr/rrtransform.c | 10 +++++-----
9 files changed, 32 insertions(+), 30 deletions(-)
New commits:
commit ec6294116cc41ff1c3be081b626952fb7e614244
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Sun Oct 18 23:12:52 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];
^
Reviewed-by: Adam Jackson <ajax at redhat.com>
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
diff --git a/os/osinit.c b/os/osinit.c
index ddd3fce..6ec2f11 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -158,8 +158,10 @@ void
OsInit(void)
{
static Bool been_here = FALSE;
+#ifndef XQUARTZ
static const char *devnull = "/dev/null";
char fname[PATH_MAX];
+#endif
if (!been_here) {
#if !defined(WIN32) || defined(__CYGWIN__)
commit 0a5d54f721de7e3ab3b6f4b080190a92bbe3429b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Sun Oct 18 23:12:51 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;
^
Reviewed-by: Adam Jackson <ajax at redhat.com>
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 e09875701b980b8c4578fb310a922c9934c34eef
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Sun Oct 18 23:12:50 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)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Reviewed-by: Adam Jackson <ajax at redhat.com>
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 5dc415048e4091b18cd7d123ebeae8f95ed5a4f5
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Sun Oct 18 23:12:49 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'
~~~ ^
Reviewed-by: Adam Jackson <ajax at redhat.com>
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 9a2a05a9a7ba02921fa29844c4cad41243c41326
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Oct 14 15:13:42 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 a7a00e4bd8153e0386c7e58d6b30a7a96f15fdb0
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Oct 14 15:13:39 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 aa73d587fece225753d8e6b8773a9c8b85823bd9
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Oct 14 15:13:38 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 85eb90ea45e89033b97bf71a13c5c70fec8f6871
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Oct 14 15:13:36 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 9f0fcd14b52f8481cbb3b3b9c6e06f64ff003cc8
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Oct 14 15:13:35 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 610dd8a58a75bb6a5b7d7abbae476d1cc4be519e
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Oct 14 15:13:34 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 xorg-commit
mailing list