Commit 286d8326 authored by Mike Gabriel's avatar Mike Gabriel

Use internal temp variable for swap macros. Make swaps/swapl type safe…

Use internal temp variable for swap macros. Make swaps/swapl type safe (introducing wrong_size check at build time). While working on this changeset, various spots got discovered where swapl or swaps was used on a wrong type, where byte swapping calls had been forgotten or done on the wrong variable. This backport at least includes changes from the following X.org commits, listed in non-chronological order: commit 2c7c520cfe0df30f4bc3adba59d9c62582823bf8 Author: Matt Turner <mattst88@gmail.com> Date: Thu Aug 4 15:35:41 2011 -0400 Use internal temp variable for swap macros Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: 's avatarPeter Harris <pharris@opentext.com> Signed-off-by: 's avatarMatt Turner <mattst88@gmail.com> commit 9edcae78c46286baff42e74bfe26f6ae4d00fe01 Author: Matt Turner <mattst88@gmail.com> Date: Wed Sep 21 17:14:16 2011 -0400 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: 's avatarPeter Harris <pharris@opentext.com> Signed-off-by: 's avatarMatt Turner <mattst88@gmail.com> commit dab064fa5e0b1f5c67222562ad5367005832cba1 Author: Andrea Canciani <ranma42@gmail.com> Date: Tue Nov 2 20:10:32 2010 +0100 render: Fix byteswapping of gradient stops The function swapStops repeatedly swaps the color components as CARD16, but incorrectly steps over them as if they were CARD32. This causes half of the stops not to be swapped at all and some unrelated data be swapped instead. Signed-off-by: 's avatarAndrea Canciani <ranma42@gmail.com> Reviewed-by: 's avatarSoren Sandmann <sandmann@daimi.au.dk> Reviewed-by: 's avatarJulien Cristau <jcristau@debian.org> Signed-off-by: 's avatarKeith Packard <keithp@keithp.com> commit 54770c980cd2b91a8377f975a58ed69def5cfa42 Author: Matt Turner <mattst88@gmail.com> Date: Tue Aug 16 16:59:07 2011 -0400 Cast char* buffers to swap functions Reviewed-by: 's avatarPeter Harris <pharris@opentext.com> Signed-off-by: 's avatarMatt Turner <mattst88@gmail.com> commit 6844bd2e63490870bab3c469eec6030354ef2865 Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Wed Jan 9 19:52:00 2008 -0800 More Xv extension byte swapping fixes commit e46f6ddeccd082b2d507a1e8b57ea30e6b0a2c83 Author: Michel Dänzer <michel@tungstengraphics.com> Date: Wed Jan 16 14:24:22 2008 +0100 Yet another Xv extension byte swapping fix.
parent d1d859df
...@@ -85,10 +85,9 @@ ProcBigReqDispatch (client) ...@@ -85,10 +85,9 @@ ProcBigReqDispatch (client)
{ {
REQUEST(xBigReqEnableReq); REQUEST(xBigReqEnableReq);
xBigReqEnableReply rep; xBigReqEnableReply rep;
register int n;
if (client->swapped) { if (client->swapped) {
swaps(&stuff->length, n); swaps(&stuff->length);
} }
if (stuff->brReqType != X_BigReqEnable) if (stuff->brReqType != X_BigReqEnable)
return BadRequest; return BadRequest;
...@@ -100,8 +99,8 @@ ProcBigReqDispatch (client) ...@@ -100,8 +99,8 @@ ProcBigReqDispatch (client)
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.max_request_size = maxBigRequestSize; rep.max_request_size = maxBigRequestSize;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.max_request_size, n); swapl(&rep.max_request_size);
} }
WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep); WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
......
...@@ -105,7 +105,6 @@ ProcDPMSGetVersion(client) ...@@ -105,7 +105,6 @@ ProcDPMSGetVersion(client)
{ {
/* REQUEST(xDPMSGetVersionReq); */ /* REQUEST(xDPMSGetVersionReq); */
xDPMSGetVersionReply rep; xDPMSGetVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xDPMSGetVersionReq); REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
...@@ -115,9 +114,9 @@ ProcDPMSGetVersion(client) ...@@ -115,9 +114,9 @@ ProcDPMSGetVersion(client)
rep.majorVersion = DPMSMajorVersion; rep.majorVersion = DPMSMajorVersion;
rep.minorVersion = DPMSMinorVersion; rep.minorVersion = DPMSMinorVersion;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swaps(&rep.majorVersion, n); swaps(&rep.majorVersion);
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep); WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -128,7 +127,6 @@ ProcDPMSCapable(register ClientPtr client) ...@@ -128,7 +127,6 @@ ProcDPMSCapable(register ClientPtr client)
{ {
/* REQUEST(xDPMSCapableReq); */ /* REQUEST(xDPMSCapableReq); */
xDPMSCapableReply rep; xDPMSCapableReply rep;
register int n;
REQUEST_SIZE_MATCH(xDPMSCapableReq); REQUEST_SIZE_MATCH(xDPMSCapableReq);
...@@ -138,7 +136,7 @@ ProcDPMSCapable(register ClientPtr client) ...@@ -138,7 +136,7 @@ ProcDPMSCapable(register ClientPtr client)
rep.capable = DPMSCapableFlag; rep.capable = DPMSCapableFlag;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
} }
WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep); WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -150,7 +148,6 @@ ProcDPMSGetTimeouts(client) ...@@ -150,7 +148,6 @@ ProcDPMSGetTimeouts(client)
{ {
/* REQUEST(xDPMSGetTimeoutsReq); */ /* REQUEST(xDPMSGetTimeoutsReq); */
xDPMSGetTimeoutsReply rep; xDPMSGetTimeoutsReply rep;
register int n;
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq); REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
...@@ -162,10 +159,10 @@ ProcDPMSGetTimeouts(client) ...@@ -162,10 +159,10 @@ ProcDPMSGetTimeouts(client)
rep.off = DPMSOffTime / MILLI_PER_SECOND; rep.off = DPMSOffTime / MILLI_PER_SECOND;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swaps(&rep.standby, n); swaps(&rep.standby);
swaps(&rep.suspend, n); swaps(&rep.suspend);
swaps(&rep.off, n); swaps(&rep.off);
} }
WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep); WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -265,7 +262,6 @@ ProcDPMSInfo(register ClientPtr client) ...@@ -265,7 +262,6 @@ ProcDPMSInfo(register ClientPtr client)
{ {
/* REQUEST(xDPMSInfoReq); */ /* REQUEST(xDPMSInfoReq); */
xDPMSInfoReply rep; xDPMSInfoReply rep;
register int n;
REQUEST_SIZE_MATCH(xDPMSInfoReq); REQUEST_SIZE_MATCH(xDPMSInfoReq);
...@@ -276,8 +272,8 @@ ProcDPMSInfo(register ClientPtr client) ...@@ -276,8 +272,8 @@ ProcDPMSInfo(register ClientPtr client)
rep.state = DPMSEnabled; rep.state = DPMSEnabled;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swaps(&rep.power_level, n); swaps(&rep.power_level);
} }
WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep); WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -316,13 +312,12 @@ static int ...@@ -316,13 +312,12 @@ static int
SProcDPMSGetVersion(client) SProcDPMSGetVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST(xDPMSGetVersionReq); REQUEST(xDPMSGetVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSGetVersionReq); REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
swaps(&stuff->majorVersion, n); swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion, n); swaps(&stuff->minorVersion);
return ProcDPMSGetVersion(client); return ProcDPMSGetVersion(client);
} }
...@@ -330,9 +325,8 @@ static int ...@@ -330,9 +325,8 @@ static int
SProcDPMSCapable(register ClientPtr client) SProcDPMSCapable(register ClientPtr client)
{ {
REQUEST(xDPMSCapableReq); REQUEST(xDPMSCapableReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSCapableReq); REQUEST_SIZE_MATCH(xDPMSCapableReq);
return ProcDPMSCapable(client); return ProcDPMSCapable(client);
...@@ -343,9 +337,8 @@ SProcDPMSGetTimeouts(client) ...@@ -343,9 +337,8 @@ SProcDPMSGetTimeouts(client)
register ClientPtr client; register ClientPtr client;
{ {
REQUEST(xDPMSGetTimeoutsReq); REQUEST(xDPMSGetTimeoutsReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq); REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
return ProcDPMSGetTimeouts(client); return ProcDPMSGetTimeouts(client);
...@@ -356,14 +349,13 @@ SProcDPMSSetTimeouts(client) ...@@ -356,14 +349,13 @@ SProcDPMSSetTimeouts(client)
register ClientPtr client; register ClientPtr client;
{ {
REQUEST(xDPMSSetTimeoutsReq); REQUEST(xDPMSSetTimeoutsReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq); REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
swaps(&stuff->standby, n); swaps(&stuff->standby);
swaps(&stuff->suspend, n); swaps(&stuff->suspend);
swaps(&stuff->off, n); swaps(&stuff->off);
return ProcDPMSSetTimeouts(client); return ProcDPMSSetTimeouts(client);
} }
...@@ -372,9 +364,8 @@ SProcDPMSEnable(client) ...@@ -372,9 +364,8 @@ SProcDPMSEnable(client)
register ClientPtr client; register ClientPtr client;
{ {
REQUEST(xDPMSEnableReq); REQUEST(xDPMSEnableReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSEnableReq); REQUEST_SIZE_MATCH(xDPMSEnableReq);
return ProcDPMSEnable(client); return ProcDPMSEnable(client);
...@@ -385,9 +376,8 @@ SProcDPMSDisable(client) ...@@ -385,9 +376,8 @@ SProcDPMSDisable(client)
register ClientPtr client; register ClientPtr client;
{ {
REQUEST(xDPMSDisableReq); REQUEST(xDPMSDisableReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSDisableReq); REQUEST_SIZE_MATCH(xDPMSDisableReq);
return ProcDPMSDisable(client); return ProcDPMSDisable(client);
...@@ -398,12 +388,11 @@ SProcDPMSForceLevel(client) ...@@ -398,12 +388,11 @@ SProcDPMSForceLevel(client)
register ClientPtr client; register ClientPtr client;
{ {
REQUEST(xDPMSForceLevelReq); REQUEST(xDPMSForceLevelReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSForceLevelReq); REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
swaps(&stuff->level, n); swaps(&stuff->level);
return ProcDPMSForceLevel(client); return ProcDPMSForceLevel(client);
} }
...@@ -413,9 +402,8 @@ SProcDPMSInfo(client) ...@@ -413,9 +402,8 @@ SProcDPMSInfo(client)
register ClientPtr client; register ClientPtr client;
{ {
REQUEST(xDPMSInfoReq); REQUEST(xDPMSInfoReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSInfoReq); REQUEST_SIZE_MATCH(xDPMSInfoReq);
return ProcDPMSInfo(client); return ProcDPMSInfo(client);
......
...@@ -936,7 +936,6 @@ ProcPanoramiXQueryVersion (ClientPtr client) ...@@ -936,7 +936,6 @@ ProcPanoramiXQueryVersion (ClientPtr client)
{ {
/* REQUEST(xPanoramiXQueryVersionReq); */ /* REQUEST(xPanoramiXQueryVersionReq); */
xPanoramiXQueryVersionReply rep; xPanoramiXQueryVersionReply rep;
register int n;
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
rep.type = X_Reply; rep.type = X_Reply;
...@@ -945,10 +944,10 @@ ProcPanoramiXQueryVersion (ClientPtr client) ...@@ -945,10 +944,10 @@ ProcPanoramiXQueryVersion (ClientPtr client)
rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION; rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION;
rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION; rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swaps(&rep.majorVersion, n); swaps(&rep.majorVersion);
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion);
} }
WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep);
return (client->noClientException); return (client->noClientException);
...@@ -960,7 +959,6 @@ ProcPanoramiXGetState(ClientPtr client) ...@@ -960,7 +959,6 @@ ProcPanoramiXGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq); REQUEST(xPanoramiXGetStateReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetStateReply rep; xPanoramiXGetStateReply rep;
register int n;
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
pWin = LookupWindow (stuff->window, client); pWin = LookupWindow (stuff->window, client);
...@@ -971,9 +969,9 @@ ProcPanoramiXGetState(ClientPtr client) ...@@ -971,9 +969,9 @@ ProcPanoramiXGetState(ClientPtr client)
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.state = !noPanoramiXExtension; rep.state = !noPanoramiXExtension;
if (client->swapped) { if (client->swapped) {
swaps (&rep.sequenceNumber, n); swaps (&rep.sequenceNumber);
swapl (&rep.length, n); swapl (&rep.length);
swaps (&rep.state, n); swapl ((int* )&rep.state);
} }
WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
return client->noClientException; return client->noClientException;
...@@ -986,7 +984,6 @@ ProcPanoramiXGetScreenCount(ClientPtr client) ...@@ -986,7 +984,6 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
REQUEST(xPanoramiXGetScreenCountReq); REQUEST(xPanoramiXGetScreenCountReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetScreenCountReply rep; xPanoramiXGetScreenCountReply rep;
register int n;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
pWin = LookupWindow (stuff->window, client); pWin = LookupWindow (stuff->window, client);
...@@ -997,9 +994,9 @@ ProcPanoramiXGetScreenCount(ClientPtr client) ...@@ -997,9 +994,9 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.ScreenCount = PanoramiXNumScreens; rep.ScreenCount = PanoramiXNumScreens;
if (client->swapped) { if (client->swapped) {
swaps (&rep.sequenceNumber, n); swaps (&rep.sequenceNumber);
swapl (&rep.length, n); swapl (&rep.length);
swaps (&rep.ScreenCount, n); swapl ((int* )&rep.ScreenCount);
} }
WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep); WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep);
return client->noClientException; return client->noClientException;
...@@ -1011,7 +1008,6 @@ ProcPanoramiXGetScreenSize(ClientPtr client) ...@@ -1011,7 +1008,6 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
REQUEST(xPanoramiXGetScreenSizeReq); REQUEST(xPanoramiXGetScreenSizeReq);
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetScreenSizeReply rep; xPanoramiXGetScreenSizeReply rep;
register int n;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
pWin = LookupWindow (stuff->window, client); pWin = LookupWindow (stuff->window, client);
...@@ -1024,10 +1020,10 @@ ProcPanoramiXGetScreenSize(ClientPtr client) ...@@ -1024,10 +1020,10 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
rep.width = panoramiXdataPtr[stuff->screen].width; rep.width = panoramiXdataPtr[stuff->screen].width;
rep.height = panoramiXdataPtr[stuff->screen].height; rep.height = panoramiXdataPtr[stuff->screen].height;
if (client->swapped) { if (client->swapped) {
swaps (&rep.sequenceNumber, n); swaps (&rep.sequenceNumber);
swapl (&rep.length, n); swapl (&rep.length);
swaps (&rep.width, n); swapl (&rep.width);
swaps (&rep.height, n); swapl (&rep.height);
} }
WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep); WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep);
return client->noClientException; return client->noClientException;
...@@ -1047,10 +1043,9 @@ ProcXineramaIsActive(ClientPtr client) ...@@ -1047,10 +1043,9 @@ ProcXineramaIsActive(ClientPtr client)
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.state = !noPanoramiXExtension; rep.state = !noPanoramiXExtension;
if (client->swapped) { if (client->swapped) {
register int n; swaps (&rep.sequenceNumber);
swaps (&rep.sequenceNumber, n); swapl (&rep.length);
swapl (&rep.length, n); swapl (&rep.state);
swapl (&rep.state, n);
} }
WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep); WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
return client->noClientException; return client->noClientException;
...@@ -1070,10 +1065,9 @@ ProcXineramaQueryScreens(ClientPtr client) ...@@ -1070,10 +1065,9 @@ ProcXineramaQueryScreens(ClientPtr client)
rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens; rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
rep.length = rep.number * sz_XineramaScreenInfo >> 2; rep.length = rep.number * sz_XineramaScreenInfo >> 2;
if (client->swapped) { if (client->swapped) {
register int n; swaps (&rep.sequenceNumber);
swaps (&rep.sequenceNumber, n); swapl (&rep.length);
swapl (&rep.length, n); swapl (&rep.number);
swapl (&rep.number, n);
} }
WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep); WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
...@@ -1088,11 +1082,10 @@ ProcXineramaQueryScreens(ClientPtr client) ...@@ -1088,11 +1082,10 @@ ProcXineramaQueryScreens(ClientPtr client)
scratch.height = panoramiXdataPtr[i].height; scratch.height = panoramiXdataPtr[i].height;
if(client->swapped) { if(client->swapped) {
register int n; swaps (&scratch.x_org);
swaps (&scratch.x_org, n); swaps (&scratch.y_org);
swaps (&scratch.y_org, n); swaps (&scratch.width);
swaps (&scratch.width, n); swaps (&scratch.height);
swaps (&scratch.height, n);
} }
WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch); WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
} }
......
...@@ -57,9 +57,8 @@ static int ...@@ -57,9 +57,8 @@ static int
SProcPanoramiXQueryVersion (ClientPtr client) SProcPanoramiXQueryVersion (ClientPtr client)
{ {
REQUEST(xPanoramiXQueryVersionReq); REQUEST(xPanoramiXQueryVersionReq);
register int n;
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
return ProcPanoramiXQueryVersion(client); return ProcPanoramiXQueryVersion(client);
} }
...@@ -68,9 +67,8 @@ static int ...@@ -68,9 +67,8 @@ static int
SProcPanoramiXGetState(ClientPtr client) SProcPanoramiXGetState(ClientPtr client)
{ {
REQUEST(xPanoramiXGetStateReq); REQUEST(xPanoramiXGetStateReq);
register int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
return ProcPanoramiXGetState(client); return ProcPanoramiXGetState(client);
} }
...@@ -79,9 +77,8 @@ static int ...@@ -79,9 +77,8 @@ static int
SProcPanoramiXGetScreenCount(ClientPtr client) SProcPanoramiXGetScreenCount(ClientPtr client)
{ {
REQUEST(xPanoramiXGetScreenCountReq); REQUEST(xPanoramiXGetScreenCountReq);
register int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
return ProcPanoramiXGetScreenCount(client); return ProcPanoramiXGetScreenCount(client);
} }
...@@ -90,9 +87,8 @@ static int ...@@ -90,9 +87,8 @@ static int
SProcPanoramiXGetScreenSize(ClientPtr client) SProcPanoramiXGetScreenSize(ClientPtr client)
{ {
REQUEST(xPanoramiXGetScreenSizeReq); REQUEST(xPanoramiXGetScreenSizeReq);
register int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
return ProcPanoramiXGetScreenSize(client); return ProcPanoramiXGetScreenSize(client);
} }
...@@ -102,9 +98,8 @@ static int ...@@ -102,9 +98,8 @@ static int
SProcXineramaIsActive(ClientPtr client) SProcXineramaIsActive(ClientPtr client)
{ {
REQUEST(xXineramaIsActiveReq); REQUEST(xXineramaIsActiveReq);
register int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xXineramaIsActiveReq); REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
return ProcXineramaIsActive(client); return ProcXineramaIsActive(client);
} }
...@@ -114,9 +109,8 @@ static int ...@@ -114,9 +109,8 @@ static int
SProcXineramaQueryScreens(ClientPtr client) SProcXineramaQueryScreens(ClientPtr client)
{ {
REQUEST(xXineramaQueryScreensReq); REQUEST(xXineramaQueryScreensReq);
register int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
return ProcXineramaQueryScreens(client); return ProcXineramaQueryScreens(client);
} }
......
...@@ -704,8 +704,8 @@ ProcScreenSaverQueryVersion (client) ...@@ -704,8 +704,8 @@ ProcScreenSaverQueryVersion (client)
rep.majorVersion = SERVER_SAVER_MAJOR_VERSION; rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
rep.minorVersion = SERVER_SAVER_MINOR_VERSION; rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
} }
WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep);
return (client->noClientException); return (client->noClientException);
...@@ -772,12 +772,12 @@ ProcScreenSaverQueryInfo (client) ...@@ -772,12 +772,12 @@ ProcScreenSaverQueryInfo (client)
rep.kind = ScreenSaverInternal; rep.kind = ScreenSaverInternal;
if (client->swapped) if (client->swapped)
{ {
swaps (&rep.sequenceNumber, n); swaps (&rep.sequenceNumber);
swapl (&rep.length, n); swapl (&rep.length);
swapl (&rep.window, n); swapl (&rep.window);
swapl (&rep.tilOrSince, n); swapl (&rep.tilOrSince);
swapl (&rep.idle, n); swapl (&rep.idle);
swapl (&rep.eventMask, n); swapl (&rep.eventMask);
} }
WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep); WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep);
return (client->noClientException); return (client->noClientException);
...@@ -1331,7 +1331,7 @@ SProcScreenSaverQueryVersion (client) ...@@ -1331,7 +1331,7 @@ SProcScreenSaverQueryVersion (client)
REQUEST(xScreenSaverQueryVersionReq); REQUEST(xScreenSaverQueryVersionReq);
int n; int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq); REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
return ProcScreenSaverQueryVersion (client); return ProcScreenSaverQueryVersion (client);
} }
...@@ -1343,9 +1343,9 @@ SProcScreenSaverQueryInfo (client) ...@@ -1343,9 +1343,9 @@ SProcScreenSaverQueryInfo (client)
REQUEST(xScreenSaverQueryInfoReq); REQUEST(xScreenSaverQueryInfoReq);
int n; int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq); REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
swapl (&stuff->drawable, n); swapl (&stuff->drawable);
return ProcScreenSaverQueryInfo (client); return ProcScreenSaverQueryInfo (client);
} }
...@@ -1356,10 +1356,10 @@ SProcScreenSaverSelectInput (client) ...@@ -1356,10 +1356,10 @@ SProcScreenSaverSelectInput (client)
REQUEST(xScreenSaverSelectInputReq); REQUEST(xScreenSaverSelectInputReq);
int n; int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq); REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
swapl (&stuff->drawable, n); swapl (&stuff->drawable);
swapl (&stuff->eventMask, n); swapl (&stuff->eventMask);
return ProcScreenSaverSelectInput (client); return ProcScreenSaverSelectInput (client);
} }
...@@ -1370,16 +1370,16 @@ SProcScreenSaverSetAttributes (client) ...@@ -1370,16 +1370,16 @@ SProcScreenSaverSetAttributes (client)
REQUEST(xScreenSaverSetAttributesReq); REQUEST(xScreenSaverSetAttributesReq);
int n; int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
swapl (&stuff->drawable, n); swapl (&stuff->drawable);
swaps (&stuff->x, n); swaps (&stuff->x);
swaps (&stuff->y, n); swaps (&stuff->y);
swaps (&stuff->width, n); swaps (&stuff->width);
swaps (&stuff->height, n); swaps (&stuff->height);
swaps (&stuff->borderWidth, n); swaps (&stuff->borderWidth);
swapl (&stuff->visualID, n); swapl (&stuff->visualID);
swapl (&stuff->mask, n); swapl (&stuff->mask);
SwapRestL(stuff); SwapRestL(stuff);
return ProcScreenSaverSetAttributes (client); return ProcScreenSaverSetAttributes (client);
} }
...@@ -1391,9 +1391,9 @@ SProcScreenSaverUnsetAttributes (client) ...@@ -1391,9 +1391,9 @@ SProcScreenSaverUnsetAttributes (client)
REQUEST(xScreenSaverUnsetAttributesReq); REQUEST(xScreenSaverUnsetAttributesReq);
int n; int n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq); REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
swapl (&stuff->drawable, n); swapl (&stuff->drawable);
return ProcScreenSaverUnsetAttributes (client); return ProcScreenSaverUnsetAttributes (client);
} }
......
...@@ -491,10 +491,9 @@ ProcSecurityQueryVersion( ...@@ -491,10 +491,9 @@ ProcSecurityQueryVersion(
rep.minorVersion = SERVER_SECURITY_MINOR_VERSION; rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
if(client->swapped) if(client->swapped)
{ {
register char n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber, n); swaps(&rep.majorVersion);
swaps(&rep.majorVersion, n); swaps(&rep.minorVersion);
swaps(&rep.minorVersion, n);
} }
(void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
(char *)&rep); (char *)&rep);
...@@ -709,11 +708,10 @@ ProcSecurityGenerateAuthorization( ...@@ -709,11 +708,10 @@ ProcSecurityGenerateAuthorization(
if (client->swapped) if (client->swapped)
{ {
register char n; swapl(&rep.length);
swapl(&rep.length, n); swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber, n); swapl(&rep.authId);
swapl(&rep.authId, n); swaps(&rep.dataLength);
swaps(&rep.dataLength, n);
} }
WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
...@@ -788,12 +786,11 @@ SProcSecurityQueryVersion( ...@@ -788,12 +786,11 @@ SProcSecurityQueryVersion(
ClientPtr client) ClientPtr client)
{ {
REQUEST(xSecurityQueryVersionReq); REQUEST(xSecurityQueryVersionReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
swaps(&stuff->majorVersion, n); swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion,n); swaps(&stuff->minorVersion);
return ProcSecurityQueryVersion(client); return ProcSecurityQueryVersion(client);
} /* SProcSecurityQueryVersion */ } /* SProcSecurityQueryVersion */
...@@ -803,16 +800,15 @@ SProcSecurityGenerateAuthorization( ...@@ -803,16 +800,15 @@ SProcSecurityGenerateAuthorization(
ClientPtr client) ClientPtr client)
{ {
REQUEST(xSecurityGenerateAuthorizationReq); REQUEST(xSecurityGenerateAuthorizationReq);
register char n;
CARD32 *values; CARD32 *values;
unsigned long nvalues; unsigned long nvalues;
int values_offset; int values_offset;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq); REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
swaps(&stuff->nbytesAuthProto, n); swaps(&stuff->nbytesAuthProto);
swaps(&stuff->nbytesAuthData, n); swaps(&stuff->nbytesAuthData);
swapl(&stuff->valueMask, n); swapl(&stuff->valueMask);
values_offset = ((stuff->nbytesAuthProto + (unsigned)3) >> 2) + values_offset = ((stuff->nbytesAuthProto + (unsigned)3) >> 2) +
((stuff->nbytesAuthData + (unsigned)3) >> 2); ((stuff->nbytesAuthData + (unsigned)3) >> 2);
if (values_offset > if (values_offset >
...@@ -830,11 +826,10 @@ SProcSecurityRevokeAuthorization( ...@@ -830,11 +826,10 @@ SProcSecurityRevokeAuthorization(
ClientPtr client) ClientPtr client)
{ {
REQUEST(xSecurityRevokeAuthorizationReq); REQUEST(xSecurityRevokeAuthorizationReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
swapl(&stuff->authId, n); swapl(&stuff->authId);
return ProcSecurityRevokeAuthorization(client); return ProcSecurityRevokeAuthorization(client);
} /* SProcSecurityRevokeAuthorization */ } /* SProcSecurityRevokeAuthorization */
......
...@@ -289,7 +289,6 @@ ProcShapeQueryVersion (client) ...@@ -289,7 +289,6 @@ ProcShapeQueryVersion (client)
register ClientPtr client; register ClientPtr client;
{ {
xShapeQueryVersionReply rep; xShapeQueryVersionReply rep;
register int n;
REQUEST_SIZE_MATCH (xShapeQueryVersionReq); REQUEST_SIZE_MATCH (xShapeQueryVersionReq);
memset(&rep, 0, sizeof(xShapeQueryVersionReply)); memset(&rep, 0, sizeof(xShapeQueryVersionReply));
...@@ -299,10 +298,10 @@ ProcShapeQueryVersion (client) ...@@ -299,10 +298,10 @@ ProcShapeQueryVersion (client)
rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION; rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
rep.minorVersion = SERVER_SHAPE_MINOR_VERSION; rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swaps(&rep.majorVersion, n); swaps(&rep.majorVersion);
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion);
} }
WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep);
return (client->noClientException); return (client->noClientException);
...@@ -714,7 +713,6 @@ ProcShapeQueryExtents (client) ...@@ -714,7 +713,6 @@ ProcShapeQueryExtents (client)
WindowPtr pWin; WindowPtr pWin;
xShapeQueryExtentsReply rep; xShapeQueryExtentsReply rep;
BoxRec extents, *pExtents; BoxRec extents, *pExtents;
register int n;
RegionPtr region; RegionPtr region;
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq); REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
...@@ -756,16 +754,16 @@ ProcShapeQueryExtents (client) ...@@ -756,16 +754,16 @@ ProcShapeQueryExtents (client)
rep.widthClipShape = extents.x2 - extents.x1; rep.widthClipShape = extents.x2 - extents.x1;
rep.heightClipShape = extents.y2 - extents.y1; rep.heightClipShape = extents.y2 - extents.y1;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swaps(&rep.xBoundingShape, n); swaps(&rep.xBoundingShape);
swaps(&rep.yBoundingShape, n); swaps(&rep.yBoundingShape);
swaps(&rep.widthBoundingShape, n); swaps(&rep.widthBoundingShape);
swaps(&rep.heightBoundingShape, n); swaps(&rep.heightBoundingShape);
swaps(&rep.xClipShape, n); swaps(&rep.xClipShape);
swaps(&rep.yClipShape, n); swaps(&rep.yClipShape);
swaps(&rep.widthClipShape, n); swaps(&rep.widthClipShape);
swaps(&rep.heightClipShape, n); swaps(&rep.heightClipShape);
} }
WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep); WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep);
return (client->noClientException); return (client->noClientException);
...@@ -998,7 +996,6 @@ ProcShapeInputSelected (client) ...@@ -998,7 +996,6 @@ ProcShapeInputSelected (client)
ShapeEventPtr pShapeEvent, *pHead; ShapeEventPtr pShapeEvent, *pHead;
int enabled; int enabled;
xShapeInputSelectedReply rep; xShapeInputSelectedReply rep;
register int n;
REQUEST_SIZE_MATCH (xShapeInputSelectedReq); REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
pWin = LookupWindow (stuff->window, client); pWin = LookupWindow (stuff->window, client);
...@@ -1023,8 +1020,8 @@ ProcShapeInputSelected (client) ...@@ -1023,8 +1020,8 @@ ProcShapeInputSelected (client)
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.enabled = enabled; rep.enabled = enabled;
if (client->swapped) { if (client->swapped) {
swaps (&rep.sequenceNumber, n); swaps (&rep.sequenceNumber);
swapl (&rep.length, n); swapl (&rep.length);
} }
WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep); WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep);
return (client->noClientException); return (client->noClientException);
...@@ -1040,7 +1037,6 @@ ProcShapeGetRectangles (client) ...@@ -1040,7 +1037,6 @@ ProcShapeGetRectangles (client)
xRectangle *rects; xRectangle *rects;
int nrects, i; int nrects, i;
RegionPtr region; RegionPtr region;
register int n;
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq); REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
pWin = LookupWindow (stuff->window, client); pWin = LookupWindow (stuff->window, client);
...@@ -1105,9 +1101,9 @@ ProcShapeGetRectangles (client) ...@@ -1105,9 +1101,9 @@ ProcShapeGetRectangles (client)
rep.ordering = YXBanded; rep.ordering = YXBanded;
rep.nrects = nrects; rep.nrects = nrects;
if (client->swapped) { if (client->swapped) {
swaps (&rep.sequenceNumber, n); swaps (&rep.sequenceNumber);
swapl (&rep.length, n); swapl (&rep.length);
swapl (&rep.nrects, n); swapl (&rep.nrects);
SwapShorts ((short *)rects, (unsigned long)nrects * 4); SwapShorts ((short *)rects, (unsigned long)nrects * 4);
} }
WriteToClient (client, sizeof (rep), (char *) &rep); WriteToClient (client, sizeof (rep), (char *) &rep);
...@@ -1185,10 +1181,9 @@ static int ...@@ -1185,10 +1181,9 @@ static int
SProcShapeQueryVersion (client) SProcShapeQueryVersion (client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST (xShapeQueryVersionReq); REQUEST (xShapeQueryVersionReq);
swaps (&stuff->length, n); swaps (&stuff->length);
return ProcShapeQueryVersion (client); return ProcShapeQueryVersion (client);
} }
...@@ -1196,14 +1191,13 @@ static int ...@@ -1196,14 +1191,13 @@ static int
SProcShapeRectangles (client) SProcShapeRectangles (client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST (xShapeRectanglesReq); REQUEST (xShapeRectanglesReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq); REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
swapl (&stuff->dest, n); swapl (&stuff->dest);
swaps (&stuff->xOff, n); swaps (&stuff->xOff);
swaps (&stuff->yOff, n); swaps (&stuff->yOff);
SwapRestS(stuff); SwapRestS(stuff);
return ProcShapeRectangles (client); return ProcShapeRectangles (client);
} }
...@@ -1212,15 +1206,14 @@ static int ...@@ -1212,15 +1206,14 @@ static int
SProcShapeMask (client) SProcShapeMask (client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST (xShapeMaskReq); REQUEST (xShapeMaskReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeMaskReq); REQUEST_SIZE_MATCH (xShapeMaskReq);
swapl (&stuff->dest, n); swapl (&stuff->dest);
swaps (&stuff->xOff, n); swaps (&stuff->xOff);
swaps (&stuff->yOff, n); swaps (&stuff->yOff);
swapl (&stuff->src, n); swapl (&stuff->src);
return ProcShapeMask (client); return ProcShapeMask (client);
} }
...@@ -1228,15 +1221,14 @@ static int ...@@ -1228,15 +1221,14 @@ static int
SProcShapeCombine (client) SProcShapeCombine (client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST (xShapeCombineReq); REQUEST (xShapeCombineReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeCombineReq); REQUEST_SIZE_MATCH (xShapeCombineReq);
swapl (&stuff->dest, n); swapl (&stuff->dest);
swaps (&stuff->xOff, n); swaps (&stuff->xOff);
swaps (&stuff->yOff, n); swaps (&stuff->yOff);
swapl (&stuff->src, n); swapl (&stuff->src);
return ProcShapeCombine (client); return ProcShapeCombine (client);
} }
...@@ -1244,14 +1236,13 @@ static int ...@@ -1244,14 +1236,13 @@ static int
SProcShapeOffset (client) SProcShapeOffset (client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST (xShapeOffsetReq); REQUEST (xShapeOffsetReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeOffsetReq); REQUEST_SIZE_MATCH (xShapeOffsetReq);
swapl (&stuff->dest, n); swapl (&stuff->dest);
swaps (&stuff->xOff, n); swaps (&stuff->xOff);
swaps (&stuff->yOff, n); swaps (&stuff->yOff);
return ProcShapeOffset (client); return ProcShapeOffset (client);
} }
...@@ -1259,12 +1250,11 @@ static int ...@@ -1259,12 +1250,11 @@ static int
SProcShapeQueryExtents (client) SProcShapeQueryExtents (client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST (xShapeQueryExtentsReq); REQUEST (xShapeQueryExtentsReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq); REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
swapl (&stuff->window, n); swapl (&stuff->window);
return ProcShapeQueryExtents (client); return ProcShapeQueryExtents (client);
} }
...@@ -1272,12 +1262,11 @@ static int ...@@ -1272,12 +1262,11 @@ static int
SProcShapeSelectInput (client) SProcShapeSelectInput (client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST (xShapeSelectInputReq); REQUEST (xShapeSelectInputReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeSelectInputReq); REQUEST_SIZE_MATCH (xShapeSelectInputReq);
swapl (&stuff->window, n); swapl (&stuff->window);
return ProcShapeSelectInput (client); return ProcShapeSelectInput (client);
} }
...@@ -1285,12 +1274,11 @@ static int ...@@ -1285,12 +1274,11 @@ static int
SProcShapeInputSelected (client) SProcShapeInputSelected (client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST (xShapeInputSelectedReq); REQUEST (xShapeInputSelectedReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeInputSelectedReq); REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
swapl (&stuff->window, n); swapl (&stuff->window);
return ProcShapeInputSelected (client); return ProcShapeInputSelected (client);
} }
...@@ -1299,11 +1287,10 @@ SProcShapeGetRectangles (client) ...@@ -1299,11 +1287,10 @@ SProcShapeGetRectangles (client)
register ClientPtr client; register ClientPtr client;
{ {
REQUEST(xShapeGetRectanglesReq); REQUEST(xShapeGetRectanglesReq);
register char n;
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq); REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
swapl (&stuff->window, n); swapl (&stuff->window);
return ProcShapeGetRectangles (client); return ProcShapeGetRectangles (client);
} }
......
...@@ -346,7 +346,6 @@ ProcShmQueryVersion(client) ...@@ -346,7 +346,6 @@ ProcShmQueryVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
xShmQueryVersionReply rep; xShmQueryVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xShmQueryVersionReq); REQUEST_SIZE_MATCH(xShmQueryVersionReq);
memset(&rep, 0, sizeof(xShmQueryVersionReply)); memset(&rep, 0, sizeof(xShmQueryVersionReply));
...@@ -360,12 +359,12 @@ ProcShmQueryVersion(client) ...@@ -360,12 +359,12 @@ ProcShmQueryVersion(client)
rep.uid = geteuid(); rep.uid = geteuid();
rep.gid = getegid(); rep.gid = getegid();
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swaps(&rep.majorVersion, n); swaps(&rep.majorVersion);
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion);
swaps(&rep.uid, n); swaps(&rep.uid);
swaps(&rep.gid, n); swaps(&rep.gid);
} }
WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep);
return (client->noClientException); return (client->noClientException);
...@@ -712,11 +711,10 @@ ProcPanoramiXShmGetImage(ClientPtr client) ...@@ -712,11 +711,10 @@ ProcPanoramiXShmGetImage(ClientPtr client)
} }
if (client->swapped) { if (client->swapped) {
register int n; swaps(&xgi.sequenceNumber);
swaps(&xgi.sequenceNumber, n); swapl(&xgi.length);
swapl(&xgi.length, n); swapl(&xgi.visual);
swapl(&xgi.visual, n); swapl(&xgi.size);
swapl(&xgi.size, n);
} }
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
...@@ -952,7 +950,6 @@ ProcShmGetImage(client) ...@@ -952,7 +950,6 @@ ProcShmGetImage(client)
Mask plane = 0; Mask plane = 0;
xShmGetImageReply xgi; xShmGetImageReply xgi;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
int n;
REQUEST(xShmGetImageReq); REQUEST(xShmGetImageReq);
...@@ -1043,10 +1040,10 @@ ProcShmGetImage(client) ...@@ -1043,10 +1040,10 @@ ProcShmGetImage(client)
} }
if (client->swapped) { if (client->swapped) {
swaps(&xgi.sequenceNumber, n); swaps(&xgi.sequenceNumber);
swapl(&xgi.length, n); swapl(&xgi.length);
swapl(&xgi.visual, n); swapl(&xgi.visual);
swapl(&xgi.size, n); swapl(&xgi.size);
} }
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
...@@ -1205,10 +1202,9 @@ static int ...@@ -1205,10 +1202,9 @@ static int
SProcShmQueryVersion(client) SProcShmQueryVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST(xShmQueryVersionReq); REQUEST(xShmQueryVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return ProcShmQueryVersion(client); return ProcShmQueryVersion(client);
} }
...@@ -1216,12 +1212,11 @@ static int ...@@ -1216,12 +1212,11 @@ static int
SProcShmAttach(client) SProcShmAttach(client)
ClientPtr client; ClientPtr client;
{ {
register int n;
REQUEST(xShmAttachReq); REQUEST(xShmAttachReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmAttachReq); REQUEST_SIZE_MATCH(xShmAttachReq);
swapl(&stuff->shmseg, n); swapl(&stuff->shmseg);
swapl(&stuff->shmid, n); swapl(&stuff->shmid);
return ProcShmAttach(client); return ProcShmAttach(client);
} }
...@@ -1229,11 +1224,10 @@ static int ...@@ -1229,11 +1224,10 @@ static int
SProcShmDetach(client) SProcShmDetach(client)
ClientPtr client; ClientPtr client;
{ {
register int n;
REQUEST(xShmDetachReq); REQUEST(xShmDetachReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmDetachReq); REQUEST_SIZE_MATCH(xShmDetachReq);
swapl(&stuff->shmseg, n); swapl(&stuff->shmseg);
return ProcShmDetach(client); return ProcShmDetach(client);
} }
...@@ -1241,22 +1235,21 @@ static int ...@@ -1241,22 +1235,21 @@ static int
SProcShmPutImage(client) SProcShmPutImage(client)
ClientPtr client; ClientPtr client;
{ {
register int n;
REQUEST(xShmPutImageReq); REQUEST(xShmPutImageReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmPutImageReq); REQUEST_SIZE_MATCH(xShmPutImageReq);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->totalWidth, n); swaps(&stuff->totalWidth);
swaps(&stuff->totalHeight, n); swaps(&stuff->totalHeight);
swaps(&stuff->srcX, n); swaps(&stuff->srcX);
swaps(&stuff->srcY, n); swaps(&stuff->srcY);
swaps(&stuff->srcWidth, n); swaps(&stuff->srcWidth);
swaps(&stuff->srcHeight, n); swaps(&stuff->srcHeight);
swaps(&stuff->dstX, n); swaps(&stuff->dstX);
swaps(&stuff->dstY, n); swaps(&stuff->dstY);
swapl(&stuff->shmseg, n); swapl(&stuff->shmseg);
swapl(&stuff->offset, n); swapl(&stuff->offset);
return ProcShmPutImage(client); return ProcShmPutImage(client);
} }
...@@ -1264,18 +1257,17 @@ static int ...@@ -1264,18 +1257,17 @@ static int
SProcShmGetImage(client) SProcShmGetImage(client)
ClientPtr client; ClientPtr client;
{ {
register int n;
REQUEST(xShmGetImageReq); REQUEST(xShmGetImageReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmGetImageReq); REQUEST_SIZE_MATCH(xShmGetImageReq);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
swapl(&stuff->planeMask, n); swapl(&stuff->planeMask);
swapl(&stuff->shmseg, n); swapl(&stuff->shmseg);
swapl(&stuff->offset, n); swapl(&stuff->offset);
return ProcShmGetImage(client); return ProcShmGetImage(client);
} }
...@@ -1283,16 +1275,15 @@ static int ...@@ -1283,16 +1275,15 @@ static int
SProcShmCreatePixmap(client) SProcShmCreatePixmap(client)
ClientPtr client; ClientPtr client;
{ {
register int n;
REQUEST(xShmCreatePixmapReq); REQUEST(xShmCreatePixmapReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq); REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
swapl(&stuff->pid, n); swapl(&stuff->pid);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
swapl(&stuff->shmseg, n); swapl(&stuff->shmseg);
swapl(&stuff->offset, n); swapl(&stuff->offset);
return ProcShmCreatePixmap(client); return ProcShmCreatePixmap(client);
} }
......
...@@ -1343,7 +1343,6 @@ ProcSyncInitialize(client) ...@@ -1343,7 +1343,6 @@ ProcSyncInitialize(client)
ClientPtr client; ClientPtr client;
{ {
xSyncInitializeReply rep; xSyncInitializeReply rep;
int n;
REQUEST_SIZE_MATCH(xSyncInitializeReq); REQUEST_SIZE_MATCH(xSyncInitializeReq);
...@@ -1356,7 +1355,7 @@ ProcSyncInitialize(client) ...@@ -1356,7 +1355,7 @@ ProcSyncInitialize(client)
if (client->swapped) if (client->swapped)
{ {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
} }
WriteToClient(client, sizeof(rep), (char *) &rep); WriteToClient(client, sizeof(rep), (char *) &rep);
return (client->noClientException); return (client->noClientException);
...@@ -1397,10 +1396,9 @@ ProcSyncListSystemCounters(client) ...@@ -1397,10 +1396,9 @@ ProcSyncListSystemCounters(client)
if (client->swapped) if (client->swapped)
{ {
register char n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber, n); swapl(&rep.length);
swapl(&rep.length, n); swapl(&rep.nCounters);
swapl(&rep.nCounters, n);
} }
for (i = 0; i < SyncNumSystemCounters; i++) for (i = 0; i < SyncNumSystemCounters; i++)
...@@ -1417,11 +1415,10 @@ ProcSyncListSystemCounters(client) ...@@ -1417,11 +1415,10 @@ ProcSyncListSystemCounters(client)
if (client->swapped) if (client->swapped)
{ {
register char n; swapl(&walklist->counter);
swapl(&walklist->counter, n); swapl(&walklist->resolution_hi);
swapl(&walklist->resolution_hi, n); swapl(&walklist->resolution_lo);
swapl(&walklist->resolution_lo, n); swaps(&walklist->name_length);
swaps(&walklist->name_length, n);
} }
pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter; pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter;
...@@ -1502,9 +1499,8 @@ ProcSyncGetPriority(client) ...@@ -1502,9 +1499,8 @@ ProcSyncGetPriority(client)
if (client->swapped) if (client->swapped)
{ {
register char n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber, n); swapl(&rep.priority);
swapl(&rep.priority, n);
} }
WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep); WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
...@@ -1787,11 +1783,10 @@ ProcSyncQueryCounter(client) ...@@ -1787,11 +1783,10 @@ ProcSyncQueryCounter(client)
rep.value_lo = XSyncValueLow32(pCounter->value); rep.value_lo = XSyncValueLow32(pCounter->value);
if (client->swapped) if (client->swapped)
{ {
register char n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber, n); swapl(&rep.length);
swapl(&rep.length, n); swapl(&rep.value_hi);
swapl(&rep.value_hi, n); swapl(&rep.value_lo);
swapl(&rep.value_lo, n);
} }
WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep); WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
return (client->noClientException); return (client->noClientException);
...@@ -1969,15 +1964,14 @@ ProcSyncQueryAlarm(client) ...@@ -1969,15 +1964,14 @@ ProcSyncQueryAlarm(client)
if (client->swapped) if (client->swapped)
{ {
register char n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber, n); swapl(&rep.length);
swapl(&rep.length, n); swapl(&rep.counter);
swapl(&rep.counter, n); swapl(&rep.wait_value_hi);
swapl(&rep.wait_value_hi, n); swapl(&rep.wait_value_lo);
swapl(&rep.wait_value_lo, n); swapl(&rep.test_type);
swapl(&rep.test_type, n); swapl(&rep.delta_hi);
swapl(&rep.delta_hi, n); swapl(&rep.delta_lo);
swapl(&rep.delta_lo, n);
} }
WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep); WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
...@@ -2058,9 +2052,8 @@ SProcSyncInitialize(client) ...@@ -2058,9 +2052,8 @@ SProcSyncInitialize(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncInitializeReq); REQUEST(xSyncInitializeReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncInitializeReq); REQUEST_SIZE_MATCH (xSyncInitializeReq);
return ProcSyncInitialize(client); return ProcSyncInitialize(client);
...@@ -2071,9 +2064,8 @@ SProcSyncListSystemCounters(client) ...@@ -2071,9 +2064,8 @@ SProcSyncListSystemCounters(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncListSystemCountersReq); REQUEST(xSyncListSystemCountersReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncListSystemCountersReq); REQUEST_SIZE_MATCH (xSyncListSystemCountersReq);
return ProcSyncListSystemCounters(client); return ProcSyncListSystemCounters(client);
...@@ -2084,13 +2076,12 @@ SProcSyncCreateCounter(client) ...@@ -2084,13 +2076,12 @@ SProcSyncCreateCounter(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncCreateCounterReq); REQUEST(xSyncCreateCounterReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncCreateCounterReq); REQUEST_SIZE_MATCH (xSyncCreateCounterReq);
swapl(&stuff->cid, n); swapl(&stuff->cid);
swapl(&stuff->initial_value_lo, n); swapl(&stuff->initial_value_lo);
swapl(&stuff->initial_value_hi, n); swapl(&stuff->initial_value_hi);
return ProcSyncCreateCounter(client); return ProcSyncCreateCounter(client);
} }
...@@ -2100,13 +2091,12 @@ SProcSyncSetCounter(client) ...@@ -2100,13 +2091,12 @@ SProcSyncSetCounter(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncSetCounterReq); REQUEST(xSyncSetCounterReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncSetCounterReq); REQUEST_SIZE_MATCH (xSyncSetCounterReq);
swapl(&stuff->cid, n); swapl(&stuff->cid);
swapl(&stuff->value_lo, n); swapl(&stuff->value_lo);
swapl(&stuff->value_hi, n); swapl(&stuff->value_hi);
return ProcSyncSetCounter(client); return ProcSyncSetCounter(client);
} }
...@@ -2116,13 +2106,12 @@ SProcSyncChangeCounter(client) ...@@ -2116,13 +2106,12 @@ SProcSyncChangeCounter(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncChangeCounterReq); REQUEST(xSyncChangeCounterReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncChangeCounterReq); REQUEST_SIZE_MATCH (xSyncChangeCounterReq);
swapl(&stuff->cid, n); swapl(&stuff->cid);
swapl(&stuff->value_lo, n); swapl(&stuff->value_lo);
swapl(&stuff->value_hi, n); swapl(&stuff->value_hi);
return ProcSyncChangeCounter(client); return ProcSyncChangeCounter(client);
} }
...@@ -2132,11 +2121,10 @@ SProcSyncQueryCounter(client) ...@@ -2132,11 +2121,10 @@ SProcSyncQueryCounter(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncQueryCounterReq); REQUEST(xSyncQueryCounterReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncQueryCounterReq); REQUEST_SIZE_MATCH (xSyncQueryCounterReq);
swapl(&stuff->counter, n); swapl(&stuff->counter);
return ProcSyncQueryCounter(client); return ProcSyncQueryCounter(client);
} }
...@@ -2146,11 +2134,10 @@ SProcSyncDestroyCounter(client) ...@@ -2146,11 +2134,10 @@ SProcSyncDestroyCounter(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncDestroyCounterReq); REQUEST(xSyncDestroyCounterReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncDestroyCounterReq); REQUEST_SIZE_MATCH (xSyncDestroyCounterReq);
swapl(&stuff->counter, n); swapl(&stuff->counter);
return ProcSyncDestroyCounter(client); return ProcSyncDestroyCounter(client);
} }
...@@ -2160,9 +2147,8 @@ SProcSyncAwait(client) ...@@ -2160,9 +2147,8 @@ SProcSyncAwait(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncAwaitReq); REQUEST(xSyncAwaitReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq); REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
SwapRestL(stuff); SwapRestL(stuff);
...@@ -2175,12 +2161,11 @@ SProcSyncCreateAlarm(client) ...@@ -2175,12 +2161,11 @@ SProcSyncCreateAlarm(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncCreateAlarmReq); REQUEST(xSyncCreateAlarmReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq); REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
swapl(&stuff->id, n); swapl(&stuff->id);
swapl(&stuff->valueMask, n); swapl(&stuff->valueMask);
SwapRestL(stuff); SwapRestL(stuff);
return ProcSyncCreateAlarm(client); return ProcSyncCreateAlarm(client);
...@@ -2191,12 +2176,11 @@ SProcSyncChangeAlarm(client) ...@@ -2191,12 +2176,11 @@ SProcSyncChangeAlarm(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncChangeAlarmReq); REQUEST(xSyncChangeAlarmReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
swapl(&stuff->alarm, n); swapl(&stuff->alarm);
swapl(&stuff->valueMask, n); swapl(&stuff->valueMask);
SwapRestL(stuff); SwapRestL(stuff);
return ProcSyncChangeAlarm(client); return ProcSyncChangeAlarm(client);
} }
...@@ -2206,11 +2190,10 @@ SProcSyncQueryAlarm(client) ...@@ -2206,11 +2190,10 @@ SProcSyncQueryAlarm(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncQueryAlarmReq); REQUEST(xSyncQueryAlarmReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncQueryAlarmReq); REQUEST_SIZE_MATCH (xSyncQueryAlarmReq);
swapl(&stuff->alarm, n); swapl(&stuff->alarm);
return ProcSyncQueryAlarm(client); return ProcSyncQueryAlarm(client);
} }
...@@ -2220,11 +2203,10 @@ SProcSyncDestroyAlarm(client) ...@@ -2220,11 +2203,10 @@ SProcSyncDestroyAlarm(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncDestroyAlarmReq); REQUEST(xSyncDestroyAlarmReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq); REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq);
swapl(&stuff->alarm, n); swapl(&stuff->alarm);
return ProcSyncDestroyAlarm(client); return ProcSyncDestroyAlarm(client);
} }
...@@ -2234,12 +2216,11 @@ SProcSyncSetPriority(client) ...@@ -2234,12 +2216,11 @@ SProcSyncSetPriority(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncSetPriorityReq); REQUEST(xSyncSetPriorityReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncSetPriorityReq); REQUEST_SIZE_MATCH (xSyncSetPriorityReq);
swapl(&stuff->id, n); swapl(&stuff->id);
swapl(&stuff->priority, n); swapl(&stuff->priority);
return ProcSyncSetPriority(client); return ProcSyncSetPriority(client);
} }
...@@ -2249,11 +2230,10 @@ SProcSyncGetPriority(client) ...@@ -2249,11 +2230,10 @@ SProcSyncGetPriority(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xSyncGetPriorityReq); REQUEST(xSyncGetPriorityReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncGetPriorityReq); REQUEST_SIZE_MATCH (xSyncGetPriorityReq);
swapl(&stuff->id, n); swapl(&stuff->id);
return ProcSyncGetPriority(client); return ProcSyncGetPriority(client);
} }
......
...@@ -98,7 +98,6 @@ ProcXCMiscGetVersion(client) ...@@ -98,7 +98,6 @@ ProcXCMiscGetVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
xXCMiscGetVersionReply rep; xXCMiscGetVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq); REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
rep.type = X_Reply; rep.type = X_Reply;
...@@ -107,9 +106,9 @@ ProcXCMiscGetVersion(client) ...@@ -107,9 +106,9 @@ ProcXCMiscGetVersion(client)
rep.majorVersion = XCMiscMajorVersion; rep.majorVersion = XCMiscMajorVersion;
rep.minorVersion = XCMiscMinorVersion; rep.minorVersion = XCMiscMinorVersion;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swaps(&rep.majorVersion, n); swaps(&rep.majorVersion);
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -120,7 +119,6 @@ ProcXCMiscGetXIDRange(client) ...@@ -120,7 +119,6 @@ ProcXCMiscGetXIDRange(client)
register ClientPtr client; register ClientPtr client;
{ {
xXCMiscGetXIDRangeReply rep; xXCMiscGetXIDRangeReply rep;
register int n;
XID min_id, max_id; XID min_id, max_id;
REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq); REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
...@@ -131,9 +129,9 @@ ProcXCMiscGetXIDRange(client) ...@@ -131,9 +129,9 @@ ProcXCMiscGetXIDRange(client)
rep.start_id = min_id; rep.start_id = min_id;
rep.count = max_id - min_id + 1; rep.count = max_id - min_id + 1;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.start_id, n); swapl(&rep.start_id);
swapl(&rep.count, n); swapl(&rep.count);
} }
WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep); WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -145,7 +143,6 @@ ProcXCMiscGetXIDList(client) ...@@ -145,7 +143,6 @@ ProcXCMiscGetXIDList(client)
{ {
REQUEST(xXCMiscGetXIDListReq); REQUEST(xXCMiscGetXIDListReq);
xXCMiscGetXIDListReply rep; xXCMiscGetXIDListReply rep;
register int n;
XID *pids; XID *pids;
unsigned int count; unsigned int count;
...@@ -165,9 +162,9 @@ ProcXCMiscGetXIDList(client) ...@@ -165,9 +162,9 @@ ProcXCMiscGetXIDList(client)
rep.length = count; rep.length = count;
rep.count = count; rep.count = count;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.count, n); swapl(&rep.count);
} }
WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep); WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep);
if (count) if (count)
...@@ -201,13 +198,12 @@ static int ...@@ -201,13 +198,12 @@ static int
SProcXCMiscGetVersion(client) SProcXCMiscGetVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST(xXCMiscGetVersionReq); REQUEST(xXCMiscGetVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq); REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
swaps(&stuff->majorVersion, n); swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion, n); swaps(&stuff->minorVersion);
return ProcXCMiscGetVersion(client); return ProcXCMiscGetVersion(client);
} }
...@@ -215,10 +211,9 @@ static int ...@@ -215,10 +211,9 @@ static int
SProcXCMiscGetXIDRange(client) SProcXCMiscGetXIDRange(client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST(xReq); REQUEST(xReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return ProcXCMiscGetXIDRange(client); return ProcXCMiscGetXIDRange(client);
} }
...@@ -226,12 +221,11 @@ static int ...@@ -226,12 +221,11 @@ static int
SProcXCMiscGetXIDList(client) SProcXCMiscGetXIDList(client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST(xXCMiscGetXIDListReq); REQUEST(xXCMiscGetXIDListReq);
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq); REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->count, n); swapl(&stuff->count);
return ProcXCMiscGetXIDList(client); return ProcXCMiscGetXIDList(client);
} }
......
...@@ -375,14 +375,13 @@ ProcXF86BigfontQueryVersion( ...@@ -375,14 +375,13 @@ ProcXF86BigfontQueryVersion(
#endif #endif
; /* may add more bits here in future versions */ ; /* may add more bits here in future versions */
if (client->swapped) { if (client->swapped) {
char tmp; swaps(&reply.sequenceNumber);
swaps(&reply.sequenceNumber, tmp); swapl(&reply.length);
swapl(&reply.length, tmp); swaps(&reply.majorVersion);
swaps(&reply.majorVersion, tmp); swaps(&reply.minorVersion);
swaps(&reply.minorVersion, tmp); swapl(&reply.uid);
swapl(&reply.uid, tmp); swapl(&reply.gid);
swapl(&reply.gid, tmp); swapl(&reply.signature);
swapl(&reply.signature, tmp);
} }
WriteToClient(client, WriteToClient(client,
sizeof(xXF86BigfontQueryVersionReply), (char *)&reply); sizeof(xXF86BigfontQueryVersionReply), (char *)&reply);
...@@ -393,14 +392,12 @@ static void ...@@ -393,14 +392,12 @@ static void
swapCharInfo( swapCharInfo(
xCharInfo *pCI) xCharInfo *pCI)
{ {
char tmp; swaps(&pCI->leftSideBearing);
swaps(&pCI->rightSideBearing);
swaps(&pCI->leftSideBearing, tmp); swaps(&pCI->characterWidth);
swaps(&pCI->rightSideBearing, tmp); swaps(&pCI->ascent);
swaps(&pCI->characterWidth, tmp); swaps(&pCI->descent);
swaps(&pCI->ascent, tmp); swaps(&pCI->attributes);
swaps(&pCI->descent, tmp);
swaps(&pCI->attributes, tmp);
} }
/* static CARD32 hashCI (xCharInfo *p); */ /* static CARD32 hashCI (xCharInfo *p); */
...@@ -671,21 +668,20 @@ ProcXF86BigfontQueryFont( ...@@ -671,21 +668,20 @@ ProcXF86BigfontQueryFont(
reply->shmid = shmid; reply->shmid = shmid;
reply->shmsegoffset = 0; reply->shmsegoffset = 0;
if (client->swapped) { if (client->swapped) {
char tmp; swaps(&reply->sequenceNumber);
swaps(&reply->sequenceNumber, tmp); swapl(&reply->length);
swapl(&reply->length, tmp);
swapCharInfo(&reply->minBounds); swapCharInfo(&reply->minBounds);
swapCharInfo(&reply->maxBounds); swapCharInfo(&reply->maxBounds);
swaps(&reply->minCharOrByte2, tmp); swaps(&reply->minCharOrByte2);
swaps(&reply->maxCharOrByte2, tmp); swaps(&reply->maxCharOrByte2);
swaps(&reply->defaultChar, tmp); swaps(&reply->defaultChar);
swaps(&reply->nFontProps, tmp); swaps(&reply->nFontProps);
swaps(&reply->fontAscent, tmp); swaps(&reply->fontAscent);
swaps(&reply->fontDescent, tmp); swaps(&reply->fontDescent);
swapl(&reply->nCharInfos, tmp); swapl(&reply->nCharInfos);
swapl(&reply->nUniqCharInfos, tmp); swapl(&reply->nUniqCharInfos);
swapl(&reply->shmid, tmp); swapl(&reply->shmid);
swapl(&reply->shmsegoffset, tmp); swapl(&reply->shmsegoffset);
} }
p = (char*) &reply[1]; p = (char*) &reply[1];
{ {
...@@ -698,9 +694,8 @@ ProcXF86BigfontQueryFont( ...@@ -698,9 +694,8 @@ ProcXF86BigfontQueryFont(
prFP->name = pFP->name; prFP->name = pFP->name;
prFP->value = pFP->value; prFP->value = pFP->value;
if (client->swapped) { if (client->swapped) {
char tmp; swapl(&prFP->name);
swapl(&prFP->name, tmp); swapl(&prFP->value);
swapl(&prFP->value, tmp);
} }
} }
p = (char*) prFP; p = (char*) prFP;
...@@ -719,8 +714,7 @@ ProcXF86BigfontQueryFont( ...@@ -719,8 +714,7 @@ ProcXF86BigfontQueryFont(
for (j = 0; j < nCharInfos; j++, ps++) { for (j = 0; j < nCharInfos; j++, ps++) {
*ps = pIndex2UniqIndex[j]; *ps = pIndex2UniqIndex[j];
if (client->swapped) { if (client->swapped) {
char tmp; swaps(ps);
swaps(ps, tmp);
} }
} }
} }
...@@ -755,9 +749,8 @@ SProcXF86BigfontQueryVersion( ...@@ -755,9 +749,8 @@ SProcXF86BigfontQueryVersion(
ClientPtr client) ClientPtr client)
{ {
REQUEST(xXF86BigfontQueryVersionReq); REQUEST(xXF86BigfontQueryVersionReq);
char tmp;
swaps(&stuff->length, tmp); swaps(&stuff->length);
return ProcXF86BigfontQueryVersion(client); return ProcXF86BigfontQueryVersion(client);
} }
...@@ -766,11 +759,10 @@ SProcXF86BigfontQueryFont( ...@@ -766,11 +759,10 @@ SProcXF86BigfontQueryFont(
ClientPtr client) ClientPtr client)
{ {
REQUEST(xXF86BigfontQueryFontReq); REQUEST(xXF86BigfontQueryFontReq);
char tmp;
swaps(&stuff->length, tmp); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq); REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
swapl(&stuff->id, tmp); swapl(&stuff->id);
return ProcXF86BigfontQueryFont(client); return ProcXF86BigfontQueryFont(client);
} }
......
...@@ -27,26 +27,19 @@ ProcXResQueryVersion (ClientPtr client) ...@@ -27,26 +27,19 @@ ProcXResQueryVersion (ClientPtr client)
{ {
REQUEST(xXResQueryVersionReq); REQUEST(xXResQueryVersionReq);
xXResQueryVersionReply rep; xXResQueryVersionReply rep;
CARD16 client_major, client_minor; /* not used */
REQUEST_SIZE_MATCH (xXResQueryVersionReq); 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.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.server_major = SERVER_XRES_MAJOR_VERSION; rep.server_major = SERVER_XRES_MAJOR_VERSION;
rep.server_minor = SERVER_XRES_MINOR_VERSION; rep.server_minor = SERVER_XRES_MINOR_VERSION;
if (client->swapped) { if (client->swapped) {
int n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber, n); swapl(&rep.length);
swapl(&rep.length, n); swaps(&rep.server_major);
swaps(&rep.server_major, n); swaps(&rep.server_minor);
swaps(&rep.server_minor, n);
} }
WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep);
return (client->noClientException); return (client->noClientException);
...@@ -77,10 +70,9 @@ ProcXResQueryClients (ClientPtr client) ...@@ -77,10 +70,9 @@ ProcXResQueryClients (ClientPtr client)
rep.num_clients = num_clients; rep.num_clients = num_clients;
rep.length = rep.num_clients * sz_xXResClient >> 2; rep.length = rep.num_clients * sz_xXResClient >> 2;
if (client->swapped) { if (client->swapped) {
int n; swaps (&rep.sequenceNumber);
swaps (&rep.sequenceNumber, n); swapl (&rep.length);
swapl (&rep.length, n); swapl (&rep.num_clients);
swapl (&rep.num_clients, n);
} }
WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep); WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep);
...@@ -92,9 +84,8 @@ ProcXResQueryClients (ClientPtr client) ...@@ -92,9 +84,8 @@ ProcXResQueryClients (ClientPtr client)
scratch.resource_mask = RESOURCE_ID_MASK; scratch.resource_mask = RESOURCE_ID_MASK;
if(client->swapped) { if(client->swapped) {
register int n; swapl (&scratch.resource_base);
swapl (&scratch.resource_base, n); swapl (&scratch.resource_mask);
swapl (&scratch.resource_mask, n);
} }
WriteToClient (client, sz_xXResClient, (char *) &scratch); WriteToClient (client, sz_xXResClient, (char *) &scratch);
} }
...@@ -150,10 +141,9 @@ ProcXResQueryClientResources (ClientPtr client) ...@@ -150,10 +141,9 @@ ProcXResQueryClientResources (ClientPtr client)
rep.num_types = num_types; rep.num_types = num_types;
rep.length = rep.num_types * sz_xXResType >> 2; rep.length = rep.num_types * sz_xXResType >> 2;
if (client->swapped) { if (client->swapped) {
int n; swaps (&rep.sequenceNumber);
swaps (&rep.sequenceNumber, n); swapl (&rep.length);
swapl (&rep.length, n); swapl (&rep.num_types);
swapl (&rep.num_types, n);
} }
WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep); WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep);
...@@ -173,9 +163,8 @@ ProcXResQueryClientResources (ClientPtr client) ...@@ -173,9 +163,8 @@ ProcXResQueryClientResources (ClientPtr client)
scratch.count = counts[i]; scratch.count = counts[i];
if(client->swapped) { if(client->swapped) {
register int n; swapl (&scratch.resource_type);
swapl (&scratch.resource_type, n); swapl (&scratch.count);
swapl (&scratch.count, n);
} }
WriteToClient (client, sz_xXResType, (char *) &scratch); WriteToClient (client, sz_xXResType, (char *) &scratch);
} }
...@@ -229,11 +218,10 @@ ProcXResQueryClientPixmapBytes (ClientPtr client) ...@@ -229,11 +218,10 @@ ProcXResQueryClientPixmapBytes (ClientPtr client)
rep.bytes_overflow = 0; rep.bytes_overflow = 0;
#endif #endif
if (client->swapped) { if (client->swapped) {
int n; swaps (&rep.sequenceNumber);
swaps (&rep.sequenceNumber, n); swapl (&rep.length);
swapl (&rep.length, n); swapl (&rep.bytes);
swapl (&rep.bytes, n); swapl (&rep.bytes_overflow);
swapl (&rep.bytes_overflow, n);
} }
WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep); WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep);
...@@ -266,12 +254,7 @@ ProcResDispatch (ClientPtr client) ...@@ -266,12 +254,7 @@ ProcResDispatch (ClientPtr client)
static int static int
SProcXResQueryVersion (ClientPtr client) SProcXResQueryVersion (ClientPtr client)
{ {
REQUEST(xXResQueryVersionReq);
int n;
REQUEST_SIZE_MATCH (xXResQueryVersionReq); REQUEST_SIZE_MATCH (xXResQueryVersionReq);
swaps(&stuff->client_major,n);
swaps(&stuff->client_minor,n);
return ProcXResQueryVersion(client); return ProcXResQueryVersion(client);
} }
...@@ -279,10 +262,9 @@ static int ...@@ -279,10 +262,9 @@ static int
SProcXResQueryClientResources (ClientPtr client) SProcXResQueryClientResources (ClientPtr client)
{ {
REQUEST(xXResQueryClientResourcesReq); REQUEST(xXResQueryClientResourcesReq);
int n;
REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq); REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq);
swaps(&stuff->xid,n); swapl(&stuff->xid);
return ProcXResQueryClientResources(client); return ProcXResQueryClientResources(client);
} }
...@@ -290,10 +272,9 @@ static int ...@@ -290,10 +272,9 @@ static int
SProcXResQueryClientPixmapBytes (ClientPtr client) SProcXResQueryClientPixmapBytes (ClientPtr client)
{ {
REQUEST(xXResQueryClientPixmapBytesReq); REQUEST(xXResQueryClientPixmapBytesReq);
int n;
REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq); REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq);
swaps(&stuff->xid,n); swapl(&stuff->xid);
return ProcXResQueryClientPixmapBytes(client); return ProcXResQueryClientPixmapBytes(client);
} }
...@@ -301,9 +282,8 @@ static int ...@@ -301,9 +282,8 @@ static int
SProcResDispatch (ClientPtr client) SProcResDispatch (ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
int n;
swaps(&stuff->length,n); swaps(&stuff->length);
switch (stuff->data) { switch (stuff->data) {
case X_XResQueryVersion: case X_XResQueryVersion:
......
...@@ -121,7 +121,6 @@ ProcXTestGetVersion(client) ...@@ -121,7 +121,6 @@ ProcXTestGetVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
xXTestGetVersionReply rep; xXTestGetVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xXTestGetVersionReq); REQUEST_SIZE_MATCH(xXTestGetVersionReq);
rep.type = X_Reply; rep.type = X_Reply;
...@@ -130,8 +129,8 @@ ProcXTestGetVersion(client) ...@@ -130,8 +129,8 @@ ProcXTestGetVersion(client)
rep.majorVersion = XTestMajorVersion; rep.majorVersion = XTestMajorVersion;
rep.minorVersion = XTestMinorVersion; rep.minorVersion = XTestMinorVersion;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -145,7 +144,6 @@ ProcXTestCompareCursor(client) ...@@ -145,7 +144,6 @@ ProcXTestCompareCursor(client)
xXTestCompareCursorReply rep; xXTestCompareCursorReply rep;
WindowPtr pWin; WindowPtr pWin;
CursorPtr pCursor; CursorPtr pCursor;
register int n;
REQUEST_SIZE_MATCH(xXTestCompareCursorReq); REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
pWin = (WindowPtr)LookupWindow(stuff->window, client); pWin = (WindowPtr)LookupWindow(stuff->window, client);
...@@ -168,7 +166,7 @@ ProcXTestCompareCursor(client) ...@@ -168,7 +166,7 @@ ProcXTestCompareCursor(client)
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.same = (wCursor(pWin) == pCursor); rep.same = (wCursor(pWin) == pCursor);
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
} }
WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep); WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -285,7 +283,7 @@ ProcXTestFakeInput(client) ...@@ -285,7 +283,7 @@ ProcXTestFakeInput(client)
if (client->swapped) if (client->swapped)
{ {
(void) XTestSwapFakeInput(client, (xReq *)stuff); (void) XTestSwapFakeInput(client, (xReq *)stuff);
swaps(&stuff->length, n); swaps(&stuff->length);
} }
ResetCurrentRequest (client); ResetCurrentRequest (client);
client->sequence--; client->sequence--;
...@@ -512,12 +510,11 @@ static int ...@@ -512,12 +510,11 @@ static int
SProcXTestGetVersion(client) SProcXTestGetVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST(xXTestGetVersionReq); REQUEST(xXTestGetVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestGetVersionReq); REQUEST_SIZE_MATCH(xXTestGetVersionReq);
swaps(&stuff->minorVersion, n); swaps(&stuff->minorVersion);
return ProcXTestGetVersion(client); return ProcXTestGetVersion(client);
} }
...@@ -525,13 +522,12 @@ static int ...@@ -525,13 +522,12 @@ static int
SProcXTestCompareCursor(client) SProcXTestCompareCursor(client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST(xXTestCompareCursorReq); REQUEST(xXTestCompareCursorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestCompareCursorReq); REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->cursor, n); swapl(&stuff->cursor);
return ProcXTestCompareCursor(client); return ProcXTestCompareCursor(client);
} }
...@@ -568,7 +564,7 @@ SProcXTestFakeInput(client) ...@@ -568,7 +564,7 @@ SProcXTestFakeInput(client)
register int n; register int n;
REQUEST(xReq); REQUEST(xReq);
swaps(&stuff->length, n); swaps(&stuff->length);
n = XTestSwapFakeInput(client, stuff); n = XTestSwapFakeInput(client, stuff);
if (n != Success) if (n != Success)
return n; return n;
...@@ -579,10 +575,9 @@ static int ...@@ -579,10 +575,9 @@ static int
SProcXTestGrabControl(client) SProcXTestGrabControl(client)
register ClientPtr client; register ClientPtr client;
{ {
register int n;
REQUEST(xXTestGrabControlReq); REQUEST(xXTestGrabControlReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestGrabControlReq); REQUEST_SIZE_MATCH(xXTestGrabControlReq);
return ProcXTestGrabControl(client); return ProcXTestGrabControl(client);
} }
......
...@@ -319,10 +319,6 @@ SProcTestFakeInput(client) ...@@ -319,10 +319,6 @@ SProcTestFakeInput(client)
register ClientPtr client; register ClientPtr client;
{ {
/* /*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
/*
* index counter * index counter
*/ */
int i; int i;
...@@ -339,8 +335,8 @@ SProcTestFakeInput(client) ...@@ -339,8 +335,8 @@ SProcTestFakeInput(client)
/* /*
* byte-swap the fields in the request * byte-swap the fields in the request
*/ */
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->ack, n); swapl(&stuff->ack);
/* /*
* have to parse and then byte-swap the input action list here * have to parse and then byte-swap the input action list here
*/ */
...@@ -363,7 +359,7 @@ SProcTestFakeInput(client) ...@@ -363,7 +359,7 @@ SProcTestFakeInput(client)
/* /*
* byte-swap the delay_time field * byte-swap the delay_time field
*/ */
swaps(&(((XTestKeyInfo *) input_action_ptr)->delay_time), n); swaps(&(((XTestKeyInfo *) input_action_ptr)->delay_time));
/* /*
* advance to the next input action * advance to the next input action
*/ */
...@@ -373,7 +369,7 @@ SProcTestFakeInput(client) ...@@ -373,7 +369,7 @@ SProcTestFakeInput(client)
/* /*
* byte-swap the delay_time field * byte-swap the delay_time field
*/ */
swaps(&(((XTestMotionInfo *) input_action_ptr)->delay_time), n); swaps(&(((XTestMotionInfo *) input_action_ptr)->delay_time));
/* /*
* advance to the next input action * advance to the next input action
*/ */
...@@ -383,15 +379,15 @@ SProcTestFakeInput(client) ...@@ -383,15 +379,15 @@ SProcTestFakeInput(client)
/* /*
* byte-swap the jumpx field * byte-swap the jumpx field
*/ */
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx), n); swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx));
/* /*
* byte-swap the jumpy field * byte-swap the jumpy field
*/ */
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy), n); swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy));
/* /*
* byte-swap the delay_time field * byte-swap the delay_time field
*/ */
swaps(&(((XTestJumpInfo *) input_action_ptr)->delay_time), n); swaps(&(((XTestJumpInfo *) input_action_ptr)->delay_time));
/* /*
* advance to the next input action * advance to the next input action
*/ */
...@@ -409,7 +405,7 @@ SProcTestFakeInput(client) ...@@ -409,7 +405,7 @@ SProcTestFakeInput(client)
/* /*
* byte-swap the delay_time field * byte-swap the delay_time field
*/ */
swapl(&(((XTestDelayInfo *) input_action_ptr)->delay_time), n); swapl(&(((XTestDelayInfo *) input_action_ptr)->delay_time));
/* /*
* advance to the next input action * advance to the next input action
*/ */
...@@ -440,17 +436,12 @@ static int ...@@ -440,17 +436,12 @@ static int
SProcTestGetInput(client) SProcTestGetInput(client)
register ClientPtr client; register ClientPtr client;
{ {
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
REQUEST(xTestGetInputReq); REQUEST(xTestGetInputReq);
/* /*
* byte-swap the fields in the request * byte-swap the fields in the request
*/ */
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->mode, n); swapl(&stuff->mode);
return(ProcTestGetInput(client)); return(ProcTestGetInput(client));
} }
...@@ -464,16 +455,11 @@ static int ...@@ -464,16 +455,11 @@ static int
SProcTestStopInput(client) SProcTestStopInput(client)
register ClientPtr client; register ClientPtr client;
{ {
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
REQUEST(xTestStopInputReq); REQUEST(xTestStopInputReq);
/* /*
* byte-swap the length field in the request * byte-swap the length field in the request
*/ */
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcTestStopInput(client)); return(ProcTestStopInput(client));
} }
...@@ -487,16 +473,11 @@ static int ...@@ -487,16 +473,11 @@ static int
SProcTestReset(client) SProcTestReset(client)
register ClientPtr client; register ClientPtr client;
{ {
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
REQUEST(xTestResetReq); REQUEST(xTestResetReq);
/* /*
* byte-swap the length field in the request * byte-swap the length field in the request
*/ */
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcTestReset(client)); return(ProcTestReset(client));
} }
...@@ -510,16 +491,11 @@ static int ...@@ -510,16 +491,11 @@ static int
SProcTestQueryInputSize(client) SProcTestQueryInputSize(client)
register ClientPtr client; register ClientPtr client;
{ {
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
REQUEST(xTestQueryInputSizeReq); REQUEST(xTestQueryInputSizeReq);
/* /*
* byte-swap the length field in the request * byte-swap the length field in the request
*/ */
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcTestQueryInputSize(client)); return(ProcTestQueryInputSize(client));
} }
...@@ -781,10 +757,6 @@ SReplyXTestDispatch(client_ptr, size, reply_ptr) ...@@ -781,10 +757,6 @@ SReplyXTestDispatch(client_ptr, size, reply_ptr)
char *reply_ptr; char *reply_ptr;
{ {
/* /*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
/*
* pointer to xTestQueryInputSizeReply * pointer to xTestQueryInputSizeReply
*/ */
xTestQueryInputSizeReply *rep_ptr; xTestQueryInputSizeReply *rep_ptr;
...@@ -793,9 +765,9 @@ SReplyXTestDispatch(client_ptr, size, reply_ptr) ...@@ -793,9 +765,9 @@ SReplyXTestDispatch(client_ptr, size, reply_ptr)
* there is only one reply in this extension, so byte-swap it * there is only one reply in this extension, so byte-swap it
*/ */
rep_ptr = (xTestQueryInputSizeReply *) reply_ptr; rep_ptr = (xTestQueryInputSizeReply *) reply_ptr;
swaps(&(rep_ptr->sequenceNumber), n); swaps(&(rep_ptr->sequenceNumber));
swapl(&(rep_ptr->length), n); swapl(&(rep_ptr->length));
swapl(&(rep_ptr->size_return), n); swapl(&(rep_ptr->size_return));
/* /*
* now write the swapped reply to the client * now write the swapped reply to the client
*/ */
...@@ -814,10 +786,6 @@ SEventXTestDispatch(from, to) ...@@ -814,10 +786,6 @@ SEventXTestDispatch(from, to)
xEvent *to; xEvent *to;
{ {
/* /*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
/*
* index counter * index counter
*/ */
int i; int i;
...@@ -845,7 +813,7 @@ SEventXTestDispatch(from, to) ...@@ -845,7 +813,7 @@ SEventXTestDispatch(from, to)
/* /*
* byte-swap the sequence number in the "to" event * byte-swap the sequence number in the "to" event
*/ */
swaps(&(((xTestInputActionEvent *) to)->sequenceNumber), n); swaps(&(((xTestInputActionEvent *) to)->sequenceNumber));
/* /*
* If the event is an xTestInputActionEvent, then it needs more * If the event is an xTestInputActionEvent, then it needs more
* processing. Otherwise, it is an xTestFakeAckEvent, which * processing. Otherwise, it is an xTestFakeAckEvent, which
...@@ -886,7 +854,7 @@ SEventXTestDispatch(from, to) ...@@ -886,7 +854,7 @@ SEventXTestDispatch(from, to)
/* /*
* byte-swap the delay_time field * byte-swap the delay_time field
*/ */
swaps(&(((XTestKeyInfo *) input_action_ptr)->delay_time), n); swaps(&(((XTestKeyInfo *) input_action_ptr)->delay_time));
/* /*
* advance to the next input action * advance to the next input action
*/ */
...@@ -896,7 +864,7 @@ SEventXTestDispatch(from, to) ...@@ -896,7 +864,7 @@ SEventXTestDispatch(from, to)
/* /*
* byte-swap the delay_time field * byte-swap the delay_time field
*/ */
swaps(&(((XTestMotionInfo *) input_action_ptr)->delay_time), n); swaps(&(((XTestMotionInfo *) input_action_ptr)->delay_time));
/* /*
* advance to the next input action * advance to the next input action
*/ */
...@@ -906,15 +874,15 @@ SEventXTestDispatch(from, to) ...@@ -906,15 +874,15 @@ SEventXTestDispatch(from, to)
/* /*
* byte-swap the jumpx field * byte-swap the jumpx field
*/ */
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx), n); swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx));
/* /*
* byte-swap the jumpy field * byte-swap the jumpy field
*/ */
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy), n); swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy));
/* /*
* byte-swap the delay_time field * byte-swap the delay_time field
*/ */
swaps(&(((XTestJumpInfo *) input_action_ptr)->delay_time), n); swaps(&(((XTestJumpInfo *) input_action_ptr)->delay_time));
/* /*
* advance to the next input action * advance to the next input action
*/ */
...@@ -932,7 +900,7 @@ SEventXTestDispatch(from, to) ...@@ -932,7 +900,7 @@ SEventXTestDispatch(from, to)
/* /*
* byte-swap the delay_time field * byte-swap the delay_time field
*/ */
swapl(&(((XTestDelayInfo *) input_action_ptr)->delay_time), n); swapl(&(((XTestDelayInfo *) input_action_ptr)->delay_time));
/* /*
* advance to the next input action * advance to the next input action
*/ */
......
...@@ -1349,164 +1349,154 @@ ProcXvListImageFormats(ClientPtr client) ...@@ -1349,164 +1349,154 @@ ProcXvListImageFormats(ClientPtr client)
static int static int
SProcXvQueryExtension(ClientPtr client) SProcXvQueryExtension(ClientPtr client)
{ {
register char n;
REQUEST(xvQueryExtensionReq); REQUEST(xvQueryExtensionReq);
REQUEST_SIZE_MATCH(xvQueryExtensionReq); REQUEST_SIZE_MATCH(xvQueryExtensionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return ProcXvQueryExtension(client); return ProcXvQueryExtension(client);
} }
static int static int
SProcXvQueryAdaptors(ClientPtr client) SProcXvQueryAdaptors(ClientPtr client)
{ {
register char n;
REQUEST(xvQueryAdaptorsReq); REQUEST(xvQueryAdaptorsReq);
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
return ProcXvQueryAdaptors(client); return ProcXvQueryAdaptors(client);
} }
static int static int
SProcXvQueryEncodings(ClientPtr client) SProcXvQueryEncodings(ClientPtr client)
{ {
register char n;
REQUEST(xvQueryEncodingsReq); REQUEST(xvQueryEncodingsReq);
REQUEST_SIZE_MATCH(xvQueryEncodingsReq); REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
return ProcXvQueryEncodings(client); return ProcXvQueryEncodings(client);
} }
static int static int
SProcXvGrabPort(ClientPtr client) SProcXvGrabPort(ClientPtr client)
{ {
register char n;
REQUEST(xvGrabPortReq); REQUEST(xvGrabPortReq);
REQUEST_SIZE_MATCH(xvGrabPortReq); REQUEST_SIZE_MATCH(xvGrabPortReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->time, n); swapl(&stuff->time);
return ProcXvGrabPort(client); return ProcXvGrabPort(client);
} }
static int static int
SProcXvUngrabPort(ClientPtr client) SProcXvUngrabPort(ClientPtr client)
{ {
register char n;
REQUEST(xvUngrabPortReq); REQUEST(xvUngrabPortReq);
REQUEST_SIZE_MATCH(xvUngrabPortReq); REQUEST_SIZE_MATCH(xvUngrabPortReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->time, n); swapl(&stuff->time);
return ProcXvUngrabPort(client); return ProcXvUngrabPort(client);
} }
static int static int
SProcXvPutVideo(ClientPtr client) SProcXvPutVideo(ClientPtr client)
{ {
register char n;
REQUEST(xvPutVideoReq); REQUEST(xvPutVideoReq);
REQUEST_SIZE_MATCH(xvPutVideoReq); REQUEST_SIZE_MATCH(xvPutVideoReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->vid_x, n); swaps(&stuff->vid_x);
swaps(&stuff->vid_y, n); swaps(&stuff->vid_y);
swaps(&stuff->vid_w, n); swaps(&stuff->vid_w);
swaps(&stuff->vid_h, n); swaps(&stuff->vid_h);
swaps(&stuff->drw_x, n); swaps(&stuff->drw_x);
swaps(&stuff->drw_y, n); swaps(&stuff->drw_y);
swaps(&stuff->drw_w, n); swaps(&stuff->drw_w);
swaps(&stuff->drw_h, n); swaps(&stuff->drw_h);
return ProcXvPutVideo(client); return ProcXvPutVideo(client);
} }
static int static int
SProcXvPutStill(ClientPtr client) SProcXvPutStill(ClientPtr client)
{ {
register char n;
REQUEST(xvPutStillReq); REQUEST(xvPutStillReq);
REQUEST_SIZE_MATCH(xvPutStillReq); REQUEST_SIZE_MATCH(xvPutStillReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->vid_x, n); swaps(&stuff->vid_x);
swaps(&stuff->vid_y, n); swaps(&stuff->vid_y);
swaps(&stuff->vid_w, n); swaps(&stuff->vid_w);
swaps(&stuff->vid_h, n); swaps(&stuff->vid_h);
swaps(&stuff->drw_x, n); swaps(&stuff->drw_x);
swaps(&stuff->drw_y, n); swaps(&stuff->drw_y);
swaps(&stuff->drw_w, n); swaps(&stuff->drw_w);
swaps(&stuff->drw_h, n); swaps(&stuff->drw_h);
return ProcXvPutStill(client); return ProcXvPutStill(client);
} }
static int static int
SProcXvGetVideo(ClientPtr client) SProcXvGetVideo(ClientPtr client)
{ {
register char n;
REQUEST(xvGetVideoReq); REQUEST(xvGetVideoReq);
REQUEST_SIZE_MATCH(xvGetVideoReq); REQUEST_SIZE_MATCH(xvGetVideoReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->vid_x, n); swaps(&stuff->vid_x);
swaps(&stuff->vid_y, n); swaps(&stuff->vid_y);
swaps(&stuff->vid_w, n); swaps(&stuff->vid_w);
swaps(&stuff->vid_h, n); swaps(&stuff->vid_h);
swaps(&stuff->drw_x, n); swaps(&stuff->drw_x);
swaps(&stuff->drw_y, n); swaps(&stuff->drw_y);
swaps(&stuff->drw_w, n); swaps(&stuff->drw_w);
swaps(&stuff->drw_h, n); swaps(&stuff->drw_h);
return ProcXvGetVideo(client); return ProcXvGetVideo(client);
} }
static int static int
SProcXvGetStill(ClientPtr client) SProcXvGetStill(ClientPtr client)
{ {
register char n;
REQUEST(xvGetStillReq); REQUEST(xvGetStillReq);
REQUEST_SIZE_MATCH(xvGetStillReq); REQUEST_SIZE_MATCH(xvGetStillReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->vid_x, n); swaps(&stuff->vid_x);
swaps(&stuff->vid_y, n); swaps(&stuff->vid_y);
swaps(&stuff->vid_w, n); swaps(&stuff->vid_w);
swaps(&stuff->vid_h, n); swaps(&stuff->vid_h);
swaps(&stuff->drw_x, n); swaps(&stuff->drw_x);
swaps(&stuff->drw_y, n); swaps(&stuff->drw_y);
swaps(&stuff->drw_w, n); swaps(&stuff->drw_w);
swaps(&stuff->drw_h, n); swaps(&stuff->drw_h);
return ProcXvGetStill(client); return ProcXvGetStill(client);
} }
static int static int
SProcXvPutImage(ClientPtr client) SProcXvPutImage(ClientPtr client)
{ {
register char n;
REQUEST(xvPutImageReq); REQUEST(xvPutImageReq);
REQUEST_AT_LEAST_SIZE(xvPutImageReq); REQUEST_AT_LEAST_SIZE(xvPutImageReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swapl(&stuff->id, n); swapl(&stuff->id);
swaps(&stuff->src_x, n); swaps(&stuff->src_x);
swaps(&stuff->src_y, n); swaps(&stuff->src_y);
swaps(&stuff->src_w, n); swaps(&stuff->src_w);
swaps(&stuff->src_h, n); swaps(&stuff->src_h);
swaps(&stuff->drw_x, n); swaps(&stuff->drw_x);
swaps(&stuff->drw_y, n); swaps(&stuff->drw_y);
swaps(&stuff->drw_w, n); swaps(&stuff->drw_w);
swaps(&stuff->drw_h, n); swaps(&stuff->drw_h);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
return ProcXvPutImage(client); return ProcXvPutImage(client);
} }
...@@ -1514,26 +1504,25 @@ SProcXvPutImage(ClientPtr client) ...@@ -1514,26 +1504,25 @@ SProcXvPutImage(ClientPtr client)
static int static int
SProcXvShmPutImage(ClientPtr client) SProcXvShmPutImage(ClientPtr client)
{ {
register char n;
REQUEST(xvShmPutImageReq); REQUEST(xvShmPutImageReq);
REQUEST_SIZE_MATCH(xvShmPutImageReq); REQUEST_SIZE_MATCH(xvShmPutImageReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swapl(&stuff->shmseg, n); swapl(&stuff->shmseg);
swapl(&stuff->id, n); swapl(&stuff->id);
swaps(&stuff->src_x, n); swapl(&stuff->offset);
swaps(&stuff->src_y, n); swaps(&stuff->src_x);
swaps(&stuff->src_w, n); swaps(&stuff->src_y);
swaps(&stuff->src_h, n); swaps(&stuff->src_w);
swaps(&stuff->drw_x, n); swaps(&stuff->src_h);
swaps(&stuff->drw_y, n); swaps(&stuff->drw_x);
swaps(&stuff->drw_w, n); swaps(&stuff->drw_y);
swaps(&stuff->drw_h, n); swaps(&stuff->drw_w);
swaps(&stuff->offset, n); swaps(&stuff->drw_h);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
return ProcXvShmPutImage(client); return ProcXvShmPutImage(client);
} }
#endif #endif
...@@ -1542,108 +1531,101 @@ SProcXvShmPutImage(ClientPtr client) ...@@ -1542,108 +1531,101 @@ SProcXvShmPutImage(ClientPtr client)
static int static int
SProcXvSelectVideoNotify(ClientPtr client) SProcXvSelectVideoNotify(ClientPtr client)
{ {
register char n;
REQUEST(xvSelectVideoNotifyReq); REQUEST(xvSelectVideoNotifyReq);
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
return ProcXvSelectVideoNotify(client); return ProcXvSelectVideoNotify(client);
} }
static int static int
SProcXvSelectPortNotify(ClientPtr client) SProcXvSelectPortNotify(ClientPtr client)
{ {
register char n;
REQUEST(xvSelectPortNotifyReq); REQUEST(xvSelectPortNotifyReq);
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq); REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
return ProcXvSelectPortNotify(client); return ProcXvSelectPortNotify(client);
} }
static int static int
SProcXvStopVideo(ClientPtr client) SProcXvStopVideo(ClientPtr client)
{ {
register char n;
REQUEST(xvStopVideoReq); REQUEST(xvStopVideoReq);
REQUEST_SIZE_MATCH(xvStopVideoReq); REQUEST_SIZE_MATCH(xvStopVideoReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
return ProcXvStopVideo(client); return ProcXvStopVideo(client);
} }
static int static int
SProcXvSetPortAttribute(ClientPtr client) SProcXvSetPortAttribute(ClientPtr client)
{ {
register char n;
REQUEST(xvSetPortAttributeReq); REQUEST(xvSetPortAttributeReq);
REQUEST_SIZE_MATCH(xvSetPortAttributeReq); REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->attribute, n); swapl(&stuff->attribute);
swapl(&stuff->value);
return ProcXvSetPortAttribute(client); return ProcXvSetPortAttribute(client);
} }
static int static int
SProcXvGetPortAttribute(ClientPtr client) SProcXvGetPortAttribute(ClientPtr client)
{ {
register char n;
REQUEST(xvGetPortAttributeReq); REQUEST(xvGetPortAttributeReq);
REQUEST_SIZE_MATCH(xvGetPortAttributeReq); REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swapl(&stuff->attribute, n); swapl(&stuff->attribute);
return ProcXvGetPortAttribute(client); return ProcXvGetPortAttribute(client);
} }
static int static int
SProcXvQueryBestSize(ClientPtr client) SProcXvQueryBestSize(ClientPtr client)
{ {
register char n;
REQUEST(xvQueryBestSizeReq); REQUEST(xvQueryBestSizeReq);
REQUEST_SIZE_MATCH(xvQueryBestSizeReq); REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
swaps(&stuff->vid_w, n); swaps(&stuff->vid_w);
swaps(&stuff->vid_h, n); swaps(&stuff->vid_h);
swaps(&stuff->drw_w, n); swaps(&stuff->drw_w);
swaps(&stuff->drw_h, n); swaps(&stuff->drw_h);
return ProcXvQueryBestSize(client); return ProcXvQueryBestSize(client);
} }
static int static int
SProcXvQueryPortAttributes(ClientPtr client) SProcXvQueryPortAttributes(ClientPtr client)
{ {
register char n;
REQUEST(xvQueryPortAttributesReq); REQUEST(xvQueryPortAttributesReq);
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq); REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
return ProcXvQueryPortAttributes(client); return ProcXvQueryPortAttributes(client);
} }
static int static int
SProcXvQueryImageAttributes(ClientPtr client) SProcXvQueryImageAttributes(ClientPtr client)
{ {
register char n;
REQUEST(xvQueryImageAttributesReq); REQUEST(xvQueryImageAttributesReq);
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->id, n); swapl(&stuff->port);
swaps(&stuff->width, n); swapl(&stuff->id);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height);
return ProcXvQueryImageAttributes(client); return ProcXvQueryImageAttributes(client);
} }
static int static int
SProcXvListImageFormats(ClientPtr client) SProcXvListImageFormats(ClientPtr client)
{ {
register char n;
REQUEST(xvListImageFormatsReq); REQUEST(xvListImageFormatsReq);
REQUEST_SIZE_MATCH(xvListImageFormatsReq); REQUEST_SIZE_MATCH(xvListImageFormatsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->port, n); swapl(&stuff->port);
return ProcXvListImageFormats(client); return ProcXvListImageFormats(client);
} }
...@@ -1653,12 +1635,10 @@ SWriteQueryExtensionReply( ...@@ -1653,12 +1635,10 @@ SWriteQueryExtensionReply(
ClientPtr client, ClientPtr client,
xvQueryExtensionReply *rep xvQueryExtensionReply *rep
){ ){
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swaps(&rep->version);
swapl(&rep->length, n); swaps(&rep->revision);
swaps(&rep->version, n);
swaps(&rep->revision, n);
(void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep);
...@@ -1670,11 +1650,9 @@ SWriteQueryAdaptorsReply( ...@@ -1670,11 +1650,9 @@ SWriteQueryAdaptorsReply(
ClientPtr client, ClientPtr client,
xvQueryAdaptorsReply *rep xvQueryAdaptorsReply *rep
){ ){
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swaps(&rep->num_adaptors);
swapl(&rep->length, n);
swaps(&rep->num_adaptors, n);
(void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep);
...@@ -1686,11 +1664,9 @@ SWriteQueryEncodingsReply( ...@@ -1686,11 +1664,9 @@ SWriteQueryEncodingsReply(
ClientPtr client, ClientPtr client,
xvQueryEncodingsReply *rep xvQueryEncodingsReply *rep
){ ){
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swaps(&rep->num_encodings);
swapl(&rep->length, n);
swaps(&rep->num_encodings, n);
(void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep);
...@@ -1702,12 +1678,10 @@ SWriteAdaptorInfo( ...@@ -1702,12 +1678,10 @@ SWriteAdaptorInfo(
ClientPtr client, ClientPtr client,
xvAdaptorInfo *pAdaptor xvAdaptorInfo *pAdaptor
){ ){
register char n; swapl(&pAdaptor->base_id);
swaps(&pAdaptor->name_size);
swapl(&pAdaptor->base_id, n); swaps(&pAdaptor->num_ports);
swaps(&pAdaptor->name_size, n); swaps(&pAdaptor->num_formats);
swaps(&pAdaptor->num_ports, n);
swaps(&pAdaptor->num_formats, n);
(void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor); (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor);
...@@ -1719,14 +1693,12 @@ SWriteEncodingInfo( ...@@ -1719,14 +1693,12 @@ SWriteEncodingInfo(
ClientPtr client, ClientPtr client,
xvEncodingInfo *pEncoding xvEncodingInfo *pEncoding
){ ){
register char n; swapl(&pEncoding->encoding);
swaps(&pEncoding->name_size);
swapl(&pEncoding->encoding, n); swaps(&pEncoding->width);
swaps(&pEncoding->name_size, n); swaps(&pEncoding->height);
swaps(&pEncoding->width, n); swapl(&pEncoding->rate.numerator);
swaps(&pEncoding->height, n); swapl(&pEncoding->rate.denominator);
swapl(&pEncoding->rate.numerator, n);
swapl(&pEncoding->rate.denominator, n);
(void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding); (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding);
return Success; return Success;
...@@ -1737,9 +1709,7 @@ SWriteFormat( ...@@ -1737,9 +1709,7 @@ SWriteFormat(
ClientPtr client, ClientPtr client,
xvFormat *pFormat xvFormat *pFormat
){ ){
register char n; swapl(&pFormat->visual);
swapl(&pFormat->visual, n);
(void)WriteToClient(client, sz_xvFormat, (char *)pFormat); (void)WriteToClient(client, sz_xvFormat, (char *)pFormat);
return Success; return Success;
...@@ -1750,12 +1720,10 @@ SWriteAttributeInfo( ...@@ -1750,12 +1720,10 @@ SWriteAttributeInfo(
ClientPtr client, ClientPtr client,
xvAttributeInfo *pAtt xvAttributeInfo *pAtt
){ ){
register char n; swapl(&pAtt->flags);
swapl(&pAtt->size);
swapl(&pAtt->flags, n); swapl(&pAtt->min);
swapl(&pAtt->size, n); swapl(&pAtt->max);
swapl(&pAtt->min, n);
swapl(&pAtt->max, n);
(void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt); (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt);
return Success; return Success;
...@@ -1766,21 +1734,19 @@ SWriteImageFormatInfo( ...@@ -1766,21 +1734,19 @@ SWriteImageFormatInfo(
ClientPtr client, ClientPtr client,
xvImageFormatInfo *pImage xvImageFormatInfo *pImage
){ ){
register char n; swapl(&pImage->id);
swapl(&pImage->red_mask);
swapl(&pImage->id, n); swapl(&pImage->green_mask);
swapl(&pImage->red_mask, n); swapl(&pImage->blue_mask);
swapl(&pImage->green_mask, n); swapl(&pImage->y_sample_bits);
swapl(&pImage->blue_mask, n); swapl(&pImage->u_sample_bits);
swapl(&pImage->y_sample_bits, n); swapl(&pImage->v_sample_bits);
swapl(&pImage->u_sample_bits, n); swapl(&pImage->horz_y_period);
swapl(&pImage->v_sample_bits, n); swapl(&pImage->horz_u_period);
swapl(&pImage->horz_y_period, n); swapl(&pImage->horz_v_period);
swapl(&pImage->horz_u_period, n); swapl(&pImage->vert_y_period);
swapl(&pImage->horz_v_period, n); swapl(&pImage->vert_u_period);
swapl(&pImage->vert_y_period, n); swapl(&pImage->vert_v_period);
swapl(&pImage->vert_u_period, n);
swapl(&pImage->vert_v_period, n);
(void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage); (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage);
...@@ -1794,10 +1760,8 @@ SWriteGrabPortReply( ...@@ -1794,10 +1760,8 @@ SWriteGrabPortReply(
ClientPtr client, ClientPtr client,
xvGrabPortReply *rep xvGrabPortReply *rep
){ ){
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
(void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep); (void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep);
...@@ -1809,11 +1773,9 @@ SWriteGetPortAttributeReply( ...@@ -1809,11 +1773,9 @@ SWriteGetPortAttributeReply(
ClientPtr client, ClientPtr client,
xvGetPortAttributeReply *rep xvGetPortAttributeReply *rep
){ ){
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swapl(&rep->value);
swapl(&rep->length, n);
swapl(&rep->value, n);
(void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep); (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep);
...@@ -1825,12 +1787,10 @@ SWriteQueryBestSizeReply( ...@@ -1825,12 +1787,10 @@ SWriteQueryBestSizeReply(
ClientPtr client, ClientPtr client,
xvQueryBestSizeReply *rep xvQueryBestSizeReply *rep
){ ){
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swaps(&rep->actual_width);
swapl(&rep->length, n); swaps(&rep->actual_height);
swaps(&rep->actual_width, n);
swaps(&rep->actual_height, n);
(void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep);
...@@ -1842,12 +1802,10 @@ SWriteQueryPortAttributesReply( ...@@ -1842,12 +1802,10 @@ SWriteQueryPortAttributesReply(
ClientPtr client, ClientPtr client,
xvQueryPortAttributesReply *rep xvQueryPortAttributesReply *rep
){ ){
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swapl(&rep->num_attributes);
swapl(&rep->length, n); swapl(&rep->text_size);
swapl(&rep->num_attributes, n);
swapl(&rep->text_size, n);
(void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep);
...@@ -1859,14 +1817,12 @@ SWriteQueryImageAttributesReply( ...@@ -1859,14 +1817,12 @@ SWriteQueryImageAttributesReply(
ClientPtr client, ClientPtr client,
xvQueryImageAttributesReply *rep xvQueryImageAttributesReply *rep
){ ){
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swapl(&rep->num_planes);
swapl(&rep->length, n); swapl(&rep->data_size);
swapl(&rep->num_planes, n); swaps(&rep->width);
swapl(&rep->data_size, n); swaps(&rep->height);
swaps(&rep->width, n);
swaps(&rep->height, n);
(void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep);
...@@ -1879,11 +1835,9 @@ SWriteListImageFormatsReply( ...@@ -1879,11 +1835,9 @@ SWriteListImageFormatsReply(
ClientPtr client, ClientPtr client,
xvListImageFormatsReply *rep xvListImageFormatsReply *rep
){ ){
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swapl(&rep->num_formats);
swapl(&rep->length, n);
swapl(&rep->num_formats, n);
(void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep); (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep);
......
...@@ -82,12 +82,10 @@ int ...@@ -82,12 +82,10 @@ int
SProcXAllowDeviceEvents(client) SProcXAllowDeviceEvents(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xAllowDeviceEventsReq); REQUEST(xAllowDeviceEventsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq); REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
swapl(&stuff->time, n); swapl(&stuff->time);
return(ProcXAllowDeviceEvents(client)); return(ProcXAllowDeviceEvents(client));
} }
......
...@@ -83,12 +83,10 @@ int ...@@ -83,12 +83,10 @@ int
SProcXChangeDeviceControl(client) SProcXChangeDeviceControl(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xChangeDeviceControlReq); REQUEST(xChangeDeviceControlReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
swaps(&stuff->control, n); swaps(&stuff->control);
return(ProcXChangeDeviceControl(client)); return(ProcXChangeDeviceControl(client));
} }
...@@ -210,10 +208,8 @@ SRepXChangeDeviceControl (client, size, rep) ...@@ -210,10 +208,8 @@ SRepXChangeDeviceControl (client, size, rep)
int size; int size;
xChangeDeviceControlReply *rep; xChangeDeviceControlReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -84,12 +84,10 @@ int ...@@ -84,12 +84,10 @@ int
SProcXChangeFeedbackControl(client) SProcXChangeFeedbackControl(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xChangeFeedbackControlReq); REQUEST(xChangeFeedbackControlReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq); REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
swapl(&stuff->mask, n); swapl(&stuff->mask);
return(ProcXChangeFeedbackControl(client)); return(ProcXChangeFeedbackControl(client));
} }
...@@ -156,13 +154,12 @@ ProcXChangeFeedbackControl(client) ...@@ -156,13 +154,12 @@ ProcXChangeFeedbackControl(client)
break; break;
case StringFeedbackClass: case StringFeedbackClass:
{ {
register char n;
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]); xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]);
if (client->swapped) if (client->swapped)
{ {
if (len < (sizeof(xStringFeedbackCtl) + 3) >> 2) if (len < (sizeof(xStringFeedbackCtl) + 3) >> 2)
return BadLength; return BadLength;
swaps(&f->num_keysyms,n); swaps(&f->num_keysyms);
} }
if (len != ((sizeof(xStringFeedbackCtl)>>2) + f->num_keysyms)) if (len != ((sizeof(xStringFeedbackCtl)>>2) + f->num_keysyms))
{ {
...@@ -242,18 +239,17 @@ ChangeKbdFeedback (client, dev, mask, k, f) ...@@ -242,18 +239,17 @@ ChangeKbdFeedback (client, dev, mask, k, f)
KbdFeedbackPtr k; KbdFeedbackPtr k;
xKbdFeedbackCtl *f; xKbdFeedbackCtl *f;
{ {
register char n;
KeybdCtrl kctrl; KeybdCtrl kctrl;
int t; int t;
int key = DO_ALL; int key = DO_ALL;
if (client->swapped) if (client->swapped)
{ {
swaps(&f->length,n); swaps(&f->length);
swaps(&f->pitch,n); swaps(&f->pitch);
swaps(&f->duration,n); swaps(&f->duration);
swapl(&f->led_mask,n); swapl(&f->led_mask);
swapl(&f->led_values,n); swapl(&f->led_values);
} }
kctrl = k->ctrl; kctrl = k->ctrl;
...@@ -398,15 +394,14 @@ ChangePtrFeedback (client, dev, mask, p, f) ...@@ -398,15 +394,14 @@ ChangePtrFeedback (client, dev, mask, p, f)
PtrFeedbackPtr p; PtrFeedbackPtr p;
xPtrFeedbackCtl *f; xPtrFeedbackCtl *f;
{ {
register char n;
PtrCtrl pctrl; /* might get BadValue part way through */ PtrCtrl pctrl; /* might get BadValue part way through */
if (client->swapped) if (client->swapped)
{ {
swaps(&f->length,n); swaps(&f->length);
swaps(&f->num,n); swaps(&f->num);
swaps(&f->denom,n); swaps(&f->denom);
swaps(&f->thresh,n); swaps(&f->thresh);
} }
pctrl = p->ctrl; pctrl = p->ctrl;
...@@ -480,12 +475,10 @@ ChangeIntegerFeedback (client, dev, mask, i, f) ...@@ -480,12 +475,10 @@ ChangeIntegerFeedback (client, dev, mask, i, f)
IntegerFeedbackPtr i; IntegerFeedbackPtr i;
xIntegerFeedbackCtl *f; xIntegerFeedbackCtl *f;
{ {
register char n;
if (client->swapped) if (client->swapped)
{ {
swaps(&f->length,n); swaps(&f->length);
swapl(&f->int_to_display,n); swapl(&f->int_to_display);
} }
i->ctrl.integer_displayed = f->int_to_display; i->ctrl.integer_displayed = f->int_to_display;
...@@ -507,14 +500,13 @@ ChangeStringFeedback (client, dev, mask, s, f) ...@@ -507,14 +500,13 @@ ChangeStringFeedback (client, dev, mask, s, f)
StringFeedbackPtr s; StringFeedbackPtr s;
xStringFeedbackCtl *f; xStringFeedbackCtl *f;
{ {
register char n;
int i, j; int i, j;
KeySym *syms, *sup_syms; KeySym *syms, *sup_syms;
syms = (KeySym *) (f+1); syms = (KeySym *) (f+1);
if (client->swapped) if (client->swapped)
{ {
swaps(&f->length,n); /* swapped num_keysyms in calling proc */ swaps(&f->length); /* swapped num_keysyms in calling proc */
SwapLongs((CARD32 *) syms, f->num_keysyms); SwapLongs((CARD32 *) syms, f->num_keysyms);
} }
...@@ -559,15 +551,14 @@ ChangeBellFeedback (client, dev, mask, b, f) ...@@ -559,15 +551,14 @@ ChangeBellFeedback (client, dev, mask, b, f)
BellFeedbackPtr b; BellFeedbackPtr b;
xBellFeedbackCtl *f; xBellFeedbackCtl *f;
{ {
register char n;
int t; int t;
BellCtrl bctrl; /* might get BadValue part way through */ BellCtrl bctrl; /* might get BadValue part way through */
if (client->swapped) if (client->swapped)
{ {
swaps(&f->length,n); swaps(&f->length);
swaps(&f->pitch,n); swaps(&f->pitch);
swaps(&f->duration,n); swaps(&f->duration);
} }
bctrl = b->ctrl; bctrl = b->ctrl;
...@@ -634,14 +625,13 @@ ChangeLedFeedback (client, dev, mask, l, f) ...@@ -634,14 +625,13 @@ ChangeLedFeedback (client, dev, mask, l, f)
LedFeedbackPtr l; LedFeedbackPtr l;
xLedFeedbackCtl *f; xLedFeedbackCtl *f;
{ {
register char n;
LedCtrl lctrl; /* might get BadValue part way through */ LedCtrl lctrl; /* might get BadValue part way through */
if (client->swapped) if (client->swapped)
{ {
swaps(&f->length,n); swaps(&f->length);
swapl(&f->led_values,n); swapl(&f->led_values);
swapl(&f->led_mask,n); swapl(&f->led_mask);
} }
f->led_mask &= l->ctrl.led_mask; /* set only supported leds */ f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
......
...@@ -85,10 +85,8 @@ int ...@@ -85,10 +85,8 @@ int
SProcXChangeKeyboardDevice(client) SProcXChangeKeyboardDevice(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xChangeKeyboardDeviceReq); REQUEST(xChangeKeyboardDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq); REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
return(ProcXChangeKeyboardDevice(client)); return(ProcXChangeKeyboardDevice(client));
} }
...@@ -208,9 +206,7 @@ SRepXChangeKeyboardDevice (client, size, rep) ...@@ -208,9 +206,7 @@ SRepXChangeKeyboardDevice (client, size, rep)
int size; int size;
xChangeKeyboardDeviceReply *rep; xChangeKeyboardDeviceReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -82,11 +82,10 @@ int ...@@ -82,11 +82,10 @@ int
SProcXChangeDeviceKeyMapping(client) SProcXChangeDeviceKeyMapping(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
unsigned int count; unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq); REQUEST(xChangeDeviceKeyMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
count = stuff->keyCodes * stuff->keySymsPerKeyCode; count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32)); REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
......
...@@ -84,13 +84,11 @@ int ...@@ -84,13 +84,11 @@ int
SProcXChangeDeviceDontPropagateList(client) SProcXChangeDeviceDontPropagateList(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xChangeDeviceDontPropagateListReq); REQUEST(xChangeDeviceDontPropagateListReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swaps(&stuff->count, n); swaps(&stuff->count);
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq, REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
stuff->count * sizeof(CARD32)); stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count); SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
......
...@@ -88,10 +88,8 @@ int ...@@ -88,10 +88,8 @@ int
SProcXChangePointerDevice(client) SProcXChangePointerDevice(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xChangePointerDeviceReq); REQUEST(xChangePointerDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangePointerDeviceReq); REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
return(ProcXChangePointerDevice(client)); return(ProcXChangePointerDevice(client));
} }
...@@ -254,9 +252,7 @@ SRepXChangePointerDevice (client, size, rep) ...@@ -254,9 +252,7 @@ SRepXChangePointerDevice (client, size, rep)
int size; int size;
xChangePointerDeviceReply *rep; xChangePointerDeviceReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -83,10 +83,8 @@ int ...@@ -83,10 +83,8 @@ int
SProcXCloseDevice(client) SProcXCloseDevice(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xCloseDeviceReq); REQUEST(xCloseDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCloseDeviceReq); REQUEST_SIZE_MATCH(xCloseDeviceReq);
return(ProcXCloseDevice(client)); return(ProcXCloseDevice(client));
} }
......
...@@ -81,10 +81,8 @@ int ...@@ -81,10 +81,8 @@ int
SProcXDeviceBell(client) SProcXDeviceBell(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xDeviceBellReq); REQUEST(xDeviceBellReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXDeviceBell(client)); return(ProcXDeviceBell(client));
} }
......
...@@ -586,17 +586,16 @@ SEventDeviceValuator (from, to) ...@@ -586,17 +586,16 @@ SEventDeviceValuator (from, to)
deviceValuator *from; deviceValuator *from;
deviceValuator *to; deviceValuator *to;
{ {
register char n;
register int i; register int i;
INT32 *ip B32; INT32 *ip B32;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber);
swaps(&to->device_state,n); swaps(&to->device_state);
ip = &to->valuator0; ip = &to->valuator0;
for (i=0; i<6; i++) for (i=0; i<6; i++)
{ {
swapl((ip+i),n); /* macro - braces are required */ swapl((ip+i)); /* macro - braces are required */
} }
} }
...@@ -605,12 +604,10 @@ SEventFocus (from, to) ...@@ -605,12 +604,10 @@ SEventFocus (from, to)
deviceFocus *from; deviceFocus *from;
deviceFocus *to; deviceFocus *to;
{ {
register char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber);
swapl(&to->time, n); swapl(&to->time);
swapl(&to->window, n); swapl(&to->window);
} }
void void
...@@ -619,16 +616,15 @@ SDeviceStateNotifyEvent (from, to) ...@@ -619,16 +616,15 @@ SDeviceStateNotifyEvent (from, to)
deviceStateNotify *to; deviceStateNotify *to;
{ {
register int i; register int i;
register char n;
INT32 *ip B32; INT32 *ip B32;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber);
swapl(&to->time, n); swapl(&to->time);
ip = &to->valuator0; ip = &to->valuator0;
for (i=0; i<3; i++) for (i=0; i<3; i++)
{ {
swapl((ip+i),n); /* macro - braces are required */ swapl((ip+i)); /* macro - braces are required */
} }
} }
...@@ -637,10 +633,8 @@ SDeviceKeyStateNotifyEvent (from, to) ...@@ -637,10 +633,8 @@ SDeviceKeyStateNotifyEvent (from, to)
deviceKeyStateNotify *from; deviceKeyStateNotify *from;
deviceKeyStateNotify *to; deviceKeyStateNotify *to;
{ {
register char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber);
} }
void void
...@@ -648,10 +642,8 @@ SDeviceButtonStateNotifyEvent (from, to) ...@@ -648,10 +642,8 @@ SDeviceButtonStateNotifyEvent (from, to)
deviceButtonStateNotify *from; deviceButtonStateNotify *from;
deviceButtonStateNotify *to; deviceButtonStateNotify *to;
{ {
register char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber);
} }
void void
...@@ -659,11 +651,9 @@ SChangeDeviceNotifyEvent (from, to) ...@@ -659,11 +651,9 @@ SChangeDeviceNotifyEvent (from, to)
changeDeviceNotify *from; changeDeviceNotify *from;
changeDeviceNotify *to; changeDeviceNotify *to;
{ {
register char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber);
swapl(&to->time, n); swapl(&to->time);
} }
void void
...@@ -671,11 +661,9 @@ SDeviceMappingNotifyEvent (from, to) ...@@ -671,11 +661,9 @@ SDeviceMappingNotifyEvent (from, to)
deviceMappingNotify *from; deviceMappingNotify *from;
deviceMappingNotify *to; deviceMappingNotify *to;
{ {
register char n;
*to = *from; *to = *from;
swaps(&to->sequenceNumber,n); swaps(&to->sequenceNumber);
swapl(&to->time, n); swapl(&to->time);
} }
/************************************************************************ /************************************************************************
......
...@@ -80,10 +80,8 @@ int ...@@ -80,10 +80,8 @@ int
SProcXGetDeviceButtonMapping(client) SProcXGetDeviceButtonMapping(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetDeviceButtonMappingReq); REQUEST(xGetDeviceButtonMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXGetDeviceButtonMapping(client)); return(ProcXGetDeviceButtonMapping(client));
} }
...@@ -146,9 +144,7 @@ SRepXGetDeviceButtonMapping (client, size, rep) ...@@ -146,9 +144,7 @@ SRepXGetDeviceButtonMapping (client, size, rep)
int size; int size;
xGetDeviceButtonMappingReply *rep; xGetDeviceButtonMappingReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -81,12 +81,10 @@ int ...@@ -81,12 +81,10 @@ int
SProcXGetDeviceControl(client) SProcXGetDeviceControl(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetDeviceControlReq); REQUEST(xGetDeviceControlReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceControlReq); REQUEST_SIZE_MATCH(xGetDeviceControlReq);
swaps(&stuff->control, n); swaps(&stuff->control);
return(ProcXGetDeviceControl(client)); return(ProcXGetDeviceControl(client));
} }
...@@ -178,7 +176,6 @@ CopySwapDeviceResolution (client, v, buf, length) ...@@ -178,7 +176,6 @@ CopySwapDeviceResolution (client, v, buf, length)
char *buf; char *buf;
int length; int length;
{ {
register char n;
AxisInfoPtr a; AxisInfoPtr a;
xDeviceResolutionState *r; xDeviceResolutionState *r;
int i, *iptr; int i, *iptr;
...@@ -197,13 +194,13 @@ CopySwapDeviceResolution (client, v, buf, length) ...@@ -197,13 +194,13 @@ CopySwapDeviceResolution (client, v, buf, length)
*iptr++ = a->max_resolution; *iptr++ = a->max_resolution;
if (client->swapped) if (client->swapped)
{ {
swaps (&r->control,n); swaps (&r->control);
swaps (&r->length,n); swaps (&r->length);
swapl (&r->num_valuators,n); swapl (&r->num_valuators);
iptr = (int *) buf; iptr = (int *) buf;
for (i=0; i < (3 * v->numAxes); i++,iptr++) for (i=0; i < (3 * v->numAxes); i++,iptr++)
{ {
swapl (iptr,n); swapl (iptr);
} }
} }
} }
...@@ -221,10 +218,8 @@ SRepXGetDeviceControl (client, size, rep) ...@@ -221,10 +218,8 @@ SRepXGetDeviceControl (client, size, rep)
int size; int size;
xGetDeviceControlReply *rep; xGetDeviceControlReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -81,10 +81,8 @@ int ...@@ -81,10 +81,8 @@ int
SProcXGetFeedbackControl(client) SProcXGetFeedbackControl(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetFeedbackControlReq); REQUEST(xGetFeedbackControlReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXGetFeedbackControl(client)); return(ProcXGetFeedbackControl(client));
} }
...@@ -207,7 +205,6 @@ CopySwapKbdFeedback (client, k, buf) ...@@ -207,7 +205,6 @@ CopySwapKbdFeedback (client, k, buf)
char **buf; char **buf;
{ {
int i; int i;
register char n;
xKbdFeedbackState *k2; xKbdFeedbackState *k2;
k2 = (xKbdFeedbackState *) *buf; k2 = (xKbdFeedbackState *) *buf;
...@@ -224,11 +221,11 @@ CopySwapKbdFeedback (client, k, buf) ...@@ -224,11 +221,11 @@ CopySwapKbdFeedback (client, k, buf)
k2->auto_repeats[i] = k->ctrl.autoRepeats[i]; k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
if (client->swapped) if (client->swapped)
{ {
swaps(&k2->length,n); swaps(&k2->length);
swaps(&k2->pitch,n); swaps(&k2->pitch);
swaps(&k2->duration,n); swaps(&k2->duration);
swapl(&k2->led_mask,n); swapl(&k2->led_mask);
swapl(&k2->led_values,n); swapl(&k2->led_values);
} }
*buf += sizeof (xKbdFeedbackState); *buf += sizeof (xKbdFeedbackState);
} }
...@@ -245,7 +242,6 @@ CopySwapPtrFeedback (client, p, buf) ...@@ -245,7 +242,6 @@ CopySwapPtrFeedback (client, p, buf)
PtrFeedbackPtr p; PtrFeedbackPtr p;
char **buf; char **buf;
{ {
register char n;
xPtrFeedbackState *p2; xPtrFeedbackState *p2;
p2 = (xPtrFeedbackState *) *buf; p2 = (xPtrFeedbackState *) *buf;
...@@ -257,10 +253,10 @@ CopySwapPtrFeedback (client, p, buf) ...@@ -257,10 +253,10 @@ CopySwapPtrFeedback (client, p, buf)
p2->threshold = p->ctrl.threshold; p2->threshold = p->ctrl.threshold;
if (client->swapped) if (client->swapped)
{ {
swaps(&p2->length,n); swaps(&p2->length);
swaps(&p2->accelNum,n); swaps(&p2->accelNum);
swaps(&p2->accelDenom,n); swaps(&p2->accelDenom);
swaps(&p2->threshold,n); swaps(&p2->threshold);
} }
*buf += sizeof (xPtrFeedbackState); *buf += sizeof (xPtrFeedbackState);
} }
...@@ -277,7 +273,6 @@ CopySwapIntegerFeedback (client, i, buf) ...@@ -277,7 +273,6 @@ CopySwapIntegerFeedback (client, i, buf)
IntegerFeedbackPtr i; IntegerFeedbackPtr i;
char **buf; char **buf;
{ {
register char n;
xIntegerFeedbackState *i2; xIntegerFeedbackState *i2;
i2 = (xIntegerFeedbackState *) *buf; i2 = (xIntegerFeedbackState *) *buf;
...@@ -289,10 +284,10 @@ CopySwapIntegerFeedback (client, i, buf) ...@@ -289,10 +284,10 @@ CopySwapIntegerFeedback (client, i, buf)
i2->max_value = i->ctrl.max_value; i2->max_value = i->ctrl.max_value;
if (client->swapped) if (client->swapped)
{ {
swaps(&i2->length,n); swaps(&i2->length);
swapl(&i2->resolution,n); swapl(&i2->resolution);
swapl(&i2->min_value,n); swapl(&i2->min_value);
swapl(&i2->max_value,n); swapl(&i2->max_value);
} }
*buf += sizeof (xIntegerFeedbackState); *buf += sizeof (xIntegerFeedbackState);
} }
...@@ -310,7 +305,6 @@ CopySwapStringFeedback (client, s, buf) ...@@ -310,7 +305,6 @@ CopySwapStringFeedback (client, s, buf)
char **buf; char **buf;
{ {
int i; int i;
register char n;
xStringFeedbackState *s2; xStringFeedbackState *s2;
KeySym *kptr; KeySym *kptr;
...@@ -327,13 +321,13 @@ CopySwapStringFeedback (client, s, buf) ...@@ -327,13 +321,13 @@ CopySwapStringFeedback (client, s, buf)
*kptr++ = *(s->ctrl.symbols_supported+i); *kptr++ = *(s->ctrl.symbols_supported+i);
if (client->swapped) if (client->swapped)
{ {
swaps(&s2->length,n); swaps(&s2->length);
swaps(&s2->max_symbols,n); swaps(&s2->max_symbols);
swaps(&s2->num_syms_supported,n); swaps(&s2->num_syms_supported);
kptr = (KeySym *) (*buf); kptr = (KeySym *) (*buf);
for (i=0; i<s->ctrl.num_symbols_supported; i++,kptr++) for (i=0; i<s->ctrl.num_symbols_supported; i++,kptr++)
{ {
swapl(kptr,n); swapl(kptr);
} }
} }
*buf += (s->ctrl.num_symbols_supported * sizeof (KeySym)); *buf += (s->ctrl.num_symbols_supported * sizeof (KeySym));
...@@ -351,7 +345,6 @@ CopySwapLedFeedback (client, l, buf) ...@@ -351,7 +345,6 @@ CopySwapLedFeedback (client, l, buf)
LedFeedbackPtr l; LedFeedbackPtr l;
char **buf; char **buf;
{ {
register char n;
xLedFeedbackState *l2; xLedFeedbackState *l2;
l2 = (xLedFeedbackState *) *buf; l2 = (xLedFeedbackState *) *buf;
...@@ -362,9 +355,9 @@ CopySwapLedFeedback (client, l, buf) ...@@ -362,9 +355,9 @@ CopySwapLedFeedback (client, l, buf)
l2->led_mask = l->ctrl.led_mask; l2->led_mask = l->ctrl.led_mask;
if (client->swapped) if (client->swapped)
{ {
swaps(&l2->length,n); swaps(&l2->length);
swapl(&l2->led_values,n); swapl(&l2->led_values);
swapl(&l2->led_mask,n); swapl(&l2->led_mask);
} }
*buf += sizeof (xLedFeedbackState); *buf += sizeof (xLedFeedbackState);
} }
...@@ -381,7 +374,6 @@ CopySwapBellFeedback (client, b, buf) ...@@ -381,7 +374,6 @@ CopySwapBellFeedback (client, b, buf)
BellFeedbackPtr b; BellFeedbackPtr b;
char **buf; char **buf;
{ {
register char n;
xBellFeedbackState *b2; xBellFeedbackState *b2;
b2 = (xBellFeedbackState *) *buf; b2 = (xBellFeedbackState *) *buf;
...@@ -393,9 +385,9 @@ CopySwapBellFeedback (client, b, buf) ...@@ -393,9 +385,9 @@ CopySwapBellFeedback (client, b, buf)
b2->duration = b->ctrl.duration; b2->duration = b->ctrl.duration;
if (client->swapped) if (client->swapped)
{ {
swaps(&b2->length,n); swaps(&b2->length);
swaps(&b2->pitch,n); swaps(&b2->pitch);
swaps(&b2->duration,n); swaps(&b2->duration);
} }
*buf += sizeof (xBellFeedbackState); *buf += sizeof (xBellFeedbackState);
} }
...@@ -413,10 +405,8 @@ SRepXGetFeedbackControl (client, size, rep) ...@@ -413,10 +405,8 @@ SRepXGetFeedbackControl (client, size, rep)
int size; int size;
xGetFeedbackControlReply *rep; xGetFeedbackControlReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swaps(&rep->num_feedbacks);
swapl(&rep->length, n);
swaps(&rep->num_feedbacks, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -81,10 +81,8 @@ int ...@@ -81,10 +81,8 @@ int
SProcXGetDeviceFocus(client) SProcXGetDeviceFocus(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetDeviceFocusReq); REQUEST(xGetDeviceFocusReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXGetDeviceFocus(client)); return(ProcXGetDeviceFocus(client));
} }
...@@ -147,11 +145,9 @@ SRepXGetDeviceFocus (client, size, rep) ...@@ -147,11 +145,9 @@ SRepXGetDeviceFocus (client, size, rep)
int size; int size;
xGetDeviceFocusReply *rep; xGetDeviceFocusReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swapl(&rep->focus);
swapl(&rep->length, n); swapl(&rep->time);
swapl(&rep->focus, n);
swapl(&rep->time, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -82,10 +82,8 @@ int ...@@ -82,10 +82,8 @@ int
SProcXGetDeviceKeyMapping(client) SProcXGetDeviceKeyMapping(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetDeviceKeyMappingReq); REQUEST(xGetDeviceKeyMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXGetDeviceKeyMapping(client)); return(ProcXGetDeviceKeyMapping(client));
} }
...@@ -169,10 +167,8 @@ SRepXGetDeviceKeyMapping (client, size, rep) ...@@ -169,10 +167,8 @@ SRepXGetDeviceKeyMapping (client, size, rep)
int size; int size;
xGetDeviceKeyMappingReply *rep; xGetDeviceKeyMappingReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -81,10 +81,8 @@ int ...@@ -81,10 +81,8 @@ int
SProcXGetDeviceModifierMapping(client) SProcXGetDeviceModifierMapping(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetDeviceModifierMappingReq); REQUEST(xGetDeviceModifierMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXGetDeviceModifierMapping(client)); return(ProcXGetDeviceModifierMapping(client));
} }
...@@ -150,9 +148,7 @@ SRepXGetDeviceModifierMapping (client, size, rep) ...@@ -150,9 +148,7 @@ SRepXGetDeviceModifierMapping (client, size, rep)
int size; int size;
xGetDeviceModifierMappingReply *rep; xGetDeviceModifierMappingReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -85,12 +85,10 @@ int ...@@ -85,12 +85,10 @@ int
SProcXGetDeviceDontPropagateList(client) SProcXGetDeviceDontPropagateList(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetDeviceDontPropagateListReq); REQUEST(xGetDeviceDontPropagateListReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
swapl(&stuff->window, n); swapl(&stuff->window);
return(ProcXGetDeviceDontPropagateList(client)); return(ProcXGetDeviceDontPropagateList(client));
} }
...@@ -206,10 +204,8 @@ SRepXGetDeviceDontPropagateList (client, size, rep) ...@@ -206,10 +204,8 @@ SRepXGetDeviceDontPropagateList (client, size, rep)
int size; int size;
xGetDeviceDontPropagateListReply *rep; xGetDeviceDontPropagateListReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swaps(&rep->count);
swapl(&rep->length, n);
swaps(&rep->count, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -83,12 +83,10 @@ int ...@@ -83,12 +83,10 @@ int
SProcXGetSelectedExtensionEvents(client) SProcXGetSelectedExtensionEvents(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetSelectedExtensionEventsReq); REQUEST(xGetSelectedExtensionEventsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
swapl(&stuff->window, n); swapl(&stuff->window);
return(ProcXGetSelectedExtensionEvents(client)); return(ProcXGetSelectedExtensionEvents(client));
} }
...@@ -186,11 +184,9 @@ SRepXGetSelectedExtensionEvents (client, size, rep) ...@@ -186,11 +184,9 @@ SRepXGetSelectedExtensionEvents (client, size, rep)
int size; int size;
xGetSelectedExtensionEventsReply *rep; xGetSelectedExtensionEventsReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swaps(&rep->this_client_count);
swapl(&rep->length, n); swaps(&rep->all_clients_count);
swaps(&rep->this_client_count, n);
swaps(&rep->all_clients_count, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -82,12 +82,10 @@ int ...@@ -82,12 +82,10 @@ int
SProcXGetExtensionVersion(client) SProcXGetExtensionVersion(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetExtensionVersionReq); REQUEST(xGetExtensionVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq); REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return(ProcXGetExtensionVersion(client)); return(ProcXGetExtensionVersion(client));
} }
...@@ -148,11 +146,9 @@ SRepXGetExtensionVersion (client, size, rep) ...@@ -148,11 +146,9 @@ SRepXGetExtensionVersion (client, size, rep)
int size; int size;
xGetExtensionVersionReply *rep; xGetExtensionVersionReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swaps(&rep->major_version);
swapl(&rep->length, n); swaps(&rep->minor_version);
swaps(&rep->major_version, n);
swaps(&rep->minor_version, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -86,14 +86,12 @@ int ...@@ -86,14 +86,12 @@ int
SProcXGrabDevice(client) SProcXGrabDevice(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGrabDeviceReq); REQUEST(xGrabDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swapl(&stuff->time, n); swapl(&stuff->time);
swaps(&stuff->event_count, n); swaps(&stuff->event_count);
if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count) if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count)
return BadLength; return BadLength;
...@@ -221,9 +219,7 @@ SRepXGrabDevice (client, size, rep) ...@@ -221,9 +219,7 @@ SRepXGrabDevice (client, size, rep)
int size; int size;
xGrabDeviceReply *rep; xGrabDeviceReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -83,14 +83,12 @@ int ...@@ -83,14 +83,12 @@ int
SProcXGrabDeviceButton(client) SProcXGrabDeviceButton(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGrabDeviceButtonReq); REQUEST(xGrabDeviceButtonReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers, n); swaps(&stuff->modifiers);
swaps(&stuff->event_count, n); swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq, REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
stuff->event_count * sizeof(CARD32)); stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
......
...@@ -83,14 +83,12 @@ int ...@@ -83,14 +83,12 @@ int
SProcXGrabDeviceKey(client) SProcXGrabDeviceKey(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGrabDeviceKeyReq); REQUEST(xGrabDeviceKeyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers, n); swaps(&stuff->modifiers);
swaps(&stuff->event_count, n); swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32)); REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return(ProcXGrabDeviceKey(client)); return(ProcXGrabDeviceKey(client));
......
...@@ -81,13 +81,11 @@ int ...@@ -81,13 +81,11 @@ int
SProcXGetDeviceMotionEvents(client) SProcXGetDeviceMotionEvents(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xGetDeviceMotionEventsReq); REQUEST(xGetDeviceMotionEventsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq); REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
swapl(&stuff->start, n); swapl(&stuff->start);
swapl(&stuff->stop, n); swapl(&stuff->stop);
return(ProcXGetDeviceMotionEvents(client)); return(ProcXGetDeviceMotionEvents(client));
} }
...@@ -175,12 +173,10 @@ ProcXGetDeviceMotionEvents(client) ...@@ -175,12 +173,10 @@ ProcXGetDeviceMotionEvents(client)
{ {
if (client->swapped) if (client->swapped)
{ {
register char n;
bufptr = coords; bufptr = coords;
for (i=0; i<nEvents * (axes+1); i++) for (i=0; i<nEvents * (axes+1); i++)
{ {
swapl(bufptr, n); swapl(bufptr);
bufptr++; bufptr++;
} }
} }
...@@ -204,10 +200,8 @@ SRepXGetDeviceMotionEvents (client, size, rep) ...@@ -204,10 +200,8 @@ SRepXGetDeviceMotionEvents (client, size, rep)
int size; int size;
xGetDeviceMotionEventsReply *rep; xGetDeviceMotionEventsReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n); swapl(&rep->nEvents);
swapl(&rep->length, n);
swapl(&rep->nEvents, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -83,10 +83,8 @@ int ...@@ -83,10 +83,8 @@ int
SProcXListInputDevices(client) SProcXListInputDevices(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xListInputDevicesReq); REQUEST(xListInputDevicesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXListInputDevices(client)); return(ProcXListInputDevices(client));
} }
...@@ -254,7 +252,6 @@ CopySwapDevice (client, d, num_classes, buf) ...@@ -254,7 +252,6 @@ CopySwapDevice (client, d, num_classes, buf)
int num_classes; int num_classes;
char **buf; char **buf;
{ {
register char n;
xDeviceInfoPtr dev; xDeviceInfoPtr dev;
dev = (xDeviceInfoPtr) *buf; dev = (xDeviceInfoPtr) *buf;
...@@ -270,7 +267,7 @@ CopySwapDevice (client, d, num_classes, buf) ...@@ -270,7 +267,7 @@ CopySwapDevice (client, d, num_classes, buf)
dev->use = IsXExtensionDevice; dev->use = IsXExtensionDevice;
if (client->swapped) if (client->swapped)
{ {
swapl(&dev->type, n); /* macro - braces are required */ swapl(&dev->type); /* macro - braces are required */
} }
*buf += sizeof (xDeviceInfo); *buf += sizeof (xDeviceInfo);
} }
...@@ -287,7 +284,6 @@ CopySwapKeyClass (client, k, buf) ...@@ -287,7 +284,6 @@ CopySwapKeyClass (client, k, buf)
KeyClassPtr k; KeyClassPtr k;
char **buf; char **buf;
{ {
register char n;
xKeyInfoPtr k2; xKeyInfoPtr k2;
k2 = (xKeyInfoPtr) *buf; k2 = (xKeyInfoPtr) *buf;
...@@ -298,7 +294,7 @@ CopySwapKeyClass (client, k, buf) ...@@ -298,7 +294,7 @@ CopySwapKeyClass (client, k, buf)
k2->num_keys = k2->max_keycode - k2->min_keycode + 1; k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
if (client->swapped) if (client->swapped)
{ {
swaps(&k2->num_keys,n); swaps(&k2->num_keys);
} }
*buf += sizeof (xKeyInfo); *buf += sizeof (xKeyInfo);
} }
...@@ -315,7 +311,6 @@ CopySwapButtonClass (client, b, buf) ...@@ -315,7 +311,6 @@ CopySwapButtonClass (client, b, buf)
ButtonClassPtr b; ButtonClassPtr b;
char **buf; char **buf;
{ {
register char n;
xButtonInfoPtr b2; xButtonInfoPtr b2;
b2 = (xButtonInfoPtr) *buf; b2 = (xButtonInfoPtr) *buf;
...@@ -324,7 +319,7 @@ CopySwapButtonClass (client, b, buf) ...@@ -324,7 +319,7 @@ CopySwapButtonClass (client, b, buf)
b2->num_buttons = b->numButtons; b2->num_buttons = b->numButtons;
if (client->swapped) if (client->swapped)
{ {
swaps(&b2->num_buttons,n); /* macro - braces are required */ swaps(&b2->num_buttons); /* macro - braces are required */
} }
*buf += sizeof (xButtonInfo); *buf += sizeof (xButtonInfo);
} }
...@@ -348,7 +343,6 @@ CopySwapValuatorClass (client, v, buf) ...@@ -348,7 +343,6 @@ CopySwapValuatorClass (client, v, buf)
char **buf; char **buf;
{ {
int i, j, axes, t_axes; int i, j, axes, t_axes;
register char n;
xValuatorInfoPtr v2; xValuatorInfoPtr v2;
AxisInfo *a; AxisInfo *a;
xAxisInfoPtr a2; xAxisInfoPtr a2;
...@@ -365,7 +359,7 @@ CopySwapValuatorClass (client, v, buf) ...@@ -365,7 +359,7 @@ CopySwapValuatorClass (client, v, buf)
v2->motion_buffer_size = v->numMotionEvents; v2->motion_buffer_size = v->numMotionEvents;
if (client->swapped) if (client->swapped)
{ {
swapl(&v2->motion_buffer_size,n); swapl(&v2->motion_buffer_size);
} }
*buf += sizeof (xValuatorInfo); *buf += sizeof (xValuatorInfo);
a = v->axes + (VPC * i); a = v->axes + (VPC * i);
...@@ -375,9 +369,9 @@ CopySwapValuatorClass (client, v, buf) ...@@ -375,9 +369,9 @@ CopySwapValuatorClass (client, v, buf)
a2->max_value = a->max_value; a2->max_value = a->max_value;
a2->resolution = a->resolution; a2->resolution = a->resolution;
if (client->swapped) { if (client->swapped) {
swapl(&a2->min_value,n); swapl(&a2->min_value);
swapl(&a2->max_value,n); swapl(&a2->max_value);
swapl(&a2->resolution,n); swapl(&a2->resolution);
} }
a2++; a2++;
a++; a++;
...@@ -400,9 +394,7 @@ SRepXListInputDevices (client, size, rep) ...@@ -400,9 +394,7 @@ SRepXListInputDevices (client, size, rep)
int size; int size;
xListInputDevicesReply *rep; xListInputDevicesReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -85,10 +85,8 @@ int ...@@ -85,10 +85,8 @@ int
SProcXOpenDevice(client) SProcXOpenDevice(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xOpenDeviceReq); REQUEST(xOpenDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXOpenDevice(client)); return(ProcXOpenDevice(client));
} }
...@@ -198,9 +196,7 @@ SRepXOpenDevice (client, size, rep) ...@@ -198,9 +196,7 @@ SRepXOpenDevice (client, size, rep)
int size; int size;
xOpenDeviceReply *rep; xOpenDeviceReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -63,10 +63,8 @@ int ...@@ -63,10 +63,8 @@ int
SProcXQueryDeviceState(client) SProcXQueryDeviceState(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xQueryDeviceStateReq); REQUEST(xQueryDeviceStateReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXQueryDeviceState(client)); return(ProcXQueryDeviceState(client));
} }
...@@ -80,7 +78,6 @@ int ...@@ -80,7 +78,6 @@ int
ProcXQueryDeviceState(client) ProcXQueryDeviceState(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
int i; int i;
int num_classes = 0; int num_classes = 0;
int total_length = 0; int total_length = 0;
...@@ -179,7 +176,7 @@ ProcXQueryDeviceState(client) ...@@ -179,7 +176,7 @@ ProcXQueryDeviceState(client)
*((int *) buf) = *values++; *((int *) buf) = *values++;
if (client->swapped) if (client->swapped)
{ {
swapl ((int *) buf, n);/* macro - braces needed */ swapl ((int *) buf);/* macro - braces needed */
} }
buf += sizeof(int); buf += sizeof(int);
} }
...@@ -207,9 +204,7 @@ SRepXQueryDeviceState (client, size, rep) ...@@ -207,9 +204,7 @@ SRepXQueryDeviceState (client, size, rep)
int size; int size;
xQueryDeviceStateReply *rep; xQueryDeviceStateReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -87,13 +87,11 @@ int ...@@ -87,13 +87,11 @@ int
SProcXSelectExtensionEvent (client) SProcXSelectExtensionEvent (client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xSelectExtensionEventReq); REQUEST(xSelectExtensionEventReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swaps(&stuff->count, n); swaps(&stuff->count);
REQUEST_FIXED_SIZE(xSelectExtensionEventReq, REQUEST_FIXED_SIZE(xSelectExtensionEventReq,
stuff->count * sizeof(CARD32)); stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count); SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
......
...@@ -86,7 +86,6 @@ int ...@@ -86,7 +86,6 @@ int
SProcXSendExtensionEvent(client) SProcXSendExtensionEvent(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
CARD32 *p; CARD32 *p;
register int i; register int i;
xEvent eventT; xEvent eventT;
...@@ -94,10 +93,10 @@ SProcXSendExtensionEvent(client) ...@@ -94,10 +93,10 @@ SProcXSendExtensionEvent(client)
EventSwapPtr proc; EventSwapPtr proc;
REQUEST(xSendExtensionEventReq); REQUEST(xSendExtensionEventReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
swapl(&stuff->destination, n); swapl(&stuff->destination);
swaps(&stuff->count, n); swaps(&stuff->count);
if (stuff->length != (sizeof(xSendExtensionEventReq) >> 2) + stuff->count + if (stuff->length != (sizeof(xSendExtensionEventReq) >> 2) + stuff->count +
(stuff->num_events * (sizeof(xEvent) >> 2))) (stuff->num_events * (sizeof(xEvent) >> 2)))
...@@ -154,6 +153,8 @@ ProcXSendExtensionEvent (client) ...@@ -154,6 +153,8 @@ ProcXSendExtensionEvent (client)
return Success; return Success;
} }
// FIXME: ret is not initialized and should not be returned...
if (stuff->num_events == 0) if (stuff->num_events == 0)
return ret; return ret;
......
...@@ -84,10 +84,8 @@ int ...@@ -84,10 +84,8 @@ int
SProcXSetDeviceButtonMapping(client) SProcXSetDeviceButtonMapping(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xSetDeviceButtonMappingReq); REQUEST(xSetDeviceButtonMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXSetDeviceButtonMapping(client)); return(ProcXSetDeviceButtonMapping(client));
} }
...@@ -162,9 +160,7 @@ SRepXSetDeviceButtonMapping (client, size, rep) ...@@ -162,9 +160,7 @@ SRepXSetDeviceButtonMapping (client, size, rep)
int size; int size;
xSetDeviceButtonMappingReply *rep; xSetDeviceButtonMappingReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -81,10 +81,8 @@ int ...@@ -81,10 +81,8 @@ int
SProcXSetDeviceValuators(client) SProcXSetDeviceValuators(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xSetDeviceValuatorsReq); REQUEST(xSetDeviceValuatorsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXSetDeviceValuators(client)); return(ProcXSetDeviceValuators(client));
} }
...@@ -166,9 +164,7 @@ SRepXSetDeviceValuators (client, size, rep) ...@@ -166,9 +164,7 @@ SRepXSetDeviceValuators (client, size, rep)
int size; int size;
xSetDeviceValuatorsReply *rep; xSetDeviceValuatorsReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -84,13 +84,11 @@ int ...@@ -84,13 +84,11 @@ int
SProcXSetDeviceFocus(client) SProcXSetDeviceFocus(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xSetDeviceFocusReq); REQUEST(xSetDeviceFocusReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq); REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
swapl(&stuff->focus, n); swapl(&stuff->focus);
swapl(&stuff->time, n); swapl(&stuff->time);
return(ProcXSetDeviceFocus(client)); return(ProcXSetDeviceFocus(client));
} }
......
...@@ -82,10 +82,8 @@ int ...@@ -82,10 +82,8 @@ int
SProcXSetDeviceModifierMapping(client) SProcXSetDeviceModifierMapping(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xSetDeviceModifierMappingReq); REQUEST(xSetDeviceModifierMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXSetDeviceModifierMapping(client)); return(ProcXSetDeviceModifierMapping(client));
} }
...@@ -155,10 +153,8 @@ SRepXSetDeviceModifierMapping (client, size, rep) ...@@ -155,10 +153,8 @@ SRepXSetDeviceModifierMapping (client, size, rep)
int size; int size;
xSetDeviceModifierMappingReply *rep; xSetDeviceModifierMappingReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -81,10 +81,8 @@ int ...@@ -81,10 +81,8 @@ int
SProcXSetDeviceMode(client) SProcXSetDeviceMode(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xSetDeviceModeReq); REQUEST(xSetDeviceModeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcXSetDeviceMode(client)); return(ProcXSetDeviceMode(client));
} }
...@@ -150,9 +148,7 @@ SRepXSetDeviceMode (client, size, rep) ...@@ -150,9 +148,7 @@ SRepXSetDeviceMode (client, size, rep)
int size; int size;
xSetDeviceModeReply *rep; xSetDeviceModeReply *rep;
{ {
register char n; swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep); WriteToClient(client, size, (char *)rep);
} }
...@@ -80,12 +80,10 @@ int ...@@ -80,12 +80,10 @@ int
SProcXUngrabDevice(client) SProcXUngrabDevice(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xUngrabDeviceReq); REQUEST(xUngrabDeviceReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceReq); REQUEST_SIZE_MATCH(xUngrabDeviceReq);
swapl(&stuff->time, n); swapl(&stuff->time);
return(ProcXUngrabDevice(client)); return(ProcXUngrabDevice(client));
} }
......
...@@ -86,13 +86,11 @@ int ...@@ -86,13 +86,11 @@ int
SProcXUngrabDeviceButton(client) SProcXUngrabDeviceButton(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xUngrabDeviceButtonReq); REQUEST(xUngrabDeviceButtonReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers, n); swaps(&stuff->modifiers);
return(ProcXUngrabDeviceButton(client)); return(ProcXUngrabDeviceButton(client));
} }
......
...@@ -86,13 +86,11 @@ int ...@@ -86,13 +86,11 @@ int
SProcXUngrabDeviceKey(client) SProcXUngrabDeviceKey(client)
register ClientPtr client; register ClientPtr client;
{ {
register char n;
REQUEST(xUngrabDeviceKeyReq); REQUEST(xUngrabDeviceKeyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers, n); swaps(&stuff->modifiers);
return(ProcXUngrabDeviceKey(client)); return(ProcXUngrabDeviceKey(client));
} }
......
...@@ -113,7 +113,6 @@ ProcCompositeQueryVersion (ClientPtr client) ...@@ -113,7 +113,6 @@ ProcCompositeQueryVersion (ClientPtr client)
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0 .length = 0
}; };
register int n;
REQUEST(xCompositeQueryVersionReq); REQUEST(xCompositeQueryVersionReq);
...@@ -128,10 +127,10 @@ ProcCompositeQueryVersion (ClientPtr client) ...@@ -128,10 +127,10 @@ ProcCompositeQueryVersion (ClientPtr client)
pCompositeClient->major_version = rep.majorVersion; pCompositeClient->major_version = rep.majorVersion;
pCompositeClient->minor_version = rep.minorVersion; pCompositeClient->minor_version = rep.minorVersion;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.majorVersion, n); swapl(&rep.majorVersion);
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep);
return Success; return Success;
...@@ -352,7 +351,6 @@ ProcCompositeGetOverlayWindow(ClientPtr client) ...@@ -352,7 +351,6 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
CompScreenPtr cs; CompScreenPtr cs;
CompOverlayClientPtr pOc; CompOverlayClientPtr pOc;
int rc; int rc;
int n = 0;
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq); REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
/* Unsupported by current architecture and porting is too much effort. */ /* Unsupported by current architecture and porting is too much effort. */
...@@ -403,9 +401,9 @@ ProcCompositeGetOverlayWindow(ClientPtr client) ...@@ -403,9 +401,9 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.overlayWin, n); swapl(&rep.overlayWin);
} }
WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep); WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
...@@ -470,111 +468,102 @@ ProcCompositeDispatch (ClientPtr client) ...@@ -470,111 +468,102 @@ ProcCompositeDispatch (ClientPtr client)
static int static int
SProcCompositeQueryVersion (ClientPtr client) SProcCompositeQueryVersion (ClientPtr client)
{ {
int n;
REQUEST(xCompositeQueryVersionReq); REQUEST(xCompositeQueryVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq); REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
swapl(&stuff->majorVersion, n); swapl(&stuff->majorVersion);
swapl(&stuff->minorVersion, n); swapl(&stuff->minorVersion);
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
static int static int
SProcCompositeRedirectWindow (ClientPtr client) SProcCompositeRedirectWindow (ClientPtr client)
{ {
int n;
REQUEST(xCompositeRedirectWindowReq); REQUEST(xCompositeRedirectWindowReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq); REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq);
swapl (&stuff->window, n); swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
static int static int
SProcCompositeRedirectSubwindows (ClientPtr client) SProcCompositeRedirectSubwindows (ClientPtr client)
{ {
int n;
REQUEST(xCompositeRedirectSubwindowsReq); REQUEST(xCompositeRedirectSubwindowsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq); REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq);
swapl (&stuff->window, n); swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
static int static int
SProcCompositeUnredirectWindow (ClientPtr client) SProcCompositeUnredirectWindow (ClientPtr client)
{ {
int n;
REQUEST(xCompositeUnredirectWindowReq); REQUEST(xCompositeUnredirectWindowReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq); REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq);
swapl (&stuff->window, n); swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
static int static int
SProcCompositeUnredirectSubwindows (ClientPtr client) SProcCompositeUnredirectSubwindows (ClientPtr client)
{ {
int n;
REQUEST(xCompositeUnredirectSubwindowsReq); REQUEST(xCompositeUnredirectSubwindowsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq); REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq);
swapl (&stuff->window, n); swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
static int static int
SProcCompositeCreateRegionFromBorderClip (ClientPtr client) SProcCompositeCreateRegionFromBorderClip (ClientPtr client)
{ {
int n;
REQUEST(xCompositeCreateRegionFromBorderClipReq); REQUEST(xCompositeCreateRegionFromBorderClipReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq); REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq);
swapl (&stuff->region, n); swapl (&stuff->region);
swapl (&stuff->window, n); swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
static int static int
SProcCompositeNameWindowPixmap (ClientPtr client) SProcCompositeNameWindowPixmap (ClientPtr client)
{ {
int n;
REQUEST(xCompositeNameWindowPixmapReq); REQUEST(xCompositeNameWindowPixmapReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq); REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq);
swapl (&stuff->window, n); swapl (&stuff->window);
swapl (&stuff->pixmap, n); swapl (&stuff->pixmap);
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
static int static int
SProcCompositeGetOverlayWindow(ClientPtr client) SProcCompositeGetOverlayWindow(ClientPtr client)
{ {
int n = 0;
REQUEST(xCompositeGetOverlayWindowReq); REQUEST(xCompositeGetOverlayWindowReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq); REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
swapl(&stuff->window, n); swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
static int static int
SProcCompositeReleaseOverlayWindow(ClientPtr client) SProcCompositeReleaseOverlayWindow(ClientPtr client)
{ {
int n = 0;
REQUEST(xCompositeReleaseOverlayWindowReq); REQUEST(xCompositeReleaseOverlayWindowReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq); REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq);
swapl(&stuff->window, n); swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client); return (*ProcCompositeVector[stuff->compositeReqType]) (client);
} }
...@@ -903,7 +892,6 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client) ...@@ -903,7 +892,6 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
int rc; int rc;
PanoramiXRes *win, *overlayWin = NULL; PanoramiXRes *win, *overlayWin = NULL;
int i; int i;
int n = 0;
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq); REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
...@@ -986,9 +974,9 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client) ...@@ -986,9 +974,9 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.overlayWin, n); swapl(&rep.overlayWin);
} }
WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep); WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep);
......
...@@ -137,7 +137,6 @@ ProcDamageQueryVersion(ClientPtr client) ...@@ -137,7 +137,6 @@ ProcDamageQueryVersion(ClientPtr client)
{ {
DamageClientPtr pDamageClient = GetDamageClient (client); DamageClientPtr pDamageClient = GetDamageClient (client);
xDamageQueryVersionReply rep; xDamageQueryVersionReply rep;
register int n;
REQUEST(xDamageQueryVersionReq); REQUEST(xDamageQueryVersionReq);
REQUEST_SIZE_MATCH(xDamageQueryVersionReq); REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
...@@ -158,10 +157,10 @@ ProcDamageQueryVersion(ClientPtr client) ...@@ -158,10 +157,10 @@ ProcDamageQueryVersion(ClientPtr client)
pDamageClient->major_version = rep.majorVersion; pDamageClient->major_version = rep.majorVersion;
pDamageClient->minor_version = rep.minorVersion; pDamageClient->minor_version = rep.minorVersion;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.majorVersion, n); swapl(&rep.majorVersion);
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -309,52 +308,48 @@ ProcDamageDispatch (ClientPtr client) ...@@ -309,52 +308,48 @@ ProcDamageDispatch (ClientPtr client)
static int static int
SProcDamageQueryVersion(ClientPtr client) SProcDamageQueryVersion(ClientPtr client)
{ {
register int n;
REQUEST(xDamageQueryVersionReq); REQUEST(xDamageQueryVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDamageQueryVersionReq); REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
swapl(&stuff->majorVersion, n); swapl(&stuff->majorVersion);
swapl(&stuff->minorVersion, n); swapl(&stuff->minorVersion);
return (*ProcDamageVector[stuff->damageReqType]) (client); return (*ProcDamageVector[stuff->damageReqType]) (client);
} }
static int static int
SProcDamageCreate (ClientPtr client) SProcDamageCreate (ClientPtr client)
{ {
register int n;
REQUEST(xDamageCreateReq); REQUEST(xDamageCreateReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xDamageCreateReq); REQUEST_SIZE_MATCH(xDamageCreateReq);
swapl (&stuff->damage, n); swapl (&stuff->damage);
swapl (&stuff->drawable, n); swapl (&stuff->drawable);
return (*ProcDamageVector[stuff->damageReqType]) (client); return (*ProcDamageVector[stuff->damageReqType]) (client);
} }
static int static int
SProcDamageDestroy (ClientPtr client) SProcDamageDestroy (ClientPtr client)
{ {
register int n;
REQUEST(xDamageDestroyReq); REQUEST(xDamageDestroyReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xDamageDestroyReq); REQUEST_SIZE_MATCH(xDamageDestroyReq);
swapl (&stuff->damage, n); swapl (&stuff->damage);
return (*ProcDamageVector[stuff->damageReqType]) (client); return (*ProcDamageVector[stuff->damageReqType]) (client);
} }
static int static int
SProcDamageSubtract (ClientPtr client) SProcDamageSubtract (ClientPtr client)
{ {
register int n;
REQUEST(xDamageSubtractReq); REQUEST(xDamageSubtractReq);
swaps (&stuff->length, n); swaps (&stuff->length);
REQUEST_SIZE_MATCH(xDamageSubtractReq); REQUEST_SIZE_MATCH(xDamageSubtractReq);
swapl (&stuff->damage, n); swapl (&stuff->damage);
swapl (&stuff->repair, n); swapl (&stuff->repair);
swapl (&stuff->parts, n); swapl (&stuff->parts);
return (*ProcDamageVector[stuff->damageReqType]) (client); return (*ProcDamageVector[stuff->damageReqType]) (client);
} }
......
...@@ -362,8 +362,6 @@ ProcDbeGetVersion(client) ...@@ -362,8 +362,6 @@ ProcDbeGetVersion(client)
{ {
/* REQUEST(xDbeGetVersionReq); */ /* REQUEST(xDbeGetVersionReq); */
xDbeGetVersionReply rep; xDbeGetVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xDbeGetVersionReq); REQUEST_SIZE_MATCH(xDbeGetVersionReq);
...@@ -375,7 +373,7 @@ ProcDbeGetVersion(client) ...@@ -375,7 +373,7 @@ ProcDbeGetVersion(client)
if (client->swapped) if (client->swapped)
{ {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
} }
WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep); WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep);
...@@ -898,7 +896,7 @@ ProcDbeGetVisualInfo(client) ...@@ -898,7 +896,7 @@ ProcDbeGetVisualInfo(client)
xDbeGetVisualInfoReply rep; xDbeGetVisualInfoReply rep;
Drawable *drawables; Drawable *drawables;
DrawablePtr *pDrawables = NULL; DrawablePtr *pDrawables = NULL;
register int i, j, n; register int i, j;
register int count; /* number of visual infos in reply */ register int count; /* number of visual infos in reply */
register int length; /* length of reply */ register int length; /* length of reply */
ScreenPtr pScreen; ScreenPtr pScreen;
...@@ -984,9 +982,9 @@ ProcDbeGetVisualInfo(client) ...@@ -984,9 +982,9 @@ ProcDbeGetVisualInfo(client)
if (client->swapped) if (client->swapped)
{ {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.m, n); swapl(&rep.m);
} }
/* Send off reply. */ /* Send off reply. */
...@@ -1003,7 +1001,7 @@ ProcDbeGetVisualInfo(client) ...@@ -1003,7 +1001,7 @@ ProcDbeGetVisualInfo(client)
if (client->swapped) if (client->swapped)
{ {
swapl(&data32, n); swapl(&data32);
} }
WriteToClient(client, sizeof(CARD32), (char *)&data32); WriteToClient(client, sizeof(CARD32), (char *)&data32);
...@@ -1024,7 +1022,7 @@ ProcDbeGetVisualInfo(client) ...@@ -1024,7 +1022,7 @@ ProcDbeGetVisualInfo(client)
if (client->swapped) if (client->swapped)
{ {
swapl(&visInfo.visualID, n); swapl(&visInfo.visualID);
/* We do not need to swap depth and perfLevel since they are /* We do not need to swap depth and perfLevel since they are
* already 1 byte quantities. * already 1 byte quantities.
...@@ -1075,8 +1073,6 @@ ProcDbeGetBackBufferAttributes(client) ...@@ -1075,8 +1073,6 @@ ProcDbeGetBackBufferAttributes(client)
REQUEST(xDbeGetBackBufferAttributesReq); REQUEST(xDbeGetBackBufferAttributesReq);
xDbeGetBackBufferAttributesReply rep; xDbeGetBackBufferAttributesReply rep;
DbeWindowPrivPtr pDbeWindowPriv; DbeWindowPrivPtr pDbeWindowPriv;
int n;
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
...@@ -1096,9 +1092,9 @@ ProcDbeGetBackBufferAttributes(client) ...@@ -1096,9 +1092,9 @@ ProcDbeGetBackBufferAttributes(client)
if (client->swapped) if (client->swapped)
{ {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.attributes, n); swapl(&rep.attributes);
} }
WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply), WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply),
...@@ -1179,10 +1175,8 @@ SProcDbeGetVersion(client) ...@@ -1179,10 +1175,8 @@ SProcDbeGetVersion(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xDbeGetVersionReq); REQUEST(xDbeGetVersionReq);
register int n;
swaps(&stuff->length);
swaps(&stuff->length, n);
return(ProcDbeGetVersion(client)); return(ProcDbeGetVersion(client));
} /* SProcDbeGetVersion() */ } /* SProcDbeGetVersion() */
...@@ -1216,13 +1210,12 @@ SProcDbeAllocateBackBufferName(client) ...@@ -1216,13 +1210,12 @@ SProcDbeAllocateBackBufferName(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xDbeAllocateBackBufferNameReq); REQUEST(xDbeAllocateBackBufferNameReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq); REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->buffer, n); swapl(&stuff->buffer);
/* stuff->swapAction is a byte. We do not need to swap this field. */ /* stuff->swapAction is a byte. We do not need to swap this field. */
return(ProcDbeAllocateBackBufferName(client)); return(ProcDbeAllocateBackBufferName(client));
...@@ -1252,13 +1245,11 @@ SProcDbeDeallocateBackBufferName(client) ...@@ -1252,13 +1245,11 @@ SProcDbeDeallocateBackBufferName(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST (xDbeDeallocateBackBufferNameReq); REQUEST (xDbeDeallocateBackBufferNameReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq); REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq);
swapl(&stuff->buffer, n); swapl(&stuff->buffer);
return(ProcDbeDeallocateBackBufferName(client)); return(ProcDbeDeallocateBackBufferName(client));
...@@ -1291,14 +1282,14 @@ SProcDbeSwapBuffers(client) ...@@ -1291,14 +1282,14 @@ SProcDbeSwapBuffers(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xDbeSwapBuffersReq); REQUEST(xDbeSwapBuffersReq);
unsigned int i, n; unsigned int i;
xDbeSwapInfo *pSwapInfo; xDbeSwapInfo *pSwapInfo;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq); REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
swapl(&stuff->n, n); swapl(&stuff->n);
if (stuff->n > UINT32_MAX / sizeof(DbeSwapInfoRec)) if (stuff->n > UINT32_MAX / sizeof(DbeSwapInfoRec))
return BadAlloc; return BadAlloc;
REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, stuff->n * sizeof(xDbeSwapInfo)); REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, stuff->n * sizeof(xDbeSwapInfo));
...@@ -1313,7 +1304,7 @@ SProcDbeSwapBuffers(client) ...@@ -1313,7 +1304,7 @@ SProcDbeSwapBuffers(client)
*/ */
for (i = 0; i < stuff->n; i++) for (i = 0; i < stuff->n; i++)
{ {
swapl(&pSwapInfo->window, n); swapl(&pSwapInfo->window);
} }
} }
...@@ -1343,9 +1334,8 @@ SProcDbeBeginIdiom(client) ...@@ -1343,9 +1334,8 @@ SProcDbeBeginIdiom(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xDbeBeginIdiomReq); REQUEST(xDbeBeginIdiomReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
return(ProcDbeBeginIdiom(client)); return(ProcDbeBeginIdiom(client));
} /* SProcDbeBeginIdiom() */ } /* SProcDbeBeginIdiom() */
...@@ -1373,13 +1363,11 @@ SProcDbeGetVisualInfo(client) ...@@ -1373,13 +1363,11 @@ SProcDbeGetVisualInfo(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xDbeGetVisualInfoReq); REQUEST(xDbeGetVisualInfoReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq); REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq);
swapl(&stuff->n, n); swapl(&stuff->n);
SwapRestL(stuff); SwapRestL(stuff);
return(ProcDbeGetVisualInfo(client)); return(ProcDbeGetVisualInfo(client));
...@@ -1408,12 +1396,11 @@ SProcDbeGetBackBufferAttributes(client) ...@@ -1408,12 +1396,11 @@ SProcDbeGetBackBufferAttributes(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST (xDbeGetBackBufferAttributesReq); REQUEST (xDbeGetBackBufferAttributesReq);
register int n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
swapl(&stuff->buffer, n); swapl(&stuff->buffer);
return(ProcDbeGetBackBufferAttributes(client)); return(ProcDbeGetBackBufferAttributes(client));
......
...@@ -3808,7 +3808,7 @@ ProcInitialConnection(register ClientPtr client) ...@@ -3808,7 +3808,7 @@ ProcInitialConnection(register ClientPtr client)
((prefix->nbytesAuthString + (unsigned)3) >> 2); ((prefix->nbytesAuthString + (unsigned)3) >> 2);
if (client->swapped) if (client->swapped)
{ {
swaps(&stuff->length, whichbyte); swaps(&stuff->length);
} }
ResetCurrentRequest(client); ResetCurrentRequest(client);
return (client->noClientException); return (client->noClientException);
......
...@@ -78,14 +78,13 @@ void ...@@ -78,14 +78,13 @@ void
Swap32Write(ClientPtr pClient, int size, register CARD32 *pbuf) Swap32Write(ClientPtr pClient, int size, register CARD32 *pbuf)
{ {
register int i; register int i;
register char n;
size >>= 2; size >>= 2;
for(i = 0; i < size; i++) for(i = 0; i < size; i++)
/* brackets are mandatory here, because "swapl" macro expands /* brackets are mandatory here, because "swapl" macro expands
to several statements */ to several statements */
{ {
swapl(&pbuf[i], n); swapl(&pbuf[i]);
} }
(void)WriteToClient(pClient, size << 2, (char *) pbuf); (void)WriteToClient(pClient, size << 2, (char *) pbuf);
} }
...@@ -191,9 +190,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) ...@@ -191,9 +190,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
void void
SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep) SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swaps(&pRep->sequenceNumber, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -202,67 +199,57 @@ void ...@@ -202,67 +199,57 @@ void
SGetWindowAttributesReply(ClientPtr pClient, int size, SGetWindowAttributesReply(ClientPtr pClient, int size,
xGetWindowAttributesReply *pRep) xGetWindowAttributesReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swapl(&pRep->visualID);
swapl(&pRep->length, n); swaps(&pRep->class);
swapl(&pRep->visualID, n); swapl(&pRep->backingBitPlanes);
swaps(&pRep->class, n); swapl(&pRep->backingPixel);
swapl(&pRep->backingBitPlanes, n); swapl(&pRep->colormap);
swapl(&pRep->backingPixel, n); swapl(&pRep->allEventMasks);
swapl(&pRep->colormap, n); swapl(&pRep->yourEventMask);
swapl(&pRep->allEventMasks, n); swaps(&pRep->doNotPropagateMask);
swapl(&pRep->yourEventMask, n);
swaps(&pRep->doNotPropagateMask, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep) SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->root);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->x);
swapl(&pRep->root, n); swaps(&pRep->y);
swaps(&pRep->x, n); swaps(&pRep->width);
swaps(&pRep->y, n); swaps(&pRep->height);
swaps(&pRep->width, n); swaps(&pRep->borderWidth);
swaps(&pRep->height, n);
swaps(&pRep->borderWidth, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep) SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swapl(&pRep->root);
swapl(&pRep->length, n); swapl(&pRep->parent);
swapl(&pRep->root, n); swaps(&pRep->nChildren);
swapl(&pRep->parent, n);
swaps(&pRep->nChildren, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep) SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->atom);
swaps(&pRep->sequenceNumber, n);
swapl(&pRep->atom, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep) SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->nameLength);
swapl(&pRep->length, n);
swaps(&pRep->nameLength, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -270,24 +257,20 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep) ...@@ -270,24 +257,20 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep)
void void
SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep) SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swapl(&pRep->propertyType);
swapl(&pRep->length, n); swapl(&pRep->bytesAfter);
swapl(&pRep->propertyType, n); swapl(&pRep->nItems);
swapl(&pRep->bytesAfter, n);
swapl(&pRep->nItems, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep) SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->nProperties);
swapl(&pRep->length, n);
swaps(&pRep->nProperties, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -295,10 +278,8 @@ void ...@@ -295,10 +278,8 @@ void
SGetSelectionOwnerReply(ClientPtr pClient, int size, SGetSelectionOwnerReply(ClientPtr pClient, int size,
xGetSelectionOwnerReply *pRep) xGetSelectionOwnerReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->owner);
swaps(&pRep->sequenceNumber, n);
swapl(&pRep->owner, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -306,27 +287,23 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size, ...@@ -306,27 +287,23 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size,
void void
SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep) SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->root);
swaps(&pRep->sequenceNumber, n); swapl(&pRep->child);
swapl(&pRep->root, n); swaps(&pRep->rootX);
swapl(&pRep->child, n); swaps(&pRep->rootY);
swaps(&pRep->rootX, n); swaps(&pRep->winX);
swaps(&pRep->rootY, n); swaps(&pRep->winY);
swaps(&pRep->winX, n); swaps(&pRep->mask);
swaps(&pRep->winY, n);
swaps(&pRep->mask, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SwapTimecoord(xTimecoord* pCoord) SwapTimecoord(xTimecoord* pCoord)
{ {
register char n; swapl(&pCoord->time);
swaps(&pCoord->x);
swapl(&pCoord->time, n); swaps(&pCoord->y);
swaps(&pCoord->x, n);
swaps(&pCoord->y, n);
} }
void void
...@@ -348,33 +325,27 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep) ...@@ -348,33 +325,27 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep)
void void
SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep) SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swapl(&pRep->nEvents);
swapl(&pRep->length, n);
swapl(&pRep->nEvents, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep) STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->child);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->dstX);
swapl(&pRep->child, n); swaps(&pRep->dstY);
swaps(&pRep->dstX, n);
swaps(&pRep->dstY, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep) SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->focus);
swaps(&pRep->sequenceNumber, n);
swapl(&pRep->focus, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -382,10 +353,8 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep) ...@@ -382,10 +353,8 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep)
void void
SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep) SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n);
swapl(&pRep->length, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -393,30 +362,26 @@ static ...@@ -393,30 +362,26 @@ static
void void
SwapCharInfo(xCharInfo *pInfo) SwapCharInfo(xCharInfo *pInfo)
{ {
register char n; swaps(&pInfo->leftSideBearing);
swaps(&pInfo->rightSideBearing);
swaps(&pInfo->leftSideBearing, n); swaps(&pInfo->characterWidth);
swaps(&pInfo->rightSideBearing, n); swaps(&pInfo->ascent);
swaps(&pInfo->characterWidth, n); swaps(&pInfo->descent);
swaps(&pInfo->ascent, n); swaps(&pInfo->attributes);
swaps(&pInfo->descent, n);
swaps(&pInfo->attributes, n);
} }
static void static void
SwapFontInfo(xQueryFontReply *pr) SwapFontInfo(xQueryFontReply *pr)
{ {
register char n; swaps(&pr->minCharOrByte2);
swaps(&pr->maxCharOrByte2);
swaps(&pr->minCharOrByte2, n); swaps(&pr->defaultChar);
swaps(&pr->maxCharOrByte2, n); swaps(&pr->nFontProps);
swaps(&pr->defaultChar, n); swaps(&pr->fontAscent);
swaps(&pr->nFontProps, n); swaps(&pr->fontDescent);
swaps(&pr->fontAscent, n);
swaps(&pr->fontDescent, n);
SwapCharInfo( &pr->minBounds); SwapCharInfo( &pr->minBounds);
SwapCharInfo( &pr->maxBounds); SwapCharInfo( &pr->maxBounds);
swapl(&pr->nCharInfos, n); swapl(&pr->nCharInfos);
} }
static static
...@@ -427,10 +392,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs) ...@@ -427,10 +392,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs)
xCharInfo * pxci; xCharInfo * pxci;
unsigned nchars, nprops; unsigned nchars, nprops;
char *pby; char *pby;
register char n;
swaps(&pr->sequenceNumber, n); swaps(&pr->sequenceNumber);
swapl(&pr->length, n); swapl(&pr->length);
nchars = pr->nCharInfos; nchars = pr->nCharInfos;
nprops = pr->nFontProps; nprops = pr->nFontProps;
SwapFontInfo(pr); SwapFontInfo(pr);
...@@ -439,9 +403,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs) ...@@ -439,9 +403,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs)
* they are always 2 4 byte values */ * they are always 2 4 byte values */
for(i = 0; i < nprops; i++) for(i = 0; i < nprops; i++)
{ {
swapl(pby, n); swapl((int *)pby);
pby += 4; pby += 4;
swapl(pby, n); swapl((int *)pby);
pby += 4; pby += 4;
} }
if (hasGlyphs) if (hasGlyphs)
...@@ -462,27 +426,23 @@ SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep) ...@@ -462,27 +426,23 @@ SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep)
void void
SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep) SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swaps(&pRep->fontAscent);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->fontDescent);
swaps(&pRep->fontAscent, n); swaps(&pRep->overallAscent);
swaps(&pRep->fontDescent, n); swaps(&pRep->overallDescent);
swaps(&pRep->overallAscent, n); swapl(&pRep->overallWidth);
swaps(&pRep->overallDescent, n); swapl(&pRep->overallLeft);
swapl(&pRep->overallWidth, n); swapl(&pRep->overallRight);
swapl(&pRep->overallLeft, n);
swapl(&pRep->overallRight, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep) SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->nFonts);
swapl(&pRep->length, n);
swaps(&pRep->nFonts, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -497,22 +457,18 @@ SListFontsWithInfoReply(ClientPtr pClient, int size, ...@@ -497,22 +457,18 @@ SListFontsWithInfoReply(ClientPtr pClient, int size,
void void
SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep) SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->nPaths);
swapl(&pRep->length, n);
swaps(&pRep->nPaths, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep) SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swapl(&pRep->visual);
swapl(&pRep->length, n);
swapl(&pRep->visual, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
/* Fortunately, image doesn't need swapping */ /* Fortunately, image doesn't need swapping */
} }
...@@ -521,11 +477,9 @@ void ...@@ -521,11 +477,9 @@ void
SListInstalledColormapsReply(ClientPtr pClient, int size, SListInstalledColormapsReply(ClientPtr pClient, int size,
xListInstalledColormapsReply *pRep) xListInstalledColormapsReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->nColormaps);
swapl(&pRep->length, n);
swaps(&pRep->nColormaps, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -535,41 +489,35 @@ SAllocColorReply(pClient, size, pRep) ...@@ -535,41 +489,35 @@ SAllocColorReply(pClient, size, pRep)
int size; int size;
xAllocColorReply *pRep; xAllocColorReply *pRep;
{ {
register char n; swaps(&pRep->sequenceNumber);
swaps(&pRep->red);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->green);
swaps(&pRep->red, n); swaps(&pRep->blue);
swaps(&pRep->green, n); swapl(&pRep->pixel);
swaps(&pRep->blue, n);
swapl(&pRep->pixel, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep) SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->pixel);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->exactRed);
swapl(&pRep->pixel, n); swaps(&pRep->exactGreen);
swaps(&pRep->exactRed, n); swaps(&pRep->exactBlue);
swaps(&pRep->exactGreen, n); swaps(&pRep->screenRed);
swaps(&pRep->exactBlue, n); swaps(&pRep->screenGreen);
swaps(&pRep->screenRed, n); swaps(&pRep->screenBlue);
swaps(&pRep->screenGreen, n);
swaps(&pRep->screenBlue, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep) SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->nPixels);
swapl(&pRep->length, n); swaps(&pRep->nMasks);
swaps(&pRep->nPixels, n);
swaps(&pRep->nMasks, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -577,25 +525,21 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep) ...@@ -577,25 +525,21 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep)
void void
SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep) SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->nPixels);
swapl(&pRep->length, n); swapl(&pRep->redMask);
swaps(&pRep->nPixels, n); swapl(&pRep->greenMask);
swapl(&pRep->redMask, n); swapl(&pRep->blueMask);
swapl(&pRep->greenMask, n);
swapl(&pRep->blueMask, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SwapRGB(xrgb *prgb) SwapRGB(xrgb *prgb)
{ {
register char n; swaps(&prgb->red);
swaps(&prgb->green);
swaps(&prgb->red, n); swaps(&prgb->blue);
swaps(&prgb->green, n);
swaps(&prgb->blue, n);
} }
void void
...@@ -617,47 +561,39 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb) ...@@ -617,47 +561,39 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb)
void void
SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep) SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->nColors);
swapl(&pRep->length, n);
swaps(&pRep->nColors, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep) SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swaps(&pRep->exactRed);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->exactGreen);
swaps(&pRep->exactRed, n); swaps(&pRep->exactBlue);
swaps(&pRep->exactGreen, n); swaps(&pRep->screenRed);
swaps(&pRep->exactBlue, n); swaps(&pRep->screenGreen);
swaps(&pRep->screenRed, n); swaps(&pRep->screenBlue);
swaps(&pRep->screenGreen, n);
swaps(&pRep->screenBlue, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep) SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swaps(&pRep->width);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->height);
swaps(&pRep->width, n);
swaps(&pRep->height, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep) SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n);
swapl(&pRep->length, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -665,10 +601,8 @@ void ...@@ -665,10 +601,8 @@ void
SGetKeyboardMappingReply(ClientPtr pClient, int size, SGetKeyboardMappingReply(ClientPtr pClient, int size,
xGetKeyboardMappingReply *pRep) xGetKeyboardMappingReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n);
swapl(&pRep->length, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -676,10 +610,8 @@ void ...@@ -676,10 +610,8 @@ void
SGetPointerMappingReply(ClientPtr pClient, int size, SGetPointerMappingReply(ClientPtr pClient, int size,
xGetPointerMappingReply *pRep) xGetPointerMappingReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n);
swapl(&pRep->length, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -687,46 +619,38 @@ void ...@@ -687,46 +619,38 @@ void
SGetModifierMappingReply(ClientPtr pClient, int size, SGetModifierMappingReply(ClientPtr pClient, int size,
xGetModifierMappingReply *pRep) xGetModifierMappingReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n);
swapl(&pRep->length, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply *pRep) SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swapl(&pRep->ledMask);
swapl(&pRep->length, n); swaps(&pRep->bellPitch);
swapl(&pRep->ledMask, n); swaps(&pRep->bellDuration);
swaps(&pRep->bellPitch, n);
swaps(&pRep->bellDuration, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pRep) SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swaps(&pRep->accelNumerator);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->accelDenominator);
swaps(&pRep->accelNumerator, n); swaps(&pRep->threshold);
swaps(&pRep->accelDenominator, n);
swaps(&pRep->threshold, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
void void
SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep) SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swaps(&pRep->timeout);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->interval);
swaps(&pRep->timeout, n);
swaps(&pRep->interval, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
...@@ -738,8 +662,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf) ...@@ -738,8 +662,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf)
while (bufT < endbuf) { while (bufT < endbuf) {
xHostEntry *host = (xHostEntry *) bufT; xHostEntry *host = (xHostEntry *) bufT;
int len = host->length; int len = host->length;
register char n; swaps (&host->length);
swaps (&host->length, n);
bufT += sizeof (xHostEntry) + (((len + 3) >> 2) << 2); bufT += sizeof (xHostEntry) + (((len + 3) >> 2) << 2);
} }
(void)WriteToClient (pClient, size, buf); (void)WriteToClient (pClient, size, buf);
...@@ -748,11 +671,9 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf) ...@@ -748,11 +671,9 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf)
void void
SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep) SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep)
{ {
register char n; swaps(&pRep->sequenceNumber);
swapl(&pRep->length);
swaps(&pRep->sequenceNumber, n); swaps(&pRep->nHosts);
swapl(&pRep->length, n);
swaps(&pRep->nHosts, n);
(void)WriteToClient(pClient, size, (char *) pRep); (void)WriteToClient(pClient, size, (char *) pRep);
} }
......
...@@ -68,23 +68,21 @@ SOFTWARE. ...@@ -68,23 +68,21 @@ SOFTWARE.
void void
SwapLongs (register CARD32 *list, register unsigned long count) SwapLongs (register CARD32 *list, register unsigned long count)
{ {
register char n;
while (count >= 8) { while (count >= 8) {
swapl(list+0, n); swapl(list+0);
swapl(list+1, n); swapl(list+1);
swapl(list+2, n); swapl(list+2);
swapl(list+3, n); swapl(list+3);
swapl(list+4, n); swapl(list+4);
swapl(list+5, n); swapl(list+5);
swapl(list+6, n); swapl(list+6);
swapl(list+7, n); swapl(list+7);
list += 8; list += 8;
count -= 8; count -= 8;
} }
if (count != 0) { if (count != 0) {
do { do {
swapl(list, n); swapl(list);
list++; list++;
} while (--count != 0); } while (--count != 0);
} }
...@@ -95,31 +93,29 @@ SwapLongs (register CARD32 *list, register unsigned long count) ...@@ -95,31 +93,29 @@ SwapLongs (register CARD32 *list, register unsigned long count)
void void
SwapShorts (register short *list, register unsigned long count) SwapShorts (register short *list, register unsigned long count)
{ {
register char n;
while (count >= 16) { while (count >= 16) {
swaps(list+0, n); swaps(list+0);
swaps(list+1, n); swaps(list+1);
swaps(list+2, n); swaps(list+2);
swaps(list+3, n); swaps(list+3);
swaps(list+4, n); swaps(list+4);
swaps(list+5, n); swaps(list+5);
swaps(list+6, n); swaps(list+6);
swaps(list+7, n); swaps(list+7);
swaps(list+8, n); swaps(list+8);
swaps(list+9, n); swaps(list+9);
swaps(list+10, n); swaps(list+10);
swaps(list+11, n); swaps(list+11);
swaps(list+12, n); swaps(list+12);
swaps(list+13, n); swaps(list+13);
swaps(list+14, n); swaps(list+14);
swaps(list+15, n); swaps(list+15);
list += 16; list += 16;
count -= 16; count -= 16;
} }
if (count != 0) { if (count != 0) {
do { do {
swaps(list, n); swaps(list);
list++; list++;
} while (--count != 0); } while (--count != 0);
} }
...@@ -130,10 +126,8 @@ SwapShorts (register short *list, register unsigned long count) ...@@ -130,10 +126,8 @@ SwapShorts (register short *list, register unsigned long count)
int int
SProcSimpleReq(register ClientPtr client) SProcSimpleReq(register ClientPtr client)
{ {
register char n;
REQUEST(xReq); REQUEST(xReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return(*ProcVector[stuff->reqType])(client); return(*ProcVector[stuff->reqType])(client);
} }
...@@ -143,33 +137,29 @@ SProcSimpleReq(register ClientPtr client) ...@@ -143,33 +137,29 @@ SProcSimpleReq(register ClientPtr client)
int int
SProcResourceReq(register ClientPtr client) SProcResourceReq(register ClientPtr client)
{ {
register char n;
REQUEST(xResourceReq); REQUEST(xResourceReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */ REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */
swapl(&stuff->id, n); swapl(&stuff->id);
return(*ProcVector[stuff->reqType])(client); return(*ProcVector[stuff->reqType])(client);
} }
int int
SProcCreateWindow(register ClientPtr client) SProcCreateWindow(register ClientPtr client)
{ {
register char n;
REQUEST(xCreateWindowReq); REQUEST(xCreateWindowReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xCreateWindowReq); REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
swapl(&stuff->wid, n); swapl(&stuff->wid);
swapl(&stuff->parent, n); swapl(&stuff->parent);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
swaps(&stuff->borderWidth, n); swaps(&stuff->borderWidth);
swaps(&stuff->class, n); swaps(&stuff->class);
swapl(&stuff->visual, n); swapl(&stuff->visual);
swapl(&stuff->mask, n); swapl(&stuff->mask);
SwapRestL(stuff); SwapRestL(stuff);
return((* ProcVector[X_CreateWindow])(client)); return((* ProcVector[X_CreateWindow])(client));
} }
...@@ -177,13 +167,11 @@ SProcCreateWindow(register ClientPtr client) ...@@ -177,13 +167,11 @@ SProcCreateWindow(register ClientPtr client)
int int
SProcChangeWindowAttributes(register ClientPtr client) SProcChangeWindowAttributes(register ClientPtr client)
{ {
register char n;
REQUEST(xChangeWindowAttributesReq); REQUEST(xChangeWindowAttributesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->valueMask, n); swapl(&stuff->valueMask);
SwapRestL(stuff); SwapRestL(stuff);
return((* ProcVector[X_ChangeWindowAttributes])(client)); return((* ProcVector[X_ChangeWindowAttributes])(client));
} }
...@@ -191,26 +179,24 @@ SProcChangeWindowAttributes(register ClientPtr client) ...@@ -191,26 +179,24 @@ SProcChangeWindowAttributes(register ClientPtr client)
int int
SProcReparentWindow(register ClientPtr client) SProcReparentWindow(register ClientPtr client)
{ {
register char n;
REQUEST(xReparentWindowReq); REQUEST(xReparentWindowReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xReparentWindowReq); REQUEST_SIZE_MATCH(xReparentWindowReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->parent, n); swapl(&stuff->parent);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
return((* ProcVector[X_ReparentWindow])(client)); return((* ProcVector[X_ReparentWindow])(client));
} }
int int
SProcConfigureWindow(register ClientPtr client) SProcConfigureWindow(register ClientPtr client)
{ {
register char n;
REQUEST(xConfigureWindowReq); REQUEST(xConfigureWindowReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swaps(&stuff->mask, n); swaps(&stuff->mask);
SwapRestL(stuff); SwapRestL(stuff);
return((* ProcVector[X_ConfigureWindow])(client)); return((* ProcVector[X_ConfigureWindow])(client));
...@@ -220,25 +206,23 @@ SProcConfigureWindow(register ClientPtr client) ...@@ -220,25 +206,23 @@ SProcConfigureWindow(register ClientPtr client)
int int
SProcInternAtom(register ClientPtr client) SProcInternAtom(register ClientPtr client)
{ {
register char n;
REQUEST(xInternAtomReq); REQUEST(xInternAtomReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xInternAtomReq); REQUEST_AT_LEAST_SIZE(xInternAtomReq);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return((* ProcVector[X_InternAtom])(client)); return((* ProcVector[X_InternAtom])(client));
} }
int int
SProcChangeProperty(register ClientPtr client) SProcChangeProperty(register ClientPtr client)
{ {
register char n;
REQUEST(xChangePropertyReq); REQUEST(xChangePropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangePropertyReq); REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->property, n); swapl(&stuff->property);
swapl(&stuff->type, n); swapl(&stuff->type);
swapl(&stuff->nUnits, n); swapl(&stuff->nUnits);
switch ( stuff->format ) { switch ( stuff->format ) {
case 8 : case 8 :
break; break;
...@@ -255,12 +239,11 @@ SProcChangeProperty(register ClientPtr client) ...@@ -255,12 +239,11 @@ SProcChangeProperty(register ClientPtr client)
int int
SProcDeleteProperty(register ClientPtr client) SProcDeleteProperty(register ClientPtr client)
{ {
register char n;
REQUEST(xDeletePropertyReq); REQUEST(xDeletePropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDeletePropertyReq); REQUEST_SIZE_MATCH(xDeletePropertyReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->property, n); swapl(&stuff->property);
return((* ProcVector[X_DeleteProperty])(client)); return((* ProcVector[X_DeleteProperty])(client));
} }
...@@ -268,57 +251,53 @@ SProcDeleteProperty(register ClientPtr client) ...@@ -268,57 +251,53 @@ SProcDeleteProperty(register ClientPtr client)
int int
SProcGetProperty(register ClientPtr client) SProcGetProperty(register ClientPtr client)
{ {
register char n;
REQUEST(xGetPropertyReq); REQUEST(xGetPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetPropertyReq); REQUEST_SIZE_MATCH(xGetPropertyReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->property, n); swapl(&stuff->property);
swapl(&stuff->type, n); swapl(&stuff->type);
swapl(&stuff->longOffset, n); swapl(&stuff->longOffset);
swapl(&stuff->longLength, n); swapl(&stuff->longLength);
return((* ProcVector[X_GetProperty])(client)); return((* ProcVector[X_GetProperty])(client));
} }
int int
SProcSetSelectionOwner(register ClientPtr client) SProcSetSelectionOwner(register ClientPtr client)
{ {
register char n;
REQUEST(xSetSelectionOwnerReq); REQUEST(xSetSelectionOwnerReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->selection, n); swapl(&stuff->selection);
swapl(&stuff->time, n); swapl(&stuff->time);
return((* ProcVector[X_SetSelectionOwner])(client)); return((* ProcVector[X_SetSelectionOwner])(client));
} }
int int
SProcConvertSelection(register ClientPtr client) SProcConvertSelection(register ClientPtr client)
{ {
register char n;
REQUEST(xConvertSelectionReq); REQUEST(xConvertSelectionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xConvertSelectionReq); REQUEST_SIZE_MATCH(xConvertSelectionReq);
swapl(&stuff->requestor, n); swapl(&stuff->requestor);
swapl(&stuff->selection, n); swapl(&stuff->selection);
swapl(&stuff->target, n); swapl(&stuff->target);
swapl(&stuff->property, n); swapl(&stuff->property);
swapl(&stuff->time, n); swapl(&stuff->time);
return((* ProcVector[X_ConvertSelection])(client)); return((* ProcVector[X_ConvertSelection])(client));
} }
int int
SProcSendEvent(register ClientPtr client) SProcSendEvent(register ClientPtr client)
{ {
register char n;
xEvent eventT; xEvent eventT;
EventSwapPtr proc; EventSwapPtr proc;
REQUEST(xSendEventReq); REQUEST(xSendEventReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSendEventReq); REQUEST_SIZE_MATCH(xSendEventReq);
swapl(&stuff->destination, n); swapl(&stuff->destination);
swapl(&stuff->eventMask, n); swapl(&stuff->eventMask);
/* Swap event */ /* Swap event */
proc = EventSwapVector[stuff->event.u.u.type & 0177]; proc = EventSwapVector[stuff->event.u.u.type & 0177];
...@@ -333,223 +312,206 @@ SProcSendEvent(register ClientPtr client) ...@@ -333,223 +312,206 @@ SProcSendEvent(register ClientPtr client)
int int
SProcGrabPointer(register ClientPtr client) SProcGrabPointer(register ClientPtr client)
{ {
register char n;
REQUEST(xGrabPointerReq); REQUEST(xGrabPointerReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGrabPointerReq); REQUEST_SIZE_MATCH(xGrabPointerReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swaps(&stuff->eventMask, n); swaps(&stuff->eventMask);
swapl(&stuff->confineTo, n); swapl(&stuff->confineTo);
swapl(&stuff->cursor, n); swapl(&stuff->cursor);
swapl(&stuff->time, n); swapl(&stuff->time);
return((* ProcVector[X_GrabPointer])(client)); return((* ProcVector[X_GrabPointer])(client));
} }
int int
SProcGrabButton(register ClientPtr client) SProcGrabButton(register ClientPtr client)
{ {
register char n;
REQUEST(xGrabButtonReq); REQUEST(xGrabButtonReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGrabButtonReq); REQUEST_SIZE_MATCH(xGrabButtonReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swaps(&stuff->eventMask, n); swaps(&stuff->eventMask);
swapl(&stuff->confineTo, n); swapl(&stuff->confineTo);
swapl(&stuff->cursor, n); swapl(&stuff->cursor);
swaps(&stuff->modifiers, n); swaps(&stuff->modifiers);
return((* ProcVector[X_GrabButton])(client)); return((* ProcVector[X_GrabButton])(client));
} }
int int
SProcUngrabButton(register ClientPtr client) SProcUngrabButton(register ClientPtr client)
{ {
register char n;
REQUEST(xUngrabButtonReq); REQUEST(xUngrabButtonReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabButtonReq); REQUEST_SIZE_MATCH(xUngrabButtonReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers, n); swaps(&stuff->modifiers);
return((* ProcVector[X_UngrabButton])(client)); return((* ProcVector[X_UngrabButton])(client));
} }
int int
SProcChangeActivePointerGrab(register ClientPtr client) SProcChangeActivePointerGrab(register ClientPtr client)
{ {
register char n;
REQUEST(xChangeActivePointerGrabReq); REQUEST(xChangeActivePointerGrabReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
swapl(&stuff->cursor, n); swapl(&stuff->cursor);
swapl(&stuff->time, n); swapl(&stuff->time);
swaps(&stuff->eventMask, n); swaps(&stuff->eventMask);
return((* ProcVector[X_ChangeActivePointerGrab])(client)); return((* ProcVector[X_ChangeActivePointerGrab])(client));
} }
int int
SProcGrabKeyboard(register ClientPtr client) SProcGrabKeyboard(register ClientPtr client)
{ {
register char n;
REQUEST(xGrabKeyboardReq); REQUEST(xGrabKeyboardReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGrabKeyboardReq); REQUEST_SIZE_MATCH(xGrabKeyboardReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swapl(&stuff->time, n); swapl(&stuff->time);
return((* ProcVector[X_GrabKeyboard])(client)); return((* ProcVector[X_GrabKeyboard])(client));
} }
int int
SProcGrabKey(register ClientPtr client) SProcGrabKey(register ClientPtr client)
{ {
register char n;
REQUEST(xGrabKeyReq); REQUEST(xGrabKeyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGrabKeyReq); REQUEST_SIZE_MATCH(xGrabKeyReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers, n); swaps(&stuff->modifiers);
return((* ProcVector[X_GrabKey])(client)); return((* ProcVector[X_GrabKey])(client));
} }
int int
SProcUngrabKey(register ClientPtr client) SProcUngrabKey(register ClientPtr client)
{ {
register char n;
REQUEST(xUngrabKeyReq); REQUEST(xUngrabKeyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabKeyReq); REQUEST_SIZE_MATCH(xUngrabKeyReq);
swapl(&stuff->grabWindow, n); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers, n); swaps(&stuff->modifiers);
return((* ProcVector[X_UngrabKey])(client)); return((* ProcVector[X_UngrabKey])(client));
} }
int int
SProcGetMotionEvents(register ClientPtr client) SProcGetMotionEvents(register ClientPtr client)
{ {
register char n;
REQUEST(xGetMotionEventsReq); REQUEST(xGetMotionEventsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetMotionEventsReq); REQUEST_SIZE_MATCH(xGetMotionEventsReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->start, n); swapl(&stuff->start);
swapl(&stuff->stop, n); swapl(&stuff->stop);
return((* ProcVector[X_GetMotionEvents])(client)); return((* ProcVector[X_GetMotionEvents])(client));
} }
int int
SProcTranslateCoords(register ClientPtr client) SProcTranslateCoords(register ClientPtr client)
{ {
register char n;
REQUEST(xTranslateCoordsReq); REQUEST(xTranslateCoordsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xTranslateCoordsReq); REQUEST_SIZE_MATCH(xTranslateCoordsReq);
swapl(&stuff->srcWid, n); swapl(&stuff->srcWid);
swapl(&stuff->dstWid, n); swapl(&stuff->dstWid);
swaps(&stuff->srcX, n); swaps(&stuff->srcX);
swaps(&stuff->srcY, n); swaps(&stuff->srcY);
return((* ProcVector[X_TranslateCoords])(client)); return((* ProcVector[X_TranslateCoords])(client));
} }
int int
SProcWarpPointer(register ClientPtr client) SProcWarpPointer(register ClientPtr client)
{ {
register char n;
REQUEST(xWarpPointerReq); REQUEST(xWarpPointerReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xWarpPointerReq); REQUEST_SIZE_MATCH(xWarpPointerReq);
swapl(&stuff->srcWid, n); swapl(&stuff->srcWid);
swapl(&stuff->dstWid, n); swapl(&stuff->dstWid);
swaps(&stuff->srcX, n); swaps(&stuff->srcX);
swaps(&stuff->srcY, n); swaps(&stuff->srcY);
swaps(&stuff->srcWidth, n); swaps(&stuff->srcWidth);
swaps(&stuff->srcHeight, n); swaps(&stuff->srcHeight);
swaps(&stuff->dstX, n); swaps(&stuff->dstX);
swaps(&stuff->dstY, n); swaps(&stuff->dstY);
return((* ProcVector[X_WarpPointer])(client)); return((* ProcVector[X_WarpPointer])(client));
} }
int int
SProcSetInputFocus(register ClientPtr client) SProcSetInputFocus(register ClientPtr client)
{ {
register char n;
REQUEST(xSetInputFocusReq); REQUEST(xSetInputFocusReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSetInputFocusReq); REQUEST_SIZE_MATCH(xSetInputFocusReq);
swapl(&stuff->focus, n); swapl(&stuff->focus);
swapl(&stuff->time, n); swapl(&stuff->time);
return((* ProcVector[X_SetInputFocus])(client)); return((* ProcVector[X_SetInputFocus])(client));
} }
int int
SProcOpenFont(register ClientPtr client) SProcOpenFont(register ClientPtr client)
{ {
register char n;
REQUEST(xOpenFontReq); REQUEST(xOpenFontReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xOpenFontReq); REQUEST_AT_LEAST_SIZE(xOpenFontReq);
swapl(&stuff->fid, n); swapl(&stuff->fid);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return((* ProcVector[X_OpenFont])(client)); return((* ProcVector[X_OpenFont])(client));
} }
int int
SProcListFonts(register ClientPtr client) SProcListFonts(register ClientPtr client)
{ {
register char n;
REQUEST(xListFontsReq); REQUEST(xListFontsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xListFontsReq); REQUEST_AT_LEAST_SIZE(xListFontsReq);
swaps(&stuff->maxNames, n); swaps(&stuff->maxNames);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return((* ProcVector[X_ListFonts])(client)); return((* ProcVector[X_ListFonts])(client));
} }
int int
SProcListFontsWithInfo(register ClientPtr client) SProcListFontsWithInfo(register ClientPtr client)
{ {
register char n;
REQUEST(xListFontsWithInfoReq); REQUEST(xListFontsWithInfoReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq); REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq);
swaps(&stuff->maxNames, n); swaps(&stuff->maxNames);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return((* ProcVector[X_ListFontsWithInfo])(client)); return((* ProcVector[X_ListFontsWithInfo])(client));
} }
int int
SProcSetFontPath(register ClientPtr client) SProcSetFontPath(register ClientPtr client)
{ {
register char n;
REQUEST(xSetFontPathReq); REQUEST(xSetFontPathReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSetFontPathReq); REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
swaps(&stuff->nFonts, n); swaps(&stuff->nFonts);
return((* ProcVector[X_SetFontPath])(client)); return((* ProcVector[X_SetFontPath])(client));
} }
int int
SProcCreatePixmap(register ClientPtr client) SProcCreatePixmap(register ClientPtr client)
{ {
register char n;
REQUEST(xCreatePixmapReq); REQUEST(xCreatePixmapReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCreatePixmapReq); REQUEST_SIZE_MATCH(xCreatePixmapReq);
swapl(&stuff->pid, n); swapl(&stuff->pid);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
return((* ProcVector[X_CreatePixmap])(client)); return((* ProcVector[X_CreatePixmap])(client));
} }
int int
SProcCreateGC(register ClientPtr client) SProcCreateGC(register ClientPtr client)
{ {
register char n;
REQUEST(xCreateGCReq); REQUEST(xCreateGCReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xCreateGCReq); REQUEST_AT_LEAST_SIZE(xCreateGCReq);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->mask, n); swapl(&stuff->mask);
SwapRestL(stuff); SwapRestL(stuff);
return((* ProcVector[X_CreateGC])(client)); return((* ProcVector[X_CreateGC])(client));
} }
...@@ -557,12 +519,11 @@ SProcCreateGC(register ClientPtr client) ...@@ -557,12 +519,11 @@ SProcCreateGC(register ClientPtr client)
int int
SProcChangeGC(register ClientPtr client) SProcChangeGC(register ClientPtr client)
{ {
register char n;
REQUEST(xChangeGCReq); REQUEST(xChangeGCReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeGCReq); REQUEST_AT_LEAST_SIZE(xChangeGCReq);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swapl(&stuff->mask, n); swapl(&stuff->mask);
SwapRestL(stuff); SwapRestL(stuff);
return((* ProcVector[X_ChangeGC])(client)); return((* ProcVector[X_ChangeGC])(client));
} }
...@@ -570,26 +531,24 @@ SProcChangeGC(register ClientPtr client) ...@@ -570,26 +531,24 @@ SProcChangeGC(register ClientPtr client)
int int
SProcCopyGC(register ClientPtr client) SProcCopyGC(register ClientPtr client)
{ {
register char n;
REQUEST(xCopyGCReq); REQUEST(xCopyGCReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCopyGCReq); REQUEST_SIZE_MATCH(xCopyGCReq);
swapl(&stuff->srcGC, n); swapl(&stuff->srcGC);
swapl(&stuff->dstGC, n); swapl(&stuff->dstGC);
swapl(&stuff->mask, n); swapl(&stuff->mask);
return((* ProcVector[X_CopyGC])(client)); return((* ProcVector[X_CopyGC])(client));
} }
int int
SProcSetDashes(register ClientPtr client) SProcSetDashes(register ClientPtr client)
{ {
register char n;
REQUEST(xSetDashesReq); REQUEST(xSetDashesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSetDashesReq); REQUEST_AT_LEAST_SIZE(xSetDashesReq);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->dashOffset, n); swaps(&stuff->dashOffset);
swaps(&stuff->nDashes, n); swaps(&stuff->nDashes);
return((* ProcVector[X_SetDashes])(client)); return((* ProcVector[X_SetDashes])(client));
} }
...@@ -597,13 +556,12 @@ SProcSetDashes(register ClientPtr client) ...@@ -597,13 +556,12 @@ SProcSetDashes(register ClientPtr client)
int int
SProcSetClipRectangles(register ClientPtr client) SProcSetClipRectangles(register ClientPtr client)
{ {
register char n;
REQUEST(xSetClipRectanglesReq); REQUEST(xSetClipRectanglesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->xOrigin, n); swaps(&stuff->xOrigin);
swaps(&stuff->yOrigin, n); swaps(&stuff->yOrigin);
SwapRestS(stuff); SwapRestS(stuff);
return((* ProcVector[X_SetClipRectangles])(client)); return((* ProcVector[X_SetClipRectangles])(client));
} }
...@@ -611,54 +569,51 @@ SProcSetClipRectangles(register ClientPtr client) ...@@ -611,54 +569,51 @@ SProcSetClipRectangles(register ClientPtr client)
int int
SProcClearToBackground(register ClientPtr client) SProcClearToBackground(register ClientPtr client)
{ {
register char n;
REQUEST(xClearAreaReq); REQUEST(xClearAreaReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xClearAreaReq); REQUEST_SIZE_MATCH(xClearAreaReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
return((* ProcVector[X_ClearArea])(client)); return((* ProcVector[X_ClearArea])(client));
} }
int int
SProcCopyArea(register ClientPtr client) SProcCopyArea(register ClientPtr client)
{ {
register char n;
REQUEST(xCopyAreaReq); REQUEST(xCopyAreaReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCopyAreaReq); REQUEST_SIZE_MATCH(xCopyAreaReq);
swapl(&stuff->srcDrawable, n); swapl(&stuff->srcDrawable);
swapl(&stuff->dstDrawable, n); swapl(&stuff->dstDrawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->srcX, n); swaps(&stuff->srcX);
swaps(&stuff->srcY, n); swaps(&stuff->srcY);
swaps(&stuff->dstX, n); swaps(&stuff->dstX);
swaps(&stuff->dstY, n); swaps(&stuff->dstY);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
return((* ProcVector[X_CopyArea])(client)); return((* ProcVector[X_CopyArea])(client));
} }
int int
SProcCopyPlane(register ClientPtr client) SProcCopyPlane(register ClientPtr client)
{ {
register char n;
REQUEST(xCopyPlaneReq); REQUEST(xCopyPlaneReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCopyPlaneReq); REQUEST_SIZE_MATCH(xCopyPlaneReq);
swapl(&stuff->srcDrawable, n); swapl(&stuff->srcDrawable);
swapl(&stuff->dstDrawable, n); swapl(&stuff->dstDrawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->srcX, n); swaps(&stuff->srcX);
swaps(&stuff->srcY, n); swaps(&stuff->srcY);
swaps(&stuff->dstX, n); swaps(&stuff->dstX);
swaps(&stuff->dstY, n); swaps(&stuff->dstY);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
swapl(&stuff->bitPlane, n); swapl(&stuff->bitPlane);
return((* ProcVector[X_CopyPlane])(client)); return((* ProcVector[X_CopyPlane])(client));
} }
...@@ -667,13 +622,11 @@ SProcCopyPlane(register ClientPtr client) ...@@ -667,13 +622,11 @@ SProcCopyPlane(register ClientPtr client)
int int
SProcPoly(register ClientPtr client) SProcPoly(register ClientPtr client)
{ {
register char n;
REQUEST(xPolyPointReq); REQUEST(xPolyPointReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xPolyPointReq); REQUEST_AT_LEAST_SIZE(xPolyPointReq);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
SwapRestS(stuff); SwapRestS(stuff);
return((* ProcVector[stuff->reqType])(client)); return((* ProcVector[stuff->reqType])(client));
} }
...@@ -684,13 +637,11 @@ SProcPoly(register ClientPtr client) ...@@ -684,13 +637,11 @@ SProcPoly(register ClientPtr client)
int int
SProcFillPoly(register ClientPtr client) SProcFillPoly(register ClientPtr client)
{ {
register char n;
REQUEST(xFillPolyReq); REQUEST(xFillPolyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xFillPolyReq); REQUEST_AT_LEAST_SIZE(xFillPolyReq);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
SwapRestS(stuff); SwapRestS(stuff);
return((* ProcVector[X_FillPoly])(client)); return((* ProcVector[X_FillPoly])(client));
} }
...@@ -698,16 +649,15 @@ SProcFillPoly(register ClientPtr client) ...@@ -698,16 +649,15 @@ SProcFillPoly(register ClientPtr client)
int int
SProcPutImage(register ClientPtr client) SProcPutImage(register ClientPtr client)
{ {
register char n;
REQUEST(xPutImageReq); REQUEST(xPutImageReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xPutImageReq); REQUEST_AT_LEAST_SIZE(xPutImageReq);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
swaps(&stuff->dstX, n); swaps(&stuff->dstX);
swaps(&stuff->dstY, n); swaps(&stuff->dstY);
/* Image should already be swapped */ /* Image should already be swapped */
return((* ProcVector[X_PutImage])(client)); return((* ProcVector[X_PutImage])(client));
...@@ -716,16 +666,15 @@ SProcPutImage(register ClientPtr client) ...@@ -716,16 +666,15 @@ SProcPutImage(register ClientPtr client)
int int
SProcGetImage(register ClientPtr client) SProcGetImage(register ClientPtr client)
{ {
register char n;
REQUEST(xGetImageReq); REQUEST(xGetImageReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetImageReq); REQUEST_SIZE_MATCH(xGetImageReq);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
swapl(&stuff->planeMask, n); swapl(&stuff->planeMask);
return((* ProcVector[X_GetImage])(client)); return((* ProcVector[X_GetImage])(client));
} }
...@@ -734,14 +683,13 @@ SProcGetImage(register ClientPtr client) ...@@ -734,14 +683,13 @@ SProcGetImage(register ClientPtr client)
int int
SProcPolyText(register ClientPtr client) SProcPolyText(register ClientPtr client)
{ {
register char n;
REQUEST(xPolyTextReq); REQUEST(xPolyTextReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xPolyTextReq); REQUEST_AT_LEAST_SIZE(xPolyTextReq);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
return((* ProcVector[stuff->reqType])(client)); return((* ProcVector[stuff->reqType])(client));
} }
...@@ -750,27 +698,25 @@ SProcPolyText(register ClientPtr client) ...@@ -750,27 +698,25 @@ SProcPolyText(register ClientPtr client)
int int
SProcImageText(register ClientPtr client) SProcImageText(register ClientPtr client)
{ {
register char n;
REQUEST(xImageTextReq); REQUEST(xImageTextReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xImageTextReq); REQUEST_AT_LEAST_SIZE(xImageTextReq);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->gc, n); swapl(&stuff->gc);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
return((* ProcVector[stuff->reqType])(client)); return((* ProcVector[stuff->reqType])(client));
} }
int int
SProcCreateColormap(register ClientPtr client) SProcCreateColormap(register ClientPtr client)
{ {
register char n;
REQUEST(xCreateColormapReq); REQUEST(xCreateColormapReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCreateColormapReq); REQUEST_SIZE_MATCH(xCreateColormapReq);
swapl(&stuff->mid, n); swapl(&stuff->mid);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->visual, n); swapl(&stuff->visual);
return((* ProcVector[X_CreateColormap])(client)); return((* ProcVector[X_CreateColormap])(client));
} }
...@@ -778,12 +724,11 @@ SProcCreateColormap(register ClientPtr client) ...@@ -778,12 +724,11 @@ SProcCreateColormap(register ClientPtr client)
int int
SProcCopyColormapAndFree(register ClientPtr client) SProcCopyColormapAndFree(register ClientPtr client)
{ {
register char n;
REQUEST(xCopyColormapAndFreeReq); REQUEST(xCopyColormapAndFreeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
swapl(&stuff->mid, n); swapl(&stuff->mid);
swapl(&stuff->srcCmap, n); swapl(&stuff->srcCmap);
return((* ProcVector[X_CopyColormapAndFree])(client)); return((* ProcVector[X_CopyColormapAndFree])(client));
} }
...@@ -791,67 +736,61 @@ SProcCopyColormapAndFree(register ClientPtr client) ...@@ -791,67 +736,61 @@ SProcCopyColormapAndFree(register ClientPtr client)
int int
SProcAllocColor(register ClientPtr client) SProcAllocColor(register ClientPtr client)
{ {
register char n;
REQUEST(xAllocColorReq); REQUEST(xAllocColorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllocColorReq); REQUEST_SIZE_MATCH(xAllocColorReq);
swapl(&stuff->cmap, n); swapl(&stuff->cmap);
swaps(&stuff->red, n); swaps(&stuff->red);
swaps(&stuff->green, n); swaps(&stuff->green);
swaps(&stuff->blue, n); swaps(&stuff->blue);
return((* ProcVector[X_AllocColor])(client)); return((* ProcVector[X_AllocColor])(client));
} }
int int
SProcAllocNamedColor(register ClientPtr client) SProcAllocNamedColor(register ClientPtr client)
{ {
register char n;
REQUEST(xAllocNamedColorReq); REQUEST(xAllocNamedColorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq); REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq);
swapl(&stuff->cmap, n); swapl(&stuff->cmap);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return((* ProcVector[X_AllocNamedColor])(client)); return((* ProcVector[X_AllocNamedColor])(client));
} }
int int
SProcAllocColorCells(register ClientPtr client) SProcAllocColorCells(register ClientPtr client)
{ {
register char n;
REQUEST(xAllocColorCellsReq); REQUEST(xAllocColorCellsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllocColorCellsReq); REQUEST_SIZE_MATCH(xAllocColorCellsReq);
swapl(&stuff->cmap, n); swapl(&stuff->cmap);
swaps(&stuff->colors, n); swaps(&stuff->colors);
swaps(&stuff->planes, n); swaps(&stuff->planes);
return((* ProcVector[X_AllocColorCells])(client)); return((* ProcVector[X_AllocColorCells])(client));
} }
int int
SProcAllocColorPlanes(register ClientPtr client) SProcAllocColorPlanes(register ClientPtr client)
{ {
register char n;
REQUEST(xAllocColorPlanesReq); REQUEST(xAllocColorPlanesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllocColorPlanesReq); REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
swapl(&stuff->cmap, n); swapl(&stuff->cmap);
swaps(&stuff->colors, n); swaps(&stuff->colors);
swaps(&stuff->red, n); swaps(&stuff->red);
swaps(&stuff->green, n); swaps(&stuff->green);
swaps(&stuff->blue, n); swaps(&stuff->blue);
return((* ProcVector[X_AllocColorPlanes])(client)); return((* ProcVector[X_AllocColorPlanes])(client));
} }
int int
SProcFreeColors(register ClientPtr client) SProcFreeColors(register ClientPtr client)
{ {
register char n;
REQUEST(xFreeColorsReq); REQUEST(xFreeColorsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xFreeColorsReq); REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
swapl(&stuff->cmap, n); swapl(&stuff->cmap);
swapl(&stuff->planeMask, n); swapl(&stuff->planeMask);
SwapRestL(stuff); SwapRestL(stuff);
return((* ProcVector[X_FreeColors])(client)); return((* ProcVector[X_FreeColors])(client));
...@@ -860,25 +799,22 @@ SProcFreeColors(register ClientPtr client) ...@@ -860,25 +799,22 @@ SProcFreeColors(register ClientPtr client)
void void
SwapColorItem(xColorItem *pItem) SwapColorItem(xColorItem *pItem)
{ {
register char n; swapl(&pItem->pixel);
swaps(&pItem->red);
swapl(&pItem->pixel, n); swaps(&pItem->green);
swaps(&pItem->red, n); swaps(&pItem->blue);
swaps(&pItem->green, n);
swaps(&pItem->blue, n);
} }
int int
SProcStoreColors(register ClientPtr client) SProcStoreColors(register ClientPtr client)
{ {
register char n;
long count; long count;
xColorItem *pItem; xColorItem *pItem;
REQUEST(xStoreColorsReq); REQUEST(xStoreColorsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xStoreColorsReq); REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
swapl(&stuff->cmap, n); swapl(&stuff->cmap);
pItem = (xColorItem *) &stuff[1]; pItem = (xColorItem *) &stuff[1];
for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; ) for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; )
SwapColorItem(pItem++); SwapColorItem(pItem++);
...@@ -888,24 +824,22 @@ SProcStoreColors(register ClientPtr client) ...@@ -888,24 +824,22 @@ SProcStoreColors(register ClientPtr client)
int int
SProcStoreNamedColor (register ClientPtr client) SProcStoreNamedColor (register ClientPtr client)
{ {
register char n;
REQUEST(xStoreNamedColorReq); REQUEST(xStoreNamedColorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq); REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq);
swapl(&stuff->cmap, n); swapl(&stuff->cmap);
swapl(&stuff->pixel, n); swapl(&stuff->pixel);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return((* ProcVector[X_StoreNamedColor])(client)); return((* ProcVector[X_StoreNamedColor])(client));
} }
int int
SProcQueryColors (register ClientPtr client) SProcQueryColors (register ClientPtr client)
{ {
register char n;
REQUEST(xQueryColorsReq); REQUEST(xQueryColorsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xQueryColorsReq); REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
swapl(&stuff->cmap, n); swapl(&stuff->cmap);
SwapRestL(stuff); SwapRestL(stuff);
return((* ProcVector[X_QueryColors])(client)); return((* ProcVector[X_QueryColors])(client));
} }
...@@ -913,54 +847,51 @@ SProcQueryColors (register ClientPtr client) ...@@ -913,54 +847,51 @@ SProcQueryColors (register ClientPtr client)
int int
SProcLookupColor (register ClientPtr client) SProcLookupColor (register ClientPtr client)
{ {
register char n;
REQUEST(xLookupColorReq); REQUEST(xLookupColorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xLookupColorReq); REQUEST_AT_LEAST_SIZE(xLookupColorReq);
swapl(&stuff->cmap, n); swapl(&stuff->cmap);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return((* ProcVector[X_LookupColor])(client)); return((* ProcVector[X_LookupColor])(client));
} }
int int
SProcCreateCursor (register ClientPtr client) SProcCreateCursor (register ClientPtr client)
{ {
register char n;
REQUEST(xCreateCursorReq); REQUEST(xCreateCursorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCreateCursorReq); REQUEST_SIZE_MATCH(xCreateCursorReq);
swapl(&stuff->cid, n); swapl(&stuff->cid);
swapl(&stuff->source, n); swapl(&stuff->source);
swapl(&stuff->mask, n); swapl(&stuff->mask);
swaps(&stuff->foreRed, n); swaps(&stuff->foreRed);
swaps(&stuff->foreGreen, n); swaps(&stuff->foreGreen);
swaps(&stuff->foreBlue, n); swaps(&stuff->foreBlue);
swaps(&stuff->backRed, n); swaps(&stuff->backRed);
swaps(&stuff->backGreen, n); swaps(&stuff->backGreen);
swaps(&stuff->backBlue, n); swaps(&stuff->backBlue);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
return((* ProcVector[X_CreateCursor])(client)); return((* ProcVector[X_CreateCursor])(client));
} }
int int
SProcCreateGlyphCursor (register ClientPtr client) SProcCreateGlyphCursor (register ClientPtr client)
{ {
register char n;
REQUEST(xCreateGlyphCursorReq); REQUEST(xCreateGlyphCursorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
swapl(&stuff->cid, n); swapl(&stuff->cid);
swapl(&stuff->source, n); swapl(&stuff->source);
swapl(&stuff->mask, n); swapl(&stuff->mask);
swaps(&stuff->sourceChar, n); swaps(&stuff->sourceChar);
swaps(&stuff->maskChar, n); swaps(&stuff->maskChar);
swaps(&stuff->foreRed, n); swaps(&stuff->foreRed);
swaps(&stuff->foreGreen, n); swaps(&stuff->foreGreen);
swaps(&stuff->foreBlue, n); swaps(&stuff->foreBlue);
swaps(&stuff->backRed, n); swaps(&stuff->backRed);
swaps(&stuff->backGreen, n); swaps(&stuff->backGreen);
swaps(&stuff->backBlue, n); swaps(&stuff->backBlue);
return((* ProcVector[X_CreateGlyphCursor])(client)); return((* ProcVector[X_CreateGlyphCursor])(client));
} }
...@@ -968,30 +899,28 @@ SProcCreateGlyphCursor (register ClientPtr client) ...@@ -968,30 +899,28 @@ SProcCreateGlyphCursor (register ClientPtr client)
int int
SProcRecolorCursor (register ClientPtr client) SProcRecolorCursor (register ClientPtr client)
{ {
register char n;
REQUEST(xRecolorCursorReq); REQUEST(xRecolorCursorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecolorCursorReq); REQUEST_SIZE_MATCH(xRecolorCursorReq);
swapl(&stuff->cursor, n); swapl(&stuff->cursor);
swaps(&stuff->foreRed, n); swaps(&stuff->foreRed);
swaps(&stuff->foreGreen, n); swaps(&stuff->foreGreen);
swaps(&stuff->foreBlue, n); swaps(&stuff->foreBlue);
swaps(&stuff->backRed, n); swaps(&stuff->backRed);
swaps(&stuff->backGreen, n); swaps(&stuff->backGreen);
swaps(&stuff->backBlue, n); swaps(&stuff->backBlue);
return((* ProcVector[X_RecolorCursor])(client)); return((* ProcVector[X_RecolorCursor])(client));
} }
int int
SProcQueryBestSize (register ClientPtr client) SProcQueryBestSize (register ClientPtr client)
{ {
register char n;
REQUEST(xQueryBestSizeReq); REQUEST(xQueryBestSizeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xQueryBestSizeReq); REQUEST_SIZE_MATCH(xQueryBestSizeReq);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
return((* ProcVector[X_QueryBestSize])(client)); return((* ProcVector[X_QueryBestSize])(client));
} }
...@@ -999,20 +928,18 @@ SProcQueryBestSize (register ClientPtr client) ...@@ -999,20 +928,18 @@ SProcQueryBestSize (register ClientPtr client)
int int
SProcQueryExtension (register ClientPtr client) SProcQueryExtension (register ClientPtr client)
{ {
register char n;
REQUEST(xQueryExtensionReq); REQUEST(xQueryExtensionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xQueryExtensionReq); REQUEST_AT_LEAST_SIZE(xQueryExtensionReq);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return((* ProcVector[X_QueryExtension])(client)); return((* ProcVector[X_QueryExtension])(client));
} }
int int
SProcChangeKeyboardMapping (register ClientPtr client) SProcChangeKeyboardMapping (register ClientPtr client)
{ {
register char n;
REQUEST(xChangeKeyboardMappingReq); REQUEST(xChangeKeyboardMappingReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
SwapRestL(stuff); SwapRestL(stuff);
return((* ProcVector[X_ChangeKeyboardMapping])(client)); return((* ProcVector[X_ChangeKeyboardMapping])(client));
...@@ -1022,11 +949,10 @@ SProcChangeKeyboardMapping (register ClientPtr client) ...@@ -1022,11 +949,10 @@ SProcChangeKeyboardMapping (register ClientPtr client)
int int
SProcChangeKeyboardControl (register ClientPtr client) SProcChangeKeyboardControl (register ClientPtr client)
{ {
register char n;
REQUEST(xChangeKeyboardControlReq); REQUEST(xChangeKeyboardControlReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq); REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
swapl(&stuff->mask, n); swapl(&stuff->mask);
SwapRestL(stuff); SwapRestL(stuff);
return((* ProcVector[X_ChangeKeyboardControl])(client)); return((* ProcVector[X_ChangeKeyboardControl])(client));
} }
...@@ -1034,13 +960,12 @@ SProcChangeKeyboardControl (register ClientPtr client) ...@@ -1034,13 +960,12 @@ SProcChangeKeyboardControl (register ClientPtr client)
int int
SProcChangePointerControl (register ClientPtr client) SProcChangePointerControl (register ClientPtr client)
{ {
register char n;
REQUEST(xChangePointerControlReq); REQUEST(xChangePointerControlReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangePointerControlReq); REQUEST_SIZE_MATCH(xChangePointerControlReq);
swaps(&stuff->accelNum, n); swaps(&stuff->accelNum);
swaps(&stuff->accelDenum, n); swaps(&stuff->accelDenum);
swaps(&stuff->threshold, n); swaps(&stuff->threshold);
return((* ProcVector[X_ChangePointerControl])(client)); return((* ProcVector[X_ChangePointerControl])(client));
} }
...@@ -1048,37 +973,33 @@ SProcChangePointerControl (register ClientPtr client) ...@@ -1048,37 +973,33 @@ SProcChangePointerControl (register ClientPtr client)
int int
SProcSetScreenSaver (register ClientPtr client) SProcSetScreenSaver (register ClientPtr client)
{ {
register char n;
REQUEST(xSetScreenSaverReq); REQUEST(xSetScreenSaverReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSetScreenSaverReq); REQUEST_SIZE_MATCH(xSetScreenSaverReq);
swaps(&stuff->timeout, n); swaps(&stuff->timeout);
swaps(&stuff->interval, n); swaps(&stuff->interval);
return((* ProcVector[X_SetScreenSaver])(client)); return((* ProcVector[X_SetScreenSaver])(client));
} }
int int
SProcChangeHosts (register ClientPtr client) SProcChangeHosts (register ClientPtr client)
{ {
register char n;
REQUEST(xChangeHostsReq); REQUEST(xChangeHostsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeHostsReq); REQUEST_AT_LEAST_SIZE(xChangeHostsReq);
swaps(&stuff->hostLength, n); swaps(&stuff->hostLength);
return((* ProcVector[X_ChangeHosts])(client)); return((* ProcVector[X_ChangeHosts])(client));
} }
int SProcRotateProperties (register ClientPtr client) int SProcRotateProperties (register ClientPtr client)
{ {
register char n;
REQUEST(xRotatePropertiesReq); REQUEST(xRotatePropertiesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq); REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swaps(&stuff->nAtoms, n); swaps(&stuff->nAtoms);
swaps(&stuff->nPositions, n); swaps(&stuff->nPositions);
SwapRestL(stuff); SwapRestL(stuff);
return ((* ProcVector[X_RotateProperties])(client)); return ((* ProcVector[X_RotateProperties])(client));
} }
...@@ -1086,19 +1007,16 @@ int SProcRotateProperties (register ClientPtr client) ...@@ -1086,19 +1007,16 @@ int SProcRotateProperties (register ClientPtr client)
int int
SProcNoOperation(register ClientPtr client) SProcNoOperation(register ClientPtr client)
{ {
register char n;
REQUEST(xReq); REQUEST(xReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return ((* ProcVector[X_NoOperation])(client)); return ((* ProcVector[X_NoOperation])(client));
} }
void void
SwapConnClientPrefix(xConnClientPrefix *pCCP) SwapConnClientPrefix(xConnClientPrefix *pCCP)
{ {
register char n; swaps(&pCCP->majorVersion);
swaps(&pCCP->minorVersion);
swaps(&pCCP->majorVersion, n); swaps(&pCCP->nbytesAuthProto);
swaps(&pCCP->minorVersion, n); swaps(&pCCP->nbytesAuthString);
swaps(&pCCP->nbytesAuthProto, n);
swaps(&pCCP->nbytesAuthString, n);
} }
...@@ -131,7 +131,6 @@ ProcRenderQueryVersion (ClientPtr client) ...@@ -131,7 +131,6 @@ ProcRenderQueryVersion (ClientPtr client)
{ {
RenderClientPtr pRenderClient = GetRenderClient (client); RenderClientPtr pRenderClient = GetRenderClient (client);
xRenderQueryVersionReply rep; xRenderQueryVersionReply rep;
register int n;
REQUEST(xRenderQueryVersionReq); REQUEST(xRenderQueryVersionReq);
REQUEST_SIZE_MATCH(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
...@@ -146,10 +145,10 @@ ProcRenderQueryVersion (ClientPtr client) ...@@ -146,10 +145,10 @@ ProcRenderQueryVersion (ClientPtr client)
rep.majorVersion = nxagentRenderVersionMajor; rep.majorVersion = nxagentRenderVersionMajor;
rep.minorVersion = nxagentRenderVersionMinor; rep.minorVersion = nxagentRenderVersionMinor;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.majorVersion, n); swapl(&rep.majorVersion);
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep);
return (client->noClientException); return (client->noClientException);
...@@ -176,7 +175,6 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -176,7 +175,6 @@ ProcRenderQueryPictFormats (ClientPtr client)
int nvisual; int nvisual;
int rlength; int rlength;
int s; int s;
int n;
int numScreens; int numScreens;
int numSubpixel; int numSubpixel;
...@@ -266,16 +264,16 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -266,16 +264,16 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictForm->colormap = None; pictForm->colormap = None;
if (client->swapped) if (client->swapped)
{ {
swapl (&pictForm->id, n); swapl (&pictForm->id);
swaps (&pictForm->direct.red, n); swaps (&pictForm->direct.red);
swaps (&pictForm->direct.redMask, n); swaps (&pictForm->direct.redMask);
swaps (&pictForm->direct.green, n); swaps (&pictForm->direct.green);
swaps (&pictForm->direct.greenMask, n); swaps (&pictForm->direct.greenMask);
swaps (&pictForm->direct.blue, n); swaps (&pictForm->direct.blue);
swaps (&pictForm->direct.blueMask, n); swaps (&pictForm->direct.blueMask);
swaps (&pictForm->direct.alpha, n); swaps (&pictForm->direct.alpha);
swaps (&pictForm->direct.alphaMask, n); swaps (&pictForm->direct.alphaMask);
swapl (&pictForm->colormap, n); swapl (&pictForm->colormap);
} }
pictForm++; pictForm++;
} }
...@@ -305,8 +303,8 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -305,8 +303,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictVisual->format = pFormat->id; pictVisual->format = pFormat->id;
if (client->swapped) if (client->swapped)
{ {
swapl (&pictVisual->visual, n); swapl (&pictVisual->visual);
swapl (&pictVisual->format, n); swapl (&pictVisual->format);
} }
pictVisual++; pictVisual++;
nvisual++; nvisual++;
...@@ -316,7 +314,7 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -316,7 +314,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictDepth->nPictVisuals = nvisual; pictDepth->nPictVisuals = nvisual;
if (client->swapped) if (client->swapped)
{ {
swaps (&pictDepth->nPictVisuals, n); swaps (&pictDepth->nPictVisuals);
} }
ndepth++; ndepth++;
pictDepth = (xPictDepth *) pictVisual; pictDepth = (xPictDepth *) pictVisual;
...@@ -329,8 +327,8 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -329,8 +327,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictScreen->fallback = 0; pictScreen->fallback = 0;
if (client->swapped) if (client->swapped)
{ {
swapl (&pictScreen->nDepth, n); swapl (&pictScreen->nDepth);
swapl (&pictScreen->fallback, n); swapl (&pictScreen->fallback);
} }
pictScreen = (xPictScreen *) pictDepth; pictScreen = (xPictScreen *) pictDepth;
} }
...@@ -346,20 +344,20 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -346,20 +344,20 @@ ProcRenderQueryPictFormats (ClientPtr client)
*pictSubpixel = SubPixelUnknown; *pictSubpixel = SubPixelUnknown;
if (client->swapped) if (client->swapped)
{ {
swapl (pictSubpixel, n); swapl (pictSubpixel);
} }
++pictSubpixel; ++pictSubpixel;
} }
if (client->swapped) if (client->swapped)
{ {
swaps (&reply->sequenceNumber, n); swaps (&reply->sequenceNumber);
swapl (&reply->length, n); swapl (&reply->length);
swapl (&reply->numFormats, n); swapl (&reply->numFormats);
swapl (&reply->numScreens, n); swapl (&reply->numScreens);
swapl (&reply->numDepths, n); swapl (&reply->numDepths);
swapl (&reply->numVisuals, n); swapl (&reply->numVisuals);
swapl (&reply->numSubpixel, n); swapl (&reply->numSubpixel);
} }
WriteToClient(client, rlength, (char *) reply); WriteToClient(client, rlength, (char *) reply);
free (reply); free (reply);
......
...@@ -277,32 +277,107 @@ version_compare(uint32_t a_major, uint32_t a_minor, ...@@ -277,32 +277,107 @@ version_compare(uint32_t a_major, uint32_t a_minor,
#define SwapRestL(stuff) \ #define SwapRestL(stuff) \
SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff)) SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
void __attribute__ ((error("wrong sized variable passed to swap")))
wrong_size(void);
#else
static inline void
wrong_size(void)
{
}
#endif
#if !(defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)))
static inline int
__builtin_constant_p(int x)
{
return 0;
}
#endif
/* byte swap a 64-bit value */
static inline void
swap_uint64(uint64_t *x)
{
char n;
n = ((char *) x)[0];
((char *) x)[0] = ((char *) x)[7];
((char *) x)[7] = n;
n = ((char *) x)[1];
((char *) x)[1] = ((char *) x)[6];
((char *) x)[6] = n;
n = ((char *) x)[2];
((char *) x)[2] = ((char *) x)[5];
((char *) x)[5] = n;
n = ((char *) x)[3];
((char *) x)[3] = ((char *) x)[4];
((char *) x)[4] = n;
}
#define swapll(x) do { \
if (sizeof(*(x)) != 8) \
wrong_size(); \
swap_uint64((uint64_t *)(x)); \
} while (0)
/* byte swap a 32-bit value */ /* byte swap a 32-bit value */
#define swapl(x, n) { \ static inline void
n = ((char *) (x))[0];\ swap_uint32(uint32_t * x)
((char *) (x))[0] = ((char *) (x))[3];\ {
((char *) (x))[3] = n;\ char n = ((char *) x)[0];
n = ((char *) (x))[1];\
((char *) (x))[1] = ((char *) (x))[2];\ ((char *) x)[0] = ((char *) x)[3];
((char *) (x))[2] = n; } ((char *) x)[3] = n;
n = ((char *) x)[1];
/* byte swap a short */ ((char *) x)[1] = ((char *) x)[2];
#define swaps(x, n) { \ ((char *) x)[2] = n;
n = ((char *) (x))[0];\ }
((char *) (x))[0] = ((char *) (x))[1];\
((char *) (x))[1] = n; } #define swapl(x) do { \
if (sizeof(*(x)) != 4) \
wrong_size(); \
if (__builtin_constant_p((uintptr_t)(x) & 3) && ((uintptr_t)(x) & 3) == 0) \
*(x) = lswapl(*(x)); \
else \
swap_uint32((uint32_t *)(x)); \
} while (0)
/* byte swap a 16-bit value */
static inline void
swap_uint16(uint16_t * x)
{
char n = ((char *) x)[0];
((char *) x)[0] = ((char *) x)[1];
((char *) x)[1] = n;
}
#define swaps(x) do { \
if (sizeof(*(x)) != 2) \
wrong_size(); \
if (__builtin_constant_p((uintptr_t)(x) & 1) && ((uintptr_t)(x) & 1) == 0) \
*(x) = lswaps(*(x)); \
else \
swap_uint16((uint16_t *)(x)); \
} while (0)
/* copy 32-bit value from src to dst byteswapping on the way */ /* copy 32-bit value from src to dst byteswapping on the way */
#define cpswapl(src, dst) { \ #define cpswapl(src, dst) do { \
((char *)&(dst))[0] = ((char *) &(src))[3];\ if (sizeof((src)) != 4 || sizeof((dst)) != 4) \
((char *)&(dst))[1] = ((char *) &(src))[2];\ wrong_size(); \
((char *)&(dst))[2] = ((char *) &(src))[1];\ (dst) = lswapl((src)); \
((char *)&(dst))[3] = ((char *) &(src))[0]; } } while (0)
/* copy short from src to dst byteswapping on the way */ /* copy short from src to dst byteswapping on the way */
#define cpswaps(src, dst) { \ #define cpswaps(src, dst) do { \
((char *) &(dst))[0] = ((char *) &(src))[1];\ if (sizeof((src)) != 2 || sizeof((dst)) != 2) \
((char *) &(dst))[1] = ((char *) &(src))[0]; } wrong_size(); \
(dst) = lswaps((src)); \
} while (0)
extern void SwapLongs( extern void SwapLongs(
CARD32 *list, CARD32 *list,
......
...@@ -933,9 +933,9 @@ ErrorConnMax(XtransConnInfo trans_conn) ...@@ -933,9 +933,9 @@ ErrorConnMax(XtransConnInfo trans_conn)
if (((*(char *) &whichbyte) && (byteOrder == 'B')) || if (((*(char *) &whichbyte) && (byteOrder == 'B')) ||
(!(*(char *) &whichbyte) && (byteOrder == 'l'))) (!(*(char *) &whichbyte) && (byteOrder == 'l')))
{ {
swaps(&csp.majorVersion, whichbyte); swaps(&csp.majorVersion);
swaps(&csp.minorVersion, whichbyte); swaps(&csp.minorVersion);
swaps(&csp.length, whichbyte); swaps(&csp.length);
} }
iov[0].iov_len = sz_xConnSetupPrefix; iov[0].iov_len = sz_xConnSetupPrefix;
iov[0].iov_base = (char *) &csp; iov[0].iov_base = (char *) &csp;
......
...@@ -591,8 +591,7 @@ ResetCurrentRequest(ClientPtr client) ...@@ -591,8 +591,7 @@ ResetCurrentRequest(ClientPtr client)
((xBigReq *)oci->bufptr)->length = client->req_len; ((xBigReq *)oci->bufptr)->length = client->req_len;
if (client->swapped) if (client->swapped)
{ {
char n; swapl(&((xBigReq *)oci->bufptr)->length);
swapl(&((xBigReq *)oci->bufptr)->length, n);
} }
} }
#endif #endif
...@@ -948,11 +947,10 @@ WriteToClient (ClientPtr who, int count, char *buf) ...@@ -948,11 +947,10 @@ WriteToClient (ClientPtr who, int count, char *buf)
{ /* start of new reply */ { /* start of new reply */
CARD32 replylen; CARD32 replylen;
unsigned long bytesleft; unsigned long bytesleft;
char n;
replylen = ((xGenericReply *)buf)->length; replylen = ((xGenericReply *)buf)->length;
if (who->swapped) if (who->swapped)
swapl(&replylen, n); swapl(&replylen);
bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes; bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;
replyinfo.startOfReply = TRUE; replyinfo.startOfReply = TRUE;
replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft; replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft;
......
...@@ -997,7 +997,6 @@ ProcRRGetCrtcInfo(ClientPtr client) ...@@ -997,7 +997,6 @@ ProcRRGetCrtcInfo(ClientPtr client)
int i, j, k; int i, j, k;
int width, height; int width, height;
BoxRec panned_area; BoxRec panned_area;
int n;
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
...@@ -1060,7 +1059,7 @@ ProcRRGetCrtcInfo(ClientPtr client) ...@@ -1060,7 +1059,7 @@ ProcRRGetCrtcInfo(ClientPtr client)
for (i = 0; i < crtc->numOutputs; i++) { for (i = 0; i < crtc->numOutputs; i++) {
outputs[i] = crtc->outputs[i]->id; outputs[i] = crtc->outputs[i]->id;
if (client->swapped) if (client->swapped)
swapl(&outputs[i], n); swapl(&outputs[i]);
} }
k = 0; k = 0;
for (i = 0; i < pScrPriv->numOutputs; i++) for (i = 0; i < pScrPriv->numOutputs; i++)
...@@ -1068,23 +1067,23 @@ ProcRRGetCrtcInfo(ClientPtr client) ...@@ -1068,23 +1067,23 @@ ProcRRGetCrtcInfo(ClientPtr client)
if (pScrPriv->outputs[i]->crtcs[j] == crtc) { if (pScrPriv->outputs[i]->crtcs[j] == crtc) {
possible[k] = pScrPriv->outputs[i]->id; possible[k] = pScrPriv->outputs[i]->id;
if (client->swapped) if (client->swapped)
swapl(&possible[k], n); swapl(&possible[k]);
k++; k++;
} }
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.timestamp, n); swapl(&rep.timestamp);
swaps(&rep.x, n); swaps(&rep.x);
swaps(&rep.y, n); swaps(&rep.y);
swaps(&rep.width, n); swaps(&rep.width);
swaps(&rep.height, n); swaps(&rep.height);
swapl(&rep.mode, n); swapl(&rep.mode);
swaps(&rep.rotation, n); swaps(&rep.rotation);
swaps(&rep.rotations, n); swaps(&rep.rotations);
swaps(&rep.nOutput, n); swaps(&rep.nOutput);
swaps(&rep.nPossibleOutput, n); swaps(&rep.nPossibleOutput);
} }
WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *) &rep);
if (extraLen) { if (extraLen) {
...@@ -1115,7 +1114,6 @@ ProcRRSetCrtcConfig(ClientPtr client) ...@@ -1115,7 +1114,6 @@ ProcRRSetCrtcConfig(ClientPtr client)
#endif #endif
i, j; i, j;
CARD8 status; CARD8 status;
int n;
REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
numOutputs = (stuff->length - bytes_to_int32(SIZEOF(xRRSetCrtcConfigReq))); numOutputs = (stuff->length - bytes_to_int32(SIZEOF(xRRSetCrtcConfigReq)));
...@@ -1314,9 +1312,9 @@ ProcRRSetCrtcConfig(ClientPtr client) ...@@ -1314,9 +1312,9 @@ ProcRRSetCrtcConfig(ClientPtr client)
.newTimestamp = pScrPriv->lastSetTime.milliseconds .newTimestamp = pScrPriv->lastSetTime.milliseconds
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.newTimestamp, n); swapl(&rep.newTimestamp);
} }
WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *) &rep); WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *) &rep);
...@@ -1334,7 +1332,6 @@ ProcRRGetPanning(ClientPtr client) ...@@ -1334,7 +1332,6 @@ ProcRRGetPanning(ClientPtr client)
BoxRec total; BoxRec total;
BoxRec tracking; BoxRec tracking;
INT16 border[4]; INT16 border[4];
int n;
REQUEST_SIZE_MATCH(xRRGetPanningReq); REQUEST_SIZE_MATCH(xRRGetPanningReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
...@@ -1372,21 +1369,21 @@ ProcRRGetPanning(ClientPtr client) ...@@ -1372,21 +1369,21 @@ ProcRRGetPanning(ClientPtr client)
} }
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.timestamp, n); swapl(&rep.timestamp);
swaps(&rep.left, n); swaps(&rep.left);
swaps(&rep.top, n); swaps(&rep.top);
swaps(&rep.width, n); swaps(&rep.width);
swaps(&rep.height, n); swaps(&rep.height);
swaps(&rep.track_left, n); swaps(&rep.track_left);
swaps(&rep.track_top, n); swaps(&rep.track_top);
swaps(&rep.track_width, n); swaps(&rep.track_width);
swaps(&rep.track_height, n); swaps(&rep.track_height);
swaps(&rep.border_left, n); swaps(&rep.border_left);
swaps(&rep.border_top, n); swaps(&rep.border_top);
swaps(&rep.border_right, n); swaps(&rep.border_right);
swaps(&rep.border_bottom, n); swaps(&rep.border_bottom);
} }
WriteToClient(client, sizeof(xRRGetPanningReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetPanningReply), (char *) &rep);
return Success; return Success;
...@@ -1405,7 +1402,6 @@ ProcRRSetPanning(ClientPtr client) ...@@ -1405,7 +1402,6 @@ ProcRRSetPanning(ClientPtr client)
BoxRec tracking; BoxRec tracking;
INT16 border[4]; INT16 border[4];
CARD8 status; CARD8 status;
int n;
REQUEST_SIZE_MATCH(xRRSetPanningReq); REQUEST_SIZE_MATCH(xRRSetPanningReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
...@@ -1456,9 +1452,9 @@ ProcRRSetPanning(ClientPtr client) ...@@ -1456,9 +1452,9 @@ ProcRRSetPanning(ClientPtr client)
.newTimestamp = pScrPriv->lastSetTime.milliseconds .newTimestamp = pScrPriv->lastSetTime.milliseconds
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.newTimestamp, n); swapl(&rep.newTimestamp);
} }
WriteToClient(client, sizeof(xRRSetPanningReply), (char *) &rep); WriteToClient(client, sizeof(xRRSetPanningReply), (char *) &rep);
return Success; return Success;
...@@ -1470,7 +1466,6 @@ ProcRRGetCrtcGammaSize(ClientPtr client) ...@@ -1470,7 +1466,6 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
REQUEST(xRRGetCrtcGammaSizeReq); REQUEST(xRRGetCrtcGammaSizeReq);
xRRGetCrtcGammaSizeReply reply; xRRGetCrtcGammaSizeReply reply;
RRCrtcPtr crtc; RRCrtcPtr crtc;
int n;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
...@@ -1486,9 +1481,9 @@ ProcRRGetCrtcGammaSize(ClientPtr client) ...@@ -1486,9 +1481,9 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
.size = crtc->gammaSize .size = crtc->gammaSize
}; };
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber, n); swaps(&reply.sequenceNumber);
swapl(&reply.length, n); swapl(&reply.length);
swaps(&reply.size, n); swaps(&reply.size);
} }
WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), (char *) &reply); WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), (char *) &reply);
return Success; return Success;
...@@ -1502,7 +1497,6 @@ ProcRRGetCrtcGamma(ClientPtr client) ...@@ -1502,7 +1497,6 @@ ProcRRGetCrtcGamma(ClientPtr client)
RRCrtcPtr crtc; RRCrtcPtr crtc;
unsigned long len; unsigned long len;
char *extra = NULL; char *extra = NULL;
int n;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
...@@ -1526,9 +1520,9 @@ ProcRRGetCrtcGamma(ClientPtr client) ...@@ -1526,9 +1520,9 @@ ProcRRGetCrtcGamma(ClientPtr client)
.size = crtc->gammaSize .size = crtc->gammaSize
}; };
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber, n); swaps(&reply.sequenceNumber);
swapl(&reply.length, n); swapl(&reply.length);
swaps(&reply.size, n); swaps(&reply.size);
} }
WriteToClient(client, sizeof(xRRGetCrtcGammaReply), (char *) &reply); WriteToClient(client, sizeof(xRRGetCrtcGammaReply), (char *) &reply);
if (crtc->gammaSize) { if (crtc->gammaSize) {
...@@ -1620,7 +1614,6 @@ transform_filter_encode(ClientPtr client, char *output, ...@@ -1620,7 +1614,6 @@ transform_filter_encode(ClientPtr client, char *output,
CARD16 *nparamsFilter, RRTransformPtr transform) CARD16 *nparamsFilter, RRTransformPtr transform)
{ {
int nbytes, nparams; int nbytes, nparams;
int n;
if (transform->filter == NULL) { if (transform->filter == NULL) {
*nbytesFilter = 0; *nbytesFilter = 0;
...@@ -1636,8 +1629,8 @@ transform_filter_encode(ClientPtr client, char *output, ...@@ -1636,8 +1629,8 @@ transform_filter_encode(ClientPtr client, char *output,
output[nbytes++] = 0; output[nbytes++] = 0;
memcpy(output + nbytes, transform->params, nparams * sizeof(xFixed)); memcpy(output + nbytes, transform->params, nparams * sizeof(xFixed));
if (client->swapped) { if (client->swapped) {
swaps(nbytesFilter, n); swaps(nbytesFilter);
swaps(nparamsFilter, n); swaps(nparamsFilter);
SwapLongs((CARD32 *) (output + nbytes), nparams); SwapLongs((CARD32 *) (output + nbytes), nparams);
} }
nbytes += nparams * sizeof(xFixed); nbytes += nparams * sizeof(xFixed);
...@@ -1662,7 +1655,6 @@ ProcRRGetCrtcTransform(ClientPtr client) ...@@ -1662,7 +1655,6 @@ ProcRRGetCrtcTransform(ClientPtr client)
int nextra; int nextra;
RRTransformPtr current, pending; RRTransformPtr current, pending;
char *extra; char *extra;
int n;
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq); REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
...@@ -1695,8 +1687,8 @@ ProcRRGetCrtcTransform(ClientPtr client) ...@@ -1695,8 +1687,8 @@ ProcRRGetCrtcTransform(ClientPtr client)
&reply->currentNparamsFilter, current); &reply->currentNparamsFilter, current);
if (client->swapped) { if (client->swapped) {
swaps(&reply->sequenceNumber, n); swaps(&reply->sequenceNumber);
swapl(&reply->length, n); swapl(&reply->length);
} }
WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra, WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra,
(char *) reply); (char *) reply);
......
...@@ -35,8 +35,6 @@ RRClientKnowsRates(ClientPtr pClient) ...@@ -35,8 +35,6 @@ RRClientKnowsRates(ClientPtr pClient)
static int static int
ProcRRQueryVersion(ClientPtr client) ProcRRQueryVersion(ClientPtr client)
{ {
int n;
xRRQueryVersionReply rep = { xRRQueryVersionReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
...@@ -61,10 +59,10 @@ ProcRRQueryVersion(ClientPtr client) ...@@ -61,10 +59,10 @@ ProcRRQueryVersion(ClientPtr client)
} }
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.majorVersion, n); swapl(&rep.majorVersion);
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion);
} }
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
WriteToClient(client, sizeof(xRRQueryVersionReply), &rep); WriteToClient(client, sizeof(xRRQueryVersionReply), &rep);
......
...@@ -344,7 +344,6 @@ ProcRRCreateMode(ClientPtr client) ...@@ -344,7 +344,6 @@ ProcRRCreateMode(ClientPtr client)
char *name; char *name;
int error, rc; int error, rc;
RRModePtr mode; RRModePtr mode;
int n;
REQUEST_AT_LEAST_SIZE(xRRCreateModeReq); REQUEST_AT_LEAST_SIZE(xRRCreateModeReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
...@@ -377,9 +376,9 @@ ProcRRCreateMode(ClientPtr client) ...@@ -377,9 +376,9 @@ ProcRRCreateMode(ClientPtr client)
.mode = mode->mode.id .mode = mode->mode.id
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.mode, n); swapl(&rep.mode);
} }
WriteToClient(client, sizeof(xRRCreateModeReply), (char *) &rep); WriteToClient(client, sizeof(xRRCreateModeReply), (char *) &rep);
/* Drop out reference to this mode */ /* Drop out reference to this mode */
......
...@@ -629,7 +629,7 @@ ProcRRGetMonitors(ClientPtr client) ...@@ -629,7 +629,7 @@ ProcRRGetMonitors(ClientPtr client)
RRMonitorPtr monitors; RRMonitorPtr monitors;
int nmonitors; int nmonitors;
int noutputs; int noutputs;
int m, n; int m;
Bool get_active; Bool get_active;
REQUEST_SIZE_MATCH(xRRGetMonitorsReq); REQUEST_SIZE_MATCH(xRRGetMonitorsReq);
...@@ -661,11 +661,11 @@ ProcRRGetMonitors(ClientPtr client) ...@@ -661,11 +661,11 @@ ProcRRGetMonitors(ClientPtr client)
rep.noutputs = noutputs; rep.noutputs = noutputs;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.timestamp, n); swapl(&rep.timestamp);
swapl(&rep.nmonitors, n); swapl(&rep.nmonitors);
swapl(&rep.noutputs, n); swapl(&rep.noutputs);
} }
WriteToClient(client, sizeof(xRRGetMonitorsReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetMonitorsReply), (char *) &rep);
...@@ -686,14 +686,14 @@ ProcRRGetMonitors(ClientPtr client) ...@@ -686,14 +686,14 @@ ProcRRGetMonitors(ClientPtr client)
.heightInMillimeters = monitor->geometry.mmHeight, .heightInMillimeters = monitor->geometry.mmHeight,
}; };
if (client->swapped) { if (client->swapped) {
swapl(&info.name, n); swapl(&info.name);
swaps(&info.noutput, n); swaps(&info.noutput);
swaps(&info.x, n); swaps(&info.x);
swaps(&info.y, n); swaps(&info.y);
swaps(&info.width, n); swaps(&info.width);
swaps(&info.height, n); swaps(&info.height);
swapl(&info.widthInMillimeters, n); swapl(&info.widthInMillimeters);
swapl(&info.heightInMillimeters, n); swapl(&info.heightInMillimeters);
} }
WriteToClient(client, sizeof(xRRMonitorInfo), (char *) &info); WriteToClient(client, sizeof(xRRMonitorInfo), (char *) &info);
......
...@@ -463,7 +463,6 @@ ProcRRGetOutputInfo(ClientPtr client) ...@@ -463,7 +463,6 @@ ProcRRGetOutputInfo(ClientPtr client)
RROutput *clones; RROutput *clones;
char *name; char *name;
int i; int i;
int n;
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
...@@ -509,7 +508,7 @@ ProcRRGetOutputInfo(ClientPtr client) ...@@ -509,7 +508,7 @@ ProcRRGetOutputInfo(ClientPtr client)
for (i = 0; i < output->numCrtcs; i++) { for (i = 0; i < output->numCrtcs; i++) {
crtcs[i] = output->crtcs[i]->id; crtcs[i] = output->crtcs[i]->id;
if (client->swapped) if (client->swapped)
swapl(&crtcs[i], n); swapl(&crtcs[i]);
} }
for (i = 0; i < output->numModes + output->numUserModes; i++) { for (i = 0; i < output->numModes + output->numUserModes; i++) {
if (i < output->numModes) if (i < output->numModes)
...@@ -517,26 +516,26 @@ ProcRRGetOutputInfo(ClientPtr client) ...@@ -517,26 +516,26 @@ ProcRRGetOutputInfo(ClientPtr client)
else else
modes[i] = output->userModes[i - output->numModes]->mode.id; modes[i] = output->userModes[i - output->numModes]->mode.id;
if (client->swapped) if (client->swapped)
swapl(&modes[i], n); swapl(&modes[i]);
} }
for (i = 0; i < output->numClones; i++) { for (i = 0; i < output->numClones; i++) {
clones[i] = output->clones[i]->id; clones[i] = output->clones[i]->id;
if (client->swapped) if (client->swapped)
swapl(&clones[i], n); swapl(&clones[i]);
} }
memcpy(name, output->name, output->nameLength); memcpy(name, output->name, output->nameLength);
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.timestamp, n); swapl(&rep.timestamp);
swapl(&rep.crtc, n); swapl(&rep.crtc);
swapl(&rep.mmWidth, n); swapl(&rep.mmWidth);
swapl(&rep.mmHeight, n); swapl(&rep.mmHeight);
swaps(&rep.nCrtcs, n); swaps(&rep.nCrtcs);
swaps(&rep.nModes, n); swaps(&rep.nModes);
swaps(&rep.nPreferred, n); swaps(&rep.nPreferred);
swaps(&rep.nClones, n); swaps(&rep.nClones);
swaps(&rep.nameLength, n); swaps(&rep.nameLength);
} }
WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *) &rep);
if (extraLen) { if (extraLen) {
...@@ -639,7 +638,6 @@ ProcRRGetOutputPrimary(ClientPtr client) ...@@ -639,7 +638,6 @@ ProcRRGetOutputPrimary(ClientPtr client)
xRRGetOutputPrimaryReply rep; xRRGetOutputPrimaryReply rep;
RROutputPtr primary = NULL; RROutputPtr primary = NULL;
int rc; int rc;
int n;
REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq); REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
...@@ -663,8 +661,8 @@ ProcRRGetOutputPrimary(ClientPtr client) ...@@ -663,8 +661,8 @@ ProcRRGetOutputPrimary(ClientPtr client)
.output = primary ? primary->id : None .output = primary ? primary->id : None
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.output, n); swapl(&rep.output);
} }
WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), (char *) &rep);
......
...@@ -405,7 +405,6 @@ ProcRRListOutputProperties(ClientPtr client) ...@@ -405,7 +405,6 @@ ProcRRListOutputProperties(ClientPtr client)
int numProps = 0; int numProps = 0;
RROutputPtr output; RROutputPtr output;
RRPropertyPtr prop; RRPropertyPtr prop;
int n;
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq); REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
...@@ -428,9 +427,9 @@ ProcRRListOutputProperties(ClientPtr client) ...@@ -428,9 +427,9 @@ ProcRRListOutputProperties(ClientPtr client)
.nAtoms = numProps .nAtoms = numProps
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swaps(&rep.nAtoms, n); swaps(&rep.nAtoms);
} }
WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char *) &rep); WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char *) &rep);
...@@ -455,7 +454,6 @@ ProcRRQueryOutputProperty(ClientPtr client) ...@@ -455,7 +454,6 @@ ProcRRQueryOutputProperty(ClientPtr client)
RROutputPtr output; RROutputPtr output;
RRPropertyPtr prop; RRPropertyPtr prop;
char *extra = NULL; char *extra = NULL;
int n;
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
...@@ -484,8 +482,8 @@ ProcRRQueryOutputProperty(ClientPtr client) ...@@ -484,8 +482,8 @@ ProcRRQueryOutputProperty(ClientPtr client)
.immutable = prop->immutable .immutable = prop->immutable
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
} }
WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), (char *) &rep); WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), (char *) &rep);
if (prop->num_valid) { if (prop->num_valid) {
...@@ -609,7 +607,6 @@ ProcRRGetOutputProperty(ClientPtr client) ...@@ -609,7 +607,6 @@ ProcRRGetOutputProperty(ClientPtr client)
RROutputPtr output; RROutputPtr output;
xRRGetOutputPropertyReply reply; xRRGetOutputPropertyReply reply;
char *extra = NULL; char *extra = NULL;
int m;
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq); REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
if (stuff->delete) if (stuff->delete)
...@@ -645,11 +642,11 @@ ProcRRGetOutputProperty(ClientPtr client) ...@@ -645,11 +642,11 @@ ProcRRGetOutputProperty(ClientPtr client)
reply.propertyType = None; reply.propertyType = None;
reply.format = 0; reply.format = 0;
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber, m); swaps(&reply.sequenceNumber);
swapl(&reply.length, m); swapl(&reply.length);
swapl(&reply.propertyType, m); swapl(&reply.propertyType);
swapl(&reply.bytesAfter, m); swapl(&reply.bytesAfter);
swapl(&reply.nItems, m); swapl(&reply.nItems);
} }
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), WriteToClient(client, sizeof(xRRGetOutputPropertyReply),
(char *) &reply); (char *) &reply);
...@@ -674,11 +671,11 @@ ProcRRGetOutputProperty(ClientPtr client) ...@@ -674,11 +671,11 @@ ProcRRGetOutputProperty(ClientPtr client)
reply.nItems = 0; reply.nItems = 0;
reply.propertyType = prop_value->type; reply.propertyType = prop_value->type;
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber, n); swaps(&reply.sequenceNumber);
swapl(&reply.length, n); swapl(&reply.length);
swapl(&reply.propertyType, n); swapl(&reply.propertyType);
swapl(&reply.bytesAfter, n); swapl(&reply.bytesAfter);
swapl(&reply.nItems, n); swapl(&reply.nItems);
} }
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), WriteToClient(client, sizeof(xRRGetOutputPropertyReply),
(char *) &reply); (char *) &reply);
...@@ -728,11 +725,11 @@ ProcRRGetOutputProperty(ClientPtr client) ...@@ -728,11 +725,11 @@ ProcRRGetOutputProperty(ClientPtr client)
} }
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber, n); swaps(&reply.sequenceNumber);
swapl(&reply.length, n); swapl(&reply.length);
swapl(&reply.propertyType, n); swapl(&reply.propertyType);
swapl(&reply.bytesAfter, n); swapl(&reply.bytesAfter);
swapl(&reply.nItems, n); swapl(&reply.nItems);
} }
WriteToClient(client, sizeof(xGenericReply), (char *) &reply); WriteToClient(client, sizeof(xGenericReply), (char *) &reply);
if (len) { if (len) {
......
...@@ -43,7 +43,7 @@ RRProviderInitErrorValue(void) ...@@ -43,7 +43,7 @@ RRProviderInitErrorValue(void)
if (pScrPriv->provider) { \ if (pScrPriv->provider) { \
providers[count_providers] = pScrPriv->provider->id; \ providers[count_providers] = pScrPriv->provider->id; \
if (client->swapped) \ if (client->swapped) \
swapl(&providers[count_providers], n); \ swapl(&providers[count_providers]); \
count_providers++; \ count_providers++; \
} \ } \
} while(0) } while(0)
...@@ -64,7 +64,6 @@ ProcRRGetProviders(ClientPtr client) ...@@ -64,7 +64,6 @@ ProcRRGetProviders(ClientPtr client)
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
ScreenPtr iter; ScreenPtr iter;
#endif #endif
int n;
REQUEST_SIZE_MATCH(xRRGetProvidersReq); REQUEST_SIZE_MATCH(xRRGetProvidersReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
...@@ -143,10 +142,10 @@ ProcRRGetProviders(ClientPtr client) ...@@ -143,10 +142,10 @@ ProcRRGetProviders(ClientPtr client)
} }
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.timestamp, n); swapl(&rep.timestamp);
swaps(&rep.nProviders, n); swaps(&rep.nProviders);
} }
WriteToClient(client, sizeof(xRRGetProvidersReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetProvidersReply), (char *) &rep);
if (extraLen) if (extraLen)
...@@ -179,7 +178,6 @@ ProcRRGetProviderInfo(ClientPtr client) ...@@ -179,7 +178,6 @@ ProcRRGetProviderInfo(ClientPtr client)
#endif #endif
RRProvider *providers; RRProvider *providers;
uint32_t *prov_cap; uint32_t *prov_cap;
int n;
REQUEST_SIZE_MATCH(xRRGetProviderInfoReq); REQUEST_SIZE_MATCH(xRRGetProviderInfoReq);
VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
...@@ -233,31 +231,31 @@ ProcRRGetProviderInfo(ClientPtr client) ...@@ -233,31 +231,31 @@ ProcRRGetProviderInfo(ClientPtr client)
for (i = 0; i < pScrPriv->numCrtcs; i++) { for (i = 0; i < pScrPriv->numCrtcs; i++) {
crtcs[i] = pScrPriv->crtcs[i]->id; crtcs[i] = pScrPriv->crtcs[i]->id;
if (client->swapped) if (client->swapped)
swapl(&crtcs[i], n); swapl(&crtcs[i]);
} }
for (i = 0; i < pScrPriv->numOutputs; i++) { for (i = 0; i < pScrPriv->numOutputs; i++) {
outputs[i] = pScrPriv->outputs[i]->id; outputs[i] = pScrPriv->outputs[i]->id;
if (client->swapped) if (client->swapped)
swapl(&outputs[i], n); swapl(&outputs[i]);
} }
i = 0; i = 0;
if (provider->offload_sink) { if (provider->offload_sink) {
providers[i] = provider->offload_sink->id; providers[i] = provider->offload_sink->id;
if (client->swapped) if (client->swapped)
swapl(&providers[i], n); swapl(&providers[i]);
prov_cap[i] = RR_Capability_SinkOffload; prov_cap[i] = RR_Capability_SinkOffload;
if (client->swapped) if (client->swapped)
swapl(&prov_cap[i], n); swapl(&prov_cap[i]);
i++; i++;
} }
if (provider->output_source) { if (provider->output_source) {
providers[i] = provider->output_source->id; providers[i] = provider->output_source->id;
if (client->swapped) if (client->swapped)
swapl(&providers[i], n); swapl(&providers[i]);
prov_cap[i] = RR_Capability_SourceOutput; prov_cap[i] = RR_Capability_SourceOutput;
swapl(&prov_cap[i], n); swapl(&prov_cap[i]);
i++; i++;
} }
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
...@@ -284,12 +282,12 @@ ProcRRGetProviderInfo(ClientPtr client) ...@@ -284,12 +282,12 @@ ProcRRGetProviderInfo(ClientPtr client)
#endif #endif
memcpy(name, provider->name, rep.nameLength); memcpy(name, provider->name, rep.nameLength);
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.capabilities, n); swapl(&rep.capabilities);
swaps(&rep.nCrtcs, n); swaps(&rep.nCrtcs);
swaps(&rep.nOutputs, n); swaps(&rep.nOutputs);
swaps(&rep.nameLength, n); swaps(&rep.nameLength);
} }
WriteToClient(client, sizeof(xRRGetProviderInfoReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetProviderInfoReply), (char *) &rep);
if (extraLen) if (extraLen)
......
...@@ -401,7 +401,6 @@ ProcRRListProviderProperties(ClientPtr client) ...@@ -401,7 +401,6 @@ ProcRRListProviderProperties(ClientPtr client)
int numProps = 0; int numProps = 0;
RRProviderPtr provider; RRProviderPtr provider;
RRPropertyPtr prop; RRPropertyPtr prop;
int n;
REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq); REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq);
...@@ -424,9 +423,9 @@ ProcRRListProviderProperties(ClientPtr client) ...@@ -424,9 +423,9 @@ ProcRRListProviderProperties(ClientPtr client)
.nAtoms = numProps .nAtoms = numProps
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swaps(&rep.nAtoms, n); swaps(&rep.nAtoms);
} }
temppAtoms = pAtoms; temppAtoms = pAtoms;
for (prop = provider->properties; prop; prop = prop->next) for (prop = provider->properties; prop; prop = prop->next)
...@@ -450,7 +449,6 @@ ProcRRQueryProviderProperty(ClientPtr client) ...@@ -450,7 +449,6 @@ ProcRRQueryProviderProperty(ClientPtr client)
RRProviderPtr provider; RRProviderPtr provider;
RRPropertyPtr prop; RRPropertyPtr prop;
char *extra = NULL; char *extra = NULL;
int n;
REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq); REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq);
...@@ -478,8 +476,8 @@ ProcRRQueryProviderProperty(ClientPtr client) ...@@ -478,8 +476,8 @@ ProcRRQueryProviderProperty(ClientPtr client)
.immutable = prop->immutable .immutable = prop->immutable
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
} }
WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), (char *) &rep); WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), (char *) &rep);
if (prop->num_valid) { if (prop->num_valid) {
...@@ -637,11 +635,11 @@ ProcRRGetProviderProperty(ClientPtr client) ...@@ -637,11 +635,11 @@ ProcRRGetProviderProperty(ClientPtr client)
reply.propertyType = None; reply.propertyType = None;
reply.format = 0; reply.format = 0;
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber, n); swaps(&reply.sequenceNumber);
swapl(&reply.length, n); swapl(&reply.length);
swapl(&reply.propertyType, n); swapl(&reply.propertyType);
swapl(&reply.bytesAfter, n); swapl(&reply.bytesAfter);
swapl(&reply.nItems, n); swapl(&reply.nItems);
} }
WriteToClient(client, sizeof(xRRGetProviderPropertyReply), WriteToClient(client, sizeof(xRRGetProviderPropertyReply),
(char *) &reply); (char *) &reply);
...@@ -666,11 +664,11 @@ ProcRRGetProviderProperty(ClientPtr client) ...@@ -666,11 +664,11 @@ ProcRRGetProviderProperty(ClientPtr client)
reply.nItems = 0; reply.nItems = 0;
reply.propertyType = prop_value->type; reply.propertyType = prop_value->type;
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber, n); swaps(&reply.sequenceNumber);
swapl(&reply.length, n); swapl(&reply.length);
swapl(&reply.propertyType, n); swapl(&reply.propertyType);
swapl(&reply.bytesAfter, n); swapl(&reply.bytesAfter);
swapl(&reply.nItems, n); swapl(&reply.nItems);
} }
WriteToClient(client, sizeof(xRRGetProviderPropertyReply), WriteToClient(client, sizeof(xRRGetProviderPropertyReply),
(char *) &reply); (char *) &reply);
...@@ -720,11 +718,11 @@ ProcRRGetProviderProperty(ClientPtr client) ...@@ -720,11 +718,11 @@ ProcRRGetProviderProperty(ClientPtr client)
} }
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber, n); swaps(&reply.sequenceNumber);
swapl(&reply.length, n); swapl(&reply.length);
swapl(&reply.propertyType, n); swapl(&reply.propertyType);
swapl(&reply.bytesAfter, n); swapl(&reply.bytesAfter);
swapl(&reply.nItems, n); swapl(&reply.nItems);
} }
WriteToClient(client, sizeof(xGenericReply), (char *) &reply); WriteToClient(client, sizeof(xGenericReply), (char *) &reply);
if (len) { if (len) {
......
...@@ -212,7 +212,6 @@ ProcRRGetScreenSizeRange(ClientPtr client) ...@@ -212,7 +212,6 @@ ProcRRGetScreenSizeRange(ClientPtr client)
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
int rc; int rc;
int n;
REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq); REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
...@@ -248,12 +247,12 @@ ProcRRGetScreenSizeRange(ClientPtr client) ...@@ -248,12 +247,12 @@ ProcRRGetScreenSizeRange(ClientPtr client)
rep.maxHeight = rep.minHeight = pScreen->height; rep.maxHeight = rep.minHeight = pScreen->height;
} }
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swaps(&rep.minWidth, n); swaps(&rep.minWidth);
swaps(&rep.minHeight, n); swaps(&rep.minHeight);
swaps(&rep.maxWidth, n); swaps(&rep.maxWidth);
swaps(&rep.maxHeight, n); swaps(&rep.maxHeight);
} }
WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *) &rep);
return Success; return Success;
...@@ -340,21 +339,19 @@ ProcRRSetScreenSize(ClientPtr client) ...@@ -340,21 +339,19 @@ ProcRRSetScreenSize(ClientPtr client)
static inline void static inline void
swap_modeinfos(xRRModeInfo * modeinfos, int i) swap_modeinfos(xRRModeInfo * modeinfos, int i)
{ {
int n; swapl(&modeinfos[i].id);
swaps(&modeinfos[i].width);
swapl(&modeinfos[i].id, n); swaps(&modeinfos[i].height);
swaps(&modeinfos[i].width, n); swapl(&modeinfos[i].dotClock);
swaps(&modeinfos[i].height, n); swaps(&modeinfos[i].hSyncStart);
swapl(&modeinfos[i].dotClock, n); swaps(&modeinfos[i].hSyncEnd);
swaps(&modeinfos[i].hSyncStart, n); swaps(&modeinfos[i].hTotal);
swaps(&modeinfos[i].hSyncEnd, n); swaps(&modeinfos[i].hSkew);
swaps(&modeinfos[i].hTotal, n); swaps(&modeinfos[i].vSyncStart);
swaps(&modeinfos[i].hSkew, n); swaps(&modeinfos[i].vSyncEnd);
swaps(&modeinfos[i].vSyncStart, n); swaps(&modeinfos[i].vTotal);
swaps(&modeinfos[i].vSyncEnd, n); swaps(&modeinfos[i].nameLength);
swaps(&modeinfos[i].vTotal, n); swapl(&modeinfos[i].modeFlags);
swaps(&modeinfos[i].nameLength, n);
swapl(&modeinfos[i].modeFlags, n);
} }
#define update_arrays(gpuscreen, pScrPriv, primary_crtc, has_primary) do { \ #define update_arrays(gpuscreen, pScrPriv, primary_crtc, has_primary) do { \
...@@ -366,13 +363,13 @@ swap_modeinfos(xRRModeInfo * modeinfos, int i) ...@@ -366,13 +363,13 @@ swap_modeinfos(xRRModeInfo * modeinfos, int i)
}\ }\
crtcs[crtc_count] = pScrPriv->crtcs[j]->id; \ crtcs[crtc_count] = pScrPriv->crtcs[j]->id; \
if (client->swapped) \ if (client->swapped) \
swapl(&crtcs[crtc_count], n); \ swapl(&crtcs[crtc_count]); \
crtc_count++; \ crtc_count++; \
} \ } \
for (j = 0; j < pScrPriv->numOutputs; j++) { \ for (j = 0; j < pScrPriv->numOutputs; j++) { \
outputs[output_count] = pScrPriv->outputs[j]->id; \ outputs[output_count] = pScrPriv->outputs[j]->id; \
if (client->swapped) \ if (client->swapped) \
swapl(&outputs[output_count], n); \ swapl(&outputs[output_count]); \
output_count++; \ output_count++; \
} \ } \
{ \ { \
...@@ -412,7 +409,6 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) ...@@ -412,7 +409,6 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
xRRModeInfo *modeinfos; xRRModeInfo *modeinfos;
CARD8 *names; CARD8 *names;
int has_primary = 0; int has_primary = 0;
int n;
/* we need to iterate all the GPU masters and all their output slaves */ /* we need to iterate all the GPU masters and all their output slaves */
total_crtcs = 0; total_crtcs = 0;
...@@ -479,7 +475,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) ...@@ -479,7 +475,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
primary_crtc = pScrPriv->primaryOutput->crtc; primary_crtc = pScrPriv->primaryOutput->crtc;
crtcs[0] = pScrPriv->primaryOutput->crtc->id; crtcs[0] = pScrPriv->primaryOutput->crtc->id;
if (client->swapped) if (client->swapped)
swapl(&crtcs[0], n); swapl(&crtcs[0]);
crtc_count = 1; crtc_count = 1;
} }
update_arrays(pScreen, pScrPriv, primary_crtc, has_primary); update_arrays(pScreen, pScrPriv, primary_crtc, has_primary);
...@@ -492,14 +488,14 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) ...@@ -492,14 +488,14 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
assert(bytes_to_int32((char *) names - (char *) extra) == rep.length); assert(bytes_to_int32((char *) names - (char *) extra) == rep.length);
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.timestamp, n); swapl(&rep.timestamp);
swapl(&rep.configTimestamp, n); swapl(&rep.configTimestamp);
swaps(&rep.nCrtcs, n); swaps(&rep.nCrtcs);
swaps(&rep.nOutputs, n); swaps(&rep.nOutputs);
swaps(&rep.nModes, n); swaps(&rep.nModes);
swaps(&rep.nbytesNames, n); swaps(&rep.nbytesNames);
} }
WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *) &rep);
if (extraLen) { if (extraLen) {
...@@ -525,7 +521,6 @@ rrGetScreenResources(ClientPtr client, Bool query) ...@@ -525,7 +521,6 @@ rrGetScreenResources(ClientPtr client, Bool query)
RROutput *outputs; RROutput *outputs;
xRRModeInfo *modeinfos; xRRModeInfo *modeinfos;
CARD8 *names; CARD8 *names;
int n;
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
...@@ -613,7 +608,7 @@ rrGetScreenResources(ClientPtr client, Bool query) ...@@ -613,7 +608,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
has_primary = 1; has_primary = 1;
crtcs[0] = pScrPriv->primaryOutput->crtc->id; crtcs[0] = pScrPriv->primaryOutput->crtc->id;
if (client->swapped) if (client->swapped)
swapl(&crtcs[0], n); swapl(&crtcs[0]);
} }
for (i = 0; i < pScrPriv->numCrtcs; i++) { for (i = 0; i < pScrPriv->numCrtcs; i++) {
...@@ -624,13 +619,13 @@ rrGetScreenResources(ClientPtr client, Bool query) ...@@ -624,13 +619,13 @@ rrGetScreenResources(ClientPtr client, Bool query)
} }
crtcs[i + has_primary] = pScrPriv->crtcs[i]->id; crtcs[i + has_primary] = pScrPriv->crtcs[i]->id;
if (client->swapped) if (client->swapped)
swapl(&crtcs[i + has_primary], n); swapl(&crtcs[i + has_primary]);
} }
for (i = 0; i < pScrPriv->numOutputs; i++) { for (i = 0; i < pScrPriv->numOutputs; i++) {
outputs[i] = pScrPriv->outputs[i]->id; outputs[i] = pScrPriv->outputs[i]->id;
if (client->swapped) if (client->swapped)
swapl(&outputs[i], n); swapl(&outputs[i]);
} }
for (i = 0; i < num_modes; i++) { for (i = 0; i < num_modes; i++) {
...@@ -638,19 +633,19 @@ rrGetScreenResources(ClientPtr client, Bool query) ...@@ -638,19 +633,19 @@ rrGetScreenResources(ClientPtr client, Bool query)
modeinfos[i] = mode->mode; modeinfos[i] = mode->mode;
if (client->swapped) { if (client->swapped) {
swapl(&modeinfos[i].id, n); swapl(&modeinfos[i].id);
swaps(&modeinfos[i].width, n); swaps(&modeinfos[i].width);
swaps(&modeinfos[i].height, n); swaps(&modeinfos[i].height);
swapl(&modeinfos[i].dotClock, n); swapl(&modeinfos[i].dotClock);
swaps(&modeinfos[i].hSyncStart, n); swaps(&modeinfos[i].hSyncStart);
swaps(&modeinfos[i].hSyncEnd, n); swaps(&modeinfos[i].hSyncEnd);
swaps(&modeinfos[i].hTotal, n); swaps(&modeinfos[i].hTotal);
swaps(&modeinfos[i].hSkew, n); swaps(&modeinfos[i].hSkew);
swaps(&modeinfos[i].vSyncStart, n); swaps(&modeinfos[i].vSyncStart);
swaps(&modeinfos[i].vSyncEnd, n); swaps(&modeinfos[i].vSyncEnd);
swaps(&modeinfos[i].vTotal, n); swaps(&modeinfos[i].vTotal);
swaps(&modeinfos[i].nameLength, n); swaps(&modeinfos[i].nameLength);
swapl(&modeinfos[i].modeFlags, n); swapl(&modeinfos[i].modeFlags);
} }
memcpy(names, mode->name, mode->mode.nameLength); memcpy(names, mode->name, mode->mode.nameLength);
names += mode->mode.nameLength; names += mode->mode.nameLength;
...@@ -660,14 +655,14 @@ rrGetScreenResources(ClientPtr client, Bool query) ...@@ -660,14 +655,14 @@ rrGetScreenResources(ClientPtr client, Bool query)
} }
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.timestamp, n); swapl(&rep.timestamp);
swapl(&rep.configTimestamp, n); swapl(&rep.configTimestamp);
swaps(&rep.nCrtcs, n); swaps(&rep.nCrtcs);
swaps(&rep.nOutputs, n); swaps(&rep.nOutputs);
swaps(&rep.nModes, n); swaps(&rep.nModes);
swaps(&rep.nbytesNames, n); swaps(&rep.nbytesNames);
} }
WriteToClient(client, sizeof(xRRGetScreenResourcesReply), WriteToClient(client, sizeof(xRRGetScreenResourcesReply),
(char *) (char *) &rep); (char *) (char *) &rep);
...@@ -801,7 +796,6 @@ ProcRRGetScreenInfo(ClientPtr client) ...@@ -801,7 +796,6 @@ ProcRRGetScreenInfo(ClientPtr client)
CARD8 *extra; CARD8 *extra;
unsigned long extraLen; unsigned long extraLen;
RROutputPtr output; RROutputPtr output;
int n;
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
...@@ -895,22 +889,22 @@ ProcRRGetScreenInfo(ClientPtr client) ...@@ -895,22 +889,22 @@ ProcRRGetScreenInfo(ClientPtr client)
size->widthInMillimeters = pSize->mmWidth; size->widthInMillimeters = pSize->mmWidth;
size->heightInMillimeters = pSize->mmHeight; size->heightInMillimeters = pSize->mmHeight;
if (client->swapped) { if (client->swapped) {
swaps(&size->widthInPixels, n); swaps(&size->widthInPixels);
swaps(&size->heightInPixels, n); swaps(&size->heightInPixels);
swaps(&size->widthInMillimeters, n); swaps(&size->widthInMillimeters);
swaps(&size->heightInMillimeters, n); swaps(&size->heightInMillimeters);
} }
size++; size++;
if (has_rate) { if (has_rate) {
*rates = pSize->nRates; *rates = pSize->nRates;
if (client->swapped) { if (client->swapped) {
swaps(rates, n); swaps(rates);
} }
rates++; rates++;
for (j = 0; j < pSize->nRates; j++) { for (j = 0; j < pSize->nRates; j++) {
*rates = pSize->pRates[j].rate; *rates = pSize->pRates[j].rate;
if (client->swapped) { if (client->swapped) {
swaps(rates, n); swaps(rates);
} }
rates++; rates++;
} }
...@@ -926,15 +920,15 @@ ProcRRGetScreenInfo(ClientPtr client) ...@@ -926,15 +920,15 @@ ProcRRGetScreenInfo(ClientPtr client)
rep.length = bytes_to_int32(extraLen); rep.length = bytes_to_int32(extraLen);
} }
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.timestamp, n); swapl(&rep.timestamp);
swapl(&rep.configTimestamp, n); swapl(&rep.configTimestamp);
swaps(&rep.rotation, n); swaps(&rep.rotation);
swaps(&rep.nSizes, n); swaps(&rep.nSizes);
swaps(&rep.sizeID, n); swaps(&rep.sizeID);
swaps(&rep.rate, n); swaps(&rep.rate);
swaps(&rep.nrateEnts, n); swaps(&rep.nrateEnts);
} }
WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *) &rep); WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *) &rep);
if (extraLen) { if (extraLen) {
...@@ -965,7 +959,6 @@ ProcRRSetScreenConfig(ClientPtr client) ...@@ -965,7 +959,6 @@ ProcRRSetScreenConfig(ClientPtr client)
RR10DataPtr pData = NULL; RR10DataPtr pData = NULL;
RRScreenSizePtr pSize; RRScreenSizePtr pSize;
int width, height; int width, height;
int n;
UpdateCurrentTime(); UpdateCurrentTime();
...@@ -1173,11 +1166,11 @@ ProcRRSetScreenConfig(ClientPtr client) ...@@ -1173,11 +1166,11 @@ ProcRRSetScreenConfig(ClientPtr client)
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.newTimestamp, n); swapl(&rep.newTimestamp);
swapl(&rep.newConfigTimestamp, n); swapl(&rep.newConfigTimestamp);
swapl(&rep.root, n); swapl(&rep.root);
} }
WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *) &rep); WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *) &rep);
......
...@@ -25,162 +25,140 @@ ...@@ -25,162 +25,140 @@
static int static int
SProcRRQueryVersion(ClientPtr client) SProcRRQueryVersion(ClientPtr client)
{ {
int n;
REQUEST(xRRQueryVersionReq); REQUEST(xRRQueryVersionReq);
REQUEST_SIZE_MATCH(xRRQueryVersionReq); REQUEST_SIZE_MATCH(xRRQueryVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->majorVersion, n); swapl(&stuff->majorVersion);
swapl(&stuff->minorVersion, n); swapl(&stuff->minorVersion);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRGetScreenInfo(ClientPtr client) SProcRRGetScreenInfo(ClientPtr client)
{ {
int n;
REQUEST(xRRGetScreenInfoReq); REQUEST(xRRGetScreenInfoReq);
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRSetScreenConfig(ClientPtr client) SProcRRSetScreenConfig(ClientPtr client)
{ {
int n;
REQUEST(xRRSetScreenConfigReq); REQUEST(xRRSetScreenConfigReq);
if (RRClientKnowsRates(client)) { if (RRClientKnowsRates(client)) {
REQUEST_SIZE_MATCH(xRRSetScreenConfigReq); REQUEST_SIZE_MATCH(xRRSetScreenConfigReq);
swaps(&stuff->rate, n); swaps(&stuff->rate);
} }
else { else {
REQUEST_SIZE_MATCH(xRR1_0SetScreenConfigReq); REQUEST_SIZE_MATCH(xRR1_0SetScreenConfigReq);
} }
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->timestamp, n); swapl(&stuff->timestamp);
swaps(&stuff->sizeID, n); swaps(&stuff->sizeID);
swaps(&stuff->rotation, n); swaps(&stuff->rotation);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRSelectInput(ClientPtr client) SProcRRSelectInput(ClientPtr client)
{ {
int n;
REQUEST(xRRSelectInputReq); REQUEST(xRRSelectInputReq);
REQUEST_SIZE_MATCH(xRRSelectInputReq); REQUEST_SIZE_MATCH(xRRSelectInputReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
swaps(&stuff->enable, n); swaps(&stuff->enable);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRGetScreenSizeRange(ClientPtr client) SProcRRGetScreenSizeRange(ClientPtr client)
{ {
int n;
REQUEST(xRRGetScreenSizeRangeReq); REQUEST(xRRGetScreenSizeRangeReq);
REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq); REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRSetScreenSize(ClientPtr client) SProcRRSetScreenSize(ClientPtr client)
{ {
int n;
REQUEST(xRRSetScreenSizeReq); REQUEST(xRRSetScreenSizeReq);
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
swapl(&stuff->widthInMillimeters, n); swapl(&stuff->widthInMillimeters);
swapl(&stuff->heightInMillimeters, n); swapl(&stuff->heightInMillimeters);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRGetScreenResources(ClientPtr client) SProcRRGetScreenResources(ClientPtr client)
{ {
int n;
REQUEST(xRRGetScreenResourcesReq); REQUEST(xRRGetScreenResourcesReq);
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRGetOutputInfo(ClientPtr client) SProcRRGetOutputInfo(ClientPtr client)
{ {
int n;
REQUEST(xRRGetOutputInfoReq); REQUEST(xRRGetOutputInfoReq);
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->output, n); swapl(&stuff->output);
swapl(&stuff->configTimestamp, n); swapl(&stuff->configTimestamp);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRListOutputProperties(ClientPtr client) SProcRRListOutputProperties(ClientPtr client)
{ {
int n;
REQUEST(xRRListOutputPropertiesReq); REQUEST(xRRListOutputPropertiesReq);
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq); REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->output, n); swapl(&stuff->output);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRQueryOutputProperty(ClientPtr client) SProcRRQueryOutputProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRQueryOutputPropertyReq); REQUEST(xRRQueryOutputPropertyReq);
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->output, n); swapl(&stuff->output);
swapl(&stuff->property, n); swapl(&stuff->property);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRConfigureOutputProperty(ClientPtr client) SProcRRConfigureOutputProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRConfigureOutputPropertyReq); REQUEST(xRRConfigureOutputPropertyReq);
REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq); REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->output, n); swapl(&stuff->output);
swapl(&stuff->property, n); swapl(&stuff->property);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
...@@ -188,16 +166,14 @@ SProcRRConfigureOutputProperty(ClientPtr client) ...@@ -188,16 +166,14 @@ SProcRRConfigureOutputProperty(ClientPtr client)
static int static int
SProcRRChangeOutputProperty(ClientPtr client) SProcRRChangeOutputProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRChangeOutputPropertyReq); REQUEST(xRRChangeOutputPropertyReq);
REQUEST_AT_LEAST_SIZE(xRRChangeOutputPropertyReq); REQUEST_AT_LEAST_SIZE(xRRChangeOutputPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->output, n); swapl(&stuff->output);
swapl(&stuff->property, n); swapl(&stuff->property);
swapl(&stuff->type, n); swapl(&stuff->type);
swapl(&stuff->nUnits, n); swapl(&stuff->nUnits);
switch (stuff->format) { switch (stuff->format) {
case 8: case 8:
break; break;
...@@ -217,134 +193,118 @@ SProcRRChangeOutputProperty(ClientPtr client) ...@@ -217,134 +193,118 @@ SProcRRChangeOutputProperty(ClientPtr client)
static int static int
SProcRRDeleteOutputProperty(ClientPtr client) SProcRRDeleteOutputProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRDeleteOutputPropertyReq); REQUEST(xRRDeleteOutputPropertyReq);
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->output, n); swapl(&stuff->output);
swapl(&stuff->property, n); swapl(&stuff->property);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRGetOutputProperty(ClientPtr client) SProcRRGetOutputProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRGetOutputPropertyReq); REQUEST(xRRGetOutputPropertyReq);
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq); REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->output, n); swapl(&stuff->output);
swapl(&stuff->property, n); swapl(&stuff->property);
swapl(&stuff->type, n); swapl(&stuff->type);
swapl(&stuff->longOffset, n); swapl(&stuff->longOffset);
swapl(&stuff->longLength, n); swapl(&stuff->longLength);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRCreateMode(ClientPtr client) SProcRRCreateMode(ClientPtr client)
{ {
int n;
xRRModeInfo *modeinfo; xRRModeInfo *modeinfo;
REQUEST(xRRCreateModeReq); REQUEST(xRRCreateModeReq);
REQUEST_AT_LEAST_SIZE(xRRCreateModeReq); REQUEST_AT_LEAST_SIZE(xRRCreateModeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
modeinfo = &stuff->modeInfo; modeinfo = &stuff->modeInfo;
swapl(&modeinfo->id, n); swapl(&modeinfo->id);
swaps(&modeinfo->width, n); swaps(&modeinfo->width);
swaps(&modeinfo->height, n); swaps(&modeinfo->height);
swapl(&modeinfo->dotClock, n); swapl(&modeinfo->dotClock);
swaps(&modeinfo->hSyncStart, n); swaps(&modeinfo->hSyncStart);
swaps(&modeinfo->hSyncEnd, n); swaps(&modeinfo->hSyncEnd);
swaps(&modeinfo->hTotal, n); swaps(&modeinfo->hTotal);
swaps(&modeinfo->vSyncStart, n); swaps(&modeinfo->vSyncStart);
swaps(&modeinfo->vSyncEnd, n); swaps(&modeinfo->vSyncEnd);
swaps(&modeinfo->vTotal, n); swaps(&modeinfo->vTotal);
swaps(&modeinfo->nameLength, n); swaps(&modeinfo->nameLength);
swapl(&modeinfo->modeFlags, n); swapl(&modeinfo->modeFlags);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRDestroyMode(ClientPtr client) SProcRRDestroyMode(ClientPtr client)
{ {
int n;
REQUEST(xRRDestroyModeReq); REQUEST(xRRDestroyModeReq);
REQUEST_SIZE_MATCH(xRRDestroyModeReq); REQUEST_SIZE_MATCH(xRRDestroyModeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->mode, n); swapl(&stuff->mode);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRAddOutputMode(ClientPtr client) SProcRRAddOutputMode(ClientPtr client)
{ {
int n;
REQUEST(xRRAddOutputModeReq); REQUEST(xRRAddOutputModeReq);
REQUEST_SIZE_MATCH(xRRAddOutputModeReq); REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->output, n); swapl(&stuff->output);
swapl(&stuff->mode, n); swapl(&stuff->mode);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRDeleteOutputMode(ClientPtr client) SProcRRDeleteOutputMode(ClientPtr client)
{ {
int n;
REQUEST(xRRDeleteOutputModeReq); REQUEST(xRRDeleteOutputModeReq);
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq); REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->output, n); swapl(&stuff->output);
swapl(&stuff->mode, n); swapl(&stuff->mode);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRGetCrtcInfo(ClientPtr client) SProcRRGetCrtcInfo(ClientPtr client)
{ {
int n;
REQUEST(xRRGetCrtcInfoReq); REQUEST(xRRGetCrtcInfoReq);
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->crtc, n); swapl(&stuff->crtc);
swapl(&stuff->configTimestamp, n); swapl(&stuff->configTimestamp);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRSetCrtcConfig(ClientPtr client) SProcRRSetCrtcConfig(ClientPtr client)
{ {
int n;
REQUEST(xRRSetCrtcConfigReq); REQUEST(xRRSetCrtcConfigReq);
REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->crtc, n); swapl(&stuff->crtc);
swapl(&stuff->timestamp, n); swapl(&stuff->timestamp);
swapl(&stuff->configTimestamp, n); swapl(&stuff->configTimestamp);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
swapl(&stuff->mode, n); swapl(&stuff->mode);
swaps(&stuff->rotation, n); swaps(&stuff->rotation);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
...@@ -352,40 +312,34 @@ SProcRRSetCrtcConfig(ClientPtr client) ...@@ -352,40 +312,34 @@ SProcRRSetCrtcConfig(ClientPtr client)
static int static int
SProcRRGetCrtcGammaSize(ClientPtr client) SProcRRGetCrtcGammaSize(ClientPtr client)
{ {
int n;
REQUEST(xRRGetCrtcGammaSizeReq); REQUEST(xRRGetCrtcGammaSizeReq);
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->crtc, n); swapl(&stuff->crtc);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRGetCrtcGamma(ClientPtr client) SProcRRGetCrtcGamma(ClientPtr client)
{ {
int n;
REQUEST(xRRGetCrtcGammaReq); REQUEST(xRRGetCrtcGammaReq);
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->crtc, n); swapl(&stuff->crtc);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRSetCrtcGamma(ClientPtr client) SProcRRSetCrtcGamma(ClientPtr client)
{ {
int n;
REQUEST(xRRSetCrtcGammaReq); REQUEST(xRRSetCrtcGammaReq);
REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->crtc, n); swapl(&stuff->crtc);
swaps(&stuff->size, n); swaps(&stuff->size);
SwapRestS(stuff); SwapRestS(stuff);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
...@@ -396,16 +350,15 @@ SProcRRSetCrtcTransform(ClientPtr client) ...@@ -396,16 +350,15 @@ SProcRRSetCrtcTransform(ClientPtr client)
int nparams; int nparams;
char *filter; char *filter;
CARD32 *params; CARD32 *params;
int n;
REQUEST(xRRSetCrtcTransformReq); REQUEST(xRRSetCrtcTransformReq);
REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->crtc, n); swapl(&stuff->crtc);
SwapLongs((CARD32 *) &stuff->transform, SwapLongs((CARD32 *) &stuff->transform,
bytes_to_int32(sizeof(xRenderTransform))); bytes_to_int32(sizeof(xRenderTransform)));
swaps(&stuff->nbytesFilter, n); swaps(&stuff->nbytesFilter);
filter = (char *) (stuff + 1); filter = (char *) (stuff + 1);
params = (CARD32 *) (filter + pad_to_int32(stuff->nbytesFilter)); params = (CARD32 *) (filter + pad_to_int32(stuff->nbytesFilter));
nparams = ((CARD32 *) stuff + client->req_len) - params; nparams = ((CARD32 *) stuff + client->req_len) - params;
...@@ -419,177 +372,153 @@ SProcRRSetCrtcTransform(ClientPtr client) ...@@ -419,177 +372,153 @@ SProcRRSetCrtcTransform(ClientPtr client)
static int static int
SProcRRGetCrtcTransform(ClientPtr client) SProcRRGetCrtcTransform(ClientPtr client)
{ {
int n;
REQUEST(xRRGetCrtcTransformReq); REQUEST(xRRGetCrtcTransformReq);
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq); REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->crtc, n); swapl(&stuff->crtc);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRGetPanning(ClientPtr client) SProcRRGetPanning(ClientPtr client)
{ {
int n;
REQUEST(xRRGetPanningReq); REQUEST(xRRGetPanningReq);
REQUEST_SIZE_MATCH(xRRGetPanningReq); REQUEST_SIZE_MATCH(xRRGetPanningReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->crtc, n); swapl(&stuff->crtc);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRSetPanning(ClientPtr client) SProcRRSetPanning(ClientPtr client)
{ {
int n;
REQUEST(xRRSetPanningReq); REQUEST(xRRSetPanningReq);
REQUEST_SIZE_MATCH(xRRSetPanningReq); REQUEST_SIZE_MATCH(xRRSetPanningReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->crtc, n); swapl(&stuff->crtc);
swapl(&stuff->timestamp, n); swapl(&stuff->timestamp);
swaps(&stuff->left, n); swaps(&stuff->left);
swaps(&stuff->top, n); swaps(&stuff->top);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
swaps(&stuff->track_left, n); swaps(&stuff->track_left);
swaps(&stuff->track_top, n); swaps(&stuff->track_top);
swaps(&stuff->track_width, n); swaps(&stuff->track_width);
swaps(&stuff->track_height, n); swaps(&stuff->track_height);
swaps(&stuff->border_left, n); swaps(&stuff->border_left);
swaps(&stuff->border_top, n); swaps(&stuff->border_top);
swaps(&stuff->border_right, n); swaps(&stuff->border_right);
swaps(&stuff->border_bottom, n); swaps(&stuff->border_bottom);
return (*ProcRandrVector[stuff->randrReqType]) (client); return (*ProcRandrVector[stuff->randrReqType]) (client);
} }
static int static int
SProcRRSetOutputPrimary(ClientPtr client) SProcRRSetOutputPrimary(ClientPtr client)
{ {
int n;
REQUEST(xRRSetOutputPrimaryReq); REQUEST(xRRSetOutputPrimaryReq);
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq); REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->output, n); swapl(&stuff->output);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRGetOutputPrimary(ClientPtr client) SProcRRGetOutputPrimary(ClientPtr client)
{ {
int n;
REQUEST(xRRGetOutputPrimaryReq); REQUEST(xRRGetOutputPrimaryReq);
REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq); REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRGetProviders(ClientPtr client) SProcRRGetProviders(ClientPtr client)
{ {
int n;
REQUEST(xRRGetProvidersReq); REQUEST(xRRGetProvidersReq);
REQUEST_SIZE_MATCH(xRRGetProvidersReq); REQUEST_SIZE_MATCH(xRRGetProvidersReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRGetProviderInfo(ClientPtr client) SProcRRGetProviderInfo(ClientPtr client)
{ {
int n;
REQUEST(xRRGetProviderInfoReq); REQUEST(xRRGetProviderInfoReq);
REQUEST_SIZE_MATCH(xRRGetProviderInfoReq); REQUEST_SIZE_MATCH(xRRGetProviderInfoReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->provider, n); swapl(&stuff->provider);
swapl(&stuff->configTimestamp, n); swapl(&stuff->configTimestamp);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRSetProviderOffloadSink(ClientPtr client) SProcRRSetProviderOffloadSink(ClientPtr client)
{ {
int n;
REQUEST(xRRSetProviderOffloadSinkReq); REQUEST(xRRSetProviderOffloadSinkReq);
REQUEST_SIZE_MATCH(xRRSetProviderOffloadSinkReq); REQUEST_SIZE_MATCH(xRRSetProviderOffloadSinkReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->provider, n); swapl(&stuff->provider);
swapl(&stuff->sink_provider, n); swapl(&stuff->sink_provider);
swapl(&stuff->configTimestamp, n); swapl(&stuff->configTimestamp);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRSetProviderOutputSource(ClientPtr client) SProcRRSetProviderOutputSource(ClientPtr client)
{ {
int n;
REQUEST(xRRSetProviderOutputSourceReq); REQUEST(xRRSetProviderOutputSourceReq);
REQUEST_SIZE_MATCH(xRRSetProviderOutputSourceReq); REQUEST_SIZE_MATCH(xRRSetProviderOutputSourceReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->provider, n); swapl(&stuff->provider);
swapl(&stuff->source_provider, n); swapl(&stuff->source_provider);
swapl(&stuff->configTimestamp, n); swapl(&stuff->configTimestamp);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRListProviderProperties(ClientPtr client) SProcRRListProviderProperties(ClientPtr client)
{ {
int n;
REQUEST(xRRListProviderPropertiesReq); REQUEST(xRRListProviderPropertiesReq);
REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq); REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->provider, n); swapl(&stuff->provider);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRQueryProviderProperty(ClientPtr client) SProcRRQueryProviderProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRQueryProviderPropertyReq); REQUEST(xRRQueryProviderPropertyReq);
REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq); REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->provider, n); swapl(&stuff->provider);
swapl(&stuff->property, n); swapl(&stuff->property);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRConfigureProviderProperty(ClientPtr client) SProcRRConfigureProviderProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRConfigureProviderPropertyReq); REQUEST(xRRConfigureProviderPropertyReq);
REQUEST_AT_LEAST_SIZE(xRRConfigureProviderPropertyReq); REQUEST_AT_LEAST_SIZE(xRRConfigureProviderPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->provider, n); swapl(&stuff->provider);
swapl(&stuff->property, n); swapl(&stuff->property);
/* TODO: no way to specify format? */ /* TODO: no way to specify format? */
SwapRestL(stuff); SwapRestL(stuff);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
...@@ -598,16 +527,14 @@ SProcRRConfigureProviderProperty(ClientPtr client) ...@@ -598,16 +527,14 @@ SProcRRConfigureProviderProperty(ClientPtr client)
static int static int
SProcRRChangeProviderProperty(ClientPtr client) SProcRRChangeProviderProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRChangeProviderPropertyReq); REQUEST(xRRChangeProviderPropertyReq);
REQUEST_AT_LEAST_SIZE(xRRChangeProviderPropertyReq); REQUEST_AT_LEAST_SIZE(xRRChangeProviderPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->provider, n); swapl(&stuff->provider);
swapl(&stuff->property, n); swapl(&stuff->property);
swapl(&stuff->type, n); swapl(&stuff->type);
swapl(&stuff->nUnits, n); swapl(&stuff->nUnits);
switch (stuff->format) { switch (stuff->format) {
case 8: case 8:
break; break;
...@@ -624,63 +551,55 @@ SProcRRChangeProviderProperty(ClientPtr client) ...@@ -624,63 +551,55 @@ SProcRRChangeProviderProperty(ClientPtr client)
static int static int
SProcRRDeleteProviderProperty(ClientPtr client) SProcRRDeleteProviderProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRDeleteProviderPropertyReq); REQUEST(xRRDeleteProviderPropertyReq);
REQUEST_SIZE_MATCH(xRRDeleteProviderPropertyReq); REQUEST_SIZE_MATCH(xRRDeleteProviderPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->provider, n); swapl(&stuff->provider);
swapl(&stuff->property, n); swapl(&stuff->property);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRGetProviderProperty(ClientPtr client) SProcRRGetProviderProperty(ClientPtr client)
{ {
int n;
REQUEST(xRRGetProviderPropertyReq); REQUEST(xRRGetProviderPropertyReq);
REQUEST_SIZE_MATCH(xRRGetProviderPropertyReq); REQUEST_SIZE_MATCH(xRRGetProviderPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->provider, n); swapl(&stuff->provider);
swapl(&stuff->property, n); swapl(&stuff->property);
swapl(&stuff->type, n); swapl(&stuff->type);
swapl(&stuff->longOffset, n); swapl(&stuff->longOffset);
swapl(&stuff->longLength, n); swapl(&stuff->longLength);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRGetMonitors(ClientPtr client) SProcRRGetMonitors(ClientPtr client)
{ {
int n;
REQUEST(xRRGetMonitorsReq); REQUEST(xRRGetMonitorsReq);
REQUEST_SIZE_MATCH(xRRGetMonitorsReq); REQUEST_SIZE_MATCH(xRRGetMonitorsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
static int static int
SProcRRSetMonitor(ClientPtr client) SProcRRSetMonitor(ClientPtr client)
{ {
int n;
REQUEST(xRRSetMonitorReq); REQUEST(xRRSetMonitorReq);
REQUEST_AT_LEAST_SIZE(xRRGetMonitorsReq); REQUEST_AT_LEAST_SIZE(xRRGetMonitorsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->monitor.name, n); swapl(&stuff->monitor.name);
swaps(&stuff->monitor.noutput, n); swaps(&stuff->monitor.noutput);
swaps(&stuff->monitor.x, n); swaps(&stuff->monitor.x);
swaps(&stuff->monitor.y, n); swaps(&stuff->monitor.y);
swaps(&stuff->monitor.width, n); swaps(&stuff->monitor.width);
swaps(&stuff->monitor.height, n); swaps(&stuff->monitor.height);
SwapRestL(stuff); SwapRestL(stuff);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
...@@ -688,14 +607,12 @@ SProcRRSetMonitor(ClientPtr client) ...@@ -688,14 +607,12 @@ SProcRRSetMonitor(ClientPtr client)
static int static int
SProcRRDeleteMonitor(ClientPtr client) SProcRRDeleteMonitor(ClientPtr client)
{ {
int n;
REQUEST(xRRDeleteMonitorReq); REQUEST(xRRDeleteMonitorReq);
REQUEST_SIZE_MATCH(xRRDeleteMonitorReq); REQUEST_SIZE_MATCH(xRRDeleteMonitorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->name, n); swapl(&stuff->name);
return ProcRandrVector[stuff->randrReqType] (client); return ProcRandrVector[stuff->randrReqType] (client);
} }
......
...@@ -108,8 +108,6 @@ extern Bool noRRXineramaExtension; ...@@ -108,8 +108,6 @@ extern Bool noRRXineramaExtension;
int int
ProcRRXineramaQueryVersion(ClientPtr client) ProcRRXineramaQueryVersion(ClientPtr client)
{ {
int n;
xPanoramiXQueryVersionReply rep = { xPanoramiXQueryVersionReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
...@@ -120,10 +118,10 @@ ProcRRXineramaQueryVersion(ClientPtr client) ...@@ -120,10 +118,10 @@ ProcRRXineramaQueryVersion(ClientPtr client)
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swaps(&rep.majorVersion, n); swaps(&rep.majorVersion);
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep); WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep);
return Success; return Success;
...@@ -139,7 +137,6 @@ ProcRRXineramaGetState(ClientPtr client) ...@@ -139,7 +137,6 @@ ProcRRXineramaGetState(ClientPtr client)
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
Bool active = FALSE; Bool active = FALSE;
int n;
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
...@@ -167,9 +164,9 @@ ProcRRXineramaGetState(ClientPtr client) ...@@ -167,9 +164,9 @@ ProcRRXineramaGetState(ClientPtr client)
.window = stuff->window .window = stuff->window
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.window, n); swapl(&rep.window);
} }
WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep); WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep);
return Success; return Success;
...@@ -194,7 +191,6 @@ ProcRRXineramaGetScreenCount(ClientPtr client) ...@@ -194,7 +191,6 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
WindowPtr pWin; WindowPtr pWin;
xPanoramiXGetScreenCountReply rep; xPanoramiXGetScreenCountReply rep;
register int rc; register int rc;
int n;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
...@@ -215,9 +211,9 @@ ProcRRXineramaGetScreenCount(ClientPtr client) ...@@ -215,9 +211,9 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
.window = stuff->window .window = stuff->window
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.window, n); swapl(&rep.window);
} }
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep); WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep);
return Success; return Success;
...@@ -231,7 +227,6 @@ ProcRRXineramaGetScreenSize(ClientPtr client) ...@@ -231,7 +227,6 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
ScreenPtr pScreen; ScreenPtr pScreen;
xPanoramiXGetScreenSizeReply rep; xPanoramiXGetScreenSizeReply rep;
register int rc; register int rc;
int n;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
...@@ -257,12 +252,12 @@ ProcRRXineramaGetScreenSize(ClientPtr client) ...@@ -257,12 +252,12 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
.screen = stuff->screen .screen = stuff->screen
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.width, n); swapl(&rep.width);
swapl(&rep.height, n); swapl(&rep.height);
swapl(&rep.window, n); swapl(&rep.window);
swapl(&rep.screen, n); swapl(&rep.screen);
} }
WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep); WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep);
return Success; return Success;
...@@ -272,7 +267,6 @@ int ...@@ -272,7 +267,6 @@ int
ProcRRXineramaIsActive(ClientPtr client) ProcRRXineramaIsActive(ClientPtr client)
{ {
xXineramaIsActiveReply rep; xXineramaIsActiveReply rep;
int n;
REQUEST_SIZE_MATCH(xXineramaIsActiveReq); REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
...@@ -283,9 +277,9 @@ ProcRRXineramaIsActive(ClientPtr client) ...@@ -283,9 +277,9 @@ ProcRRXineramaIsActive(ClientPtr client)
.state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN]) .state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN])
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.state, n); swapl(&rep.state);
} }
WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
return Success; return Success;
...@@ -312,7 +306,6 @@ ProcRRXineramaQueryScreens(ClientPtr client) ...@@ -312,7 +306,6 @@ ProcRRXineramaQueryScreens(ClientPtr client)
int m; int m;
RRMonitorPtr monitors = NULL; RRMonitorPtr monitors = NULL;
int nmonitors = 0; int nmonitors = 0;
int n;
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
...@@ -329,9 +322,9 @@ ProcRRXineramaQueryScreens(ClientPtr client) ...@@ -329,9 +322,9 @@ ProcRRXineramaQueryScreens(ClientPtr client)
.number = nmonitors .number = nmonitors
}; };
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.number, n); swapl(&rep.number);
} }
WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep); WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep);
...@@ -370,10 +363,8 @@ ProcRRXineramaDispatch(ClientPtr client) ...@@ -370,10 +363,8 @@ ProcRRXineramaDispatch(ClientPtr client)
static int static int
SProcRRXineramaQueryVersion(ClientPtr client) SProcRRXineramaQueryVersion(ClientPtr client)
{ {
int n;
REQUEST(xPanoramiXQueryVersionReq); REQUEST(xPanoramiXQueryVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
return ProcRRXineramaQueryVersion(client); return ProcRRXineramaQueryVersion(client);
} }
...@@ -381,47 +372,39 @@ SProcRRXineramaQueryVersion(ClientPtr client) ...@@ -381,47 +372,39 @@ SProcRRXineramaQueryVersion(ClientPtr client)
static int static int
SProcRRXineramaGetState(ClientPtr client) SProcRRXineramaGetState(ClientPtr client)
{ {
int n;
REQUEST(xPanoramiXGetStateReq); REQUEST(xPanoramiXGetStateReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
swapl(&stuff->window, n); swapl(&stuff->window);
return ProcRRXineramaGetState(client); return ProcRRXineramaGetState(client);
} }
static int static int
SProcRRXineramaGetScreenCount(ClientPtr client) SProcRRXineramaGetScreenCount(ClientPtr client)
{ {
int n;
REQUEST(xPanoramiXGetScreenCountReq); REQUEST(xPanoramiXGetScreenCountReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
swapl(&stuff->window, n); swapl(&stuff->window);
return ProcRRXineramaGetScreenCount(client); return ProcRRXineramaGetScreenCount(client);
} }
static int static int
SProcRRXineramaGetScreenSize(ClientPtr client) SProcRRXineramaGetScreenSize(ClientPtr client)
{ {
int n;
REQUEST(xPanoramiXGetScreenSizeReq); REQUEST(xPanoramiXGetScreenSizeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->screen, n); swapl(&stuff->screen);
return ProcRRXineramaGetScreenSize(client); return ProcRRXineramaGetScreenSize(client);
} }
static int static int
SProcRRXineramaIsActive(ClientPtr client) SProcRRXineramaIsActive(ClientPtr client)
{ {
int n;
REQUEST(xXineramaIsActiveReq); REQUEST(xXineramaIsActiveReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXineramaIsActiveReq); REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
return ProcRRXineramaIsActive(client); return ProcRRXineramaIsActive(client);
} }
...@@ -429,10 +412,8 @@ SProcRRXineramaIsActive(ClientPtr client) ...@@ -429,10 +412,8 @@ SProcRRXineramaIsActive(ClientPtr client)
static int static int
SProcRRXineramaQueryScreens(ClientPtr client) SProcRRXineramaQueryScreens(ClientPtr client)
{ {
int n;
REQUEST(xXineramaQueryScreensReq); REQUEST(xXineramaQueryScreensReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
return ProcRRXineramaQueryScreens(client); return ProcRRXineramaQueryScreens(client);
} }
......
...@@ -297,7 +297,6 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, ...@@ -297,7 +297,6 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
CARD32 elemHeaderData[2]; CARD32 elemHeaderData[2];
int numElemHeaders = 0; int numElemHeaders = 0;
Bool recordingClientSwapped = pContext->pRecordingClient->swapped; Bool recordingClientSwapped = pContext->pRecordingClient->swapped;
int n;
CARD32 serverTime = 0; CARD32 serverTime = 0;
Bool gotServerTime = FALSE; Bool gotServerTime = FALSE;
int replylen; int replylen;
...@@ -341,11 +340,11 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, ...@@ -341,11 +340,11 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
if (recordingClientSwapped) if (recordingClientSwapped)
{ {
swaps(&pRep->sequenceNumber, n); swaps(&pRep->sequenceNumber);
swapl(&pRep->length, n); swapl(&pRep->length);
swapl(&pRep->idBase, n); swapl(&pRep->idBase);
swapl(&pRep->serverTime, n); swapl(&pRep->serverTime);
swapl(&pRep->recordedSequenceNumber, n); swapl(&pRep->recordedSequenceNumber);
} }
pContext->numBufBytes = SIZEOF(xRecordEnableContextReply); pContext->numBufBytes = SIZEOF(xRecordEnableContextReply);
} }
...@@ -363,7 +362,7 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, ...@@ -363,7 +362,7 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
else else
elemHeaderData[numElemHeaders] = GetTimeInMillis(); elemHeaderData[numElemHeaders] = GetTimeInMillis();
if (recordingClientSwapped) if (recordingClientSwapped)
swapl(&elemHeaderData[numElemHeaders], n); swapl(&elemHeaderData[numElemHeaders]);
numElemHeaders++; numElemHeaders++;
} }
...@@ -373,16 +372,16 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, ...@@ -373,16 +372,16 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
{ {
elemHeaderData[numElemHeaders] = pClient->sequence; elemHeaderData[numElemHeaders] = pClient->sequence;
if (recordingClientSwapped) if (recordingClientSwapped)
swapl(&elemHeaderData[numElemHeaders], n); swapl(&elemHeaderData[numElemHeaders]);
numElemHeaders++; numElemHeaders++;
} }
/* adjust reply length */ /* adjust reply length */
replylen = pRep->length; replylen = pRep->length;
if (recordingClientSwapped) swapl(&replylen, n); if (recordingClientSwapped) swapl(&replylen);
replylen += numElemHeaders + (datalen >> 2) + (futurelen >> 2); replylen += numElemHeaders + (datalen >> 2) + (futurelen >> 2);
if (recordingClientSwapped) swapl(&replylen, n); if (recordingClientSwapped) swapl(&replylen);
pRep->length = replylen; pRep->length = replylen;
} /* end if not continued reply */ } /* end if not continued reply */
...@@ -477,7 +476,6 @@ RecordABigRequest(pContext, client, stuff) ...@@ -477,7 +476,6 @@ RecordABigRequest(pContext, client, stuff)
xReq *stuff; xReq *stuff;
{ {
CARD32 bigLength; CARD32 bigLength;
char n;
int bytesLeft; int bytesLeft;
/* note: client->req_len has been frobbed by ReadRequestFromClient /* note: client->req_len has been frobbed by ReadRequestFromClient
...@@ -494,7 +492,7 @@ RecordABigRequest(pContext, client, stuff) ...@@ -494,7 +492,7 @@ RecordABigRequest(pContext, client, stuff)
/* reinsert the extended length field that was squished out */ /* reinsert the extended length field that was squished out */
bigLength = client->req_len + (sizeof(bigLength) >> 2); bigLength = client->req_len + (sizeof(bigLength) >> 2);
if (client->swapped) if (client->swapped)
swapl(&bigLength, n); swapl(&bigLength);
RecordAProtocolElement(pContext, client, XRecordFromClient, RecordAProtocolElement(pContext, client, XRecordFromClient,
(void *)&bigLength, sizeof(bigLength), /* continuation */ -1); (void *)&bigLength, sizeof(bigLength), /* continuation */ -1);
bytesLeft -= sizeof(bigLength); bytesLeft -= sizeof(bigLength);
...@@ -1998,7 +1996,6 @@ ProcRecordQueryVersion(client) ...@@ -1998,7 +1996,6 @@ ProcRecordQueryVersion(client)
{ {
/* REQUEST(xRecordQueryVersionReq); */ /* REQUEST(xRecordQueryVersionReq); */
xRecordQueryVersionReply rep; xRecordQueryVersionReply rep;
int n;
REQUEST_SIZE_MATCH(xRecordQueryVersionReq); REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
rep.type = X_Reply; rep.type = X_Reply;
...@@ -2008,9 +2005,9 @@ ProcRecordQueryVersion(client) ...@@ -2008,9 +2005,9 @@ ProcRecordQueryVersion(client)
rep.minorVersion = SERVER_RECORD_MINOR_VERSION; rep.minorVersion = SERVER_RECORD_MINOR_VERSION;
if(client->swapped) if(client->swapped)
{ {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swaps(&rep.majorVersion, n); swaps(&rep.majorVersion);
swaps(&rep.minorVersion, n); swaps(&rep.minorVersion);
} }
(void)WriteToClient(client, sizeof(xRecordQueryVersionReply), (void)WriteToClient(client, sizeof(xRecordQueryVersionReply),
(char *)&rep); (char *)&rep);
...@@ -2320,13 +2317,12 @@ RecordSwapRanges(pRanges, nRanges) ...@@ -2320,13 +2317,12 @@ RecordSwapRanges(pRanges, nRanges)
int nRanges; int nRanges;
{ {
int i; int i;
register char n;
for (i = 0; i < nRanges; i++, pRanges++) for (i = 0; i < nRanges; i++, pRanges++)
{ {
swaps(&pRanges->extRequestsMinorFirst, n); swaps(&pRanges->extRequestsMinorFirst);
swaps(&pRanges->extRequestsMinorLast, n); swaps(&pRanges->extRequestsMinorLast);
swaps(&pRanges->extRepliesMinorFirst, n); swaps(&pRanges->extRepliesMinorFirst);
swaps(&pRanges->extRepliesMinorLast, n); swaps(&pRanges->extRepliesMinorLast);
} }
} /* RecordSwapRanges */ } /* RecordSwapRanges */
...@@ -2338,7 +2334,6 @@ ProcRecordGetContext(client) ...@@ -2338,7 +2334,6 @@ ProcRecordGetContext(client)
RecordContextPtr pContext; RecordContextPtr pContext;
REQUEST(xRecordGetContextReq); REQUEST(xRecordGetContextReq);
xRecordGetContextReply rep; xRecordGetContextReply rep;
int n;
RecordClientsAndProtocolPtr pRCAP; RecordClientsAndProtocolPtr pRCAP;
int nRCAPs = 0; int nRCAPs = 0;
GetContextRangeInfoPtr pRangeInfo; GetContextRangeInfoPtr pRangeInfo;
...@@ -2437,9 +2432,9 @@ ProcRecordGetContext(client) ...@@ -2437,9 +2432,9 @@ ProcRecordGetContext(client)
rep.elementHeader = pContext->elemHeaders; rep.elementHeader = pContext->elemHeaders;
if(client->swapped) if(client->swapped)
{ {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.nClients, n); swapl(&rep.nClients);
} }
(void)WriteToClient(client, sizeof(xRecordGetContextReply), (void)WriteToClient(client, sizeof(xRecordGetContextReply),
(char *)&rep); (char *)&rep);
...@@ -2454,13 +2449,13 @@ ProcRecordGetContext(client) ...@@ -2454,13 +2449,13 @@ ProcRecordGetContext(client)
rci.nRanges = pri->nRanges; rci.nRanges = pri->nRanges;
if (client->swapped) if (client->swapped)
{ {
swapl(&rci.nRanges, n); swapl(&rci.nRanges);
RecordSwapRanges(pri->pRanges, pri->nRanges); RecordSwapRanges(pri->pRanges, pri->nRanges);
} }
for (i = 0; i < pRCAP->numClients; i++) for (i = 0; i < pRCAP->numClients; i++)
{ {
rci.clientResource = pRCAP->pClientIDs[i]; rci.clientResource = pRCAP->pClientIDs[i];
if (client->swapped) swapl(&rci.clientResource, n); if (client->swapped) swapl(&rci.clientResource);
WriteToClient(client, sizeof(xRecordClientInfo), (char *)&rci); WriteToClient(client, sizeof(xRecordClientInfo), (char *)&rci);
WriteToClient(client, sizeof(xRecordRange) * pri->nRanges, WriteToClient(client, sizeof(xRecordRange) * pri->nRanges,
(char *)pri->pRanges); (char *)pri->pRanges);
...@@ -2712,12 +2707,11 @@ SProcRecordQueryVersion(client) ...@@ -2712,12 +2707,11 @@ SProcRecordQueryVersion(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xRecordQueryVersionReq); REQUEST(xRecordQueryVersionReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordQueryVersionReq); REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
swaps(&stuff->majorVersion, n); swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion,n); swaps(&stuff->minorVersion);
return ProcRecordQueryVersion(client); return ProcRecordQueryVersion(client);
} /* SProcRecordQueryVersion */ } /* SProcRecordQueryVersion */
...@@ -2725,19 +2719,18 @@ SProcRecordQueryVersion(client) ...@@ -2725,19 +2719,18 @@ SProcRecordQueryVersion(client)
static int static int
SwapCreateRegister(xRecordRegisterClientsReq *stuff) SwapCreateRegister(xRecordRegisterClientsReq *stuff)
{ {
register char n;
int i; int i;
XID *pClientID; XID *pClientID;
swapl(&stuff->context, n); swapl(&stuff->context);
swapl(&stuff->nClients, n); swapl(&stuff->nClients);
swapl(&stuff->nRanges, n); swapl(&stuff->nRanges);
pClientID = (XID *)&stuff[1]; pClientID = (XID *)&stuff[1];
if (stuff->nClients > stuff->length - (sz_xRecordRegisterClientsReq >> 2)) if (stuff->nClients > stuff->length - (sz_xRecordRegisterClientsReq >> 2))
return BadLength; return BadLength;
for (i = 0; i < stuff->nClients; i++, pClientID++) for (i = 0; i < stuff->nClients; i++, pClientID++)
{ {
swapl(pClientID, n); swapl(pClientID);
} }
if (stuff->nRanges > stuff->length - (sz_xRecordRegisterClientsReq >> 2) if (stuff->nRanges > stuff->length - (sz_xRecordRegisterClientsReq >> 2)
- stuff->nClients) - stuff->nClients)
...@@ -2753,9 +2746,8 @@ SProcRecordCreateContext(client) ...@@ -2753,9 +2746,8 @@ SProcRecordCreateContext(client)
{ {
REQUEST(xRecordCreateContextReq); REQUEST(xRecordCreateContextReq);
int status; int status;
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq); REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq);
if ((status = SwapCreateRegister((void *)stuff)) != Success) if ((status = SwapCreateRegister((void *)stuff)) != Success)
return status; return status;
...@@ -2769,9 +2761,8 @@ SProcRecordRegisterClients(client) ...@@ -2769,9 +2761,8 @@ SProcRecordRegisterClients(client)
{ {
REQUEST(xRecordRegisterClientsReq); REQUEST(xRecordRegisterClientsReq);
int status; int status;
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq); REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq);
if ((status = SwapCreateRegister((void *)stuff)) != Success) if ((status = SwapCreateRegister((void *)stuff)) != Success)
return status; return status;
...@@ -2784,12 +2775,11 @@ SProcRecordUnregisterClients(client) ...@@ -2784,12 +2775,11 @@ SProcRecordUnregisterClients(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xRecordUnregisterClientsReq); REQUEST(xRecordUnregisterClientsReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq); REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq);
swapl(&stuff->context, n); swapl(&stuff->context);
swapl(&stuff->nClients, n); swapl(&stuff->nClients);
SwapRestL(stuff); SwapRestL(stuff);
return ProcRecordUnregisterClients(client); return ProcRecordUnregisterClients(client);
} /* SProcRecordUnregisterClients */ } /* SProcRecordUnregisterClients */
...@@ -2800,11 +2790,10 @@ SProcRecordGetContext(client) ...@@ -2800,11 +2790,10 @@ SProcRecordGetContext(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xRecordGetContextReq); REQUEST(xRecordGetContextReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordGetContextReq); REQUEST_SIZE_MATCH(xRecordGetContextReq);
swapl(&stuff->context, n); swapl(&stuff->context);
return ProcRecordGetContext(client); return ProcRecordGetContext(client);
} /* SProcRecordGetContext */ } /* SProcRecordGetContext */
...@@ -2813,11 +2802,10 @@ SProcRecordEnableContext(client) ...@@ -2813,11 +2802,10 @@ SProcRecordEnableContext(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xRecordEnableContextReq); REQUEST(xRecordEnableContextReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordEnableContextReq); REQUEST_SIZE_MATCH(xRecordEnableContextReq);
swapl(&stuff->context, n); swapl(&stuff->context);
return ProcRecordEnableContext(client); return ProcRecordEnableContext(client);
} /* SProcRecordEnableContext */ } /* SProcRecordEnableContext */
...@@ -2827,11 +2815,10 @@ SProcRecordDisableContext(client) ...@@ -2827,11 +2815,10 @@ SProcRecordDisableContext(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xRecordDisableContextReq); REQUEST(xRecordDisableContextReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordDisableContextReq); REQUEST_SIZE_MATCH(xRecordDisableContextReq);
swapl(&stuff->context, n); swapl(&stuff->context);
return ProcRecordDisableContext(client); return ProcRecordDisableContext(client);
} /* SProcRecordDisableContext */ } /* SProcRecordDisableContext */
...@@ -2841,11 +2828,10 @@ SProcRecordFreeContext(client) ...@@ -2841,11 +2828,10 @@ SProcRecordFreeContext(client)
ClientPtr client; ClientPtr client;
{ {
REQUEST(xRecordFreeContextReq); REQUEST(xRecordFreeContextReq);
register char n;
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordFreeContextReq); REQUEST_SIZE_MATCH(xRecordFreeContextReq);
swapl(&stuff->context, n); swapl(&stuff->context);
return ProcRecordFreeContext(client); return ProcRecordFreeContext(client);
} /* SProcRecordFreeContext */ } /* SProcRecordFreeContext */
......
...@@ -283,7 +283,7 @@ ProcRenderQueryVersion (ClientPtr client) ...@@ -283,7 +283,7 @@ ProcRenderQueryVersion (ClientPtr client)
{ {
RenderClientPtr pRenderClient = GetRenderClient (client); RenderClientPtr pRenderClient = GetRenderClient (client);
xRenderQueryVersionReply rep; xRenderQueryVersionReply rep;
register int n;
REQUEST(xRenderQueryVersionReq); REQUEST(xRenderQueryVersionReq);
REQUEST_SIZE_MATCH(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
...@@ -298,10 +298,10 @@ ProcRenderQueryVersion (ClientPtr client) ...@@ -298,10 +298,10 @@ ProcRenderQueryVersion (ClientPtr client)
rep.majorVersion = SERVER_RENDER_MAJOR_VERSION; rep.majorVersion = SERVER_RENDER_MAJOR_VERSION;
rep.minorVersion = SERVER_RENDER_MINOR_VERSION; rep.minorVersion = SERVER_RENDER_MINOR_VERSION;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.majorVersion, n); swapl(&rep.majorVersion);
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep);
return (client->noClientException); return (client->noClientException);
...@@ -456,16 +456,16 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -456,16 +456,16 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictForm->colormap = None; pictForm->colormap = None;
if (client->swapped) if (client->swapped)
{ {
swapl (&pictForm->id, n); swapl (&pictForm->id);
swaps (&pictForm->direct.red, n); swaps (&pictForm->direct.red);
swaps (&pictForm->direct.redMask, n); swaps (&pictForm->direct.redMask);
swaps (&pictForm->direct.green, n); swaps (&pictForm->direct.green);
swaps (&pictForm->direct.greenMask, n); swaps (&pictForm->direct.greenMask);
swaps (&pictForm->direct.blue, n); swaps (&pictForm->direct.blue);
swaps (&pictForm->direct.blueMask, n); swaps (&pictForm->direct.blueMask);
swaps (&pictForm->direct.alpha, n); swaps (&pictForm->direct.alpha);
swaps (&pictForm->direct.alphaMask, n); swaps (&pictForm->direct.alphaMask);
swapl (&pictForm->colormap, n); swapl (&pictForm->colormap);
} }
pictForm++; pictForm++;
} }
...@@ -495,8 +495,8 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -495,8 +495,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictVisual->format = pFormat->id; pictVisual->format = pFormat->id;
if (client->swapped) if (client->swapped)
{ {
swapl (&pictVisual->visual, n); swapl (&pictVisual->visual);
swapl (&pictVisual->format, n); swapl (&pictVisual->format);
} }
pictVisual++; pictVisual++;
nvisual++; nvisual++;
...@@ -506,7 +506,7 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -506,7 +506,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictDepth->nPictVisuals = nvisual; pictDepth->nPictVisuals = nvisual;
if (client->swapped) if (client->swapped)
{ {
swaps (&pictDepth->nPictVisuals, n); swaps (&pictDepth->nPictVisuals);
} }
ndepth++; ndepth++;
pictDepth = (xPictDepth *) pictVisual; pictDepth = (xPictDepth *) pictVisual;
...@@ -519,8 +519,8 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -519,8 +519,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictScreen->fallback = 0; pictScreen->fallback = 0;
if (client->swapped) if (client->swapped)
{ {
swapl (&pictScreen->nDepth, n); swapl (&pictScreen->nDepth);
swapl (&pictScreen->fallback, n); swapl (&pictScreen->fallback);
} }
pictScreen = (xPictScreen *) pictDepth; pictScreen = (xPictScreen *) pictDepth;
} }
...@@ -536,20 +536,20 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -536,20 +536,20 @@ ProcRenderQueryPictFormats (ClientPtr client)
*pictSubpixel = SubPixelUnknown; *pictSubpixel = SubPixelUnknown;
if (client->swapped) if (client->swapped)
{ {
swapl (pictSubpixel, n); swapl (pictSubpixel);
} }
++pictSubpixel; ++pictSubpixel;
} }
if (client->swapped) if (client->swapped)
{ {
swaps (&reply->sequenceNumber, n); swaps (&reply->sequenceNumber);
swapl (&reply->length, n); swapl (&reply->length);
swapl (&reply->numFormats, n); swapl (&reply->numFormats);
swapl (&reply->numScreens, n); swapl (&reply->numScreens);
swapl (&reply->numDepths, n); swapl (&reply->numDepths);
swapl (&reply->numVisuals, n); swapl (&reply->numVisuals);
swapl (&reply->numSubpixel, n); swapl (&reply->numSubpixel);
} }
WriteToClient(client, rlength, (char *) reply); WriteToClient(client, rlength, (char *) reply);
free (reply); free (reply);
...@@ -563,7 +563,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) ...@@ -563,7 +563,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
PictFormatPtr pFormat; PictFormatPtr pFormat;
int num; int num;
int rlength; int rlength;
int i, n; int i;
REQUEST(xRenderQueryPictIndexValuesReq); REQUEST(xRenderQueryPictIndexValuesReq);
xRenderQueryPictIndexValuesReply *reply; xRenderQueryPictIndexValuesReply *reply;
xIndexValue *values; xIndexValue *values;
...@@ -605,15 +605,15 @@ ProcRenderQueryPictIndexValues (ClientPtr client) ...@@ -605,15 +605,15 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
{ {
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
swapl (&values[i].pixel, n); swapl (&values[i].pixel);
swaps (&values[i].red, n); swaps (&values[i].red);
swaps (&values[i].green, n); swaps (&values[i].green);
swaps (&values[i].blue, n); swaps (&values[i].blue);
swaps (&values[i].alpha, n); swaps (&values[i].alpha);
} }
swaps (&reply->sequenceNumber, n); swaps (&reply->sequenceNumber);
swapl (&reply->length, n); swapl (&reply->length);
swapl (&reply->numIndexValues, n); swapl (&reply->numIndexValues);
} }
WriteToClient(client, rlength, (char *) reply); WriteToClient(client, rlength, (char *) reply);
...@@ -1807,16 +1807,14 @@ ProcRenderQueryFilters (ClientPtr client) ...@@ -1807,16 +1807,14 @@ ProcRenderQueryFilters (ClientPtr client)
if (client->swapped) if (client->swapped)
{ {
register int n;
for (i = 0; i < reply->numAliases; i++) for (i = 0; i < reply->numAliases; i++)
{ {
swaps (&aliases[i], n); swaps (&aliases[i]);
} }
swaps(&reply->sequenceNumber, n); swaps(&reply->sequenceNumber);
swapl(&reply->length, n); swapl(&reply->length);
swapl(&reply->numAliases, n); swapl(&reply->numAliases);
swapl(&reply->numFilters, n); swapl(&reply->numFilters);
} }
WriteToClient(client, total_bytes, (char *) reply); WriteToClient(client, total_bytes, (char *) reply);
free (reply); free (reply);
...@@ -2039,34 +2037,31 @@ ProcRenderDispatch (ClientPtr client) ...@@ -2039,34 +2037,31 @@ ProcRenderDispatch (ClientPtr client)
static int static int
SProcRenderQueryVersion (ClientPtr client) SProcRenderQueryVersion (ClientPtr client)
{ {
register int n;
REQUEST(xRenderQueryVersionReq); REQUEST(xRenderQueryVersionReq);
REQUEST_SIZE_MATCH(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->majorVersion, n); swapl(&stuff->majorVersion);
swapl(&stuff->minorVersion, n); swapl(&stuff->minorVersion);
return (*ProcRenderVector[stuff->renderReqType])(client); return (*ProcRenderVector[stuff->renderReqType])(client);
} }
static int static int
SProcRenderQueryPictFormats (ClientPtr client) SProcRenderQueryPictFormats (ClientPtr client)
{ {
register int n;
REQUEST(xRenderQueryPictFormatsReq); REQUEST(xRenderQueryPictFormatsReq);
REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderQueryPictIndexValues (ClientPtr client) SProcRenderQueryPictIndexValues (ClientPtr client)
{ {
register int n;
REQUEST(xRenderQueryPictIndexValuesReq); REQUEST(xRenderQueryPictIndexValuesReq);
REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->format, n); swapl(&stuff->format);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2079,14 +2074,13 @@ SProcRenderQueryDithers (ClientPtr client) ...@@ -2079,14 +2074,13 @@ SProcRenderQueryDithers (ClientPtr client)
static int static int
SProcRenderCreatePicture (ClientPtr client) SProcRenderCreatePicture (ClientPtr client)
{ {
register int n;
REQUEST(xRenderCreatePictureReq); REQUEST(xRenderCreatePictureReq);
REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->pid, n); swapl(&stuff->pid);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
swapl(&stuff->format, n); swapl(&stuff->format);
swapl(&stuff->mask, n); swapl(&stuff->mask);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2094,12 +2088,11 @@ SProcRenderCreatePicture (ClientPtr client) ...@@ -2094,12 +2088,11 @@ SProcRenderCreatePicture (ClientPtr client)
static int static int
SProcRenderChangePicture (ClientPtr client) SProcRenderChangePicture (ClientPtr client)
{ {
register int n;
REQUEST(xRenderChangePictureReq); REQUEST(xRenderChangePictureReq);
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->picture, n); swapl(&stuff->picture);
swapl(&stuff->mask, n); swapl(&stuff->mask);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2107,11 +2100,10 @@ SProcRenderChangePicture (ClientPtr client) ...@@ -2107,11 +2100,10 @@ SProcRenderChangePicture (ClientPtr client)
static int static int
SProcRenderSetPictureClipRectangles (ClientPtr client) SProcRenderSetPictureClipRectangles (ClientPtr client)
{ {
register int n;
REQUEST(xRenderSetPictureClipRectanglesReq); REQUEST(xRenderSetPictureClipRectanglesReq);
REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->picture, n); swapl(&stuff->picture);
SwapRestS(stuff); SwapRestS(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2119,68 +2111,64 @@ SProcRenderSetPictureClipRectangles (ClientPtr client) ...@@ -2119,68 +2111,64 @@ SProcRenderSetPictureClipRectangles (ClientPtr client)
static int static int
SProcRenderFreePicture (ClientPtr client) SProcRenderFreePicture (ClientPtr client)
{ {
register int n;
REQUEST(xRenderFreePictureReq); REQUEST(xRenderFreePictureReq);
REQUEST_SIZE_MATCH(xRenderFreePictureReq); REQUEST_SIZE_MATCH(xRenderFreePictureReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->picture, n); swapl(&stuff->picture);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderComposite (ClientPtr client) SProcRenderComposite (ClientPtr client)
{ {
register int n;
REQUEST(xRenderCompositeReq); REQUEST(xRenderCompositeReq);
REQUEST_SIZE_MATCH(xRenderCompositeReq); REQUEST_SIZE_MATCH(xRenderCompositeReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->src, n); swapl(&stuff->src);
swapl(&stuff->mask, n); swapl(&stuff->mask);
swapl(&stuff->dst, n); swapl(&stuff->dst);
swaps(&stuff->xSrc, n); swaps(&stuff->xSrc);
swaps(&stuff->ySrc, n); swaps(&stuff->ySrc);
swaps(&stuff->xMask, n); swaps(&stuff->xMask);
swaps(&stuff->yMask, n); swaps(&stuff->yMask);
swaps(&stuff->xDst, n); swaps(&stuff->xDst);
swaps(&stuff->yDst, n); swaps(&stuff->yDst);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderScale (ClientPtr client) SProcRenderScale (ClientPtr client)
{ {
register int n;
REQUEST(xRenderScaleReq); REQUEST(xRenderScaleReq);
REQUEST_SIZE_MATCH(xRenderScaleReq); REQUEST_SIZE_MATCH(xRenderScaleReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->src, n); swapl(&stuff->src);
swapl(&stuff->dst, n); swapl(&stuff->dst);
swapl(&stuff->colorScale, n); swapl(&stuff->colorScale);
swapl(&stuff->alphaScale, n); swapl(&stuff->alphaScale);
swaps(&stuff->xSrc, n); swaps(&stuff->xSrc);
swaps(&stuff->ySrc, n); swaps(&stuff->ySrc);
swaps(&stuff->xDst, n); swaps(&stuff->xDst);
swaps(&stuff->yDst, n); swaps(&stuff->yDst);
swaps(&stuff->width, n); swaps(&stuff->width);
swaps(&stuff->height, n); swaps(&stuff->height);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderTrapezoids (ClientPtr client) SProcRenderTrapezoids (ClientPtr client)
{ {
register int n;
REQUEST(xRenderTrapezoidsReq); REQUEST(xRenderTrapezoidsReq);
REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq);
swaps (&stuff->length, n); swaps (&stuff->length);
swapl (&stuff->src, n); swapl (&stuff->src);
swapl (&stuff->dst, n); swapl (&stuff->dst);
swapl (&stuff->maskFormat, n); swapl (&stuff->maskFormat);
swaps (&stuff->xSrc, n); swaps (&stuff->xSrc);
swaps (&stuff->ySrc, n); swaps (&stuff->ySrc);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2188,16 +2176,15 @@ SProcRenderTrapezoids (ClientPtr client) ...@@ -2188,16 +2176,15 @@ SProcRenderTrapezoids (ClientPtr client)
static int static int
SProcRenderTriangles (ClientPtr client) SProcRenderTriangles (ClientPtr client)
{ {
register int n;
REQUEST(xRenderTrianglesReq); REQUEST(xRenderTrianglesReq);
REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
swaps (&stuff->length, n); swaps (&stuff->length);
swapl (&stuff->src, n); swapl (&stuff->src);
swapl (&stuff->dst, n); swapl (&stuff->dst);
swapl (&stuff->maskFormat, n); swapl (&stuff->maskFormat);
swaps (&stuff->xSrc, n); swaps (&stuff->xSrc);
swaps (&stuff->ySrc, n); swaps (&stuff->ySrc);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2205,16 +2192,15 @@ SProcRenderTriangles (ClientPtr client) ...@@ -2205,16 +2192,15 @@ SProcRenderTriangles (ClientPtr client)
static int static int
SProcRenderTriStrip (ClientPtr client) SProcRenderTriStrip (ClientPtr client)
{ {
register int n;
REQUEST(xRenderTriStripReq); REQUEST(xRenderTriStripReq);
REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); REQUEST_AT_LEAST_SIZE(xRenderTriStripReq);
swaps (&stuff->length, n); swaps (&stuff->length);
swapl (&stuff->src, n); swapl (&stuff->src);
swapl (&stuff->dst, n); swapl (&stuff->dst);
swapl (&stuff->maskFormat, n); swapl (&stuff->maskFormat);
swaps (&stuff->xSrc, n); swaps (&stuff->xSrc);
swaps (&stuff->ySrc, n); swaps (&stuff->ySrc);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2222,16 +2208,15 @@ SProcRenderTriStrip (ClientPtr client) ...@@ -2222,16 +2208,15 @@ SProcRenderTriStrip (ClientPtr client)
static int static int
SProcRenderTriFan (ClientPtr client) SProcRenderTriFan (ClientPtr client)
{ {
register int n;
REQUEST(xRenderTriFanReq); REQUEST(xRenderTriFanReq);
REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); REQUEST_AT_LEAST_SIZE(xRenderTriFanReq);
swaps (&stuff->length, n); swaps (&stuff->length);
swapl (&stuff->src, n); swapl (&stuff->src);
swapl (&stuff->dst, n); swapl (&stuff->dst);
swapl (&stuff->maskFormat, n); swapl (&stuff->maskFormat);
swaps (&stuff->xSrc, n); swaps (&stuff->xSrc);
swaps (&stuff->ySrc, n); swaps (&stuff->ySrc);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2257,51 +2242,47 @@ SProcRenderTransform (ClientPtr client) ...@@ -2257,51 +2242,47 @@ SProcRenderTransform (ClientPtr client)
static int static int
SProcRenderCreateGlyphSet (ClientPtr client) SProcRenderCreateGlyphSet (ClientPtr client)
{ {
register int n;
REQUEST(xRenderCreateGlyphSetReq); REQUEST(xRenderCreateGlyphSetReq);
REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->gsid, n); swapl(&stuff->gsid);
swapl(&stuff->format, n); swapl(&stuff->format);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderReferenceGlyphSet (ClientPtr client) SProcRenderReferenceGlyphSet (ClientPtr client)
{ {
register int n;
REQUEST(xRenderReferenceGlyphSetReq); REQUEST(xRenderReferenceGlyphSetReq);
REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->gsid, n); swapl(&stuff->gsid);
swapl(&stuff->existing, n); swapl(&stuff->existing);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderFreeGlyphSet (ClientPtr client) SProcRenderFreeGlyphSet (ClientPtr client)
{ {
register int n;
REQUEST(xRenderFreeGlyphSetReq); REQUEST(xRenderFreeGlyphSetReq);
REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->glyphset, n); swapl(&stuff->glyphset);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderAddGlyphs (ClientPtr client) SProcRenderAddGlyphs (ClientPtr client)
{ {
register int n;
register int i; register int i;
CARD32 *gids; CARD32 *gids;
void *end; void *end;
xGlyphInfo *gi; xGlyphInfo *gi;
REQUEST(xRenderAddGlyphsReq); REQUEST(xRenderAddGlyphsReq);
REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->glyphset, n); swapl(&stuff->glyphset);
swapl(&stuff->nglyphs, n); swapl(&stuff->nglyphs);
if (stuff->nglyphs & 0xe0000000) if (stuff->nglyphs & 0xe0000000)
return BadLength; return BadLength;
end = (CARD8 *) stuff + (client->req_len << 2); end = (CARD8 *) stuff + (client->req_len << 2);
...@@ -2313,13 +2294,13 @@ SProcRenderAddGlyphs (ClientPtr client) ...@@ -2313,13 +2294,13 @@ SProcRenderAddGlyphs (ClientPtr client)
return BadLength; return BadLength;
for (i = 0; i < stuff->nglyphs; i++) for (i = 0; i < stuff->nglyphs; i++)
{ {
swapl (&gids[i], n); swapl (&gids[i]);
swaps (&gi[i].width, n); swaps (&gi[i].width);
swaps (&gi[i].height, n); swaps (&gi[i].height);
swaps (&gi[i].x, n); swaps (&gi[i].x);
swaps (&gi[i].y, n); swaps (&gi[i].y);
swaps (&gi[i].xOff, n); swaps (&gi[i].xOff);
swaps (&gi[i].yOff, n); swaps (&gi[i].yOff);
} }
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2333,11 +2314,10 @@ SProcRenderAddGlyphsFromPicture (ClientPtr client) ...@@ -2333,11 +2314,10 @@ SProcRenderAddGlyphsFromPicture (ClientPtr client)
static int static int
SProcRenderFreeGlyphs (ClientPtr client) SProcRenderFreeGlyphs (ClientPtr client)
{ {
register int n;
REQUEST(xRenderFreeGlyphsReq); REQUEST(xRenderFreeGlyphsReq);
REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->glyphset, n); swapl(&stuff->glyphset);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2345,7 +2325,6 @@ SProcRenderFreeGlyphs (ClientPtr client) ...@@ -2345,7 +2325,6 @@ SProcRenderFreeGlyphs (ClientPtr client)
static int static int
SProcRenderCompositeGlyphs (ClientPtr client) SProcRenderCompositeGlyphs (ClientPtr client)
{ {
register int n;
xGlyphElt *elt; xGlyphElt *elt;
CARD8 *buffer; CARD8 *buffer;
CARD8 *end; CARD8 *end;
...@@ -2362,13 +2341,13 @@ SProcRenderCompositeGlyphs (ClientPtr client) ...@@ -2362,13 +2341,13 @@ SProcRenderCompositeGlyphs (ClientPtr client)
case X_RenderCompositeGlyphs32: size = 4; break; case X_RenderCompositeGlyphs32: size = 4; break;
} }
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->src, n); swapl(&stuff->src);
swapl(&stuff->dst, n); swapl(&stuff->dst);
swapl(&stuff->maskFormat, n); swapl(&stuff->maskFormat);
swapl(&stuff->glyphset, n); swapl(&stuff->glyphset);
swaps(&stuff->xSrc, n); swaps(&stuff->xSrc);
swaps(&stuff->ySrc, n); swaps(&stuff->ySrc);
buffer = (CARD8 *) (stuff + 1); buffer = (CARD8 *) (stuff + 1);
end = (CARD8 *) stuff + (client->req_len << 2); end = (CARD8 *) stuff + (client->req_len << 2);
while (buffer + sizeof (xGlyphElt) < end) while (buffer + sizeof (xGlyphElt) < end)
...@@ -2376,13 +2355,13 @@ SProcRenderCompositeGlyphs (ClientPtr client) ...@@ -2376,13 +2355,13 @@ SProcRenderCompositeGlyphs (ClientPtr client)
elt = (xGlyphElt *) buffer; elt = (xGlyphElt *) buffer;
buffer += sizeof (xGlyphElt); buffer += sizeof (xGlyphElt);
swaps (&elt->deltax, n); swaps (&elt->deltax);
swaps (&elt->deltay, n); swaps (&elt->deltay);
i = elt->len; i = elt->len;
if (i == 0xff) if (i == 0xff)
{ {
swapl (buffer, n); swapl ((int *) buffer);
buffer += 4; buffer += 4;
} }
else else
...@@ -2395,14 +2374,14 @@ SProcRenderCompositeGlyphs (ClientPtr client) ...@@ -2395,14 +2374,14 @@ SProcRenderCompositeGlyphs (ClientPtr client)
case 2: case 2:
while (i--) while (i--)
{ {
swaps (buffer, n); swaps ((short *) buffer);
buffer += 2; buffer += 2;
} }
break; break;
case 4: case 4:
while (i--) while (i--)
{ {
swapl (buffer, n); swapl ((int *) buffer);
buffer += 4; buffer += 4;
} }
break; break;
...@@ -2417,16 +2396,15 @@ SProcRenderCompositeGlyphs (ClientPtr client) ...@@ -2417,16 +2396,15 @@ SProcRenderCompositeGlyphs (ClientPtr client)
static int static int
SProcRenderFillRectangles (ClientPtr client) SProcRenderFillRectangles (ClientPtr client)
{ {
register int n;
REQUEST(xRenderFillRectanglesReq); REQUEST(xRenderFillRectanglesReq);
REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->dst, n); swapl(&stuff->dst);
swaps(&stuff->color.red, n); swaps(&stuff->color.red);
swaps(&stuff->color.green, n); swaps(&stuff->color.green);
swaps(&stuff->color.blue, n); swaps(&stuff->color.blue);
swaps(&stuff->color.alpha, n); swaps(&stuff->color.alpha);
SwapRestS(stuff); SwapRestS(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2434,73 +2412,68 @@ SProcRenderFillRectangles (ClientPtr client) ...@@ -2434,73 +2412,68 @@ SProcRenderFillRectangles (ClientPtr client)
static int static int
SProcRenderCreateCursor (ClientPtr client) SProcRenderCreateCursor (ClientPtr client)
{ {
register int n;
REQUEST(xRenderCreateCursorReq); REQUEST(xRenderCreateCursorReq);
REQUEST_SIZE_MATCH (xRenderCreateCursorReq); REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->cid, n); swapl(&stuff->cid);
swapl(&stuff->src, n); swapl(&stuff->src);
swaps(&stuff->x, n); swaps(&stuff->x);
swaps(&stuff->y, n); swaps(&stuff->y);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderSetPictureTransform (ClientPtr client) SProcRenderSetPictureTransform (ClientPtr client)
{ {
register int n;
REQUEST(xRenderSetPictureTransformReq); REQUEST(xRenderSetPictureTransformReq);
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->picture, n); swapl(&stuff->picture);
swapl(&stuff->transform.matrix11, n); swapl(&stuff->transform.matrix11);
swapl(&stuff->transform.matrix12, n); swapl(&stuff->transform.matrix12);
swapl(&stuff->transform.matrix13, n); swapl(&stuff->transform.matrix13);
swapl(&stuff->transform.matrix21, n); swapl(&stuff->transform.matrix21);
swapl(&stuff->transform.matrix22, n); swapl(&stuff->transform.matrix22);
swapl(&stuff->transform.matrix23, n); swapl(&stuff->transform.matrix23);
swapl(&stuff->transform.matrix31, n); swapl(&stuff->transform.matrix31);
swapl(&stuff->transform.matrix32, n); swapl(&stuff->transform.matrix32);
swapl(&stuff->transform.matrix33, n); swapl(&stuff->transform.matrix33);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderQueryFilters (ClientPtr client) SProcRenderQueryFilters (ClientPtr client)
{ {
register int n;
REQUEST (xRenderQueryFiltersReq); REQUEST (xRenderQueryFiltersReq);
REQUEST_SIZE_MATCH (xRenderQueryFiltersReq); REQUEST_SIZE_MATCH (xRenderQueryFiltersReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->drawable, n); swapl(&stuff->drawable);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderSetPictureFilter (ClientPtr client) SProcRenderSetPictureFilter (ClientPtr client)
{ {
register int n;
REQUEST (xRenderSetPictureFilterReq); REQUEST (xRenderSetPictureFilterReq);
REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->picture, n); swapl(&stuff->picture);
swaps(&stuff->nbytes, n); swaps(&stuff->nbytes);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static int static int
SProcRenderCreateAnimCursor (ClientPtr client) SProcRenderCreateAnimCursor (ClientPtr client)
{ {
register int n;
REQUEST (xRenderCreateAnimCursorReq); REQUEST (xRenderCreateAnimCursorReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq); REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->cid, n); swapl(&stuff->cid);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2508,14 +2481,13 @@ SProcRenderCreateAnimCursor (ClientPtr client) ...@@ -2508,14 +2481,13 @@ SProcRenderCreateAnimCursor (ClientPtr client)
static int static int
SProcRenderAddTraps (ClientPtr client) SProcRenderAddTraps (ClientPtr client)
{ {
register int n;
REQUEST (xRenderAddTrapsReq); REQUEST (xRenderAddTrapsReq);
REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->picture, n); swapl(&stuff->picture);
swaps(&stuff->xOff, n); swaps(&stuff->xOff);
swaps(&stuff->yOff, n); swaps(&stuff->yOff);
SwapRestL(stuff); SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
...@@ -2523,49 +2495,50 @@ SProcRenderAddTraps (ClientPtr client) ...@@ -2523,49 +2495,50 @@ SProcRenderAddTraps (ClientPtr client)
static int static int
SProcRenderCreateSolidFill(ClientPtr client) SProcRenderCreateSolidFill(ClientPtr client)
{ {
register int n;
REQUEST (xRenderCreateSolidFillReq); REQUEST (xRenderCreateSolidFillReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq); REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->pid, n); swapl(&stuff->pid);
swaps(&stuff->color.alpha, n); swaps(&stuff->color.alpha);
swaps(&stuff->color.red, n); swaps(&stuff->color.red);
swaps(&stuff->color.green, n); swaps(&stuff->color.green);
swaps(&stuff->color.blue, n); swaps(&stuff->color.blue);
return (*ProcRenderVector[stuff->renderReqType]) (client); return (*ProcRenderVector[stuff->renderReqType]) (client);
} }
static void swapStops(void *stuff, int num) static void swapStops(void *stuff, int num)
{ {
int i, n; int i;
CARD32 *stops; CARD32 *stops;
CARD16 *colors;
stops = (CARD32 *)(stuff); stops = (CARD32 *)(stuff);
for (i = 0; i < num; ++i) { for (i = 0; i < num; ++i) {
swapl(stops, n); swapl(stops);
++stops; ++stops;
} }
colors = (CARD16 *) (stops);
for (i = 0; i < 4*num; ++i) { for (i = 0; i < 4*num; ++i) {
swaps(stops, n); swaps(colors);
++stops; ++colors;
} }
} }
static int static int
SProcRenderCreateLinearGradient (ClientPtr client) SProcRenderCreateLinearGradient (ClientPtr client)
{ {
register int n;
int len; int len;
REQUEST (xRenderCreateLinearGradientReq); REQUEST (xRenderCreateLinearGradientReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->pid, n); swapl(&stuff->pid);
swapl(&stuff->p1.x, n); swapl(&stuff->p1.x);
swapl(&stuff->p1.y, n); swapl(&stuff->p1.y);
swapl(&stuff->p2.x, n); swapl(&stuff->p2.x);
swapl(&stuff->p2.y, n); swapl(&stuff->p2.y);
swapl(&stuff->nStops, n); swapl(&stuff->nStops);
len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq);
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
...@@ -2581,20 +2554,19 @@ SProcRenderCreateLinearGradient (ClientPtr client) ...@@ -2581,20 +2554,19 @@ SProcRenderCreateLinearGradient (ClientPtr client)
static int static int
SProcRenderCreateRadialGradient (ClientPtr client) SProcRenderCreateRadialGradient (ClientPtr client)
{ {
register int n;
int len; int len;
REQUEST (xRenderCreateRadialGradientReq); REQUEST (xRenderCreateRadialGradientReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->pid, n); swapl(&stuff->pid);
swapl(&stuff->inner.x, n); swapl(&stuff->inner.x);
swapl(&stuff->inner.y, n); swapl(&stuff->inner.y);
swapl(&stuff->outer.x, n); swapl(&stuff->outer.x);
swapl(&stuff->outer.y, n); swapl(&stuff->outer.y);
swapl(&stuff->inner_radius, n); swapl(&stuff->inner_radius);
swapl(&stuff->outer_radius, n); swapl(&stuff->outer_radius);
swapl(&stuff->nStops, n); swapl(&stuff->nStops);
len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq);
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
...@@ -2610,17 +2582,16 @@ SProcRenderCreateRadialGradient (ClientPtr client) ...@@ -2610,17 +2582,16 @@ SProcRenderCreateRadialGradient (ClientPtr client)
static int static int
SProcRenderCreateConicalGradient (ClientPtr client) SProcRenderCreateConicalGradient (ClientPtr client)
{ {
register int n;
int len; int len;
REQUEST (xRenderCreateConicalGradientReq); REQUEST (xRenderCreateConicalGradientReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->pid, n); swapl(&stuff->pid);
swapl(&stuff->center.x, n); swapl(&stuff->center.x);
swapl(&stuff->center.y, n); swapl(&stuff->center.y);
swapl(&stuff->angle, n); swapl(&stuff->angle);
swapl(&stuff->nStops, n); swapl(&stuff->nStops);
len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq);
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
......
...@@ -225,12 +225,11 @@ GetBit (unsigned char *line, int x) ...@@ -225,12 +225,11 @@ GetBit (unsigned char *line, int x)
int int
SProcXFixesSelectCursorInput (ClientPtr client) SProcXFixesSelectCursorInput (ClientPtr client)
{ {
register int n;
REQUEST(xXFixesSelectCursorInputReq); REQUEST(xXFixesSelectCursorInputReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->eventMask, n); swapl(&stuff->eventMask);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -329,20 +328,18 @@ ProcXFixesGetCursorImage (ClientPtr client) ...@@ -329,20 +328,18 @@ ProcXFixesGetCursorImage (ClientPtr client)
rep->cursorSerial = pCursor->serialNumber; rep->cursorSerial = pCursor->serialNumber;
image = (CARD32 *) (rep + 1); image = (CARD32 *) (rep + 1);
CopyCursorToImage (pCursor, image); CopyCursorToImage(pCursor, image);
if (client->swapped) if (client->swapped) {
{ swaps(&rep->sequenceNumber);
int n; swapl(&rep->length);
swaps (&rep->sequenceNumber, n); swaps(&rep->x);
swapl (&rep->length, n); swaps(&rep->y);
swaps (&rep->x, n); swaps(&rep->width);
swaps (&rep->y, n); swaps(&rep->height);
swaps (&rep->width, n); swaps(&rep->xhot);
swaps (&rep->height, n); swaps(&rep->yhot);
swaps (&rep->xhot, n); swapl(&rep->cursorSerial);
swaps (&rep->yhot, n); SwapLongs(image, npixels);
swapl (&rep->cursorSerial, n);
SwapLongs (image, npixels);
} }
(void) WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + (void) WriteToClient(client, sizeof (xXFixesGetCursorImageReply) +
(npixels << 2), (char *) rep); (npixels << 2), (char *) rep);
...@@ -353,9 +350,8 @@ ProcXFixesGetCursorImage (ClientPtr client) ...@@ -353,9 +350,8 @@ ProcXFixesGetCursorImage (ClientPtr client)
int int
SProcXFixesGetCursorImage (ClientPtr client) SProcXFixesGetCursorImage (ClientPtr client)
{ {
int n;
REQUEST(xXFixesGetCursorImageReq); REQUEST(xXFixesGetCursorImageReq);
swaps (&stuff->length, n); swaps(&stuff->length);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -381,13 +377,12 @@ ProcXFixesSetCursorName (ClientPtr client) ...@@ -381,13 +377,12 @@ ProcXFixesSetCursorName (ClientPtr client)
int int
SProcXFixesSetCursorName (ClientPtr client) SProcXFixesSetCursorName (ClientPtr client)
{ {
int n;
REQUEST(xXFixesSetCursorNameReq); REQUEST(xXFixesSetCursorNameReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq);
swapl (&stuff->cursor, n); swapl(&stuff->cursor);
swaps (&stuff->nbytes, n); swaps(&stuff->nbytes);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -413,13 +408,11 @@ ProcXFixesGetCursorName (ClientPtr client) ...@@ -413,13 +408,11 @@ ProcXFixesGetCursorName (ClientPtr client)
reply.sequenceNumber = client->sequence; reply.sequenceNumber = client->sequence;
reply.atom = pCursor->name; reply.atom = pCursor->name;
reply.nbytes = len; reply.nbytes = len;
if (client->swapped) if (client->swapped) {
{ swaps(&reply.sequenceNumber);
int n; swapl(&reply.length);
swaps (&reply.sequenceNumber, n); swapl(&reply.atom);
swapl (&reply.length, n); swaps(&reply.nbytes);
swapl (&reply.atom, n);
swaps (&reply.nbytes, n);
} }
WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply); WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply);
(void)WriteToClient(client, len, str); (void)WriteToClient(client, len, str);
...@@ -430,12 +423,11 @@ ProcXFixesGetCursorName (ClientPtr client) ...@@ -430,12 +423,11 @@ ProcXFixesGetCursorName (ClientPtr client)
int int
SProcXFixesGetCursorName (ClientPtr client) SProcXFixesGetCursorName (ClientPtr client)
{ {
int n;
REQUEST(xXFixesSetCursorNameReq); REQUEST(xXFixesSetCursorNameReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
swapl (&stuff->cursor, n); swapl(&stuff->cursor);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -482,23 +474,21 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) ...@@ -482,23 +474,21 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
rep->nbytes = nbytes; rep->nbytes = nbytes;
image = (CARD32 *) (rep + 1); image = (CARD32 *) (rep + 1);
CopyCursorToImage (pCursor, image); CopyCursorToImage(pCursor, image);
memcpy ((image + npixels), name, nbytes); memcpy((image + npixels), name, nbytes);
if (client->swapped) if (client->swapped) {
{ swaps(&rep->sequenceNumber);
int n; swapl(&rep->length);
swaps (&rep->sequenceNumber, n); swaps(&rep->x);
swapl (&rep->length, n); swaps(&rep->y);
swaps (&rep->x, n); swaps(&rep->width);
swaps (&rep->y, n); swaps(&rep->height);
swaps (&rep->width, n); swaps(&rep->xhot);
swaps (&rep->height, n); swaps(&rep->yhot);
swaps (&rep->xhot, n); swapl(&rep->cursorSerial);
swaps (&rep->yhot, n); swapl(&rep->cursorName);
swapl (&rep->cursorSerial, n); swaps(&rep->nbytes);
swapl (&rep->cursorName, n); SwapLongs(image, npixels);
swaps (&rep->nbytes, n);
SwapLongs (image, npixels);
} }
(void) WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + (void) WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) +
(npixels << 2) + nbytesRound, (char *) rep); (npixels << 2) + nbytesRound, (char *) rep);
...@@ -509,9 +499,8 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) ...@@ -509,9 +499,8 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
int int
SProcXFixesGetCursorImageAndName (ClientPtr client) SProcXFixesGetCursorImageAndName (ClientPtr client)
{ {
int n;
REQUEST(xXFixesGetCursorImageAndNameReq); REQUEST(xXFixesGetCursorImageAndNameReq);
swaps (&stuff->length, n); swaps(&stuff->length);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -642,13 +631,12 @@ ProcXFixesChangeCursor (ClientPtr client) ...@@ -642,13 +631,12 @@ ProcXFixesChangeCursor (ClientPtr client)
int int
SProcXFixesChangeCursor (ClientPtr client) SProcXFixesChangeCursor (ClientPtr client)
{ {
int n;
REQUEST(xXFixesChangeCursorReq); REQUEST(xXFixesChangeCursorReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); REQUEST_SIZE_MATCH(xXFixesChangeCursorReq);
swapl (&stuff->source, n); swapl(&stuff->source);
swapl (&stuff->destination, n); swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -678,13 +666,12 @@ ProcXFixesChangeCursorByName (ClientPtr client) ...@@ -678,13 +666,12 @@ ProcXFixesChangeCursorByName (ClientPtr client)
int int
SProcXFixesChangeCursorByName (ClientPtr client) SProcXFixesChangeCursorByName (ClientPtr client)
{ {
int n;
REQUEST(xXFixesChangeCursorByNameReq); REQUEST(xXFixesChangeCursorByNameReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE (xXFixesChangeCursorByNameReq); REQUEST_AT_LEAST_SIZE(xXFixesChangeCursorByNameReq);
swapl (&stuff->source, n); swapl(&stuff->source);
swaps (&stuff->nbytes, n); swaps(&stuff->nbytes);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
......
...@@ -96,12 +96,11 @@ ProcXFixesCreateRegion (ClientPtr client) ...@@ -96,12 +96,11 @@ ProcXFixesCreateRegion (ClientPtr client)
int int
SProcXFixesCreateRegion (ClientPtr client) SProcXFixesCreateRegion (ClientPtr client)
{ {
register int n;
REQUEST(xXFixesCreateRegionReq); REQUEST(xXFixesCreateRegionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq); REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq);
swapl(&stuff->region, n); swapl(&stuff->region);
SwapRestS(stuff); SwapRestS(stuff);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -141,13 +140,12 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) ...@@ -141,13 +140,12 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
int int
SProcXFixesCreateRegionFromBitmap (ClientPtr client) SProcXFixesCreateRegionFromBitmap (ClientPtr client)
{ {
int n; REQUEST(xXFixesCreateRegionFromBitmapReq);
REQUEST (xXFixesCreateRegionFromBitmapReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromBitmapReq); REQUEST_SIZE_MATCH(xXFixesCreateRegionFromBitmapReq);
swapl(&stuff->region, n); swapl(&stuff->region);
swapl(&stuff->bitmap, n); swapl(&stuff->bitmap);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -205,13 +203,12 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client) ...@@ -205,13 +203,12 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client)
int int
SProcXFixesCreateRegionFromWindow (ClientPtr client) SProcXFixesCreateRegionFromWindow (ClientPtr client)
{ {
int n; REQUEST(xXFixesCreateRegionFromWindowReq);
REQUEST (xXFixesCreateRegionFromWindowReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromWindowReq); REQUEST_SIZE_MATCH(xXFixesCreateRegionFromWindowReq);
swapl(&stuff->region, n); swapl(&stuff->region);
swapl(&stuff->window, n); swapl(&stuff->window);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -252,13 +249,12 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) ...@@ -252,13 +249,12 @@ ProcXFixesCreateRegionFromGC (ClientPtr client)
int int
SProcXFixesCreateRegionFromGC (ClientPtr client) SProcXFixesCreateRegionFromGC (ClientPtr client)
{ {
int n; REQUEST(xXFixesCreateRegionFromGCReq);
REQUEST (xXFixesCreateRegionFromGCReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq); REQUEST_SIZE_MATCH(xXFixesCreateRegionFromGCReq);
swapl(&stuff->region, n); swapl(&stuff->region);
swapl(&stuff->gc, n); swapl(&stuff->gc);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -304,13 +300,12 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) ...@@ -304,13 +300,12 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client)
int int
SProcXFixesCreateRegionFromPicture (ClientPtr client) SProcXFixesCreateRegionFromPicture (ClientPtr client)
{ {
int n; REQUEST(xXFixesCreateRegionFromPictureReq);
REQUEST (xXFixesCreateRegionFromPictureReq);
swaps(&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq); REQUEST_SIZE_MATCH(xXFixesCreateRegionFromPictureReq);
swapl(&stuff->region, n); swapl(&stuff->region);
swapl(&stuff->picture, n); swapl(&stuff->picture);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -329,12 +324,11 @@ ProcXFixesDestroyRegion (ClientPtr client) ...@@ -329,12 +324,11 @@ ProcXFixesDestroyRegion (ClientPtr client)
int int
SProcXFixesDestroyRegion (ClientPtr client) SProcXFixesDestroyRegion (ClientPtr client)
{ {
int n; REQUEST(xXFixesDestroyRegionReq);
REQUEST (xXFixesDestroyRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
swapl (&stuff->region, n); swapl(&stuff->region);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -368,12 +362,11 @@ ProcXFixesSetRegion (ClientPtr client) ...@@ -368,12 +362,11 @@ ProcXFixesSetRegion (ClientPtr client)
int int
SProcXFixesSetRegion (ClientPtr client) SProcXFixesSetRegion (ClientPtr client)
{ {
int n; REQUEST(xXFixesSetRegionReq);
REQUEST (xXFixesSetRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq); REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq);
swapl (&stuff->region, n); swapl(&stuff->region);
SwapRestS(stuff); SwapRestS(stuff);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -396,13 +389,12 @@ ProcXFixesCopyRegion (ClientPtr client) ...@@ -396,13 +389,12 @@ ProcXFixesCopyRegion (ClientPtr client)
int int
SProcXFixesCopyRegion (ClientPtr client) SProcXFixesCopyRegion (ClientPtr client)
{ {
int n; REQUEST(xXFixesCopyRegionReq);
REQUEST (xXFixesCopyRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesCopyRegionReq); REQUEST_AT_LEAST_SIZE(xXFixesCopyRegionReq);
swapl (&stuff->source, n); swapl(&stuff->source);
swapl (&stuff->destination, n); swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -441,14 +433,13 @@ ProcXFixesCombineRegion (ClientPtr client) ...@@ -441,14 +433,13 @@ ProcXFixesCombineRegion (ClientPtr client)
int int
SProcXFixesCombineRegion (ClientPtr client) SProcXFixesCombineRegion (ClientPtr client)
{ {
int n; REQUEST(xXFixesCombineRegionReq);
REQUEST (xXFixesCombineRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); REQUEST_SIZE_MATCH(xXFixesCombineRegionReq);
swapl (&stuff->source1, n); swapl(&stuff->source1);
swapl (&stuff->source2, n); swapl(&stuff->source2);
swapl (&stuff->destination, n); swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -488,17 +479,16 @@ ProcXFixesInvertRegion (ClientPtr client) ...@@ -488,17 +479,16 @@ ProcXFixesInvertRegion (ClientPtr client)
int int
SProcXFixesInvertRegion (ClientPtr client) SProcXFixesInvertRegion (ClientPtr client)
{ {
int n;
REQUEST(xXFixesInvertRegionReq); REQUEST(xXFixesInvertRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq);
swapl (&stuff->source, n); swapl(&stuff->source);
swaps (&stuff->x, n); swaps(&stuff->x);
swaps (&stuff->y, n); swaps(&stuff->y);
swaps (&stuff->width, n); swaps(&stuff->width);
swaps (&stuff->height, n); swaps(&stuff->height);
swapl (&stuff->destination, n); swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -518,14 +508,13 @@ ProcXFixesTranslateRegion (ClientPtr client) ...@@ -518,14 +508,13 @@ ProcXFixesTranslateRegion (ClientPtr client)
int int
SProcXFixesTranslateRegion (ClientPtr client) SProcXFixesTranslateRegion (ClientPtr client)
{ {
int n;
REQUEST(xXFixesTranslateRegionReq); REQUEST(xXFixesTranslateRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq);
swapl (&stuff->region, n); swapl(&stuff->region);
swaps (&stuff->dx, n); swaps(&stuff->dx);
swaps (&stuff->dy, n); swaps(&stuff->dy);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -547,13 +536,12 @@ ProcXFixesRegionExtents (ClientPtr client) ...@@ -547,13 +536,12 @@ ProcXFixesRegionExtents (ClientPtr client)
int int
SProcXFixesRegionExtents (ClientPtr client) SProcXFixesRegionExtents (ClientPtr client)
{ {
int n;
REQUEST(xXFixesRegionExtentsReq); REQUEST(xXFixesRegionExtentsReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq); REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq);
swapl (&stuff->source, n); swapl(&stuff->source);
swapl (&stuff->destination, n); swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -595,16 +583,14 @@ ProcXFixesFetchRegion (ClientPtr client) ...@@ -595,16 +583,14 @@ ProcXFixesFetchRegion (ClientPtr client)
pRect[i].width = pBox[i].x2 - pBox[i].x1; pRect[i].width = pBox[i].x2 - pBox[i].x1;
pRect[i].height = pBox[i].y2 - pBox[i].y1; pRect[i].height = pBox[i].y2 - pBox[i].y1;
} }
if (client->swapped) if (client->swapped) {
{ swaps(&reply->sequenceNumber);
int n; swapl(&reply->length);
swaps (&reply->sequenceNumber, n); swaps(&reply->x);
swapl (&reply->length, n); swaps(&reply->y);
swaps (&reply->x, n); swaps(&reply->width);
swaps (&reply->y, n); swaps(&reply->height);
swaps (&reply->width, n); SwapShorts((INT16 *) pRect, nBox * 4);
swaps (&reply->height, n);
SwapShorts ((INT16 *) pRect, nBox * 4);
} }
(void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) + (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) +
nBox * sizeof (xRectangle), (char *) reply); nBox * sizeof (xRectangle), (char *) reply);
...@@ -615,12 +601,11 @@ ProcXFixesFetchRegion (ClientPtr client) ...@@ -615,12 +601,11 @@ ProcXFixesFetchRegion (ClientPtr client)
int int
SProcXFixesFetchRegion (ClientPtr client) SProcXFixesFetchRegion (ClientPtr client)
{ {
int n;
REQUEST(xXFixesFetchRegionReq); REQUEST(xXFixesFetchRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
swapl (&stuff->region, n); swapl(&stuff->region);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -654,15 +639,14 @@ ProcXFixesSetGCClipRegion (ClientPtr client) ...@@ -654,15 +639,14 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
int int
SProcXFixesSetGCClipRegion (ClientPtr client) SProcXFixesSetGCClipRegion (ClientPtr client)
{ {
int n;
REQUEST(xXFixesSetGCClipRegionReq); REQUEST(xXFixesSetGCClipRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
swapl (&stuff->gc, n); swapl(&stuff->gc);
swapl (&stuff->region, n); swapl(&stuff->region);
swaps (&stuff->xOrigin, n); swaps(&stuff->xOrigin);
swaps (&stuff->yOrigin, n); swaps(&stuff->yOrigin);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -752,15 +736,14 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) ...@@ -752,15 +736,14 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
int int
SProcXFixesSetWindowShapeRegion (ClientPtr client) SProcXFixesSetWindowShapeRegion (ClientPtr client)
{ {
int n;
REQUEST(xXFixesSetWindowShapeRegionReq); REQUEST(xXFixesSetWindowShapeRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq); REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
swapl (&stuff->dest, n); swapl(&stuff->dest);
swaps (&stuff->xOff, n); swaps(&stuff->xOff);
swaps (&stuff->yOff, n); swaps(&stuff->yOff);
swapl (&stuff->region, n); swapl(&stuff->region);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -791,15 +774,14 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) ...@@ -791,15 +774,14 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
int int
SProcXFixesSetPictureClipRegion (ClientPtr client) SProcXFixesSetPictureClipRegion (ClientPtr client)
{ {
int n;
REQUEST(xXFixesSetPictureClipRegionReq); REQUEST(xXFixesSetPictureClipRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq);
swapl (&stuff->picture, n); swapl(&stuff->picture);
swapl (&stuff->region, n); swapl(&stuff->region);
swaps (&stuff->xOrigin, n); swaps(&stuff->xOrigin);
swaps (&stuff->yOrigin, n); swaps(&stuff->yOrigin);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -848,17 +830,15 @@ ProcXFixesExpandRegion (ClientPtr client) ...@@ -848,17 +830,15 @@ ProcXFixesExpandRegion (ClientPtr client)
int int
SProcXFixesExpandRegion (ClientPtr client) SProcXFixesExpandRegion (ClientPtr client)
{ {
int n; REQUEST(xXFixesExpandRegionReq);
REQUEST (xXFixesExpandRegionReq);
swaps (&stuff->length, n); swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesExpandRegionReq); REQUEST_SIZE_MATCH(xXFixesExpandRegionReq);
swapl (&stuff->source, n); swapl(&stuff->source);
swapl (&stuff->destination, n); swapl(&stuff->destination);
swaps (&stuff->left, n); swaps(&stuff->left);
swaps (&stuff->right, n); swaps(&stuff->right);
swaps (&stuff->top, n); swaps(&stuff->top);
swaps (&stuff->bottom, n); swaps(&stuff->bottom);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
...@@ -70,10 +70,9 @@ ProcXFixesChangeSaveSet(ClientPtr client) ...@@ -70,10 +70,9 @@ ProcXFixesChangeSaveSet(ClientPtr client)
int int
SProcXFixesChangeSaveSet(ClientPtr client) SProcXFixesChangeSaveSet(ClientPtr client)
{ {
register int n;
REQUEST(xXFixesChangeSaveSetReq); REQUEST(xXFixesChangeSaveSetReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
return ProcXFixesChangeSaveSet(client); return ProcXFixesChangeSaveSet(client);
} }
...@@ -215,14 +215,13 @@ ProcXFixesSelectSelectionInput (ClientPtr client) ...@@ -215,14 +215,13 @@ ProcXFixesSelectSelectionInput (ClientPtr client)
int int
SProcXFixesSelectSelectionInput (ClientPtr client) SProcXFixesSelectSelectionInput (ClientPtr client)
{ {
register int n;
REQUEST(xXFixesSelectSelectionInputReq); REQUEST(xXFixesSelectSelectionInputReq);
REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq); REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->window, n); swapl(&stuff->window);
swapl(&stuff->selection, n); swapl(&stuff->selection);
swapl(&stuff->eventMask, n); swapl(&stuff->eventMask);
return ProcXFixesSelectSelectionInput(client); return ProcXFixesSelectSelectionInput(client);
} }
......
...@@ -39,7 +39,6 @@ ProcXFixesQueryVersion(ClientPtr client) ...@@ -39,7 +39,6 @@ ProcXFixesQueryVersion(ClientPtr client)
{ {
XFixesClientPtr pXFixesClient = GetXFixesClient (client); XFixesClientPtr pXFixesClient = GetXFixesClient (client);
xXFixesQueryVersionReply rep; xXFixesQueryVersionReply rep;
register int n;
REQUEST(xXFixesQueryVersionReq); REQUEST(xXFixesQueryVersionReq);
REQUEST_SIZE_MATCH(xXFixesQueryVersionReq); REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
...@@ -61,10 +60,10 @@ ProcXFixesQueryVersion(ClientPtr client) ...@@ -61,10 +60,10 @@ ProcXFixesQueryVersion(ClientPtr client)
pXFixesClient->major_version = rep.majorVersion; pXFixesClient->major_version = rep.majorVersion;
pXFixesClient->minor_version = rep.minorVersion; pXFixesClient->minor_version = rep.minorVersion;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length, n); swapl(&rep.length);
swapl(&rep.majorVersion, n); swapl(&rep.majorVersion);
swapl(&rep.minorVersion, n); swapl(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep); WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -131,12 +130,11 @@ ProcXFixesDispatch (ClientPtr client) ...@@ -131,12 +130,11 @@ ProcXFixesDispatch (ClientPtr client)
static int static int
SProcXFixesQueryVersion(ClientPtr client) SProcXFixesQueryVersion(ClientPtr client)
{ {
register int n;
REQUEST(xXFixesQueryVersionReq); REQUEST(xXFixesQueryVersionReq);
swaps(&stuff->length, n); swaps(&stuff->length);
swapl(&stuff->majorVersion, n); swapl(&stuff->majorVersion);
swapl(&stuff->minorVersion, n); swapl(&stuff->minorVersion);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client); return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
} }
......
...@@ -118,9 +118,8 @@ char * tmp; ...@@ -118,9 +118,8 @@ char * tmp;
wire16[1]= slen; wire16[1]= slen;
memcpy(wire8,str,slen); memcpy(wire8,str,slen);
if (client->swapped) { if (client->swapped) {
register int n; swaps(&wire16[0]);
swaps(&wire16[0],n); swaps(&wire16[1]);
swaps(&wire16[1],n);
} }
list->nPool+= wlen; list->nPool+= wlen;
list->nFound[what]++; list->nFound[what]++;
......
...@@ -165,7 +165,6 @@ ProcXkbUseExtension(ClientPtr client) ...@@ -165,7 +165,6 @@ ProcXkbUseExtension(ClientPtr client)
{ {
REQUEST(xkbUseExtensionReq); REQUEST(xkbUseExtensionReq);
xkbUseExtensionReply rep; xkbUseExtensionReply rep;
register int n;
int supported; int supported;
REQUEST_SIZE_MATCH(xkbUseExtensionReq); REQUEST_SIZE_MATCH(xkbUseExtensionReq);
...@@ -201,9 +200,9 @@ ProcXkbUseExtension(ClientPtr client) ...@@ -201,9 +200,9 @@ ProcXkbUseExtension(ClientPtr client)
rep.serverMajor = SERVER_XKB_MAJOR_VERSION; rep.serverMajor = SERVER_XKB_MAJOR_VERSION;
rep.serverMinor = SERVER_XKB_MINOR_VERSION; rep.serverMinor = SERVER_XKB_MINOR_VERSION;
if ( client->swapped ) { if ( client->swapped ) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swaps(&rep.serverMajor, n); swaps(&rep.serverMajor);
swaps(&rep.serverMinor, n); swaps(&rep.serverMinor);
} }
WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep);
return client->noClientException; return client->noClientException;
...@@ -535,9 +534,8 @@ ProcXkbGetState(ClientPtr client) ...@@ -535,9 +534,8 @@ ProcXkbGetState(ClientPtr client)
rep.compatState = xkb->compat_state; rep.compatState = xkb->compat_state;
rep.ptrBtnState = xkb->ptr_buttons; rep.ptrBtnState = xkb->ptr_buttons;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber,n); swaps(&rep.ptrBtnState);
swaps(&rep.ptrBtnState,n);
} }
WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep); WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep);
return client->noClientException; return client->noClientException;
...@@ -610,7 +608,6 @@ ProcXkbGetControls(ClientPtr client) ...@@ -610,7 +608,6 @@ ProcXkbGetControls(ClientPtr client)
xkbGetControlsReply rep; xkbGetControlsReply rep;
XkbControlsPtr xkb; XkbControlsPtr xkb;
DeviceIntPtr dev; DeviceIntPtr dev;
register int n;
REQUEST(xkbGetControlsReq); REQUEST(xkbGetControlsReq);
REQUEST_SIZE_MATCH(xkbGetControlsReq); REQUEST_SIZE_MATCH(xkbGetControlsReq);
...@@ -653,26 +650,26 @@ ProcXkbGetControls(ClientPtr client) ...@@ -653,26 +650,26 @@ ProcXkbGetControls(ClientPtr client)
rep.axOptions = xkb->ax_options; rep.axOptions = xkb->ax_options;
memcpy(rep.perKeyRepeat,xkb->per_key_repeat,XkbPerKeyBitArraySize); memcpy(rep.perKeyRepeat,xkb->per_key_repeat,XkbPerKeyBitArraySize);
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber);
swapl(&rep.length,n); swapl(&rep.length);
swaps(&rep.internalVMods, n); swaps(&rep.internalVMods);
swaps(&rep.ignoreLockVMods, n); swaps(&rep.ignoreLockVMods);
swapl(&rep.enabledCtrls, n); swapl(&rep.enabledCtrls);
swaps(&rep.repeatDelay, n); swaps(&rep.repeatDelay);
swaps(&rep.repeatInterval, n); swaps(&rep.repeatInterval);
swaps(&rep.slowKeysDelay, n); swaps(&rep.slowKeysDelay);
swaps(&rep.debounceDelay, n); swaps(&rep.debounceDelay);
swaps(&rep.mkDelay, n); swaps(&rep.mkDelay);
swaps(&rep.mkInterval, n); swaps(&rep.mkInterval);
swaps(&rep.mkTimeToMax, n); swaps(&rep.mkTimeToMax);
swaps(&rep.mkMaxSpeed, n); swaps(&rep.mkMaxSpeed);
swaps(&rep.mkCurve, n); swaps(&rep.mkCurve);
swaps(&rep.axTimeout, n); swaps(&rep.axTimeout);
swapl(&rep.axtCtrlsMask, n); swapl(&rep.axtCtrlsMask);
swapl(&rep.axtCtrlsValues, n); swapl(&rep.axtCtrlsValues);
swaps(&rep.axtOptsMask, n); swaps(&rep.axtOptsMask);
swaps(&rep.axtOptsValues, n); swaps(&rep.axtOptsValues);
swaps(&rep.axOptions, n); swaps(&rep.axOptions);
} }
WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep); WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep);
return(client->noClientException); return(client->noClientException);
...@@ -940,8 +937,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb, ...@@ -940,8 +937,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb,
wire->nMapEntries = type->map_count; wire->nMapEntries = type->map_count;
wire->preserve = (type->preserve!=NULL); wire->preserve = (type->preserve!=NULL);
if (client->swapped) { if (client->swapped) {
register int n; swaps(&wire->virtualMods);
swaps(&wire->virtualMods,n);
} }
buf= (char *)&wire[1]; buf= (char *)&wire[1];
...@@ -957,8 +953,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb, ...@@ -957,8 +953,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb,
wire->realMods= entry->mods.real_mods; wire->realMods= entry->mods.real_mods;
wire->virtualMods= entry->mods.vmods; wire->virtualMods= entry->mods.vmods;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&wire->virtualMods);
swaps(&wire->virtualMods,n);
} }
} }
buf= (char *)wire; buf= (char *)wire;
...@@ -972,8 +967,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb, ...@@ -972,8 +967,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb,
pwire->realMods= preserve->real_mods; pwire->realMods= preserve->real_mods;
pwire->virtualMods= preserve->vmods; pwire->virtualMods= preserve->vmods;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&pwire->virtualMods);
swaps(&pwire->virtualMods,n);
} }
} }
buf= (char *)pwire; buf= (char *)pwire;
...@@ -1053,10 +1047,10 @@ register unsigned i; ...@@ -1053,10 +1047,10 @@ register unsigned i;
pSym = &xkb->map->syms[symMap->offset]; pSym = &xkb->map->syms[symMap->offset];
memcpy((char *)buf,(char *)pSym,outMap->nSyms*4); memcpy((char *)buf,(char *)pSym,outMap->nSyms*4);
if (client->swapped) { if (client->swapped) {
register int n,nSyms= outMap->nSyms; register int nSyms= outMap->nSyms;
swaps(&outMap->nSyms,n); swaps(&outMap->nSyms);
while (nSyms-->0) { while (nSyms-->0) {
swapl(buf,n); swapl((int *)buf);
buf+= 4; buf+= 4;
} }
} }
...@@ -1345,12 +1339,11 @@ char *desc,*start; ...@@ -1345,12 +1339,11 @@ char *desc,*start;
len, (unsigned long)(desc-start)); len, (unsigned long)(desc-start));
} }
if (client->swapped) { if (client->swapped) {
register int n; swaps(&rep->sequenceNumber);
swaps(&rep->sequenceNumber,n); swapl(&rep->length);
swapl(&rep->length,n); swaps(&rep->present);
swaps(&rep->present,n); swaps(&rep->totalSyms);
swaps(&rep->totalSyms,n); swaps(&rep->totalActs);
swaps(&rep->totalActs,n);
} }
WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep); WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep);
WriteToClient(client, len, start); WriteToClient(client, len, start);
...@@ -1532,8 +1525,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn; ...@@ -1532,8 +1525,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn;
for (i=0;i<req->nTypes;i++) { for (i=0;i<req->nTypes;i++) {
unsigned width; unsigned width;
if (client->swapped) { if (client->swapped) {
register int s; swaps(&wire->virtualMods);
swaps(&wire->virtualMods,s);
} }
n= i+req->firstType; n= i+req->firstType;
width= wire->numLevels; width= wire->numLevels;
...@@ -1559,8 +1551,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn; ...@@ -1559,8 +1551,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn;
preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries]; preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries];
for (n=0;n<wire->nMapEntries;n++) { for (n=0;n<wire->nMapEntries;n++) {
if (client->swapped) { if (client->swapped) {
register int s; swaps(&mapWire[n].virtualMods);
swaps(&mapWire[n].virtualMods,s);
} }
if (mapWire[n].realMods&(~wire->realMods)) { if (mapWire[n].realMods&(~wire->realMods)) {
*nMapsRtrn= _XkbErrCode4(0x06,n,mapWire[n].realMods, *nMapsRtrn= _XkbErrCode4(0x06,n,mapWire[n].realMods,
...@@ -1578,8 +1569,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn; ...@@ -1578,8 +1569,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn;
} }
if (wire->preserve) { if (wire->preserve) {
if (client->swapped) { if (client->swapped) {
register int s; swaps(&preWire[n].virtualMods);
swaps(&preWire[n].virtualMods,s);
} }
if (preWire[n].realMods&(~mapWire[n].realMods)) { if (preWire[n].realMods&(~mapWire[n].realMods)) {
*nMapsRtrn= _XkbErrCode4(0x09,n,preWire[n].realMods, *nMapsRtrn= _XkbErrCode4(0x09,n,preWire[n].realMods,
...@@ -1643,7 +1633,7 @@ xkbSymMapWireDesc* wire = *wireRtrn; ...@@ -1643,7 +1633,7 @@ xkbSymMapWireDesc* wire = *wireRtrn;
KeySym *pSyms; KeySym *pSyms;
register unsigned nG; register unsigned nG;
if (client->swapped) { if (client->swapped) {
swaps(&wire->nSyms,nG); swaps(&wire->nSyms);
} }
nG = XkbNumGroups(wire->groupInfo); nG = XkbNumGroups(wire->groupInfo);
if (nG>XkbNumKbdGroups) { if (nG>XkbNumKbdGroups) {
...@@ -2023,9 +2013,8 @@ unsigned first,last; ...@@ -2023,9 +2013,8 @@ unsigned first,last;
newSyms[s]= pSyms[s]; newSyms[s]= pSyms[s];
} }
if (client->swapped) { if (client->swapped) {
int n;
for (s=0;s<wire->nSyms;s++) { for (s=0;s<wire->nSyms;s++) {
swapl(&newSyms[s],n); swapl(&newSyms[s]);
} }
} }
} }
...@@ -2516,8 +2505,7 @@ int size; ...@@ -2516,8 +2505,7 @@ int size;
wire->flags= sym->flags; wire->flags= sym->flags;
memcpy((char*)&wire->act,(char*)&sym->act,sz_xkbActionWireDesc); memcpy((char*)&wire->act,(char*)&sym->act,sz_xkbActionWireDesc);
if (client->swapped) { if (client->swapped) {
register int n; swapl(&wire->sym);
swapl(&wire->sym,n);
} }
} }
if (rep->groups) { if (rep->groups) {
...@@ -2528,8 +2516,7 @@ int size; ...@@ -2528,8 +2516,7 @@ int size;
grp->realMods= compat->groups[i].real_mods; grp->realMods= compat->groups[i].real_mods;
grp->virtualMods= compat->groups[i].vmods; grp->virtualMods= compat->groups[i].vmods;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&grp->virtualMods);
swaps(&grp->virtualMods,n);
} }
grp++; grp++;
} }
...@@ -2542,12 +2529,11 @@ int size; ...@@ -2542,12 +2529,11 @@ int size;
else data= NULL; else data= NULL;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&rep->sequenceNumber);
swaps(&rep->sequenceNumber,n); swapl(&rep->length);
swapl(&rep->length,n); swaps(&rep->firstSI);
swaps(&rep->firstSI,n); swaps(&rep->nSI);
swaps(&rep->nSI,n); swaps(&rep->nTotalSI);
swaps(&rep->nTotalSI,n);
} }
WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep); WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep);
...@@ -2662,8 +2648,7 @@ ProcXkbSetCompatMap(ClientPtr client) ...@@ -2662,8 +2648,7 @@ ProcXkbSetCompatMap(ClientPtr client)
sym = &compat->sym_interpret[stuff->firstSI]; sym = &compat->sym_interpret[stuff->firstSI];
for (i=0;i<stuff->nSI;i++,wire++,sym++) { for (i=0;i<stuff->nSI;i++,wire++,sym++) {
if (client->swapped) { if (client->swapped) {
register int n; swapl(&wire->sym);
swapl(&wire->sym,n);
} }
sym->sym= wire->sym; sym->sym= wire->sym;
sym->mods= wire->mods; sym->mods= wire->mods;
...@@ -2685,8 +2670,7 @@ ProcXkbSetCompatMap(ClientPtr client) ...@@ -2685,8 +2670,7 @@ ProcXkbSetCompatMap(ClientPtr client)
for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) { for (i=0,bit=1;i<XkbNumKbdGroups;i++,bit<<=1) {
if (stuff->groups&bit) { if (stuff->groups&bit) {
if (client->swapped) { if (client->swapped) {
register int n; swaps(&wire->virtualMods);
swaps(&wire->virtualMods,n);
} }
compat->groups[i].mask= wire->realMods; compat->groups[i].mask= wire->realMods;
compat->groups[i].real_mods= wire->realMods; compat->groups[i].real_mods= wire->realMods;
...@@ -2742,7 +2726,6 @@ ProcXkbGetIndicatorState(ClientPtr client) ...@@ -2742,7 +2726,6 @@ ProcXkbGetIndicatorState(ClientPtr client)
xkbGetIndicatorStateReply rep; xkbGetIndicatorStateReply rep;
XkbSrvLedInfoPtr sli; XkbSrvLedInfoPtr sli;
DeviceIntPtr dev; DeviceIntPtr dev;
register int i;
REQUEST(xkbGetIndicatorStateReq); REQUEST(xkbGetIndicatorStateReq);
REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
...@@ -2764,8 +2747,8 @@ ProcXkbGetIndicatorState(ClientPtr client) ...@@ -2764,8 +2747,8 @@ ProcXkbGetIndicatorState(ClientPtr client)
rep.state = sli->effectiveState; rep.state = sli->effectiveState;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber,i); swaps(&rep.sequenceNumber);
swapl(&rep.state,i); swapl(&rep.state);
} }
WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep); WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep);
return client->noClientException; return client->noClientException;
...@@ -2817,9 +2800,8 @@ register unsigned bit; ...@@ -2817,9 +2800,8 @@ register unsigned bit;
wire->virtualMods= indicators->maps[i].mods.vmods; wire->virtualMods= indicators->maps[i].mods.vmods;
wire->ctrls= indicators->maps[i].ctrls; wire->ctrls= indicators->maps[i].ctrls;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&wire->virtualMods);
swaps(&wire->virtualMods,n); swapl(&wire->ctrls);
swapl(&wire->ctrls,n);
} }
wire++; wire++;
} }
...@@ -2834,10 +2816,10 @@ register unsigned bit; ...@@ -2834,10 +2816,10 @@ register unsigned bit;
} }
else map = NULL; else map = NULL;
if (client->swapped) { if (client->swapped) {
swaps(&rep->sequenceNumber,i); swaps(&rep->sequenceNumber);
swapl(&rep->length,i); swapl(&rep->length);
swapl(&rep->which,i); swapl(&rep->which);
swapl(&rep->realIndicators,i); swapl(&rep->realIndicators);
} }
WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *)rep); WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *)rep);
if (map) { if (map) {
...@@ -2920,9 +2902,8 @@ ProcXkbSetIndicatorMap(ClientPtr client) ...@@ -2920,9 +2902,8 @@ ProcXkbSetIndicatorMap(ClientPtr client)
for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) { for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
if (stuff->which&bit) { if (stuff->which&bit) {
if (client->swapped) { if (client->swapped) {
register int n; swaps(&from->virtualMods);
swaps(&from->virtualMods,n); swapl(&from->ctrls);
swapl(&from->ctrls,n);
} }
CHK_MASK_LEGAL(i,from->whichGroups,XkbIM_UseAnyGroup); CHK_MASK_LEGAL(i,from->whichGroups,XkbIM_UseAnyGroup);
CHK_MASK_LEGAL(i,from->whichMods,XkbIM_UseAnyMods); CHK_MASK_LEGAL(i,from->whichMods,XkbIM_UseAnyMods);
...@@ -3037,12 +3018,11 @@ ProcXkbGetNamedIndicator(ClientPtr client) ...@@ -3037,12 +3018,11 @@ ProcXkbGetNamedIndicator(ClientPtr client)
rep.supported= supported; rep.supported= supported;
} }
if ( client->swapped ) { if ( client->swapped ) {
register int n; swapl(&rep.length);
swapl(&rep.length,n); swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber,n); swapl(&rep.indicator);
swapl(&rep.indicator,n); swaps(&rep.virtualMods);
swaps(&rep.virtualMods,n); swapl(&rep.ctrls);
swapl(&rep.ctrls,n);
} }
WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep);
...@@ -3203,8 +3183,7 @@ Atom *atm; ...@@ -3203,8 +3183,7 @@ Atom *atm;
if (atoms[i]!=None) { if (atoms[i]!=None) {
*atm= atoms[i]; *atm= atoms[i];
if (swap) { if (swap) {
register int n; swapl(atm);
swapl(atm,n);
} }
atm++; atm++;
} }
...@@ -3327,12 +3306,11 @@ char * desc; ...@@ -3327,12 +3306,11 @@ char * desc;
length= rep->length*4; length= rep->length*4;
which= rep->which; which= rep->which;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&rep->sequenceNumber);
swaps(&rep->sequenceNumber,n); swapl(&rep->length);
swapl(&rep->length,n); swapl(&rep->which);
swapl(&rep->which,n); swaps(&rep->virtualMods);
swaps(&rep->virtualMods,n); swapl(&rep->indicators);
swapl(&rep->indicators,n);
} }
start = desc = (char *)ALLOCATE_LOCAL(length); start = desc = (char *)ALLOCATE_LOCAL(length);
...@@ -3341,24 +3319,21 @@ char * desc; ...@@ -3341,24 +3319,21 @@ char * desc;
if (which&XkbKeycodesNameMask) { if (which&XkbKeycodesNameMask) {
*((CARD32 *)desc)= xkb->names->keycodes; *((CARD32 *)desc)= xkb->names->keycodes;
if (client->swapped) { if (client->swapped) {
register int n; swapl((int *)desc);
swapl(desc,n);
} }
desc+= 4; desc+= 4;
} }
if (which&XkbGeometryNameMask) { if (which&XkbGeometryNameMask) {
*((CARD32 *)desc)= xkb->names->geometry; *((CARD32 *)desc)= xkb->names->geometry;
if (client->swapped) { if (client->swapped) {
register int n; swapl((int *)desc);
swapl(desc,n);
} }
desc+= 4; desc+= 4;
} }
if (which&XkbSymbolsNameMask) { if (which&XkbSymbolsNameMask) {
*((CARD32 *)desc)= xkb->names->symbols; *((CARD32 *)desc)= xkb->names->symbols;
if (client->swapped) { if (client->swapped) {
register int n; swapl((int *)desc);
swapl(desc,n);
} }
desc+= 4; desc+= 4;
} }
...@@ -3366,24 +3341,21 @@ char * desc; ...@@ -3366,24 +3341,21 @@ char * desc;
register CARD32 *atm= (CARD32 *)desc; register CARD32 *atm= (CARD32 *)desc;
atm[0]= (CARD32)xkb->names->phys_symbols; atm[0]= (CARD32)xkb->names->phys_symbols;
if (client->swapped) { if (client->swapped) {
register int n; swapl(&atm[0]);
swapl(&atm[0],n);
} }
desc+= 4; desc+= 4;
} }
if (which&XkbTypesNameMask) { if (which&XkbTypesNameMask) {
*((CARD32 *)desc)= (CARD32)xkb->names->types; *((CARD32 *)desc)= (CARD32)xkb->names->types;
if (client->swapped) { if (client->swapped) {
register int n; swapl((int *)desc);
swapl(desc,n);
} }
desc+= 4; desc+= 4;
} }
if (which&XkbCompatNameMask) { if (which&XkbCompatNameMask) {
*((CARD32 *)desc)= (CARD32)xkb->names->compat; *((CARD32 *)desc)= (CARD32)xkb->names->compat;
if (client->swapped) { if (client->swapped) {
register int n; swapl((int *)desc);
swapl(desc,n);
} }
desc+= 4; desc+= 4;
} }
...@@ -3394,8 +3366,7 @@ char * desc; ...@@ -3394,8 +3366,7 @@ char * desc;
for (i=0;i<xkb->map->num_types;i++,atm++,type++) { for (i=0;i<xkb->map->num_types;i++,atm++,type++) {
*atm= (CARD32)type->name; *atm= (CARD32)type->name;
if (client->swapped) { if (client->swapped) {
register int n; swapl(atm);
swapl(atm,n);
} }
} }
desc= (char *)atm; desc= (char *)atm;
...@@ -3416,8 +3387,7 @@ char * desc; ...@@ -3416,8 +3387,7 @@ char * desc;
for (l=0;l<type->num_levels;l++,atm++) { for (l=0;l<type->num_levels;l++,atm++) {
*atm= type->level_names[l]; *atm= type->level_names[l];
if (client->swapped) { if (client->swapped) {
register unsigned n; swapl(atm);
swapl(atm,n);
} }
} }
desc+= type->num_levels*4; desc+= type->num_levels*4;
...@@ -3453,8 +3423,7 @@ char * desc; ...@@ -3453,8 +3423,7 @@ char * desc;
for (i=0;i<rep->nRadioGroups;i++,atm++) { for (i=0;i<rep->nRadioGroups;i++,atm++) {
*atm= (CARD32)xkb->names->radio_groups[i]; *atm= (CARD32)xkb->names->radio_groups[i];
if (client->swapped) { if (client->swapped) {
register unsigned n; swapl(atm);
swapl(atm,n);
} }
} }
desc+= rep->nRadioGroups*4; desc+= rep->nRadioGroups*4;
...@@ -3515,8 +3484,7 @@ register int i; ...@@ -3515,8 +3484,7 @@ register int i;
for (i=0;i<nAtoms;i++,wire++) { for (i=0;i<nAtoms;i++,wire++) {
if (swapped) { if (swapped) {
register int n; swapl(wire);
swapl(wire,n);
} }
if ((((Atom)*wire)!=None)&&(!ValidAtom((Atom)*wire))) { if ((((Atom)*wire)!=None)&&(!ValidAtom((Atom)*wire))) {
*pError= ((Atom)*wire); *pError= ((Atom)*wire);
...@@ -3536,8 +3504,7 @@ register unsigned i,bit; ...@@ -3536,8 +3504,7 @@ register unsigned i,bit;
if ((present&bit)==0) if ((present&bit)==0)
continue; continue;
if (swapped) { if (swapped) {
register int n; swapl(wire);
swapl(wire,n);
} }
if ((((Atom)*wire)!=None)&&(!ValidAtom(((Atom)*wire)))) { if ((((Atom)*wire)!=None)&&(!ValidAtom(((Atom)*wire)))) {
*pError= (Atom)*wire; *pError= (Atom)*wire;
...@@ -3930,8 +3897,7 @@ CARD16 len,*pLen; ...@@ -3930,8 +3897,7 @@ CARD16 len,*pLen;
pLen= (CARD16 *)wire; pLen= (CARD16 *)wire;
*pLen= len; *pLen= len;
if (swap) { if (swap) {
register int n; swaps(pLen);
swaps(pLen,n);
} }
memcpy(&wire[2],str,len); memcpy(&wire[2],str,len);
wire+= ((2+len+3)/4)*4; wire+= ((2+len+3)/4)*4;
...@@ -4046,8 +4012,7 @@ xkbShapeWireDesc * shapeWire; ...@@ -4046,8 +4012,7 @@ xkbShapeWireDesc * shapeWire;
shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx); shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx);
else shapeWire->approxNdx= XkbNoShape; else shapeWire->approxNdx= XkbNoShape;
if (swap) { if (swap) {
register int n; swapl(&shapeWire->name);
swapl(&shapeWire->name,n);
} }
wire= (char *)&shapeWire[1]; wire= (char *)&shapeWire[1];
for (o=0,ol=shape->outlines;o<shape->num_outlines;o++,ol++) { for (o=0,ol=shape->outlines;o<shape->num_outlines;o++,ol++) {
...@@ -4063,9 +4028,8 @@ xkbShapeWireDesc * shapeWire; ...@@ -4063,9 +4028,8 @@ xkbShapeWireDesc * shapeWire;
ptWire[p].x= pt->x; ptWire[p].x= pt->x;
ptWire[p].y= pt->y; ptWire[p].y= pt->y;
if (swap) { if (swap) {
register int n; swaps(&ptWire[p].x);
swaps(&ptWire[p].x,n); swaps(&ptWire[p].y);
swaps(&ptWire[p].y,n);
} }
} }
wire= (char *)&ptWire[ol->num_points]; wire= (char *)&ptWire[ol->num_points];
...@@ -4108,10 +4072,9 @@ xkbDoodadWireDesc * doodadWire; ...@@ -4108,10 +4072,9 @@ xkbDoodadWireDesc * doodadWire;
doodadWire->any.top= doodad->any.top; doodadWire->any.top= doodad->any.top;
doodadWire->any.left= doodad->any.left; doodadWire->any.left= doodad->any.left;
if (swap) { if (swap) {
register int n; swapl(&doodadWire->any.name);
swapl(&doodadWire->any.name,n); swaps(&doodadWire->any.top);
swaps(&doodadWire->any.top,n); swaps(&doodadWire->any.left);
swaps(&doodadWire->any.left,n);
} }
switch (doodad->any.type) { switch (doodad->any.type) {
case XkbOutlineDoodad: case XkbOutlineDoodad:
...@@ -4120,8 +4083,7 @@ xkbDoodadWireDesc * doodadWire; ...@@ -4120,8 +4083,7 @@ xkbDoodadWireDesc * doodadWire;
doodadWire->shape.colorNdx= doodad->shape.color_ndx; doodadWire->shape.colorNdx= doodad->shape.color_ndx;
doodadWire->shape.shapeNdx= doodad->shape.shape_ndx; doodadWire->shape.shapeNdx= doodad->shape.shape_ndx;
if (swap) { if (swap) {
register int n; swaps(&doodadWire->shape.angle);
swaps(&doodadWire->shape.angle,n);
} }
break; break;
case XkbTextDoodad: case XkbTextDoodad:
...@@ -4130,10 +4092,9 @@ xkbDoodadWireDesc * doodadWire; ...@@ -4130,10 +4092,9 @@ xkbDoodadWireDesc * doodadWire;
doodadWire->text.height= doodad->text.height; doodadWire->text.height= doodad->text.height;
doodadWire->text.colorNdx= doodad->text.color_ndx; doodadWire->text.colorNdx= doodad->text.color_ndx;
if (swap) { if (swap) {
register int n; swaps(&doodadWire->text.angle);
swaps(&doodadWire->text.angle,n); swaps(&doodadWire->text.width);
swaps(&doodadWire->text.width,n); swaps(&doodadWire->text.height);
swaps(&doodadWire->text.height,n);
} }
wire= XkbWriteCountedString(wire,doodad->text.text,swap); wire= XkbWriteCountedString(wire,doodad->text.text,swap);
wire= XkbWriteCountedString(wire,doodad->text.font,swap); wire= XkbWriteCountedString(wire,doodad->text.font,swap);
...@@ -4171,8 +4132,7 @@ xkbOverlayWireDesc * olWire; ...@@ -4171,8 +4132,7 @@ xkbOverlayWireDesc * olWire;
olWire->name= ol->name; olWire->name= ol->name;
olWire->nRows= ol->num_rows; olWire->nRows= ol->num_rows;
if (swap) { if (swap) {
register int n; swapl(&olWire->name);
swapl(&olWire->name,n);
} }
wire= (char *)&olWire[1]; wire= (char *)&olWire[1];
for (r=0,row=ol->rows;r<ol->num_rows;r++,row++) { for (r=0,row=ol->rows;r<ol->num_rows;r++,row++) {
...@@ -4250,13 +4210,12 @@ xkbSectionWireDesc * sectionWire; ...@@ -4250,13 +4210,12 @@ xkbSectionWireDesc * sectionWire;
sectionWire->nOverlays= section->num_overlays; sectionWire->nOverlays= section->num_overlays;
sectionWire->pad= 0; sectionWire->pad= 0;
if (swap) { if (swap) {
register int n; swapl(&sectionWire->name);
swapl(&sectionWire->name,n); swaps(&sectionWire->top);
swaps(&sectionWire->top,n); swaps(&sectionWire->left);
swaps(&sectionWire->left,n); swaps(&sectionWire->width);
swaps(&sectionWire->width,n); swaps(&sectionWire->height);
swaps(&sectionWire->height,n); swaps(&sectionWire->angle);
swaps(&sectionWire->angle,n);
} }
wire= (char *)&sectionWire[1]; wire= (char *)&sectionWire[1];
if (section->rows) { if (section->rows) {
...@@ -4271,9 +4230,8 @@ xkbSectionWireDesc * sectionWire; ...@@ -4271,9 +4230,8 @@ xkbSectionWireDesc * sectionWire;
rowWire->vertical= row->vertical; rowWire->vertical= row->vertical;
rowWire->pad= 0; rowWire->pad= 0;
if (swap) { if (swap) {
register int n; swaps(&rowWire->top);
swaps(&rowWire->top,n); swaps(&rowWire->left);
swaps(&rowWire->left,n);
} }
wire= (char *)&rowWire[1]; wire= (char *)&rowWire[1];
if (row->keys) { if (row->keys) {
...@@ -4287,8 +4245,7 @@ xkbSectionWireDesc * sectionWire; ...@@ -4287,8 +4245,7 @@ xkbSectionWireDesc * sectionWire;
keyWire[k].shapeNdx= key->shape_ndx; keyWire[k].shapeNdx= key->shape_ndx;
keyWire[k].colorNdx= key->color_ndx; keyWire[k].colorNdx= key->color_ndx;
if (swap) { if (swap) {
register int n; swaps(&keyWire[k].gap);
swaps(&keyWire[k].gap,n);
} }
} }
wire= (char *)&keyWire[row->num_keys]; wire= (char *)&keyWire[row->num_keys];
...@@ -4390,18 +4347,17 @@ XkbSendGeometry( ClientPtr client, ...@@ -4390,18 +4347,17 @@ XkbSendGeometry( ClientPtr client,
start= NULL; start= NULL;
} }
if (client->swapped) { if (client->swapped) {
register int n; swaps(&rep->sequenceNumber);
swaps(&rep->sequenceNumber,n); swapl(&rep->length);
swapl(&rep->length,n); swapl(&rep->name);
swapl(&rep->name,n); swaps(&rep->widthMM);
swaps(&rep->widthMM,n); swaps(&rep->heightMM);
swaps(&rep->heightMM,n); swaps(&rep->nProperties);
swaps(&rep->nProperties,n); swaps(&rep->nColors);
swaps(&rep->nColors,n); swaps(&rep->nShapes);
swaps(&rep->nShapes,n); swaps(&rep->nSections);
swaps(&rep->nSections,n); swaps(&rep->nDoodads);
swaps(&rep->nDoodads,n); swaps(&rep->nKeyAliases);
swaps(&rep->nKeyAliases,n);
} }
WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *)rep); WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *)rep);
if (len>0) if (len>0)
...@@ -4453,8 +4409,7 @@ CARD16 len; ...@@ -4453,8 +4409,7 @@ CARD16 len;
wire= *wire_inout; wire= *wire_inout;
len= (CARD16 *)wire; len= (CARD16 *)wire;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&len);
swaps(&len, n);
} }
next = wire + XkbPaddedSize(len + 2); next = wire + XkbPaddedSize(len + 2);
/* Check we're still within the size of the request */ /* Check we're still within the size of the request */
...@@ -4487,11 +4442,10 @@ Status status; ...@@ -4487,11 +4442,10 @@ Status status;
any = dWire->any; any = dWire->any;
wire= (char *)&dWire[1]; wire= (char *)&dWire[1];
if (client->swapped) { if (client->swapped) {
register int n; swapl(&any.name);
swapl(&any.name, n); swaps(&any.top);
swaps(&any.top, n); swaps(&any.left);
swaps(&any.left, n); swaps(&any.angle);
swaps(&any.angle, n);
} }
CHK_ATOM_ONLY(dWire->any.name); CHK_ATOM_ONLY(dWire->any.name);
doodad = XkbAddGeomDoodad(geom, section, any.name); doodad = XkbAddGeomDoodad(geom, section, any.name);
...@@ -4526,9 +4480,8 @@ Status status; ...@@ -4526,9 +4480,8 @@ Status status;
} }
text = dWire->text; text = dWire->text;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&text.width);
swaps(&text.width, n); swaps(&text.height);
swaps(&text.height, n);
} }
doodad->text.width= text.width; doodad->text.width= text.width;
doodad->text.height= text.height; doodad->text.height= text.height;
...@@ -4602,8 +4555,7 @@ xkbOverlayRowWireDesc * rWire; ...@@ -4602,8 +4555,7 @@ xkbOverlayRowWireDesc * rWire;
wire= *wire_inout; wire= *wire_inout;
olWire= (xkbOverlayWireDesc *)wire; olWire= (xkbOverlayWireDesc *)wire;
if (client->swapped) { if (client->swapped) {
register int n; swapl(&olWire->name);
swapl(&olWire->name,n);
} }
CHK_ATOM_ONLY(olWire->name); CHK_ATOM_ONLY(olWire->name);
ol= XkbAddGeomOverlay(section,olWire->name,olWire->nRows); ol= XkbAddGeomOverlay(section,olWire->name,olWire->nRows);
...@@ -4655,13 +4607,12 @@ XkbSectionPtr section; ...@@ -4655,13 +4607,12 @@ XkbSectionPtr section;
register int r; register int r;
xkbRowWireDesc * rWire; xkbRowWireDesc * rWire;
if (client->swapped) { if (client->swapped) {
register int n; swapl(&sWire->name);
swapl(&sWire->name,n); swaps(&sWire->top);
swaps(&sWire->top,n); swaps(&sWire->left);
swaps(&sWire->left,n); swaps(&sWire->width);
swaps(&sWire->width,n); swaps(&sWire->height);
swaps(&sWire->height,n); swaps(&sWire->angle);
swaps(&sWire->angle,n);
} }
CHK_ATOM_ONLY(sWire->name); CHK_ATOM_ONLY(sWire->name);
section= XkbAddGeomSection(geom,sWire->name,sWire->nRows, section= XkbAddGeomSection(geom,sWire->name,sWire->nRows,
...@@ -4680,9 +4631,8 @@ XkbSectionPtr section; ...@@ -4680,9 +4631,8 @@ XkbSectionPtr section;
XkbRowPtr row; XkbRowPtr row;
xkbKeyWireDesc * kWire; xkbKeyWireDesc * kWire;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&rWire->top);
swaps(&rWire->top,n); swaps(&rWire->left);
swaps(&rWire->left,n);
} }
row= XkbAddGeomRow(section,rWire->nKeys); row= XkbAddGeomRow(section,rWire->nKeys);
if (!row) if (!row)
...@@ -4777,9 +4727,8 @@ char * wire; ...@@ -4777,9 +4727,8 @@ char * wire;
pt->x= ptWire[p].x; pt->x= ptWire[p].x;
pt->y= ptWire[p].y; pt->y= ptWire[p].y;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&pt->x);
swaps(&pt->x,n); swaps(&pt->y);
swaps(&pt->y,n);
} }
} }
ol->num_points= olWire->nPoints; ol->num_points= olWire->nPoints;
...@@ -5022,12 +4971,11 @@ ProcXkbPerClientFlags(ClientPtr client) ...@@ -5022,12 +4971,11 @@ ProcXkbPerClientFlags(ClientPtr client)
rep.autoCtrls= rep.autoCtrlValues= 0; rep.autoCtrls= rep.autoCtrlValues= 0;
} }
if ( client->swapped ) { if ( client->swapped ) {
register int n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber, n); swapl(&rep.supported);
swapl(&rep.supported,n); swapl(&rep.value);
swapl(&rep.value,n); swapl(&rep.autoCtrls);
swapl(&rep.autoCtrls,n); swapl(&rep.autoCtrlValues);
swapl(&rep.autoCtrlValues,n);
} }
WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep);
return client->noClientException; return client->noClientException;
...@@ -5148,16 +5096,15 @@ ProcXkbListComponents(ClientPtr client) ...@@ -5148,16 +5096,15 @@ ProcXkbListComponents(ClientPtr client)
if (list.nTotal>list.maxRtrn) if (list.nTotal>list.maxRtrn)
rep.extra = (list.nTotal-list.maxRtrn); rep.extra = (list.nTotal-list.maxRtrn);
if (client->swapped) { if (client->swapped) {
register int n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber,n); swapl(&rep.length);
swapl(&rep.length,n); swaps(&rep.nKeymaps);
swaps(&rep.nKeymaps,n); swaps(&rep.nKeycodes);
swaps(&rep.nKeycodes,n); swaps(&rep.nTypes);
swaps(&rep.nTypes,n); swaps(&rep.nCompatMaps);
swaps(&rep.nCompatMaps,n); swaps(&rep.nSymbols);
swaps(&rep.nSymbols,n); swaps(&rep.nGeometries);
swaps(&rep.nGeometries,n); swaps(&rep.extra);
swaps(&rep.extra,n);
} }
WriteToClient(client,SIZEOF(xkbListComponentsReply),(char *)&rep); WriteToClient(client,SIZEOF(xkbListComponentsReply),(char *)&rep);
if (list.nPool && list.pool) { if (list.nPool && list.pool) {
...@@ -5416,11 +5363,10 @@ ProcXkbGetKbdByName(ClientPtr client) ...@@ -5416,11 +5363,10 @@ ProcXkbGetKbdByName(ClientPtr client)
reported= rep.reported; reported= rep.reported;
if ( client->swapped ) { if ( client->swapped ) {
register int n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber,n); swapl(&rep.length);
swapl(&rep.length,n); swaps(&rep.found);
swaps(&rep.found,n); swaps(&rep.reported);
swaps(&rep.reported,n);
} }
WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), (char *)&rep);
if (reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask)) if (reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask))
...@@ -5606,13 +5552,12 @@ int length; ...@@ -5606,13 +5552,12 @@ int length;
wire.physIndicators= sli->physIndicators; wire.physIndicators= sli->physIndicators;
wire.state= sli->effectiveState; wire.state= sli->effectiveState;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&wire.ledClass);
swaps(&wire.ledClass,n); swaps(&wire.ledID);
swaps(&wire.ledID,n); swapl(&wire.namesPresent);
swapl(&wire.namesPresent,n); swapl(&wire.mapsPresent);
swapl(&wire.mapsPresent,n); swapl(&wire.physIndicators);
swapl(&wire.physIndicators,n); swapl(&wire.state);
swapl(&wire.state,n);
} }
WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc),(char *)&wire); WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc),(char *)&wire);
length+= SIZEOF(xkbDeviceLedsWireDesc); length+= SIZEOF(xkbDeviceLedsWireDesc);
...@@ -5624,8 +5569,7 @@ int length; ...@@ -5624,8 +5569,7 @@ int length;
if (sli->namesPresent&bit) { if (sli->namesPresent&bit) {
awire= (CARD32)sli->names[i]; awire= (CARD32)sli->names[i];
if (client->swapped) { if (client->swapped) {
register int n; swapl(&awire);
swapl(&awire,n);
} }
WriteToClient(client,4,(char *)&awire); WriteToClient(client,4,(char *)&awire);
length+= 4; length+= 4;
...@@ -5645,9 +5589,8 @@ int length; ...@@ -5645,9 +5589,8 @@ int length;
iwire.virtualMods= sli->maps[i].mods.vmods; iwire.virtualMods= sli->maps[i].mods.vmods;
iwire.ctrls= sli->maps[i].ctrls; iwire.ctrls= sli->maps[i].ctrls;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&iwire.virtualMods);
swaps(&iwire.virtualMods,n); swapl(&iwire.ctrls);
swapl(&iwire.ctrls,n);
} }
WriteToClient(client,SIZEOF(xkbIndicatorMapWireDesc), WriteToClient(client,SIZEOF(xkbIndicatorMapWireDesc),
(char *)&iwire); (char *)&iwire);
...@@ -5802,14 +5745,16 @@ char * str; ...@@ -5802,14 +5745,16 @@ char * str;
supported= rep.supported; supported= rep.supported;
nDeviceLedFBs = rep.nDeviceLedFBs; nDeviceLedFBs = rep.nDeviceLedFBs;
if (client->swapped) { if (client->swapped) {
register int n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber,n); swapl(&rep.length);
swapl(&rep.length,n); swaps(&rep.present);
swaps(&rep.present,n); swaps(&rep.supported);
swaps(&rep.supported,n); swaps(&rep.unsupported);
swaps(&rep.unsupported,n); swaps(&rep.nDeviceLedFBs);
swaps(&rep.nDeviceLedFBs,n);
swapl(&rep.type,n); // FIXME: rep.type here is an Atom... this might go terribly wrong...
swapl((int *)&rep.type);
} }
WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep);
...@@ -5871,12 +5816,11 @@ XkbSrvLedInfoPtr sli; ...@@ -5871,12 +5816,11 @@ XkbSrvLedInfoPtr sli;
ledWire= (xkbDeviceLedsWireDesc *)wire; ledWire= (xkbDeviceLedsWireDesc *)wire;
for (i=0;i<num;i++) { for (i=0;i<num;i++) {
if (client->swapped) { if (client->swapped) {
register int n; swaps(&ledWire->ledClass);
swaps(&ledWire->ledClass,n); swaps(&ledWire->ledID);
swaps(&ledWire->ledID,n); swapl(&ledWire->namesPresent);
swapl(&ledWire->namesPresent,n); swapl(&ledWire->mapsPresent);
swapl(&ledWire->mapsPresent,n); swapl(&ledWire->physIndicators);
swapl(&ledWire->physIndicators,n);
} }
sli= XkbFindSrvLedInfo(dev,ledWire->ledClass,ledWire->ledID, sli= XkbFindSrvLedInfo(dev,ledWire->ledClass,ledWire->ledID,
...@@ -5899,8 +5843,7 @@ XkbSrvLedInfoPtr sli; ...@@ -5899,8 +5843,7 @@ XkbSrvLedInfoPtr sli;
if (nNames>0) { if (nNames>0) {
for (n=0;n<nNames;n++) { for (n=0;n<nNames;n++) {
if (client->swapped) { if (client->swapped) {
register int t; swapl(atomWire);
swapl(atomWire,t);
} }
CHK_ATOM_OR_NONE3(((Atom)(*atomWire)),client->errorValue, CHK_ATOM_OR_NONE3(((Atom)(*atomWire)),client->errorValue,
*status_rtrn,NULL); *status_rtrn,NULL);
...@@ -5911,9 +5854,8 @@ XkbSrvLedInfoPtr sli; ...@@ -5911,9 +5854,8 @@ XkbSrvLedInfoPtr sli;
if (nMaps>0) { if (nMaps>0) {
for (n=0;n<nMaps;n++) { for (n=0;n<nMaps;n++) {
if (client->swapped) { if (client->swapped) {
register int t; swaps(&mapWire->virtualMods);
swaps(&mapWire->virtualMods,t); swapl(&mapWire->ctrls);
swapl(&mapWire->ctrls,t);
} }
CHK_MASK_LEGAL3(0x21,mapWire->whichGroups, CHK_MASK_LEGAL3(0x21,mapWire->whichGroups,
XkbIM_UseAnyGroup, XkbIM_UseAnyGroup,
...@@ -6165,12 +6107,11 @@ xkbSetDebuggingFlagsReply rep; ...@@ -6165,12 +6107,11 @@ xkbSetDebuggingFlagsReply rep;
rep.supportedFlags = ~0; rep.supportedFlags = ~0;
rep.supportedCtrls = ~0; rep.supportedCtrls = ~0;
if ( client->swapped ) { if ( client->swapped ) {
register int n; swaps(&rep.sequenceNumber);
swaps(&rep.sequenceNumber, n); swapl(&rep.currentFlags);
swapl(&rep.currentFlags, n); swapl(&rep.currentCtrls);
swapl(&rep.currentCtrls, n); swapl(&rep.supportedFlags);
swapl(&rep.supportedFlags, n); swapl(&rep.supportedCtrls);
swapl(&rep.supportedCtrls, n);
} }
WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep); WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep);
return client->noClientException; return client->noClientException;
......
...@@ -67,10 +67,9 @@ CARD16 changed; ...@@ -67,10 +67,9 @@ CARD16 changed;
pNKN->time = time; pNKN->time = time;
pNKN->changed = changed; pNKN->changed = changed;
if ( clients[i]->swapped ) { if ( clients[i]->swapped ) {
register int n; swaps(&pNKN->sequenceNumber);
swaps(&pNKN->sequenceNumber,n); swapl(&pNKN->time);
swapl(&pNKN->time,n); swaps(&pNKN->changed);
swaps(&pNKN->changed,n);
} }
WriteToClient(clients[i],sizeof(xEvent),(char *)pNKN); WriteToClient(clients[i],sizeof(xEvent),(char *)pNKN);
if (changed&XkbNKN_KeycodesMask) { if (changed&XkbNKN_KeycodesMask) {
...@@ -87,8 +86,7 @@ CARD16 changed; ...@@ -87,8 +86,7 @@ CARD16 changed;
event.u.mappingNotify.count= clients[i]->maxKC-clients[i]->minKC+1; event.u.mappingNotify.count= clients[i]->maxKC-clients[i]->minKC+1;
event.u.u.sequenceNumber= clients[i]->sequence; event.u.u.sequenceNumber= clients[i]->sequence;
if (clients[i]->swapped) { if (clients[i]->swapped) {
int n; swaps(&event.u.u.sequenceNumber);
swaps(&event.u.u.sequenceNumber,n);
} }
WriteToClient(clients[i],SIZEOF(xEvent), (char *)&event); WriteToClient(clients[i],SIZEOF(xEvent), (char *)&event);
event.u.mappingNotify.request= MappingModifier; event.u.mappingNotify.request= MappingModifier;
...@@ -146,11 +144,10 @@ register CARD16 changed,bState; ...@@ -146,11 +144,10 @@ register CARD16 changed,bState;
pSN->changed = changed; pSN->changed = changed;
pSN->ptrBtnState = bState; pSN->ptrBtnState = bState;
if ( interest->client->swapped ) { if ( interest->client->swapped ) {
register int n; swaps(&pSN->sequenceNumber);
swaps(&pSN->sequenceNumber,n); swapl(&pSN->time);
swapl(&pSN->time,n); swaps(&pSN->changed);
swaps(&pSN->changed,n); swaps(&pSN->ptrBtnState);
swaps(&pSN->ptrBtnState,n);
} }
WriteToClient(interest->client, sizeof(xEvent), (char *)pSN); WriteToClient(interest->client, sizeof(xEvent), (char *)pSN);
} }
...@@ -192,10 +189,9 @@ CARD16 changed; ...@@ -192,10 +189,9 @@ CARD16 changed;
pMN->sequenceNumber = clients[i]->sequence; pMN->sequenceNumber = clients[i]->sequence;
pMN->changed = changed; pMN->changed = changed;
if ( clients[i]->swapped ) { if ( clients[i]->swapped ) {
register int n; swaps(&pMN->sequenceNumber);
swaps(&pMN->sequenceNumber,n); swapl(&pMN->time);
swapl(&pMN->time,n); swaps(&pMN->changed);
swaps(&pMN->changed,n);
} }
WriteToClient(clients[i],sizeof(xEvent),(char *)pMN); WriteToClient(clients[i],sizeof(xEvent),(char *)pMN);
} }
...@@ -315,12 +311,11 @@ Time time = 0; ...@@ -315,12 +311,11 @@ Time time = 0;
pCN->sequenceNumber = interest->client->sequence; pCN->sequenceNumber = interest->client->sequence;
pCN->time = time; pCN->time = time;
if ( interest->client->swapped ) { if ( interest->client->swapped ) {
register int n; swaps(&pCN->sequenceNumber);
swaps(&pCN->sequenceNumber,n); swapl(&pCN->changedControls);
swapl(&pCN->changedControls,n); swapl(&pCN->enabledControls);
swapl(&pCN->enabledControls,n); swapl(&pCN->enabledControlChanges);
swapl(&pCN->enabledControlChanges,n); swapl(&pCN->time);
swapl(&pCN->time,n);
} }
WriteToClient(interest->client, sizeof(xEvent), (char *)pCN); WriteToClient(interest->client, sizeof(xEvent), (char *)pCN);
} }
...@@ -364,11 +359,10 @@ CARD32 state,changed; ...@@ -364,11 +359,10 @@ CARD32 state,changed;
pEv->changed = changed; pEv->changed = changed;
pEv->state = state; pEv->state = state;
if ( interest->client->swapped ) { if ( interest->client->swapped ) {
register int n; swaps(&pEv->sequenceNumber);
swaps(&pEv->sequenceNumber,n); swapl(&pEv->time);
swapl(&pEv->time,n); swapl(&pEv->changed);
swapl(&pEv->changed,n); swapl(&pEv->state);
swapl(&pEv->state,n);
} }
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
} }
...@@ -447,13 +441,12 @@ XID winID = 0; ...@@ -447,13 +441,12 @@ XID winID = 0;
bn.name = name; bn.name = name;
bn.window= winID; bn.window= winID;
if ( interest->client->swapped ) { if ( interest->client->swapped ) {
register int n; swaps(&bn.sequenceNumber);
swaps(&bn.sequenceNumber,n); swapl(&bn.time);
swapl(&bn.time,n); swaps(&bn.pitch);
swaps(&bn.pitch,n); swaps(&bn.duration);
swaps(&bn.duration,n); swapl(&bn.name);
swapl(&bn.name,n); swapl(&bn.window);
swapl(&bn.window,n);
} }
WriteToClient(interest->client, sizeof(xEvent), (char *)&bn); WriteToClient(interest->client, sizeof(xEvent), (char *)&bn);
} }
...@@ -494,11 +487,10 @@ CARD16 sk_delay,db_delay; ...@@ -494,11 +487,10 @@ CARD16 sk_delay,db_delay;
pEv->slowKeysDelay = sk_delay; pEv->slowKeysDelay = sk_delay;
pEv->debounceDelay = db_delay; pEv->debounceDelay = db_delay;
if ( interest->client->swapped ) { if ( interest->client->swapped ) {
register int n; swaps(&pEv->sequenceNumber);
swaps(&pEv->sequenceNumber,n); swapl(&pEv->time);
swapl(&pEv->time,n); swaps(&pEv->slowKeysDelay);
swaps(&pEv->slowKeysDelay,n); swaps(&pEv->debounceDelay);
swaps(&pEv->debounceDelay,n);
} }
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
} }
...@@ -542,12 +534,11 @@ CARD32 changedIndicators; ...@@ -542,12 +534,11 @@ CARD32 changedIndicators;
pEv->changedIndicators = changedIndicators; pEv->changedIndicators = changedIndicators;
pEv->changedVirtualMods= changedVirtualMods; pEv->changedVirtualMods= changedVirtualMods;
if ( interest->client->swapped ) { if ( interest->client->swapped ) {
register int n; swaps(&pEv->sequenceNumber);
swaps(&pEv->sequenceNumber,n); swapl(&pEv->time);
swapl(&pEv->time,n); swaps(&pEv->changed);
swaps(&pEv->changed,n); swapl(&pEv->changedIndicators);
swapl(&pEv->changedIndicators,n); swaps(&pEv->changedVirtualMods);
swaps(&pEv->changedVirtualMods,n);
} }
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
} }
...@@ -590,12 +581,11 @@ CARD16 firstSI = 0, nSI = 0, nTotalSI = 0; ...@@ -590,12 +581,11 @@ CARD16 firstSI = 0, nSI = 0, nTotalSI = 0;
pEv->nSI = nSI; pEv->nSI = nSI;
pEv->nTotalSI = nTotalSI; pEv->nTotalSI = nTotalSI;
if ( interest->client->swapped ) { if ( interest->client->swapped ) {
register int n; swaps(&pEv->sequenceNumber);
swaps(&pEv->sequenceNumber,n); swapl(&pEv->time);
swapl(&pEv->time,n); swaps(&pEv->firstSI);
swaps(&pEv->firstSI,n); swaps(&pEv->nSI);
swaps(&pEv->nSI,n); swaps(&pEv->nTotalSI);
swaps(&pEv->nTotalSI,n);
} }
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
} }
...@@ -636,9 +626,8 @@ Time time = 0; ...@@ -636,9 +626,8 @@ Time time = 0;
pEv->sequenceNumber = interest->client->sequence; pEv->sequenceNumber = interest->client->sequence;
pEv->time = time; pEv->time = time;
if ( interest->client->swapped ) { if ( interest->client->swapped ) {
register int n; swaps(&pEv->sequenceNumber);
swaps(&pEv->sequenceNumber,n); swapl(&pEv->time);
swapl(&pEv->time,n);
} }
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
} }
...@@ -696,13 +685,12 @@ CARD16 reason, supported = 0; ...@@ -696,13 +685,12 @@ CARD16 reason, supported = 0;
continue; continue;
} }
if ( interest->client->swapped ) { if ( interest->client->swapped ) {
register int n; swaps(&pEv->sequenceNumber);
swaps(&pEv->sequenceNumber,n); swapl(&pEv->time);
swapl(&pEv->time,n); swapl(&pEv->ledsDefined);
swapl(&pEv->ledsDefined,n); swapl(&pEv->ledState);
swapl(&pEv->ledState,n); swaps(&pEv->reason);
swaps(&pEv->reason,n); swaps(&pEv->supported);
swaps(&pEv->supported,n);
} }
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
} }
......
...@@ -48,32 +48,30 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -48,32 +48,30 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
static int static int
SProcXkbUseExtension(ClientPtr client) SProcXkbUseExtension(ClientPtr client)
{ {
register int n;
REQUEST(xkbUseExtensionReq); REQUEST(xkbUseExtensionReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbUseExtensionReq); REQUEST_SIZE_MATCH(xkbUseExtensionReq);
swaps(&stuff->wantedMajor,n); swaps(&stuff->wantedMajor);
swaps(&stuff->wantedMinor,n); swaps(&stuff->wantedMinor);
return ProcXkbUseExtension(client); return ProcXkbUseExtension(client);
} }
static int static int
SProcXkbSelectEvents(ClientPtr client) SProcXkbSelectEvents(ClientPtr client)
{ {
register int n;
REQUEST(xkbSelectEventsReq); REQUEST(xkbSelectEventsReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq); REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->affectWhich,n); swaps(&stuff->affectWhich);
swaps(&stuff->clear,n); swaps(&stuff->clear);
swaps(&stuff->selectAll,n); swaps(&stuff->selectAll);
swaps(&stuff->affectMap,n); swaps(&stuff->affectMap);
swaps(&stuff->map,n); swaps(&stuff->map);
if ((stuff->affectWhich&(~XkbMapNotifyMask))!=0) { if ((stuff->affectWhich&(~XkbMapNotifyMask))!=0) {
union { union {
BOOL *b; BOOL *b;
...@@ -117,12 +115,12 @@ register int n; ...@@ -117,12 +115,12 @@ register int n;
if (dataLeft<(size*2)) if (dataLeft<(size*2))
return BadLength; return BadLength;
if (size==2) { if (size==2) {
swaps(&from.c16[0],n); swaps(&from.c16[0]);
swaps(&from.c16[1],n); swaps(&from.c16[1]);
} }
else if (size==4) { else if (size==4) {
swapl(&from.c32[0],n); swapl(&from.c32[0]);
swapl(&from.c32[1],n); swapl(&from.c32[1]);
} }
else { else {
size= 2; size= 2;
...@@ -141,128 +139,114 @@ register int n; ...@@ -141,128 +139,114 @@ register int n;
static int static int
SProcXkbBell(ClientPtr client) SProcXkbBell(ClientPtr client)
{ {
register int n;
REQUEST(xkbBellReq); REQUEST(xkbBellReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbBellReq); REQUEST_SIZE_MATCH(xkbBellReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->bellClass,n); swaps(&stuff->bellClass);
swaps(&stuff->bellID,n); swaps(&stuff->bellID);
swapl(&stuff->name,n); swapl(&stuff->name);
swapl(&stuff->window,n); swapl(&stuff->window);
swaps(&stuff->pitch,n); swaps(&stuff->pitch);
swaps(&stuff->duration,n); swaps(&stuff->duration);
return ProcXkbBell(client); return ProcXkbBell(client);
} }
static int static int
SProcXkbGetState(ClientPtr client) SProcXkbGetState(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetStateReq); REQUEST(xkbGetStateReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetStateReq); REQUEST_SIZE_MATCH(xkbGetStateReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
return ProcXkbGetState(client); return ProcXkbGetState(client);
} }
static int static int
SProcXkbLatchLockState(ClientPtr client) SProcXkbLatchLockState(ClientPtr client)
{ {
register int n;
REQUEST(xkbLatchLockStateReq); REQUEST(xkbLatchLockStateReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbLatchLockStateReq); REQUEST_SIZE_MATCH(xkbLatchLockStateReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->groupLatch,n); swaps(&stuff->groupLatch);
return ProcXkbLatchLockState(client); return ProcXkbLatchLockState(client);
} }
static int static int
SProcXkbGetControls(ClientPtr client) SProcXkbGetControls(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetControlsReq); REQUEST(xkbGetControlsReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetControlsReq); REQUEST_SIZE_MATCH(xkbGetControlsReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
return ProcXkbGetControls(client); return ProcXkbGetControls(client);
} }
static int static int
SProcXkbSetControls(ClientPtr client) SProcXkbSetControls(ClientPtr client)
{ {
register int n;
REQUEST(xkbSetControlsReq); REQUEST(xkbSetControlsReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbSetControlsReq); REQUEST_SIZE_MATCH(xkbSetControlsReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->affectInternalVMods,n); swaps(&stuff->affectInternalVMods);
swaps(&stuff->internalVMods,n); swaps(&stuff->internalVMods);
swaps(&stuff->affectIgnoreLockVMods,n); swaps(&stuff->affectIgnoreLockVMods);
swaps(&stuff->ignoreLockVMods,n); swaps(&stuff->ignoreLockVMods);
swaps(&stuff->axOptions,n); swaps(&stuff->axOptions);
swapl(&stuff->affectEnabledCtrls,n); swapl(&stuff->affectEnabledCtrls);
swapl(&stuff->enabledCtrls,n); swapl(&stuff->enabledCtrls);
swapl(&stuff->changeCtrls,n); swapl(&stuff->changeCtrls);
swaps(&stuff->repeatDelay,n); swaps(&stuff->repeatDelay);
swaps(&stuff->repeatInterval,n); swaps(&stuff->repeatInterval);
swaps(&stuff->slowKeysDelay,n); swaps(&stuff->slowKeysDelay);
swaps(&stuff->debounceDelay,n); swaps(&stuff->debounceDelay);
swaps(&stuff->mkDelay,n); swaps(&stuff->mkDelay);
swaps(&stuff->mkInterval,n); swaps(&stuff->mkInterval);
swaps(&stuff->mkTimeToMax,n); swaps(&stuff->mkTimeToMax);
swaps(&stuff->mkMaxSpeed,n); swaps(&stuff->mkMaxSpeed);
swaps(&stuff->mkCurve,n); swaps(&stuff->mkCurve);
swaps(&stuff->axTimeout,n); swaps(&stuff->axTimeout);
swapl(&stuff->axtCtrlsMask,n); swapl(&stuff->axtCtrlsMask);
swapl(&stuff->axtCtrlsValues,n); swapl(&stuff->axtCtrlsValues);
swaps(&stuff->axtOptsMask,n); swaps(&stuff->axtOptsMask);
swaps(&stuff->axtOptsValues,n); swaps(&stuff->axtOptsValues);
return ProcXkbSetControls(client); return ProcXkbSetControls(client);
} }
static int static int
SProcXkbGetMap(ClientPtr client) SProcXkbGetMap(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetMapReq); REQUEST(xkbGetMapReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetMapReq); REQUEST_SIZE_MATCH(xkbGetMapReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->full,n); swaps(&stuff->full);
swaps(&stuff->partial,n); swaps(&stuff->partial);
swaps(&stuff->virtualMods,n); swaps(&stuff->virtualMods);
return ProcXkbGetMap(client); return ProcXkbGetMap(client);
} }
static int static int
SProcXkbSetMap(ClientPtr client) SProcXkbSetMap(ClientPtr client)
{ {
register int n;
REQUEST(xkbSetMapReq); REQUEST(xkbSetMapReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetMapReq); REQUEST_AT_LEAST_SIZE(xkbSetMapReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->present,n); swaps(&stuff->present);
swaps(&stuff->flags,n); swaps(&stuff->flags);
swaps(&stuff->totalSyms,n); swaps(&stuff->totalSyms);
swaps(&stuff->totalActs,n); swaps(&stuff->totalActs);
swaps(&stuff->virtualMods,n); swaps(&stuff->virtualMods);
return ProcXkbSetMap(client); return ProcXkbSetMap(client);
} }
...@@ -270,105 +254,91 @@ register int n; ...@@ -270,105 +254,91 @@ register int n;
static int static int
SProcXkbGetCompatMap(ClientPtr client) SProcXkbGetCompatMap(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetCompatMapReq); REQUEST(xkbGetCompatMapReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetCompatMapReq); REQUEST_SIZE_MATCH(xkbGetCompatMapReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->firstSI,n); swaps(&stuff->firstSI);
swaps(&stuff->nSI,n); swaps(&stuff->nSI);
return ProcXkbGetCompatMap(client); return ProcXkbGetCompatMap(client);
} }
static int static int
SProcXkbSetCompatMap(ClientPtr client) SProcXkbSetCompatMap(ClientPtr client)
{ {
register int n;
REQUEST(xkbSetCompatMapReq); REQUEST(xkbSetCompatMapReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq); REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->firstSI,n); swaps(&stuff->firstSI);
swaps(&stuff->nSI,n); swaps(&stuff->nSI);
return ProcXkbSetCompatMap(client); return ProcXkbSetCompatMap(client);
} }
static int static int
SProcXkbGetIndicatorState(ClientPtr client) SProcXkbGetIndicatorState(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetIndicatorStateReq); REQUEST(xkbGetIndicatorStateReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
return ProcXkbGetIndicatorState(client); return ProcXkbGetIndicatorState(client);
} }
static int static int
SProcXkbGetIndicatorMap(ClientPtr client) SProcXkbGetIndicatorMap(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetIndicatorMapReq); REQUEST(xkbGetIndicatorMapReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq); REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swapl(&stuff->which,n); swapl(&stuff->which);
return ProcXkbGetIndicatorMap(client); return ProcXkbGetIndicatorMap(client);
} }
static int static int
SProcXkbSetIndicatorMap(ClientPtr client) SProcXkbSetIndicatorMap(ClientPtr client)
{ {
register int n;
REQUEST(xkbSetIndicatorMapReq); REQUEST(xkbSetIndicatorMapReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq); REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swapl(&stuff->which,n); swapl(&stuff->which);
return ProcXkbSetIndicatorMap(client); return ProcXkbSetIndicatorMap(client);
} }
static int static int
SProcXkbGetNamedIndicator(ClientPtr client) SProcXkbGetNamedIndicator(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetNamedIndicatorReq); REQUEST(xkbGetNamedIndicatorReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->ledClass,n); swaps(&stuff->ledClass);
swaps(&stuff->ledID,n); swaps(&stuff->ledID);
swapl(&stuff->indicator,n); swapl(&stuff->indicator);
return ProcXkbGetNamedIndicator(client); return ProcXkbGetNamedIndicator(client);
} }
static int static int
SProcXkbSetNamedIndicator(ClientPtr client) SProcXkbSetNamedIndicator(ClientPtr client)
{ {
register int n;
REQUEST(xkbSetNamedIndicatorReq); REQUEST(xkbSetNamedIndicatorReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->ledClass,n); swaps(&stuff->ledClass);
swaps(&stuff->ledID,n); swaps(&stuff->ledID);
swapl(&stuff->indicator,n); swapl(&stuff->indicator);
swaps(&stuff->virtualMods,n); swaps(&stuff->virtualMods);
swapl(&stuff->ctrls,n); swapl(&stuff->ctrls);
return ProcXkbSetNamedIndicator(client); return ProcXkbSetNamedIndicator(client);
} }
...@@ -376,160 +346,140 @@ register int n; ...@@ -376,160 +346,140 @@ register int n;
static int static int
SProcXkbGetNames(ClientPtr client) SProcXkbGetNames(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetNamesReq); REQUEST(xkbGetNamesReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetNamesReq); REQUEST_SIZE_MATCH(xkbGetNamesReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swapl(&stuff->which,n); swapl(&stuff->which);
return ProcXkbGetNames(client); return ProcXkbGetNames(client);
} }
static int static int
SProcXkbSetNames(ClientPtr client) SProcXkbSetNames(ClientPtr client)
{ {
register int n;
REQUEST(xkbSetNamesReq); REQUEST(xkbSetNamesReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetNamesReq); REQUEST_AT_LEAST_SIZE(xkbSetNamesReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->virtualMods,n); swaps(&stuff->virtualMods);
swapl(&stuff->which,n); swapl(&stuff->which);
swapl(&stuff->indicators,n); swapl(&stuff->indicators);
swaps(&stuff->totalKTLevelNames,n); swaps(&stuff->totalKTLevelNames);
return ProcXkbSetNames(client); return ProcXkbSetNames(client);
} }
static int static int
SProcXkbGetGeometry(ClientPtr client) SProcXkbGetGeometry(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetGeometryReq); REQUEST(xkbGetGeometryReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetGeometryReq); REQUEST_SIZE_MATCH(xkbGetGeometryReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swapl(&stuff->name,n); swapl(&stuff->name);
return ProcXkbGetGeometry(client); return ProcXkbGetGeometry(client);
} }
static int static int
SProcXkbSetGeometry(ClientPtr client) SProcXkbSetGeometry(ClientPtr client)
{ {
register int n;
REQUEST(xkbSetGeometryReq); REQUEST(xkbSetGeometryReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq); REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swapl(&stuff->name,n); swapl(&stuff->name);
swaps(&stuff->widthMM,n); swaps(&stuff->widthMM);
swaps(&stuff->heightMM,n); swaps(&stuff->heightMM);
swaps(&stuff->nProperties,n); swaps(&stuff->nProperties);
swaps(&stuff->nColors,n); swaps(&stuff->nColors);
swaps(&stuff->nDoodads,n); swaps(&stuff->nDoodads);
swaps(&stuff->nKeyAliases,n); swaps(&stuff->nKeyAliases);
return ProcXkbSetGeometry(client); return ProcXkbSetGeometry(client);
} }
static int static int
SProcXkbPerClientFlags(ClientPtr client) SProcXkbPerClientFlags(ClientPtr client)
{ {
register int n;
REQUEST(xkbPerClientFlagsReq); REQUEST(xkbPerClientFlagsReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbPerClientFlagsReq); REQUEST_SIZE_MATCH(xkbPerClientFlagsReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swapl(&stuff->change,n); swapl(&stuff->change);
swapl(&stuff->value,n); swapl(&stuff->value);
swapl(&stuff->ctrlsToChange,n); swapl(&stuff->ctrlsToChange);
swapl(&stuff->autoCtrls,n); swapl(&stuff->autoCtrls);
swapl(&stuff->autoCtrlValues,n); swapl(&stuff->autoCtrlValues);
return ProcXkbPerClientFlags(client); return ProcXkbPerClientFlags(client);
} }
static int static int
SProcXkbListComponents(ClientPtr client) SProcXkbListComponents(ClientPtr client)
{ {
register int n;
REQUEST(xkbListComponentsReq); REQUEST(xkbListComponentsReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbListComponentsReq); REQUEST_AT_LEAST_SIZE(xkbListComponentsReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->maxNames,n); swaps(&stuff->maxNames);
return ProcXkbListComponents(client); return ProcXkbListComponents(client);
} }
static int static int
SProcXkbGetKbdByName(ClientPtr client) SProcXkbGetKbdByName(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetKbdByNameReq); REQUEST(xkbGetKbdByNameReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq); REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->want,n); swaps(&stuff->want);
swaps(&stuff->need,n); swaps(&stuff->need);
return ProcXkbGetKbdByName(client); return ProcXkbGetKbdByName(client);
} }
static int static int
SProcXkbGetDeviceInfo(ClientPtr client) SProcXkbGetDeviceInfo(ClientPtr client)
{ {
register int n;
REQUEST(xkbGetDeviceInfoReq); REQUEST(xkbGetDeviceInfoReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->wanted,n); swaps(&stuff->wanted);
swaps(&stuff->ledClass,n); swaps(&stuff->ledClass);
swaps(&stuff->ledID,n); swaps(&stuff->ledID);
return ProcXkbGetDeviceInfo(client); return ProcXkbGetDeviceInfo(client);
} }
static int static int
SProcXkbSetDeviceInfo(ClientPtr client) SProcXkbSetDeviceInfo(ClientPtr client)
{ {
register int n;
REQUEST(xkbSetDeviceInfoReq); REQUEST(xkbSetDeviceInfoReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq); REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq);
swaps(&stuff->deviceSpec,n); swaps(&stuff->deviceSpec);
swaps(&stuff->change,n); swaps(&stuff->change);
swaps(&stuff->nDeviceLedFBs,n); swaps(&stuff->nDeviceLedFBs);
return ProcXkbSetDeviceInfo(client); return ProcXkbSetDeviceInfo(client);
} }
static int static int
SProcXkbSetDebuggingFlags(ClientPtr client) SProcXkbSetDebuggingFlags(ClientPtr client)
{ {
register int n;
REQUEST(xkbSetDebuggingFlagsReq); REQUEST(xkbSetDebuggingFlagsReq);
swaps(&stuff->length,n); swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq); REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
swapl(&stuff->affectFlags,n); swapl(&stuff->affectFlags);
swapl(&stuff->flags,n); swapl(&stuff->flags);
swapl(&stuff->affectCtrls,n); swapl(&stuff->affectCtrls);
swapl(&stuff->ctrls,n); swapl(&stuff->ctrls);
swaps(&stuff->msgLength,n); swaps(&stuff->msgLength);
return ProcXkbSetDebuggingFlags(client); return ProcXkbSetDebuggingFlags(client);
} }
......
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