Unverified Commit 27b0b572 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'sunweaver-pr/type-safe-swapping' into 3.6.x

Attributes GH PR #167: https://github.com/ArcticaProject/nx-libs/pull/167 Reviewed by: Vadim Troshchinskiy <vadim@qindel.com> -- Mon, 04 Jul 2016 07:31:50 -0700
parents d1d859df 286d8326
...@@ -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);
} }
......
...@@ -490,9 +490,9 @@ SScreenSaverNotifyEvent (from, to) ...@@ -490,9 +490,9 @@ SScreenSaverNotifyEvent (from, to)
to->type = from->type; to->type = from->type;
to->state = from->state; to->state = from->state;
cpswaps (from->sequenceNumber, to->sequenceNumber); cpswaps (from->sequenceNumber, to->sequenceNumber);
cpswapl (from->timestamp, to->timestamp); cpswapl (from->timestamp, to->timestamp);
cpswapl (from->root, to->root); cpswapl (from->root, to->root);
cpswapl (from->window, to->window); cpswapl (from->window, to->window);
to->kind = from->kind; to->kind = from->kind;
to->forced = from->forced; to->forced = from->forced;
} }
...@@ -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);
...@@ -180,7 +178,7 @@ ProcXTestFakeInput(client) ...@@ -180,7 +178,7 @@ ProcXTestFakeInput(client)
{ {
REQUEST(xXTestFakeInputReq); REQUEST(xXTestFakeInputReq);
int nev; int nev;
int n; int n;
xEvent *ev; xEvent *ev;
DeviceIntPtr dev = NULL; DeviceIntPtr dev = NULL;
WindowPtr root; WindowPtr root;
...@@ -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
*/ */
......
...@@ -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, n); swaps(&stuff->length);
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);
swaps(&stuff->length, n);
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);
......
...@@ -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) {
......
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