From 9edcae78c46286baff42e74bfe26f6ae4d00fe01 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 21 Sep 2011 17:14:16 -0400 Subject: Use correct swap{l,s} (or none at all for CARD8) Swapping the wrong size was never caught because swap{l,s} are macros. It's clear in the case of Xext/xres.c, that the author believed client_major/minor to be CARD16 from looking at the code in the first hunk. v2: dmx.c fixes from Keith. Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- Xext/saver.c | 1 - Xext/xres.c | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'Xext') diff --git a/Xext/saver.c b/Xext/saver.c index 9e91b717b..142758c87 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -1443,7 +1443,6 @@ SProcScreenSaverSuspend (ClientPtr client) swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); - swapl(&stuff->suspend); return ProcScreenSaverSuspend (client); } diff --git a/Xext/xres.c b/Xext/xres.c index 9df12ae81..b95272882 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -28,15 +28,9 @@ ProcXResQueryVersion (ClientPtr client) { REQUEST(xXResQueryVersionReq); xXResQueryVersionReply rep; - CARD16 client_major, client_minor; /* not used */ REQUEST_SIZE_MATCH (xXResQueryVersionReq); - client_major = stuff->client_major; - client_minor = stuff->client_minor; - (void) client_major; - (void) client_minor; - rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -316,8 +310,6 @@ SProcXResQueryVersion (ClientPtr client) { REQUEST(xXResQueryVersionReq); REQUEST_SIZE_MATCH (xXResQueryVersionReq); - swaps(&stuff->client_major); - swaps(&stuff->client_minor); return ProcXResQueryVersion(client); } @@ -326,7 +318,7 @@ SProcXResQueryClientResources (ClientPtr client) { REQUEST(xXResQueryClientResourcesReq); REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq); - swaps(&stuff->xid); + swapl(&stuff->xid); return ProcXResQueryClientResources(client); } @@ -335,7 +327,7 @@ SProcXResQueryClientPixmapBytes (ClientPtr client) { REQUEST(xXResQueryClientPixmapBytesReq); REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq); - swaps(&stuff->xid); + swapl(&stuff->xid); return ProcXResQueryClientPixmapBytes(client); } -- cgit v1.2.3