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)
{
REQUEST(xBigReqEnableReq);
xBigReqEnableReply rep;
register int n;
if (client->swapped) {
swaps(&stuff->length, n);
swaps(&stuff->length);
}
if (stuff->brReqType != X_BigReqEnable)
return BadRequest;
......@@ -100,8 +99,8 @@ ProcBigReqDispatch (client)
rep.sequenceNumber = client->sequence;
rep.max_request_size = maxBigRequestSize;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.max_request_size, n);
swaps(&rep.sequenceNumber);
swapl(&rep.max_request_size);
}
WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
return(client->noClientException);
......
......@@ -105,7 +105,6 @@ ProcDPMSGetVersion(client)
{
/* REQUEST(xDPMSGetVersionReq); */
xDPMSGetVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
......@@ -115,9 +114,9 @@ ProcDPMSGetVersion(client)
rep.majorVersion = DPMSMajorVersion;
rep.minorVersion = DPMSMinorVersion;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swaps(&rep.majorVersion, n);
swaps(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep);
return(client->noClientException);
......@@ -128,7 +127,6 @@ ProcDPMSCapable(register ClientPtr client)
{
/* REQUEST(xDPMSCapableReq); */
xDPMSCapableReply rep;
register int n;
REQUEST_SIZE_MATCH(xDPMSCapableReq);
......@@ -138,7 +136,7 @@ ProcDPMSCapable(register ClientPtr client)
rep.capable = DPMSCapableFlag;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep);
return(client->noClientException);
......@@ -150,7 +148,6 @@ ProcDPMSGetTimeouts(client)
{
/* REQUEST(xDPMSGetTimeoutsReq); */
xDPMSGetTimeoutsReply rep;
register int n;
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
......@@ -162,10 +159,10 @@ ProcDPMSGetTimeouts(client)
rep.off = DPMSOffTime / MILLI_PER_SECOND;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swaps(&rep.standby, n);
swaps(&rep.suspend, n);
swaps(&rep.off, n);
swaps(&rep.sequenceNumber);
swaps(&rep.standby);
swaps(&rep.suspend);
swaps(&rep.off);
}
WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep);
return(client->noClientException);
......@@ -265,7 +262,6 @@ ProcDPMSInfo(register ClientPtr client)
{
/* REQUEST(xDPMSInfoReq); */
xDPMSInfoReply rep;
register int n;
REQUEST_SIZE_MATCH(xDPMSInfoReq);
......@@ -276,8 +272,8 @@ ProcDPMSInfo(register ClientPtr client)
rep.state = DPMSEnabled;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swaps(&rep.power_level, n);
swaps(&rep.sequenceNumber);
swaps(&rep.power_level);
}
WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep);
return(client->noClientException);
......@@ -316,13 +312,12 @@ static int
SProcDPMSGetVersion(client)
register ClientPtr client;
{
register int n;
REQUEST(xDPMSGetVersionReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
swaps(&stuff->majorVersion, n);
swaps(&stuff->minorVersion, n);
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
return ProcDPMSGetVersion(client);
}
......@@ -330,9 +325,8 @@ static int
SProcDPMSCapable(register ClientPtr client)
{
REQUEST(xDPMSCapableReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSCapableReq);
return ProcDPMSCapable(client);
......@@ -343,9 +337,8 @@ SProcDPMSGetTimeouts(client)
register ClientPtr client;
{
REQUEST(xDPMSGetTimeoutsReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
return ProcDPMSGetTimeouts(client);
......@@ -356,14 +349,13 @@ SProcDPMSSetTimeouts(client)
register ClientPtr client;
{
REQUEST(xDPMSSetTimeoutsReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
swaps(&stuff->standby, n);
swaps(&stuff->suspend, n);
swaps(&stuff->off, n);
swaps(&stuff->standby);
swaps(&stuff->suspend);
swaps(&stuff->off);
return ProcDPMSSetTimeouts(client);
}
......@@ -372,9 +364,8 @@ SProcDPMSEnable(client)
register ClientPtr client;
{
REQUEST(xDPMSEnableReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSEnableReq);
return ProcDPMSEnable(client);
......@@ -385,9 +376,8 @@ SProcDPMSDisable(client)
register ClientPtr client;
{
REQUEST(xDPMSDisableReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSDisableReq);
return ProcDPMSDisable(client);
......@@ -398,12 +388,11 @@ SProcDPMSForceLevel(client)
register ClientPtr client;
{
REQUEST(xDPMSForceLevelReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
swaps(&stuff->level, n);
swaps(&stuff->level);
return ProcDPMSForceLevel(client);
}
......@@ -413,9 +402,8 @@ SProcDPMSInfo(client)
register ClientPtr client;
{
REQUEST(xDPMSInfoReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSInfoReq);
return ProcDPMSInfo(client);
......
......@@ -936,7 +936,6 @@ ProcPanoramiXQueryVersion (ClientPtr client)
{
/* REQUEST(xPanoramiXQueryVersionReq); */
xPanoramiXQueryVersionReply rep;
register int n;
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
rep.type = X_Reply;
......@@ -945,10 +944,10 @@ ProcPanoramiXQueryVersion (ClientPtr client)
rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION;
rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.majorVersion, n);
swaps(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep);
return (client->noClientException);
......@@ -960,7 +959,6 @@ ProcPanoramiXGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq);
WindowPtr pWin;
xPanoramiXGetStateReply rep;
register int n;
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
pWin = LookupWindow (stuff->window, client);
......@@ -971,9 +969,9 @@ ProcPanoramiXGetState(ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.state = !noPanoramiXExtension;
if (client->swapped) {
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swaps (&rep.state, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl ((int* )&rep.state);
}
WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
return client->noClientException;
......@@ -986,7 +984,6 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
REQUEST(xPanoramiXGetScreenCountReq);
WindowPtr pWin;
xPanoramiXGetScreenCountReply rep;
register int n;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
pWin = LookupWindow (stuff->window, client);
......@@ -997,9 +994,9 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.ScreenCount = PanoramiXNumScreens;
if (client->swapped) {
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swaps (&rep.ScreenCount, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl ((int* )&rep.ScreenCount);
}
WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep);
return client->noClientException;
......@@ -1011,7 +1008,6 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
REQUEST(xPanoramiXGetScreenSizeReq);
WindowPtr pWin;
xPanoramiXGetScreenSizeReply rep;
register int n;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
pWin = LookupWindow (stuff->window, client);
......@@ -1024,10 +1020,10 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
rep.width = panoramiXdataPtr[stuff->screen].width;
rep.height = panoramiXdataPtr[stuff->screen].height;
if (client->swapped) {
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swaps (&rep.width, n);
swaps (&rep.height, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl (&rep.width);
swapl (&rep.height);
}
WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep);
return client->noClientException;
......@@ -1047,10 +1043,9 @@ ProcXineramaIsActive(ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.state = !noPanoramiXExtension;
if (client->swapped) {
register int n;
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.state, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl (&rep.state);
}
WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
return client->noClientException;
......@@ -1070,10 +1065,9 @@ ProcXineramaQueryScreens(ClientPtr client)
rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
rep.length = rep.number * sz_XineramaScreenInfo >> 2;
if (client->swapped) {
register int n;
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.number, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl (&rep.number);
}
WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
......@@ -1088,11 +1082,10 @@ ProcXineramaQueryScreens(ClientPtr client)
scratch.height = panoramiXdataPtr[i].height;
if(client->swapped) {
register int n;
swaps (&scratch.x_org, n);
swaps (&scratch.y_org, n);
swaps (&scratch.width, n);
swaps (&scratch.height, n);
swaps (&scratch.x_org);
swaps (&scratch.y_org);
swaps (&scratch.width);
swaps (&scratch.height);
}
WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
}
......
......@@ -57,9 +57,8 @@ static int
SProcPanoramiXQueryVersion (ClientPtr client)
{
REQUEST(xPanoramiXQueryVersionReq);
register int n;
swaps(&stuff->length,n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
return ProcPanoramiXQueryVersion(client);
}
......@@ -68,9 +67,8 @@ static int
SProcPanoramiXGetState(ClientPtr client)
{
REQUEST(xPanoramiXGetStateReq);
register int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
return ProcPanoramiXGetState(client);
}
......@@ -79,9 +77,8 @@ static int
SProcPanoramiXGetScreenCount(ClientPtr client)
{
REQUEST(xPanoramiXGetScreenCountReq);
register int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
return ProcPanoramiXGetScreenCount(client);
}
......@@ -90,9 +87,8 @@ static int
SProcPanoramiXGetScreenSize(ClientPtr client)
{
REQUEST(xPanoramiXGetScreenSizeReq);
register int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
return ProcPanoramiXGetScreenSize(client);
}
......@@ -102,9 +98,8 @@ static int
SProcXineramaIsActive(ClientPtr client)
{
REQUEST(xXineramaIsActiveReq);
register int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
return ProcXineramaIsActive(client);
}
......@@ -114,9 +109,8 @@ static int
SProcXineramaQueryScreens(ClientPtr client)
{
REQUEST(xXineramaQueryScreensReq);
register int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
return ProcXineramaQueryScreens(client);
}
......
......@@ -490,9 +490,9 @@ SScreenSaverNotifyEvent (from, to)
to->type = from->type;
to->state = from->state;
cpswaps (from->sequenceNumber, to->sequenceNumber);
cpswapl (from->timestamp, to->timestamp);
cpswapl (from->root, to->root);
cpswapl (from->window, to->window);
cpswapl (from->timestamp, to->timestamp);
cpswapl (from->root, to->root);
cpswapl (from->window, to->window);
to->kind = from->kind;
to->forced = from->forced;
}
......@@ -704,8 +704,8 @@ ProcScreenSaverQueryVersion (client)
rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep);
return (client->noClientException);
......@@ -772,12 +772,12 @@ ProcScreenSaverQueryInfo (client)
rep.kind = ScreenSaverInternal;
if (client->swapped)
{
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.window, n);
swapl (&rep.tilOrSince, n);
swapl (&rep.idle, n);
swapl (&rep.eventMask, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl (&rep.window);
swapl (&rep.tilOrSince);
swapl (&rep.idle);
swapl (&rep.eventMask);
}
WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep);
return (client->noClientException);
......@@ -1331,7 +1331,7 @@ SProcScreenSaverQueryVersion (client)
REQUEST(xScreenSaverQueryVersionReq);
int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
return ProcScreenSaverQueryVersion (client);
}
......@@ -1343,9 +1343,9 @@ SProcScreenSaverQueryInfo (client)
REQUEST(xScreenSaverQueryInfoReq);
int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
swapl (&stuff->drawable, n);
swapl (&stuff->drawable);
return ProcScreenSaverQueryInfo (client);
}
......@@ -1356,10 +1356,10 @@ SProcScreenSaverSelectInput (client)
REQUEST(xScreenSaverSelectInputReq);
int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
swapl (&stuff->drawable, n);
swapl (&stuff->eventMask, n);
swapl (&stuff->drawable);
swapl (&stuff->eventMask);
return ProcScreenSaverSelectInput (client);
}
......@@ -1370,16 +1370,16 @@ SProcScreenSaverSetAttributes (client)
REQUEST(xScreenSaverSetAttributesReq);
int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
swapl (&stuff->drawable, n);
swaps (&stuff->x, n);
swaps (&stuff->y, n);
swaps (&stuff->width, n);
swaps (&stuff->height, n);
swaps (&stuff->borderWidth, n);
swapl (&stuff->visualID, n);
swapl (&stuff->mask, n);
swapl (&stuff->drawable);
swaps (&stuff->x);
swaps (&stuff->y);
swaps (&stuff->width);
swaps (&stuff->height);
swaps (&stuff->borderWidth);
swapl (&stuff->visualID);
swapl (&stuff->mask);
SwapRestL(stuff);
return ProcScreenSaverSetAttributes (client);
}
......@@ -1391,9 +1391,9 @@ SProcScreenSaverUnsetAttributes (client)
REQUEST(xScreenSaverUnsetAttributesReq);
int n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
swapl (&stuff->drawable, n);
swapl (&stuff->drawable);
return ProcScreenSaverUnsetAttributes (client);
}
......
......@@ -491,10 +491,9 @@ ProcSecurityQueryVersion(
rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
if(client->swapped)
{
register char n;
swaps(&rep.sequenceNumber, n);
swaps(&rep.majorVersion, n);
swaps(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
(void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
(char *)&rep);
......@@ -709,11 +708,10 @@ ProcSecurityGenerateAuthorization(
if (client->swapped)
{
register char n;
swapl(&rep.length, n);
swaps(&rep.sequenceNumber, n);
swapl(&rep.authId, n);
swaps(&rep.dataLength, n);
swapl(&rep.length);
swaps(&rep.sequenceNumber);
swapl(&rep.authId);
swaps(&rep.dataLength);
}
WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
......@@ -788,12 +786,11 @@ SProcSecurityQueryVersion(
ClientPtr client)
{
REQUEST(xSecurityQueryVersionReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
swaps(&stuff->majorVersion, n);
swaps(&stuff->minorVersion,n);
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
return ProcSecurityQueryVersion(client);
} /* SProcSecurityQueryVersion */
......@@ -803,16 +800,15 @@ SProcSecurityGenerateAuthorization(
ClientPtr client)
{
REQUEST(xSecurityGenerateAuthorizationReq);
register char n;
CARD32 *values;
unsigned long nvalues;
int values_offset;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
swaps(&stuff->nbytesAuthProto, n);
swaps(&stuff->nbytesAuthData, n);
swapl(&stuff->valueMask, n);
swaps(&stuff->nbytesAuthProto);
swaps(&stuff->nbytesAuthData);
swapl(&stuff->valueMask);
values_offset = ((stuff->nbytesAuthProto + (unsigned)3) >> 2) +
((stuff->nbytesAuthData + (unsigned)3) >> 2);
if (values_offset >
......@@ -830,11 +826,10 @@ SProcSecurityRevokeAuthorization(
ClientPtr client)
{
REQUEST(xSecurityRevokeAuthorizationReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
swapl(&stuff->authId, n);
swapl(&stuff->authId);
return ProcSecurityRevokeAuthorization(client);
} /* SProcSecurityRevokeAuthorization */
......
......@@ -289,7 +289,6 @@ ProcShapeQueryVersion (client)
register ClientPtr client;
{
xShapeQueryVersionReply rep;
register int n;
REQUEST_SIZE_MATCH (xShapeQueryVersionReq);
memset(&rep, 0, sizeof(xShapeQueryVersionReply));
......@@ -299,10 +298,10 @@ ProcShapeQueryVersion (client)
rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.majorVersion, n);
swaps(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep);
return (client->noClientException);
......@@ -714,7 +713,6 @@ ProcShapeQueryExtents (client)
WindowPtr pWin;
xShapeQueryExtentsReply rep;
BoxRec extents, *pExtents;
register int n;
RegionPtr region;
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
......@@ -756,16 +754,16 @@ ProcShapeQueryExtents (client)
rep.widthClipShape = extents.x2 - extents.x1;
rep.heightClipShape = extents.y2 - extents.y1;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.xBoundingShape, n);
swaps(&rep.yBoundingShape, n);
swaps(&rep.widthBoundingShape, n);
swaps(&rep.heightBoundingShape, n);
swaps(&rep.xClipShape, n);
swaps(&rep.yClipShape, n);
swaps(&rep.widthClipShape, n);
swaps(&rep.heightClipShape, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.xBoundingShape);
swaps(&rep.yBoundingShape);
swaps(&rep.widthBoundingShape);
swaps(&rep.heightBoundingShape);
swaps(&rep.xClipShape);
swaps(&rep.yClipShape);
swaps(&rep.widthClipShape);
swaps(&rep.heightClipShape);
}
WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep);
return (client->noClientException);
......@@ -998,7 +996,6 @@ ProcShapeInputSelected (client)
ShapeEventPtr pShapeEvent, *pHead;
int enabled;
xShapeInputSelectedReply rep;
register int n;
REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
pWin = LookupWindow (stuff->window, client);
......@@ -1023,8 +1020,8 @@ ProcShapeInputSelected (client)
rep.sequenceNumber = client->sequence;
rep.enabled = enabled;
if (client->swapped) {
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
}
WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep);
return (client->noClientException);
......@@ -1040,7 +1037,6 @@ ProcShapeGetRectangles (client)
xRectangle *rects;
int nrects, i;
RegionPtr region;
register int n;
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
pWin = LookupWindow (stuff->window, client);
......@@ -1105,9 +1101,9 @@ ProcShapeGetRectangles (client)
rep.ordering = YXBanded;
rep.nrects = nrects;
if (client->swapped) {
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.nrects, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl (&rep.nrects);
SwapShorts ((short *)rects, (unsigned long)nrects * 4);
}
WriteToClient (client, sizeof (rep), (char *) &rep);
......@@ -1185,10 +1181,9 @@ static int
SProcShapeQueryVersion (client)
register ClientPtr client;
{
register int n;
REQUEST (xShapeQueryVersionReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
return ProcShapeQueryVersion (client);
}
......@@ -1196,14 +1191,13 @@ static int
SProcShapeRectangles (client)
register ClientPtr client;
{
register char n;
REQUEST (xShapeRectanglesReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
swapl (&stuff->dest, n);
swaps (&stuff->xOff, n);
swaps (&stuff->yOff, n);
swapl (&stuff->dest);
swaps (&stuff->xOff);
swaps (&stuff->yOff);
SwapRestS(stuff);
return ProcShapeRectangles (client);
}
......@@ -1212,15 +1206,14 @@ static int
SProcShapeMask (client)
register ClientPtr client;
{
register char n;
REQUEST (xShapeMaskReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeMaskReq);
swapl (&stuff->dest, n);
swaps (&stuff->xOff, n);
swaps (&stuff->yOff, n);
swapl (&stuff->src, n);
swapl (&stuff->dest);
swaps (&stuff->xOff);
swaps (&stuff->yOff);
swapl (&stuff->src);
return ProcShapeMask (client);
}
......@@ -1228,15 +1221,14 @@ static int
SProcShapeCombine (client)
register ClientPtr client;
{
register char n;
REQUEST (xShapeCombineReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeCombineReq);
swapl (&stuff->dest, n);
swaps (&stuff->xOff, n);
swaps (&stuff->yOff, n);
swapl (&stuff->src, n);
swapl (&stuff->dest);
swaps (&stuff->xOff);
swaps (&stuff->yOff);
swapl (&stuff->src);
return ProcShapeCombine (client);
}
......@@ -1244,14 +1236,13 @@ static int
SProcShapeOffset (client)
register ClientPtr client;
{
register char n;
REQUEST (xShapeOffsetReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeOffsetReq);
swapl (&stuff->dest, n);
swaps (&stuff->xOff, n);
swaps (&stuff->yOff, n);
swapl (&stuff->dest);
swaps (&stuff->xOff);
swaps (&stuff->yOff);
return ProcShapeOffset (client);
}
......@@ -1259,12 +1250,11 @@ static int
SProcShapeQueryExtents (client)
register ClientPtr client;
{
register char n;
REQUEST (xShapeQueryExtentsReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
swapl (&stuff->window, n);
swapl (&stuff->window);
return ProcShapeQueryExtents (client);
}
......@@ -1272,12 +1262,11 @@ static int
SProcShapeSelectInput (client)
register ClientPtr client;
{
register char n;
REQUEST (xShapeSelectInputReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeSelectInputReq);
swapl (&stuff->window, n);
swapl (&stuff->window);
return ProcShapeSelectInput (client);
}
......@@ -1285,12 +1274,11 @@ static int
SProcShapeInputSelected (client)
register ClientPtr client;
{
register int n;
REQUEST (xShapeInputSelectedReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
swapl (&stuff->window, n);
swapl (&stuff->window);
return ProcShapeInputSelected (client);
}
......@@ -1299,11 +1287,10 @@ SProcShapeGetRectangles (client)
register ClientPtr client;
{
REQUEST(xShapeGetRectanglesReq);
register char n;
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
swapl (&stuff->window, n);
swapl (&stuff->window);
return ProcShapeGetRectangles (client);
}
......
......@@ -346,7 +346,6 @@ ProcShmQueryVersion(client)
register ClientPtr client;
{
xShmQueryVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xShmQueryVersionReq);
memset(&rep, 0, sizeof(xShmQueryVersionReply));
......@@ -360,12 +359,12 @@ ProcShmQueryVersion(client)
rep.uid = geteuid();
rep.gid = getegid();
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.majorVersion, n);
swaps(&rep.minorVersion, n);
swaps(&rep.uid, n);
swaps(&rep.gid, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
swaps(&rep.uid);
swaps(&rep.gid);
}
WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep);
return (client->noClientException);
......@@ -712,11 +711,10 @@ ProcPanoramiXShmGetImage(ClientPtr client)
}
if (client->swapped) {
register int n;
swaps(&xgi.sequenceNumber, n);
swapl(&xgi.length, n);
swapl(&xgi.visual, n);
swapl(&xgi.size, n);
swaps(&xgi.sequenceNumber);
swapl(&xgi.length);
swapl(&xgi.visual);
swapl(&xgi.size);
}
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
......@@ -952,7 +950,6 @@ ProcShmGetImage(client)
Mask plane = 0;
xShmGetImageReply xgi;
ShmDescPtr shmdesc;
int n;
REQUEST(xShmGetImageReq);
......@@ -1043,10 +1040,10 @@ ProcShmGetImage(client)
}
if (client->swapped) {
swaps(&xgi.sequenceNumber, n);
swapl(&xgi.length, n);
swapl(&xgi.visual, n);
swapl(&xgi.size, n);
swaps(&xgi.sequenceNumber);
swapl(&xgi.length);
swapl(&xgi.visual);
swapl(&xgi.size);
}
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
......@@ -1205,10 +1202,9 @@ static int
SProcShmQueryVersion(client)
register ClientPtr client;
{
register int n;
REQUEST(xShmQueryVersionReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return ProcShmQueryVersion(client);
}
......@@ -1216,12 +1212,11 @@ static int
SProcShmAttach(client)
ClientPtr client;
{
register int n;
REQUEST(xShmAttachReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmAttachReq);
swapl(&stuff->shmseg, n);
swapl(&stuff->shmid, n);
swapl(&stuff->shmseg);
swapl(&stuff->shmid);
return ProcShmAttach(client);
}
......@@ -1229,11 +1224,10 @@ static int
SProcShmDetach(client)
ClientPtr client;
{
register int n;
REQUEST(xShmDetachReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmDetachReq);
swapl(&stuff->shmseg, n);
swapl(&stuff->shmseg);
return ProcShmDetach(client);
}
......@@ -1241,22 +1235,21 @@ static int
SProcShmPutImage(client)
ClientPtr client;
{
register int n;
REQUEST(xShmPutImageReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmPutImageReq);
swapl(&stuff->drawable, n);
swapl(&stuff->gc, n);
swaps(&stuff->totalWidth, n);
swaps(&stuff->totalHeight, n);
swaps(&stuff->srcX, n);
swaps(&stuff->srcY, n);
swaps(&stuff->srcWidth, n);
swaps(&stuff->srcHeight, n);
swaps(&stuff->dstX, n);
swaps(&stuff->dstY, n);
swapl(&stuff->shmseg, n);
swapl(&stuff->offset, n);
swapl(&stuff->drawable);
swapl(&stuff->gc);
swaps(&stuff->totalWidth);
swaps(&stuff->totalHeight);
swaps(&stuff->srcX);
swaps(&stuff->srcY);
swaps(&stuff->srcWidth);
swaps(&stuff->srcHeight);
swaps(&stuff->dstX);
swaps(&stuff->dstY);
swapl(&stuff->shmseg);
swapl(&stuff->offset);
return ProcShmPutImage(client);
}
......@@ -1264,18 +1257,17 @@ static int
SProcShmGetImage(client)
ClientPtr client;
{
register int n;
REQUEST(xShmGetImageReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmGetImageReq);
swapl(&stuff->drawable, n);
swaps(&stuff->x, n);
swaps(&stuff->y, n);
swaps(&stuff->width, n);
swaps(&stuff->height, n);
swapl(&stuff->planeMask, n);
swapl(&stuff->shmseg, n);
swapl(&stuff->offset, n);
swapl(&stuff->drawable);
swaps(&stuff->x);
swaps(&stuff->y);
swaps(&stuff->width);
swaps(&stuff->height);
swapl(&stuff->planeMask);
swapl(&stuff->shmseg);
swapl(&stuff->offset);
return ProcShmGetImage(client);
}
......@@ -1283,16 +1275,15 @@ static int
SProcShmCreatePixmap(client)
ClientPtr client;
{
register int n;
REQUEST(xShmCreatePixmapReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
swapl(&stuff->pid, n);
swapl(&stuff->drawable, n);
swaps(&stuff->width, n);
swaps(&stuff->height, n);
swapl(&stuff->shmseg, n);
swapl(&stuff->offset, n);
swapl(&stuff->pid);
swapl(&stuff->drawable);
swaps(&stuff->width);
swaps(&stuff->height);
swapl(&stuff->shmseg);
swapl(&stuff->offset);
return ProcShmCreatePixmap(client);
}
......
......@@ -1343,7 +1343,6 @@ ProcSyncInitialize(client)
ClientPtr client;
{
xSyncInitializeReply rep;
int n;
REQUEST_SIZE_MATCH(xSyncInitializeReq);
......@@ -1356,7 +1355,7 @@ ProcSyncInitialize(client)
if (client->swapped)
{
swaps(&rep.sequenceNumber, n);
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(rep), (char *) &rep);
return (client->noClientException);
......@@ -1397,10 +1396,9 @@ ProcSyncListSystemCounters(client)
if (client->swapped)
{
register char n;
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.nCounters, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.nCounters);
}
for (i = 0; i < SyncNumSystemCounters; i++)
......@@ -1417,11 +1415,10 @@ ProcSyncListSystemCounters(client)
if (client->swapped)
{
register char n;
swapl(&walklist->counter, n);
swapl(&walklist->resolution_hi, n);
swapl(&walklist->resolution_lo, n);
swaps(&walklist->name_length, n);
swapl(&walklist->counter);
swapl(&walklist->resolution_hi);
swapl(&walklist->resolution_lo);
swaps(&walklist->name_length);
}
pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter;
......@@ -1502,9 +1499,8 @@ ProcSyncGetPriority(client)
if (client->swapped)
{
register char n;
swaps(&rep.sequenceNumber, n);
swapl(&rep.priority, n);
swaps(&rep.sequenceNumber);
swapl(&rep.priority);
}
WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
......@@ -1787,11 +1783,10 @@ ProcSyncQueryCounter(client)
rep.value_lo = XSyncValueLow32(pCounter->value);
if (client->swapped)
{
register char n;
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.value_hi, n);
swapl(&rep.value_lo, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.value_hi);
swapl(&rep.value_lo);
}
WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
return (client->noClientException);
......@@ -1969,15 +1964,14 @@ ProcSyncQueryAlarm(client)
if (client->swapped)
{
register char n;
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.counter, n);
swapl(&rep.wait_value_hi, n);
swapl(&rep.wait_value_lo, n);
swapl(&rep.test_type, n);
swapl(&rep.delta_hi, n);
swapl(&rep.delta_lo, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.counter);
swapl(&rep.wait_value_hi);
swapl(&rep.wait_value_lo);
swapl(&rep.test_type);
swapl(&rep.delta_hi);
swapl(&rep.delta_lo);
}
WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
......@@ -2058,9 +2052,8 @@ SProcSyncInitialize(client)
ClientPtr client;
{
REQUEST(xSyncInitializeReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncInitializeReq);
return ProcSyncInitialize(client);
......@@ -2071,9 +2064,8 @@ SProcSyncListSystemCounters(client)
ClientPtr client;
{
REQUEST(xSyncListSystemCountersReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncListSystemCountersReq);
return ProcSyncListSystemCounters(client);
......@@ -2084,13 +2076,12 @@ SProcSyncCreateCounter(client)
ClientPtr client;
{
REQUEST(xSyncCreateCounterReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncCreateCounterReq);
swapl(&stuff->cid, n);
swapl(&stuff->initial_value_lo, n);
swapl(&stuff->initial_value_hi, n);
swapl(&stuff->cid);
swapl(&stuff->initial_value_lo);
swapl(&stuff->initial_value_hi);
return ProcSyncCreateCounter(client);
}
......@@ -2100,13 +2091,12 @@ SProcSyncSetCounter(client)
ClientPtr client;
{
REQUEST(xSyncSetCounterReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncSetCounterReq);
swapl(&stuff->cid, n);
swapl(&stuff->value_lo, n);
swapl(&stuff->value_hi, n);
swapl(&stuff->cid);
swapl(&stuff->value_lo);
swapl(&stuff->value_hi);
return ProcSyncSetCounter(client);
}
......@@ -2116,13 +2106,12 @@ SProcSyncChangeCounter(client)
ClientPtr client;
{
REQUEST(xSyncChangeCounterReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncChangeCounterReq);
swapl(&stuff->cid, n);
swapl(&stuff->value_lo, n);
swapl(&stuff->value_hi, n);
swapl(&stuff->cid);
swapl(&stuff->value_lo);
swapl(&stuff->value_hi);
return ProcSyncChangeCounter(client);
}
......@@ -2132,11 +2121,10 @@ SProcSyncQueryCounter(client)
ClientPtr client;
{
REQUEST(xSyncQueryCounterReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncQueryCounterReq);
swapl(&stuff->counter, n);
swapl(&stuff->counter);
return ProcSyncQueryCounter(client);
}
......@@ -2146,11 +2134,10 @@ SProcSyncDestroyCounter(client)
ClientPtr client;
{
REQUEST(xSyncDestroyCounterReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncDestroyCounterReq);
swapl(&stuff->counter, n);
swapl(&stuff->counter);
return ProcSyncDestroyCounter(client);
}
......@@ -2160,9 +2147,8 @@ SProcSyncAwait(client)
ClientPtr client;
{
REQUEST(xSyncAwaitReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
SwapRestL(stuff);
......@@ -2175,12 +2161,11 @@ SProcSyncCreateAlarm(client)
ClientPtr client;
{
REQUEST(xSyncCreateAlarmReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
swapl(&stuff->id, n);
swapl(&stuff->valueMask, n);
swapl(&stuff->id);
swapl(&stuff->valueMask);
SwapRestL(stuff);
return ProcSyncCreateAlarm(client);
......@@ -2191,12 +2176,11 @@ SProcSyncChangeAlarm(client)
ClientPtr client;
{
REQUEST(xSyncChangeAlarmReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
swapl(&stuff->alarm, n);
swapl(&stuff->valueMask, n);
swapl(&stuff->alarm);
swapl(&stuff->valueMask);
SwapRestL(stuff);
return ProcSyncChangeAlarm(client);
}
......@@ -2206,11 +2190,10 @@ SProcSyncQueryAlarm(client)
ClientPtr client;
{
REQUEST(xSyncQueryAlarmReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncQueryAlarmReq);
swapl(&stuff->alarm, n);
swapl(&stuff->alarm);
return ProcSyncQueryAlarm(client);
}
......@@ -2220,11 +2203,10 @@ SProcSyncDestroyAlarm(client)
ClientPtr client;
{
REQUEST(xSyncDestroyAlarmReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq);
swapl(&stuff->alarm, n);
swapl(&stuff->alarm);
return ProcSyncDestroyAlarm(client);
}
......@@ -2234,12 +2216,11 @@ SProcSyncSetPriority(client)
ClientPtr client;
{
REQUEST(xSyncSetPriorityReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncSetPriorityReq);
swapl(&stuff->id, n);
swapl(&stuff->priority, n);
swapl(&stuff->id);
swapl(&stuff->priority);
return ProcSyncSetPriority(client);
}
......@@ -2249,11 +2230,10 @@ SProcSyncGetPriority(client)
ClientPtr client;
{
REQUEST(xSyncGetPriorityReq);
register char n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH (xSyncGetPriorityReq);
swapl(&stuff->id, n);
swapl(&stuff->id);
return ProcSyncGetPriority(client);
}
......
......@@ -98,7 +98,6 @@ ProcXCMiscGetVersion(client)
register ClientPtr client;
{
xXCMiscGetVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
rep.type = X_Reply;
......@@ -107,9 +106,9 @@ ProcXCMiscGetVersion(client)
rep.majorVersion = XCMiscMajorVersion;
rep.minorVersion = XCMiscMinorVersion;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swaps(&rep.majorVersion, n);
swaps(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep);
return(client->noClientException);
......@@ -120,7 +119,6 @@ ProcXCMiscGetXIDRange(client)
register ClientPtr client;
{
xXCMiscGetXIDRangeReply rep;
register int n;
XID min_id, max_id;
REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
......@@ -131,9 +129,9 @@ ProcXCMiscGetXIDRange(client)
rep.start_id = min_id;
rep.count = max_id - min_id + 1;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.start_id, n);
swapl(&rep.count, n);
swaps(&rep.sequenceNumber);
swapl(&rep.start_id);
swapl(&rep.count);
}
WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep);
return(client->noClientException);
......@@ -145,7 +143,6 @@ ProcXCMiscGetXIDList(client)
{
REQUEST(xXCMiscGetXIDListReq);
xXCMiscGetXIDListReply rep;
register int n;
XID *pids;
unsigned int count;
......@@ -165,9 +162,9 @@ ProcXCMiscGetXIDList(client)
rep.length = count;
rep.count = count;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.count, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.count);
}
WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep);
if (count)
......@@ -201,13 +198,12 @@ static int
SProcXCMiscGetVersion(client)
register ClientPtr client;
{
register int n;
REQUEST(xXCMiscGetVersionReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
swaps(&stuff->majorVersion, n);
swaps(&stuff->minorVersion, n);
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
return ProcXCMiscGetVersion(client);
}
......@@ -215,10 +211,9 @@ static int
SProcXCMiscGetXIDRange(client)
register ClientPtr client;
{
register int n;
REQUEST(xReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return ProcXCMiscGetXIDRange(client);
}
......@@ -226,12 +221,11 @@ static int
SProcXCMiscGetXIDList(client)
register ClientPtr client;
{
register int n;
REQUEST(xXCMiscGetXIDListReq);
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
swaps(&stuff->length, n);
swapl(&stuff->count, n);
swaps(&stuff->length);
swapl(&stuff->count);
return ProcXCMiscGetXIDList(client);
}
......
......@@ -375,14 +375,13 @@ ProcXF86BigfontQueryVersion(
#endif
; /* may add more bits here in future versions */
if (client->swapped) {
char tmp;
swaps(&reply.sequenceNumber, tmp);
swapl(&reply.length, tmp);
swaps(&reply.majorVersion, tmp);
swaps(&reply.minorVersion, tmp);
swapl(&reply.uid, tmp);
swapl(&reply.gid, tmp);
swapl(&reply.signature, tmp);
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swaps(&reply.majorVersion);
swaps(&reply.minorVersion);
swapl(&reply.uid);
swapl(&reply.gid);
swapl(&reply.signature);
}
WriteToClient(client,
sizeof(xXF86BigfontQueryVersionReply), (char *)&reply);
......@@ -393,14 +392,12 @@ static void
swapCharInfo(
xCharInfo *pCI)
{
char tmp;
swaps(&pCI->leftSideBearing, tmp);
swaps(&pCI->rightSideBearing, tmp);
swaps(&pCI->characterWidth, tmp);
swaps(&pCI->ascent, tmp);
swaps(&pCI->descent, tmp);
swaps(&pCI->attributes, tmp);
swaps(&pCI->leftSideBearing);
swaps(&pCI->rightSideBearing);
swaps(&pCI->characterWidth);
swaps(&pCI->ascent);
swaps(&pCI->descent);
swaps(&pCI->attributes);
}
/* static CARD32 hashCI (xCharInfo *p); */
......@@ -671,21 +668,20 @@ ProcXF86BigfontQueryFont(
reply->shmid = shmid;
reply->shmsegoffset = 0;
if (client->swapped) {
char tmp;
swaps(&reply->sequenceNumber, tmp);
swapl(&reply->length, tmp);
swaps(&reply->sequenceNumber);
swapl(&reply->length);
swapCharInfo(&reply->minBounds);
swapCharInfo(&reply->maxBounds);
swaps(&reply->minCharOrByte2, tmp);
swaps(&reply->maxCharOrByte2, tmp);
swaps(&reply->defaultChar, tmp);
swaps(&reply->nFontProps, tmp);
swaps(&reply->fontAscent, tmp);
swaps(&reply->fontDescent, tmp);
swapl(&reply->nCharInfos, tmp);
swapl(&reply->nUniqCharInfos, tmp);
swapl(&reply->shmid, tmp);
swapl(&reply->shmsegoffset, tmp);
swaps(&reply->minCharOrByte2);
swaps(&reply->maxCharOrByte2);
swaps(&reply->defaultChar);
swaps(&reply->nFontProps);
swaps(&reply->fontAscent);
swaps(&reply->fontDescent);
swapl(&reply->nCharInfos);
swapl(&reply->nUniqCharInfos);
swapl(&reply->shmid);
swapl(&reply->shmsegoffset);
}
p = (char*) &reply[1];
{
......@@ -698,9 +694,8 @@ ProcXF86BigfontQueryFont(
prFP->name = pFP->name;
prFP->value = pFP->value;
if (client->swapped) {
char tmp;
swapl(&prFP->name, tmp);
swapl(&prFP->value, tmp);
swapl(&prFP->name);
swapl(&prFP->value);
}
}
p = (char*) prFP;
......@@ -719,8 +714,7 @@ ProcXF86BigfontQueryFont(
for (j = 0; j < nCharInfos; j++, ps++) {
*ps = pIndex2UniqIndex[j];
if (client->swapped) {
char tmp;
swaps(ps, tmp);
swaps(ps);
}
}
}
......@@ -755,9 +749,8 @@ SProcXF86BigfontQueryVersion(
ClientPtr client)
{
REQUEST(xXF86BigfontQueryVersionReq);
char tmp;
swaps(&stuff->length, tmp);
swaps(&stuff->length);
return ProcXF86BigfontQueryVersion(client);
}
......@@ -766,11 +759,10 @@ SProcXF86BigfontQueryFont(
ClientPtr client)
{
REQUEST(xXF86BigfontQueryFontReq);
char tmp;
swaps(&stuff->length, tmp);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
swapl(&stuff->id, tmp);
swapl(&stuff->id);
return ProcXF86BigfontQueryFont(client);
}
......
......@@ -27,26 +27,19 @@ ProcXResQueryVersion (ClientPtr client)
{
REQUEST(xXResQueryVersionReq);
xXResQueryVersionReply rep;
CARD16 client_major, client_minor; /* not used */
REQUEST_SIZE_MATCH (xXResQueryVersionReq);
client_major = stuff->client_major;
client_minor = stuff->client_minor;
(void) client_major;
(void) client_minor;
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.server_major = SERVER_XRES_MAJOR_VERSION;
rep.server_minor = SERVER_XRES_MINOR_VERSION;
if (client->swapped) {
int n;
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.server_major, n);
swaps(&rep.server_minor, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.server_major);
swaps(&rep.server_minor);
}
WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep);
return (client->noClientException);
......@@ -77,10 +70,9 @@ ProcXResQueryClients (ClientPtr client)
rep.num_clients = num_clients;
rep.length = rep.num_clients * sz_xXResClient >> 2;
if (client->swapped) {
int n;
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.num_clients, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl (&rep.num_clients);
}
WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep);
......@@ -92,9 +84,8 @@ ProcXResQueryClients (ClientPtr client)
scratch.resource_mask = RESOURCE_ID_MASK;
if(client->swapped) {
register int n;
swapl (&scratch.resource_base, n);
swapl (&scratch.resource_mask, n);
swapl (&scratch.resource_base);
swapl (&scratch.resource_mask);
}
WriteToClient (client, sz_xXResClient, (char *) &scratch);
}
......@@ -150,10 +141,9 @@ ProcXResQueryClientResources (ClientPtr client)
rep.num_types = num_types;
rep.length = rep.num_types * sz_xXResType >> 2;
if (client->swapped) {
int n;
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.num_types, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl (&rep.num_types);
}
WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep);
......@@ -173,9 +163,8 @@ ProcXResQueryClientResources (ClientPtr client)
scratch.count = counts[i];
if(client->swapped) {
register int n;
swapl (&scratch.resource_type, n);
swapl (&scratch.count, n);
swapl (&scratch.resource_type);
swapl (&scratch.count);
}
WriteToClient (client, sz_xXResType, (char *) &scratch);
}
......@@ -229,11 +218,10 @@ ProcXResQueryClientPixmapBytes (ClientPtr client)
rep.bytes_overflow = 0;
#endif
if (client->swapped) {
int n;
swaps (&rep.sequenceNumber, n);
swapl (&rep.length, n);
swapl (&rep.bytes, n);
swapl (&rep.bytes_overflow, n);
swaps (&rep.sequenceNumber);
swapl (&rep.length);
swapl (&rep.bytes);
swapl (&rep.bytes_overflow);
}
WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep);
......@@ -266,12 +254,7 @@ ProcResDispatch (ClientPtr client)
static int
SProcXResQueryVersion (ClientPtr client)
{
REQUEST(xXResQueryVersionReq);
int n;
REQUEST_SIZE_MATCH (xXResQueryVersionReq);
swaps(&stuff->client_major,n);
swaps(&stuff->client_minor,n);
return ProcXResQueryVersion(client);
}
......@@ -279,10 +262,9 @@ static int
SProcXResQueryClientResources (ClientPtr client)
{
REQUEST(xXResQueryClientResourcesReq);
int n;
REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq);
swaps(&stuff->xid,n);
swapl(&stuff->xid);
return ProcXResQueryClientResources(client);
}
......@@ -290,10 +272,9 @@ static int
SProcXResQueryClientPixmapBytes (ClientPtr client)
{
REQUEST(xXResQueryClientPixmapBytesReq);
int n;
REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq);
swaps(&stuff->xid,n);
swapl(&stuff->xid);
return ProcXResQueryClientPixmapBytes(client);
}
......@@ -301,9 +282,8 @@ static int
SProcResDispatch (ClientPtr client)
{
REQUEST(xReq);
int n;
swaps(&stuff->length,n);
swaps(&stuff->length);
switch (stuff->data) {
case X_XResQueryVersion:
......
......@@ -121,7 +121,6 @@ ProcXTestGetVersion(client)
register ClientPtr client;
{
xXTestGetVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
rep.type = X_Reply;
......@@ -130,8 +129,8 @@ ProcXTestGetVersion(client)
rep.majorVersion = XTestMajorVersion;
rep.minorVersion = XTestMinorVersion;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swaps(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep);
return(client->noClientException);
......@@ -145,7 +144,6 @@ ProcXTestCompareCursor(client)
xXTestCompareCursorReply rep;
WindowPtr pWin;
CursorPtr pCursor;
register int n;
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
pWin = (WindowPtr)LookupWindow(stuff->window, client);
......@@ -168,7 +166,7 @@ ProcXTestCompareCursor(client)
rep.sequenceNumber = client->sequence;
rep.same = (wCursor(pWin) == pCursor);
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep);
return(client->noClientException);
......@@ -180,7 +178,7 @@ ProcXTestFakeInput(client)
{
REQUEST(xXTestFakeInputReq);
int nev;
int n;
int n;
xEvent *ev;
DeviceIntPtr dev = NULL;
WindowPtr root;
......@@ -285,7 +283,7 @@ ProcXTestFakeInput(client)
if (client->swapped)
{
(void) XTestSwapFakeInput(client, (xReq *)stuff);
swaps(&stuff->length, n);
swaps(&stuff->length);
}
ResetCurrentRequest (client);
client->sequence--;
......@@ -512,12 +510,11 @@ static int
SProcXTestGetVersion(client)
register ClientPtr client;
{
register int n;
REQUEST(xXTestGetVersionReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
swaps(&stuff->minorVersion, n);
swaps(&stuff->minorVersion);
return ProcXTestGetVersion(client);
}
......@@ -525,13 +522,12 @@ static int
SProcXTestCompareCursor(client)
register ClientPtr client;
{
register int n;
REQUEST(xXTestCompareCursorReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
swapl(&stuff->window, n);
swapl(&stuff->cursor, n);
swapl(&stuff->window);
swapl(&stuff->cursor);
return ProcXTestCompareCursor(client);
}
......@@ -568,7 +564,7 @@ SProcXTestFakeInput(client)
register int n;
REQUEST(xReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
n = XTestSwapFakeInput(client, stuff);
if (n != Success)
return n;
......@@ -579,10 +575,9 @@ static int
SProcXTestGrabControl(client)
register ClientPtr client;
{
register int n;
REQUEST(xXTestGrabControlReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestGrabControlReq);
return ProcXTestGrabControl(client);
}
......
......@@ -319,10 +319,6 @@ SProcTestFakeInput(client)
register ClientPtr client;
{
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
/*
* index counter
*/
int i;
......@@ -339,8 +335,8 @@ SProcTestFakeInput(client)
/*
* byte-swap the fields in the request
*/
swaps(&stuff->length, n);
swapl(&stuff->ack, n);
swaps(&stuff->length);
swapl(&stuff->ack);
/*
* have to parse and then byte-swap the input action list here
*/
......@@ -363,7 +359,7 @@ SProcTestFakeInput(client)
/*
* 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
*/
......@@ -373,7 +369,7 @@ SProcTestFakeInput(client)
/*
* 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
*/
......@@ -383,15 +379,15 @@ SProcTestFakeInput(client)
/*
* byte-swap the jumpx field
*/
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx), n);
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx));
/*
* byte-swap the jumpy field
*/
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy), n);
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy));
/*
* 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
*/
......@@ -409,7 +405,7 @@ SProcTestFakeInput(client)
/*
* 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
*/
......@@ -440,17 +436,12 @@ static int
SProcTestGetInput(client)
register ClientPtr client;
{
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
REQUEST(xTestGetInputReq);
/*
* byte-swap the fields in the request
*/
swaps(&stuff->length, n);
swapl(&stuff->mode, n);
swaps(&stuff->length);
swapl(&stuff->mode);
return(ProcTestGetInput(client));
}
......@@ -464,16 +455,11 @@ static int
SProcTestStopInput(client)
register ClientPtr client;
{
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
REQUEST(xTestStopInputReq);
/*
* byte-swap the length field in the request
*/
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcTestStopInput(client));
}
......@@ -487,16 +473,11 @@ static int
SProcTestReset(client)
register ClientPtr client;
{
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
REQUEST(xTestResetReq);
/*
* byte-swap the length field in the request
*/
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcTestReset(client));
}
......@@ -510,16 +491,11 @@ static int
SProcTestQueryInputSize(client)
register ClientPtr client;
{
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
REQUEST(xTestQueryInputSizeReq);
/*
* byte-swap the length field in the request
*/
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcTestQueryInputSize(client));
}
......@@ -781,10 +757,6 @@ SReplyXTestDispatch(client_ptr, size, reply_ptr)
char *reply_ptr;
{
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
/*
* pointer to xTestQueryInputSizeReply
*/
xTestQueryInputSizeReply *rep_ptr;
......@@ -793,9 +765,9 @@ SReplyXTestDispatch(client_ptr, size, reply_ptr)
* there is only one reply in this extension, so byte-swap it
*/
rep_ptr = (xTestQueryInputSizeReply *) reply_ptr;
swaps(&(rep_ptr->sequenceNumber), n);
swapl(&(rep_ptr->length), n);
swapl(&(rep_ptr->size_return), n);
swaps(&(rep_ptr->sequenceNumber));
swapl(&(rep_ptr->length));
swapl(&(rep_ptr->size_return));
/*
* now write the swapped reply to the client
*/
......@@ -814,10 +786,6 @@ SEventXTestDispatch(from, to)
xEvent *to;
{
/*
* used in the swaps and swapl macros for temporary storage space
*/
register char n;
/*
* index counter
*/
int i;
......@@ -845,7 +813,7 @@ SEventXTestDispatch(from, to)
/*
* 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
* processing. Otherwise, it is an xTestFakeAckEvent, which
......@@ -886,7 +854,7 @@ SEventXTestDispatch(from, to)
/*
* 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
*/
......@@ -896,7 +864,7 @@ SEventXTestDispatch(from, to)
/*
* 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
*/
......@@ -906,15 +874,15 @@ SEventXTestDispatch(from, to)
/*
* byte-swap the jumpx field
*/
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx), n);
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpx));
/*
* byte-swap the jumpy field
*/
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy), n);
swaps(&(((XTestJumpInfo *) input_action_ptr)->jumpy));
/*
* 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
*/
......@@ -932,7 +900,7 @@ SEventXTestDispatch(from, to)
/*
* 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
*/
......
......@@ -82,12 +82,10 @@ int
SProcXAllowDeviceEvents(client)
register ClientPtr client;
{
register char n;
REQUEST(xAllowDeviceEventsReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
swapl(&stuff->time, n);
swapl(&stuff->time);
return(ProcXAllowDeviceEvents(client));
}
......
......@@ -83,12 +83,10 @@ int
SProcXChangeDeviceControl(client)
register ClientPtr client;
{
register char n;
REQUEST(xChangeDeviceControlReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
swaps(&stuff->control, n);
swaps(&stuff->control);
return(ProcXChangeDeviceControl(client));
}
......@@ -210,10 +208,8 @@ SRepXChangeDeviceControl (client, size, rep)
int size;
xChangeDeviceControlReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -84,12 +84,10 @@ int
SProcXChangeFeedbackControl(client)
register ClientPtr client;
{
register char n;
REQUEST(xChangeFeedbackControlReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
swapl(&stuff->mask, n);
swapl(&stuff->mask);
return(ProcXChangeFeedbackControl(client));
}
......@@ -156,13 +154,12 @@ ProcXChangeFeedbackControl(client)
break;
case StringFeedbackClass:
{
register char n;
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]);
if (client->swapped)
{
if (len < (sizeof(xStringFeedbackCtl) + 3) >> 2)
return BadLength;
swaps(&f->num_keysyms,n);
swaps(&f->num_keysyms);
}
if (len != ((sizeof(xStringFeedbackCtl)>>2) + f->num_keysyms))
{
......@@ -242,18 +239,17 @@ ChangeKbdFeedback (client, dev, mask, k, f)
KbdFeedbackPtr k;
xKbdFeedbackCtl *f;
{
register char n;
KeybdCtrl kctrl;
int t;
int key = DO_ALL;
if (client->swapped)
{
swaps(&f->length,n);
swaps(&f->pitch,n);
swaps(&f->duration,n);
swapl(&f->led_mask,n);
swapl(&f->led_values,n);
swaps(&f->length);
swaps(&f->pitch);
swaps(&f->duration);
swapl(&f->led_mask);
swapl(&f->led_values);
}
kctrl = k->ctrl;
......@@ -398,15 +394,14 @@ ChangePtrFeedback (client, dev, mask, p, f)
PtrFeedbackPtr p;
xPtrFeedbackCtl *f;
{
register char n;
PtrCtrl pctrl; /* might get BadValue part way through */
if (client->swapped)
{
swaps(&f->length,n);
swaps(&f->num,n);
swaps(&f->denom,n);
swaps(&f->thresh,n);
swaps(&f->length);
swaps(&f->num);
swaps(&f->denom);
swaps(&f->thresh);
}
pctrl = p->ctrl;
......@@ -480,12 +475,10 @@ ChangeIntegerFeedback (client, dev, mask, i, f)
IntegerFeedbackPtr i;
xIntegerFeedbackCtl *f;
{
register char n;
if (client->swapped)
{
swaps(&f->length,n);
swapl(&f->int_to_display,n);
swaps(&f->length);
swapl(&f->int_to_display);
}
i->ctrl.integer_displayed = f->int_to_display;
......@@ -507,14 +500,13 @@ ChangeStringFeedback (client, dev, mask, s, f)
StringFeedbackPtr s;
xStringFeedbackCtl *f;
{
register char n;
int i, j;
KeySym *syms, *sup_syms;
syms = (KeySym *) (f+1);
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);
}
......@@ -559,15 +551,14 @@ ChangeBellFeedback (client, dev, mask, b, f)
BellFeedbackPtr b;
xBellFeedbackCtl *f;
{
register char n;
int t;
BellCtrl bctrl; /* might get BadValue part way through */
if (client->swapped)
{
swaps(&f->length,n);
swaps(&f->pitch,n);
swaps(&f->duration,n);
swaps(&f->length);
swaps(&f->pitch);
swaps(&f->duration);
}
bctrl = b->ctrl;
......@@ -634,14 +625,13 @@ ChangeLedFeedback (client, dev, mask, l, f)
LedFeedbackPtr l;
xLedFeedbackCtl *f;
{
register char n;
LedCtrl lctrl; /* might get BadValue part way through */
if (client->swapped)
{
swaps(&f->length,n);
swapl(&f->led_values,n);
swapl(&f->led_mask,n);
swaps(&f->length);
swapl(&f->led_values);
swapl(&f->led_mask);
}
f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
......
......@@ -85,10 +85,8 @@ int
SProcXChangeKeyboardDevice(client)
register ClientPtr client;
{
register char n;
REQUEST(xChangeKeyboardDeviceReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
return(ProcXChangeKeyboardDevice(client));
}
......@@ -208,9 +206,7 @@ SRepXChangeKeyboardDevice (client, size, rep)
int size;
xChangeKeyboardDeviceReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -82,11 +82,10 @@ int
SProcXChangeDeviceKeyMapping(client)
register ClientPtr client;
{
register char n;
unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
......
......@@ -84,13 +84,11 @@ int
SProcXChangeDeviceDontPropagateList(client)
register ClientPtr client;
{
register char n;
REQUEST(xChangeDeviceDontPropagateListReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
swapl(&stuff->window, n);
swaps(&stuff->count, n);
swapl(&stuff->window);
swaps(&stuff->count);
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
......
......@@ -88,10 +88,8 @@ int
SProcXChangePointerDevice(client)
register ClientPtr client;
{
register char n;
REQUEST(xChangePointerDeviceReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
return(ProcXChangePointerDevice(client));
}
......@@ -254,9 +252,7 @@ SRepXChangePointerDevice (client, size, rep)
int size;
xChangePointerDeviceReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -83,10 +83,8 @@ int
SProcXCloseDevice(client)
register ClientPtr client;
{
register char n;
REQUEST(xCloseDeviceReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCloseDeviceReq);
return(ProcXCloseDevice(client));
}
......
......@@ -81,10 +81,8 @@ int
SProcXDeviceBell(client)
register ClientPtr client;
{
register char n;
REQUEST(xDeviceBellReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXDeviceBell(client));
}
......
......@@ -586,17 +586,16 @@ SEventDeviceValuator (from, to)
deviceValuator *from;
deviceValuator *to;
{
register char n;
register int i;
INT32 *ip B32;
*to = *from;
swaps(&to->sequenceNumber,n);
swaps(&to->device_state,n);
swaps(&to->sequenceNumber);
swaps(&to->device_state);
ip = &to->valuator0;
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)
deviceFocus *from;
deviceFocus *to;
{
register char n;
*to = *from;
swaps(&to->sequenceNumber,n);
swapl(&to->time, n);
swapl(&to->window, n);
swaps(&to->sequenceNumber);
swapl(&to->time);
swapl(&to->window);
}
void
......@@ -619,16 +616,15 @@ SDeviceStateNotifyEvent (from, to)
deviceStateNotify *to;
{
register int i;
register char n;
INT32 *ip B32;
*to = *from;
swaps(&to->sequenceNumber,n);
swapl(&to->time, n);
swaps(&to->sequenceNumber);
swapl(&to->time);
ip = &to->valuator0;
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)
deviceKeyStateNotify *from;
deviceKeyStateNotify *to;
{
register char n;
*to = *from;
swaps(&to->sequenceNumber,n);
swaps(&to->sequenceNumber);
}
void
......@@ -648,10 +642,8 @@ SDeviceButtonStateNotifyEvent (from, to)
deviceButtonStateNotify *from;
deviceButtonStateNotify *to;
{
register char n;
*to = *from;
swaps(&to->sequenceNumber,n);
swaps(&to->sequenceNumber);
}
void
......@@ -659,11 +651,9 @@ SChangeDeviceNotifyEvent (from, to)
changeDeviceNotify *from;
changeDeviceNotify *to;
{
register char n;
*to = *from;
swaps(&to->sequenceNumber,n);
swapl(&to->time, n);
swaps(&to->sequenceNumber);
swapl(&to->time);
}
void
......@@ -671,11 +661,9 @@ SDeviceMappingNotifyEvent (from, to)
deviceMappingNotify *from;
deviceMappingNotify *to;
{
register char n;
*to = *from;
swaps(&to->sequenceNumber,n);
swapl(&to->time, n);
swaps(&to->sequenceNumber);
swapl(&to->time);
}
/************************************************************************
......
......@@ -80,10 +80,8 @@ int
SProcXGetDeviceButtonMapping(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetDeviceButtonMappingReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXGetDeviceButtonMapping(client));
}
......@@ -146,9 +144,7 @@ SRepXGetDeviceButtonMapping (client, size, rep)
int size;
xGetDeviceButtonMappingReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -81,12 +81,10 @@ int
SProcXGetDeviceControl(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetDeviceControlReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
swaps(&stuff->control, n);
swaps(&stuff->control);
return(ProcXGetDeviceControl(client));
}
......@@ -178,7 +176,6 @@ CopySwapDeviceResolution (client, v, buf, length)
char *buf;
int length;
{
register char n;
AxisInfoPtr a;
xDeviceResolutionState *r;
int i, *iptr;
......@@ -197,13 +194,13 @@ CopySwapDeviceResolution (client, v, buf, length)
*iptr++ = a->max_resolution;
if (client->swapped)
{
swaps (&r->control,n);
swaps (&r->length,n);
swapl (&r->num_valuators,n);
swaps (&r->control);
swaps (&r->length);
swapl (&r->num_valuators);
iptr = (int *) buf;
for (i=0; i < (3 * v->numAxes); i++,iptr++)
{
swapl (iptr,n);
swapl (iptr);
}
}
}
......@@ -221,10 +218,8 @@ SRepXGetDeviceControl (client, size, rep)
int size;
xGetDeviceControlReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -81,10 +81,8 @@ int
SProcXGetFeedbackControl(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetFeedbackControlReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXGetFeedbackControl(client));
}
......@@ -207,7 +205,6 @@ CopySwapKbdFeedback (client, k, buf)
char **buf;
{
int i;
register char n;
xKbdFeedbackState *k2;
k2 = (xKbdFeedbackState *) *buf;
......@@ -224,11 +221,11 @@ CopySwapKbdFeedback (client, k, buf)
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
if (client->swapped)
{
swaps(&k2->length,n);
swaps(&k2->pitch,n);
swaps(&k2->duration,n);
swapl(&k2->led_mask,n);
swapl(&k2->led_values,n);
swaps(&k2->length);
swaps(&k2->pitch);
swaps(&k2->duration);
swapl(&k2->led_mask);
swapl(&k2->led_values);
}
*buf += sizeof (xKbdFeedbackState);
}
......@@ -245,7 +242,6 @@ CopySwapPtrFeedback (client, p, buf)
PtrFeedbackPtr p;
char **buf;
{
register char n;
xPtrFeedbackState *p2;
p2 = (xPtrFeedbackState *) *buf;
......@@ -257,10 +253,10 @@ CopySwapPtrFeedback (client, p, buf)
p2->threshold = p->ctrl.threshold;
if (client->swapped)
{
swaps(&p2->length,n);
swaps(&p2->accelNum,n);
swaps(&p2->accelDenom,n);
swaps(&p2->threshold,n);
swaps(&p2->length);
swaps(&p2->accelNum);
swaps(&p2->accelDenom);
swaps(&p2->threshold);
}
*buf += sizeof (xPtrFeedbackState);
}
......@@ -277,7 +273,6 @@ CopySwapIntegerFeedback (client, i, buf)
IntegerFeedbackPtr i;
char **buf;
{
register char n;
xIntegerFeedbackState *i2;
i2 = (xIntegerFeedbackState *) *buf;
......@@ -289,10 +284,10 @@ CopySwapIntegerFeedback (client, i, buf)
i2->max_value = i->ctrl.max_value;
if (client->swapped)
{
swaps(&i2->length,n);
swapl(&i2->resolution,n);
swapl(&i2->min_value,n);
swapl(&i2->max_value,n);
swaps(&i2->length);
swapl(&i2->resolution);
swapl(&i2->min_value);
swapl(&i2->max_value);
}
*buf += sizeof (xIntegerFeedbackState);
}
......@@ -310,7 +305,6 @@ CopySwapStringFeedback (client, s, buf)
char **buf;
{
int i;
register char n;
xStringFeedbackState *s2;
KeySym *kptr;
......@@ -327,13 +321,13 @@ CopySwapStringFeedback (client, s, buf)
*kptr++ = *(s->ctrl.symbols_supported+i);
if (client->swapped)
{
swaps(&s2->length,n);
swaps(&s2->max_symbols,n);
swaps(&s2->num_syms_supported,n);
swaps(&s2->length);
swaps(&s2->max_symbols);
swaps(&s2->num_syms_supported);
kptr = (KeySym *) (*buf);
for (i=0; i<s->ctrl.num_symbols_supported; i++,kptr++)
{
swapl(kptr,n);
swapl(kptr);
}
}
*buf += (s->ctrl.num_symbols_supported * sizeof (KeySym));
......@@ -351,7 +345,6 @@ CopySwapLedFeedback (client, l, buf)
LedFeedbackPtr l;
char **buf;
{
register char n;
xLedFeedbackState *l2;
l2 = (xLedFeedbackState *) *buf;
......@@ -362,9 +355,9 @@ CopySwapLedFeedback (client, l, buf)
l2->led_mask = l->ctrl.led_mask;
if (client->swapped)
{
swaps(&l2->length,n);
swapl(&l2->led_values,n);
swapl(&l2->led_mask,n);
swaps(&l2->length);
swapl(&l2->led_values);
swapl(&l2->led_mask);
}
*buf += sizeof (xLedFeedbackState);
}
......@@ -381,7 +374,6 @@ CopySwapBellFeedback (client, b, buf)
BellFeedbackPtr b;
char **buf;
{
register char n;
xBellFeedbackState *b2;
b2 = (xBellFeedbackState *) *buf;
......@@ -393,9 +385,9 @@ CopySwapBellFeedback (client, b, buf)
b2->duration = b->ctrl.duration;
if (client->swapped)
{
swaps(&b2->length,n);
swaps(&b2->pitch,n);
swaps(&b2->duration,n);
swaps(&b2->length);
swaps(&b2->pitch);
swaps(&b2->duration);
}
*buf += sizeof (xBellFeedbackState);
}
......@@ -413,10 +405,8 @@ SRepXGetFeedbackControl (client, size, rep)
int size;
xGetFeedbackControlReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->num_feedbacks, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->num_feedbacks);
WriteToClient(client, size, (char *)rep);
}
......@@ -81,10 +81,8 @@ int
SProcXGetDeviceFocus(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetDeviceFocusReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXGetDeviceFocus(client));
}
......@@ -147,11 +145,9 @@ SRepXGetDeviceFocus (client, size, rep)
int size;
xGetDeviceFocusReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swapl(&rep->focus, n);
swapl(&rep->time, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swapl(&rep->focus);
swapl(&rep->time);
WriteToClient(client, size, (char *)rep);
}
......@@ -82,10 +82,8 @@ int
SProcXGetDeviceKeyMapping(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetDeviceKeyMappingReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXGetDeviceKeyMapping(client));
}
......@@ -169,10 +167,8 @@ SRepXGetDeviceKeyMapping (client, size, rep)
int size;
xGetDeviceKeyMappingReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -81,10 +81,8 @@ int
SProcXGetDeviceModifierMapping(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetDeviceModifierMappingReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXGetDeviceModifierMapping(client));
}
......@@ -150,9 +148,7 @@ SRepXGetDeviceModifierMapping (client, size, rep)
int size;
xGetDeviceModifierMappingReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -85,12 +85,10 @@ int
SProcXGetDeviceDontPropagateList(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetDeviceDontPropagateListReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
swapl(&stuff->window, n);
swapl(&stuff->window);
return(ProcXGetDeviceDontPropagateList(client));
}
......@@ -206,10 +204,8 @@ SRepXGetDeviceDontPropagateList (client, size, rep)
int size;
xGetDeviceDontPropagateListReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->count, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->count);
WriteToClient(client, size, (char *)rep);
}
......@@ -83,12 +83,10 @@ int
SProcXGetSelectedExtensionEvents(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetSelectedExtensionEventsReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
swapl(&stuff->window, n);
swapl(&stuff->window);
return(ProcXGetSelectedExtensionEvents(client));
}
......@@ -186,11 +184,9 @@ SRepXGetSelectedExtensionEvents (client, size, rep)
int size;
xGetSelectedExtensionEventsReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->this_client_count, n);
swaps(&rep->all_clients_count, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->this_client_count);
swaps(&rep->all_clients_count);
WriteToClient(client, size, (char *)rep);
}
......@@ -82,12 +82,10 @@ int
SProcXGetExtensionVersion(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetExtensionVersionReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
swaps(&stuff->nbytes, n);
swaps(&stuff->nbytes);
return(ProcXGetExtensionVersion(client));
}
......@@ -148,11 +146,9 @@ SRepXGetExtensionVersion (client, size, rep)
int size;
xGetExtensionVersionReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->major_version, n);
swaps(&rep->minor_version, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->major_version);
swaps(&rep->minor_version);
WriteToClient(client, size, (char *)rep);
}
......@@ -86,14 +86,12 @@ int
SProcXGrabDevice(client)
register ClientPtr client;
{
register char n;
REQUEST(xGrabDeviceReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
swapl(&stuff->grabWindow, n);
swapl(&stuff->time, n);
swaps(&stuff->event_count, n);
swapl(&stuff->grabWindow);
swapl(&stuff->time);
swaps(&stuff->event_count);
if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count)
return BadLength;
......@@ -221,9 +219,7 @@ SRepXGrabDevice (client, size, rep)
int size;
xGrabDeviceReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -83,14 +83,12 @@ int
SProcXGrabDeviceButton(client)
register ClientPtr client;
{
register char n;
REQUEST(xGrabDeviceButtonReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
swapl(&stuff->grabWindow, n);
swaps(&stuff->modifiers, n);
swaps(&stuff->event_count, n);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
......
......@@ -83,14 +83,12 @@ int
SProcXGrabDeviceKey(client)
register ClientPtr client;
{
register char n;
REQUEST(xGrabDeviceKeyReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
swapl(&stuff->grabWindow, n);
swaps(&stuff->modifiers, n);
swaps(&stuff->event_count, n);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return(ProcXGrabDeviceKey(client));
......
......@@ -81,13 +81,11 @@ int
SProcXGetDeviceMotionEvents(client)
register ClientPtr client;
{
register char n;
REQUEST(xGetDeviceMotionEventsReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
swapl(&stuff->start, n);
swapl(&stuff->stop, n);
swapl(&stuff->start);
swapl(&stuff->stop);
return(ProcXGetDeviceMotionEvents(client));
}
......@@ -175,12 +173,10 @@ ProcXGetDeviceMotionEvents(client)
{
if (client->swapped)
{
register char n;
bufptr = coords;
for (i=0; i<nEvents * (axes+1); i++)
{
swapl(bufptr, n);
swapl(bufptr);
bufptr++;
}
}
......@@ -204,10 +200,8 @@ SRepXGetDeviceMotionEvents (client, size, rep)
int size;
xGetDeviceMotionEventsReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swapl(&rep->nEvents, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swapl(&rep->nEvents);
WriteToClient(client, size, (char *)rep);
}
......@@ -83,10 +83,8 @@ int
SProcXListInputDevices(client)
register ClientPtr client;
{
register char n;
REQUEST(xListInputDevicesReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXListInputDevices(client));
}
......@@ -254,7 +252,6 @@ CopySwapDevice (client, d, num_classes, buf)
int num_classes;
char **buf;
{
register char n;
xDeviceInfoPtr dev;
dev = (xDeviceInfoPtr) *buf;
......@@ -270,7 +267,7 @@ CopySwapDevice (client, d, num_classes, buf)
dev->use = IsXExtensionDevice;
if (client->swapped)
{
swapl(&dev->type, n); /* macro - braces are required */
swapl(&dev->type); /* macro - braces are required */
}
*buf += sizeof (xDeviceInfo);
}
......@@ -287,7 +284,6 @@ CopySwapKeyClass (client, k, buf)
KeyClassPtr k;
char **buf;
{
register char n;
xKeyInfoPtr k2;
k2 = (xKeyInfoPtr) *buf;
......@@ -298,7 +294,7 @@ CopySwapKeyClass (client, k, buf)
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
if (client->swapped)
{
swaps(&k2->num_keys,n);
swaps(&k2->num_keys);
}
*buf += sizeof (xKeyInfo);
}
......@@ -315,7 +311,6 @@ CopySwapButtonClass (client, b, buf)
ButtonClassPtr b;
char **buf;
{
register char n;
xButtonInfoPtr b2;
b2 = (xButtonInfoPtr) *buf;
......@@ -324,7 +319,7 @@ CopySwapButtonClass (client, b, buf)
b2->num_buttons = b->numButtons;
if (client->swapped)
{
swaps(&b2->num_buttons,n); /* macro - braces are required */
swaps(&b2->num_buttons); /* macro - braces are required */
}
*buf += sizeof (xButtonInfo);
}
......@@ -348,7 +343,6 @@ CopySwapValuatorClass (client, v, buf)
char **buf;
{
int i, j, axes, t_axes;
register char n;
xValuatorInfoPtr v2;
AxisInfo *a;
xAxisInfoPtr a2;
......@@ -365,7 +359,7 @@ CopySwapValuatorClass (client, v, buf)
v2->motion_buffer_size = v->numMotionEvents;
if (client->swapped)
{
swapl(&v2->motion_buffer_size,n);
swapl(&v2->motion_buffer_size);
}
*buf += sizeof (xValuatorInfo);
a = v->axes + (VPC * i);
......@@ -375,9 +369,9 @@ CopySwapValuatorClass (client, v, buf)
a2->max_value = a->max_value;
a2->resolution = a->resolution;
if (client->swapped) {
swapl(&a2->min_value,n);
swapl(&a2->max_value,n);
swapl(&a2->resolution,n);
swapl(&a2->min_value);
swapl(&a2->max_value);
swapl(&a2->resolution);
}
a2++;
a++;
......@@ -400,9 +394,7 @@ SRepXListInputDevices (client, size, rep)
int size;
xListInputDevicesReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -85,10 +85,8 @@ int
SProcXOpenDevice(client)
register ClientPtr client;
{
register char n;
REQUEST(xOpenDeviceReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXOpenDevice(client));
}
......@@ -198,9 +196,7 @@ SRepXOpenDevice (client, size, rep)
int size;
xOpenDeviceReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -63,10 +63,8 @@ int
SProcXQueryDeviceState(client)
register ClientPtr client;
{
register char n;
REQUEST(xQueryDeviceStateReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXQueryDeviceState(client));
}
......@@ -80,7 +78,6 @@ int
ProcXQueryDeviceState(client)
register ClientPtr client;
{
register char n;
int i;
int num_classes = 0;
int total_length = 0;
......@@ -179,7 +176,7 @@ ProcXQueryDeviceState(client)
*((int *) buf) = *values++;
if (client->swapped)
{
swapl ((int *) buf, n);/* macro - braces needed */
swapl ((int *) buf);/* macro - braces needed */
}
buf += sizeof(int);
}
......@@ -207,9 +204,7 @@ SRepXQueryDeviceState (client, size, rep)
int size;
xQueryDeviceStateReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -87,13 +87,11 @@ int
SProcXSelectExtensionEvent (client)
register ClientPtr client;
{
register char n;
REQUEST(xSelectExtensionEventReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
swapl(&stuff->window, n);
swaps(&stuff->count, n);
swapl(&stuff->window);
swaps(&stuff->count);
REQUEST_FIXED_SIZE(xSelectExtensionEventReq,
stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
......
......@@ -86,7 +86,6 @@ int
SProcXSendExtensionEvent(client)
register ClientPtr client;
{
register char n;
CARD32 *p;
register int i;
xEvent eventT;
......@@ -94,10 +93,10 @@ SProcXSendExtensionEvent(client)
EventSwapPtr proc;
REQUEST(xSendExtensionEventReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
swapl(&stuff->destination, n);
swaps(&stuff->count, n);
swapl(&stuff->destination);
swaps(&stuff->count);
if (stuff->length != (sizeof(xSendExtensionEventReq) >> 2) + stuff->count +
(stuff->num_events * (sizeof(xEvent) >> 2)))
......@@ -154,6 +153,8 @@ ProcXSendExtensionEvent (client)
return Success;
}
// FIXME: ret is not initialized and should not be returned...
if (stuff->num_events == 0)
return ret;
......
......@@ -84,10 +84,8 @@ int
SProcXSetDeviceButtonMapping(client)
register ClientPtr client;
{
register char n;
REQUEST(xSetDeviceButtonMappingReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXSetDeviceButtonMapping(client));
}
......@@ -162,9 +160,7 @@ SRepXSetDeviceButtonMapping (client, size, rep)
int size;
xSetDeviceButtonMappingReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -81,10 +81,8 @@ int
SProcXSetDeviceValuators(client)
register ClientPtr client;
{
register char n;
REQUEST(xSetDeviceValuatorsReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXSetDeviceValuators(client));
}
......@@ -166,9 +164,7 @@ SRepXSetDeviceValuators (client, size, rep)
int size;
xSetDeviceValuatorsReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -84,13 +84,11 @@ int
SProcXSetDeviceFocus(client)
register ClientPtr client;
{
register char n;
REQUEST(xSetDeviceFocusReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
swapl(&stuff->focus, n);
swapl(&stuff->time, n);
swapl(&stuff->focus);
swapl(&stuff->time);
return(ProcXSetDeviceFocus(client));
}
......
......@@ -82,10 +82,8 @@ int
SProcXSetDeviceModifierMapping(client)
register ClientPtr client;
{
register char n;
REQUEST(xSetDeviceModifierMappingReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXSetDeviceModifierMapping(client));
}
......@@ -155,10 +153,8 @@ SRepXSetDeviceModifierMapping (client, size, rep)
int size;
xSetDeviceModifierMappingReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -81,10 +81,8 @@ int
SProcXSetDeviceMode(client)
register ClientPtr client;
{
register char n;
REQUEST(xSetDeviceModeReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcXSetDeviceMode(client));
}
......@@ -150,9 +148,7 @@ SRepXSetDeviceMode (client, size, rep)
int size;
xSetDeviceModeReply *rep;
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
......@@ -80,12 +80,10 @@ int
SProcXUngrabDevice(client)
register ClientPtr client;
{
register char n;
REQUEST(xUngrabDeviceReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
swapl(&stuff->time, n);
swapl(&stuff->time);
return(ProcXUngrabDevice(client));
}
......
......@@ -86,13 +86,11 @@ int
SProcXUngrabDeviceButton(client)
register ClientPtr client;
{
register char n;
REQUEST(xUngrabDeviceButtonReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
swapl(&stuff->grabWindow, n);
swaps(&stuff->modifiers, n);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
return(ProcXUngrabDeviceButton(client));
}
......
......@@ -86,13 +86,11 @@ int
SProcXUngrabDeviceKey(client)
register ClientPtr client;
{
register char n;
REQUEST(xUngrabDeviceKeyReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
swapl(&stuff->grabWindow, n);
swaps(&stuff->modifiers, n);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
return(ProcXUngrabDeviceKey(client));
}
......
......@@ -113,7 +113,6 @@ ProcCompositeQueryVersion (ClientPtr client)
.sequenceNumber = client->sequence,
.length = 0
};
register int n;
REQUEST(xCompositeQueryVersionReq);
......@@ -128,10 +127,10 @@ ProcCompositeQueryVersion (ClientPtr client)
pCompositeClient->major_version = rep.majorVersion;
pCompositeClient->minor_version = rep.minorVersion;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.majorVersion, n);
swapl(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.majorVersion);
swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep);
return Success;
......@@ -352,7 +351,6 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
CompScreenPtr cs;
CompOverlayClientPtr pOc;
int rc;
int n = 0;
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
/* Unsupported by current architecture and porting is too much effort. */
......@@ -403,9 +401,9 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.overlayWin, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.overlayWin);
}
WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
......@@ -470,111 +468,102 @@ ProcCompositeDispatch (ClientPtr client)
static int
SProcCompositeQueryVersion (ClientPtr client)
{
int n;
REQUEST(xCompositeQueryVersionReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
swapl(&stuff->majorVersion, n);
swapl(&stuff->minorVersion, n);
swapl(&stuff->majorVersion);
swapl(&stuff->minorVersion);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeRedirectWindow (ClientPtr client)
{
int n;
REQUEST(xCompositeRedirectWindowReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq);
swapl (&stuff->window, n);
swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeRedirectSubwindows (ClientPtr client)
{
int n;
REQUEST(xCompositeRedirectSubwindowsReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq);
swapl (&stuff->window, n);
swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeUnredirectWindow (ClientPtr client)
{
int n;
REQUEST(xCompositeUnredirectWindowReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq);
swapl (&stuff->window, n);
swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeUnredirectSubwindows (ClientPtr client)
{
int n;
REQUEST(xCompositeUnredirectSubwindowsReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq);
swapl (&stuff->window, n);
swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeCreateRegionFromBorderClip (ClientPtr client)
{
int n;
REQUEST(xCompositeCreateRegionFromBorderClipReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq);
swapl (&stuff->region, n);
swapl (&stuff->window, n);
swapl (&stuff->region);
swapl (&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeNameWindowPixmap (ClientPtr client)
{
int n;
REQUEST(xCompositeNameWindowPixmapReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq);
swapl (&stuff->window, n);
swapl (&stuff->pixmap, n);
swapl (&stuff->window);
swapl (&stuff->pixmap);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeGetOverlayWindow(ClientPtr client)
{
int n = 0;
REQUEST(xCompositeGetOverlayWindowReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
swapl(&stuff->window, n);
swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeReleaseOverlayWindow(ClientPtr client)
{
int n = 0;
REQUEST(xCompositeReleaseOverlayWindowReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq);
swapl(&stuff->window, n);
swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
......@@ -903,7 +892,6 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
int rc;
PanoramiXRes *win, *overlayWin = NULL;
int i;
int n = 0;
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
......@@ -986,9 +974,9 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.overlayWin, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.overlayWin);
}
WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep);
......
......@@ -137,7 +137,6 @@ ProcDamageQueryVersion(ClientPtr client)
{
DamageClientPtr pDamageClient = GetDamageClient (client);
xDamageQueryVersionReply rep;
register int n;
REQUEST(xDamageQueryVersionReq);
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
......@@ -158,10 +157,10 @@ ProcDamageQueryVersion(ClientPtr client)
pDamageClient->major_version = rep.majorVersion;
pDamageClient->minor_version = rep.minorVersion;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.majorVersion, n);
swapl(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.majorVersion);
swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep);
return(client->noClientException);
......@@ -309,52 +308,48 @@ ProcDamageDispatch (ClientPtr client)
static int
SProcDamageQueryVersion(ClientPtr client)
{
register int n;
REQUEST(xDamageQueryVersionReq);
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
swapl(&stuff->majorVersion, n);
swapl(&stuff->minorVersion, n);
swapl(&stuff->majorVersion);
swapl(&stuff->minorVersion);
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
static int
SProcDamageCreate (ClientPtr client)
{
register int n;
REQUEST(xDamageCreateReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xDamageCreateReq);
swapl (&stuff->damage, n);
swapl (&stuff->drawable, n);
swapl (&stuff->damage);
swapl (&stuff->drawable);
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
static int
SProcDamageDestroy (ClientPtr client)
{
register int n;
REQUEST(xDamageDestroyReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xDamageDestroyReq);
swapl (&stuff->damage, n);
swapl (&stuff->damage);
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
static int
SProcDamageSubtract (ClientPtr client)
{
register int n;
REQUEST(xDamageSubtractReq);
swaps (&stuff->length, n);
swaps (&stuff->length);
REQUEST_SIZE_MATCH(xDamageSubtractReq);
swapl (&stuff->damage, n);
swapl (&stuff->repair, n);
swapl (&stuff->parts, n);
swapl (&stuff->damage);
swapl (&stuff->repair);
swapl (&stuff->parts);
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
......
......@@ -362,8 +362,6 @@ ProcDbeGetVersion(client)
{
/* REQUEST(xDbeGetVersionReq); */
xDbeGetVersionReply rep;
register int n;
REQUEST_SIZE_MATCH(xDbeGetVersionReq);
......@@ -375,7 +373,7 @@ ProcDbeGetVersion(client)
if (client->swapped)
{
swaps(&rep.sequenceNumber, n);
swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep);
......@@ -898,7 +896,7 @@ ProcDbeGetVisualInfo(client)
xDbeGetVisualInfoReply rep;
Drawable *drawables;
DrawablePtr *pDrawables = NULL;
register int i, j, n;
register int i, j;
register int count; /* number of visual infos in reply */
register int length; /* length of reply */
ScreenPtr pScreen;
......@@ -984,9 +982,9 @@ ProcDbeGetVisualInfo(client)
if (client->swapped)
{
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.m, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.m);
}
/* Send off reply. */
......@@ -1003,7 +1001,7 @@ ProcDbeGetVisualInfo(client)
if (client->swapped)
{
swapl(&data32, n);
swapl(&data32);
}
WriteToClient(client, sizeof(CARD32), (char *)&data32);
......@@ -1024,7 +1022,7 @@ ProcDbeGetVisualInfo(client)
if (client->swapped)
{
swapl(&visInfo.visualID, n);
swapl(&visInfo.visualID);
/* We do not need to swap depth and perfLevel since they are
* already 1 byte quantities.
......@@ -1075,8 +1073,6 @@ ProcDbeGetBackBufferAttributes(client)
REQUEST(xDbeGetBackBufferAttributesReq);
xDbeGetBackBufferAttributesReply rep;
DbeWindowPrivPtr pDbeWindowPriv;
int n;
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
......@@ -1096,9 +1092,9 @@ ProcDbeGetBackBufferAttributes(client)
if (client->swapped)
{
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.attributes, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.attributes);
}
WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply),
......@@ -1179,10 +1175,8 @@ SProcDbeGetVersion(client)
ClientPtr client;
{
REQUEST(xDbeGetVersionReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcDbeGetVersion(client));
} /* SProcDbeGetVersion() */
......@@ -1216,13 +1210,12 @@ SProcDbeAllocateBackBufferName(client)
ClientPtr client;
{
REQUEST(xDbeAllocateBackBufferNameReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
swapl(&stuff->window, n);
swapl(&stuff->buffer, n);
swapl(&stuff->window);
swapl(&stuff->buffer);
/* stuff->swapAction is a byte. We do not need to swap this field. */
return(ProcDbeAllocateBackBufferName(client));
......@@ -1252,13 +1245,11 @@ SProcDbeDeallocateBackBufferName(client)
ClientPtr client;
{
REQUEST (xDbeDeallocateBackBufferNameReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq);
swapl(&stuff->buffer, n);
swapl(&stuff->buffer);
return(ProcDbeDeallocateBackBufferName(client));
......@@ -1291,14 +1282,14 @@ SProcDbeSwapBuffers(client)
ClientPtr client;
{
REQUEST(xDbeSwapBuffersReq);
unsigned int i, n;
unsigned int i;
xDbeSwapInfo *pSwapInfo;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
swapl(&stuff->n, n);
swapl(&stuff->n);
if (stuff->n > UINT32_MAX / sizeof(DbeSwapInfoRec))
return BadAlloc;
REQUEST_FIXED_SIZE(xDbeSwapBuffersReq, stuff->n * sizeof(xDbeSwapInfo));
......@@ -1313,7 +1304,7 @@ SProcDbeSwapBuffers(client)
*/
for (i = 0; i < stuff->n; i++)
{
swapl(&pSwapInfo->window, n);
swapl(&pSwapInfo->window);
}
}
......@@ -1343,9 +1334,8 @@ SProcDbeBeginIdiom(client)
ClientPtr client;
{
REQUEST(xDbeBeginIdiomReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
return(ProcDbeBeginIdiom(client));
} /* SProcDbeBeginIdiom() */
......@@ -1373,13 +1363,11 @@ SProcDbeGetVisualInfo(client)
ClientPtr client;
{
REQUEST(xDbeGetVisualInfoReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq);
swapl(&stuff->n, n);
swapl(&stuff->n);
SwapRestL(stuff);
return(ProcDbeGetVisualInfo(client));
......@@ -1408,12 +1396,11 @@ SProcDbeGetBackBufferAttributes(client)
ClientPtr client;
{
REQUEST (xDbeGetBackBufferAttributesReq);
register int n;
swaps(&stuff->length, n);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
swapl(&stuff->buffer, n);
swapl(&stuff->buffer);
return(ProcDbeGetBackBufferAttributes(client));
......
......@@ -3808,7 +3808,7 @@ ProcInitialConnection(register ClientPtr client)
((prefix->nbytesAuthString + (unsigned)3) >> 2);
if (client->swapped)
{
swaps(&stuff->length, whichbyte);
swaps(&stuff->length);
}
ResetCurrentRequest(client);
return (client->noClientException);
......
......@@ -131,7 +131,6 @@ ProcRenderQueryVersion (ClientPtr client)
{
RenderClientPtr pRenderClient = GetRenderClient (client);
xRenderQueryVersionReply rep;
register int n;
REQUEST(xRenderQueryVersionReq);
REQUEST_SIZE_MATCH(xRenderQueryVersionReq);
......@@ -146,10 +145,10 @@ ProcRenderQueryVersion (ClientPtr client)
rep.majorVersion = nxagentRenderVersionMajor;
rep.minorVersion = nxagentRenderVersionMinor;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.majorVersion, n);
swapl(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.majorVersion);
swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep);
return (client->noClientException);
......@@ -176,7 +175,6 @@ ProcRenderQueryPictFormats (ClientPtr client)
int nvisual;
int rlength;
int s;
int n;
int numScreens;
int numSubpixel;
......@@ -266,16 +264,16 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictForm->colormap = None;
if (client->swapped)
{
swapl (&pictForm->id, n);
swaps (&pictForm->direct.red, n);
swaps (&pictForm->direct.redMask, n);
swaps (&pictForm->direct.green, n);
swaps (&pictForm->direct.greenMask, n);
swaps (&pictForm->direct.blue, n);
swaps (&pictForm->direct.blueMask, n);
swaps (&pictForm->direct.alpha, n);
swaps (&pictForm->direct.alphaMask, n);
swapl (&pictForm->colormap, n);
swapl (&pictForm->id);
swaps (&pictForm->direct.red);
swaps (&pictForm->direct.redMask);
swaps (&pictForm->direct.green);
swaps (&pictForm->direct.greenMask);
swaps (&pictForm->direct.blue);
swaps (&pictForm->direct.blueMask);
swaps (&pictForm->direct.alpha);
swaps (&pictForm->direct.alphaMask);
swapl (&pictForm->colormap);
}
pictForm++;
}
......@@ -305,8 +303,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictVisual->format = pFormat->id;
if (client->swapped)
{
swapl (&pictVisual->visual, n);
swapl (&pictVisual->format, n);
swapl (&pictVisual->visual);
swapl (&pictVisual->format);
}
pictVisual++;
nvisual++;
......@@ -316,7 +314,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictDepth->nPictVisuals = nvisual;
if (client->swapped)
{
swaps (&pictDepth->nPictVisuals, n);
swaps (&pictDepth->nPictVisuals);
}
ndepth++;
pictDepth = (xPictDepth *) pictVisual;
......@@ -329,8 +327,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictScreen->fallback = 0;
if (client->swapped)
{
swapl (&pictScreen->nDepth, n);
swapl (&pictScreen->fallback, n);
swapl (&pictScreen->nDepth);
swapl (&pictScreen->fallback);
}
pictScreen = (xPictScreen *) pictDepth;
}
......@@ -346,20 +344,20 @@ ProcRenderQueryPictFormats (ClientPtr client)
*pictSubpixel = SubPixelUnknown;
if (client->swapped)
{
swapl (pictSubpixel, n);
swapl (pictSubpixel);
}
++pictSubpixel;
}
if (client->swapped)
{
swaps (&reply->sequenceNumber, n);
swapl (&reply->length, n);
swapl (&reply->numFormats, n);
swapl (&reply->numScreens, n);
swapl (&reply->numDepths, n);
swapl (&reply->numVisuals, n);
swapl (&reply->numSubpixel, n);
swaps (&reply->sequenceNumber);
swapl (&reply->length);
swapl (&reply->numFormats);
swapl (&reply->numScreens);
swapl (&reply->numDepths);
swapl (&reply->numVisuals);
swapl (&reply->numSubpixel);
}
WriteToClient(client, rlength, (char *) reply);
free (reply);
......
......@@ -277,32 +277,107 @@ version_compare(uint32_t a_major, uint32_t a_minor,
#define SwapRestL(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 */
#define swapl(x, n) { \
n = ((char *) (x))[0];\
((char *) (x))[0] = ((char *) (x))[3];\
((char *) (x))[3] = n;\
n = ((char *) (x))[1];\
((char *) (x))[1] = ((char *) (x))[2];\
((char *) (x))[2] = n; }
/* byte swap a short */
#define swaps(x, n) { \
n = ((char *) (x))[0];\
((char *) (x))[0] = ((char *) (x))[1];\
((char *) (x))[1] = n; }
static inline void
swap_uint32(uint32_t * x)
{
char n = ((char *) x)[0];
((char *) x)[0] = ((char *) x)[3];
((char *) x)[3] = n;
n = ((char *) x)[1];
((char *) x)[1] = ((char *) x)[2];
((char *) x)[2] = 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 */
#define cpswapl(src, dst) { \
((char *)&(dst))[0] = ((char *) &(src))[3];\
((char *)&(dst))[1] = ((char *) &(src))[2];\
((char *)&(dst))[2] = ((char *) &(src))[1];\
((char *)&(dst))[3] = ((char *) &(src))[0]; }
#define cpswapl(src, dst) do { \
if (sizeof((src)) != 4 || sizeof((dst)) != 4) \
wrong_size(); \
(dst) = lswapl((src)); \
} while (0)
/* copy short from src to dst byteswapping on the way */
#define cpswaps(src, dst) { \
((char *) &(dst))[0] = ((char *) &(src))[1];\
((char *) &(dst))[1] = ((char *) &(src))[0]; }
#define cpswaps(src, dst) do { \
if (sizeof((src)) != 2 || sizeof((dst)) != 2) \
wrong_size(); \
(dst) = lswaps((src)); \
} while (0)
extern void SwapLongs(
CARD32 *list,
......
......@@ -933,9 +933,9 @@ ErrorConnMax(XtransConnInfo trans_conn)
if (((*(char *) &whichbyte) && (byteOrder == 'B')) ||
(!(*(char *) &whichbyte) && (byteOrder == 'l')))
{
swaps(&csp.majorVersion, whichbyte);
swaps(&csp.minorVersion, whichbyte);
swaps(&csp.length, whichbyte);
swaps(&csp.majorVersion);
swaps(&csp.minorVersion);
swaps(&csp.length);
}
iov[0].iov_len = sz_xConnSetupPrefix;
iov[0].iov_base = (char *) &csp;
......
......@@ -591,8 +591,7 @@ ResetCurrentRequest(ClientPtr client)
((xBigReq *)oci->bufptr)->length = client->req_len;
if (client->swapped)
{
char n;
swapl(&((xBigReq *)oci->bufptr)->length, n);
swapl(&((xBigReq *)oci->bufptr)->length);
}
}
#endif
......@@ -948,11 +947,10 @@ WriteToClient (ClientPtr who, int count, char *buf)
{ /* start of new reply */
CARD32 replylen;
unsigned long bytesleft;
char n;
replylen = ((xGenericReply *)buf)->length;
if (who->swapped)
swapl(&replylen, n);
swapl(&replylen);
bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;
replyinfo.startOfReply = TRUE;
replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft;
......
......@@ -997,7 +997,6 @@ ProcRRGetCrtcInfo(ClientPtr client)
int i, j, k;
int width, height;
BoxRec panned_area;
int n;
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
......@@ -1060,7 +1059,7 @@ ProcRRGetCrtcInfo(ClientPtr client)
for (i = 0; i < crtc->numOutputs; i++) {
outputs[i] = crtc->outputs[i]->id;
if (client->swapped)
swapl(&outputs[i], n);
swapl(&outputs[i]);
}
k = 0;
for (i = 0; i < pScrPriv->numOutputs; i++)
......@@ -1068,23 +1067,23 @@ ProcRRGetCrtcInfo(ClientPtr client)
if (pScrPriv->outputs[i]->crtcs[j] == crtc) {
possible[k] = pScrPriv->outputs[i]->id;
if (client->swapped)
swapl(&possible[k], n);
swapl(&possible[k]);
k++;
}
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.timestamp, n);
swaps(&rep.x, n);
swaps(&rep.y, n);
swaps(&rep.width, n);
swaps(&rep.height, n);
swapl(&rep.mode, n);
swaps(&rep.rotation, n);
swaps(&rep.rotations, n);
swaps(&rep.nOutput, n);
swaps(&rep.nPossibleOutput, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.timestamp);
swaps(&rep.x);
swaps(&rep.y);
swaps(&rep.width);
swaps(&rep.height);
swapl(&rep.mode);
swaps(&rep.rotation);
swaps(&rep.rotations);
swaps(&rep.nOutput);
swaps(&rep.nPossibleOutput);
}
WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *) &rep);
if (extraLen) {
......@@ -1115,7 +1114,6 @@ ProcRRSetCrtcConfig(ClientPtr client)
#endif
i, j;
CARD8 status;
int n;
REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
numOutputs = (stuff->length - bytes_to_int32(SIZEOF(xRRSetCrtcConfigReq)));
......@@ -1314,9 +1312,9 @@ ProcRRSetCrtcConfig(ClientPtr client)
.newTimestamp = pScrPriv->lastSetTime.milliseconds
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.newTimestamp, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.newTimestamp);
}
WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *) &rep);
......@@ -1334,7 +1332,6 @@ ProcRRGetPanning(ClientPtr client)
BoxRec total;
BoxRec tracking;
INT16 border[4];
int n;
REQUEST_SIZE_MATCH(xRRGetPanningReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
......@@ -1372,21 +1369,21 @@ ProcRRGetPanning(ClientPtr client)
}
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.timestamp, n);
swaps(&rep.left, n);
swaps(&rep.top, n);
swaps(&rep.width, n);
swaps(&rep.height, n);
swaps(&rep.track_left, n);
swaps(&rep.track_top, n);
swaps(&rep.track_width, n);
swaps(&rep.track_height, n);
swaps(&rep.border_left, n);
swaps(&rep.border_top, n);
swaps(&rep.border_right, n);
swaps(&rep.border_bottom, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.timestamp);
swaps(&rep.left);
swaps(&rep.top);
swaps(&rep.width);
swaps(&rep.height);
swaps(&rep.track_left);
swaps(&rep.track_top);
swaps(&rep.track_width);
swaps(&rep.track_height);
swaps(&rep.border_left);
swaps(&rep.border_top);
swaps(&rep.border_right);
swaps(&rep.border_bottom);
}
WriteToClient(client, sizeof(xRRGetPanningReply), (char *) &rep);
return Success;
......@@ -1405,7 +1402,6 @@ ProcRRSetPanning(ClientPtr client)
BoxRec tracking;
INT16 border[4];
CARD8 status;
int n;
REQUEST_SIZE_MATCH(xRRSetPanningReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
......@@ -1456,9 +1452,9 @@ ProcRRSetPanning(ClientPtr client)
.newTimestamp = pScrPriv->lastSetTime.milliseconds
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.newTimestamp, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.newTimestamp);
}
WriteToClient(client, sizeof(xRRSetPanningReply), (char *) &rep);
return Success;
......@@ -1470,7 +1466,6 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
REQUEST(xRRGetCrtcGammaSizeReq);
xRRGetCrtcGammaSizeReply reply;
RRCrtcPtr crtc;
int n;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
......@@ -1486,9 +1481,9 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
.size = crtc->gammaSize
};
if (client->swapped) {
swaps(&reply.sequenceNumber, n);
swapl(&reply.length, n);
swaps(&reply.size, n);
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swaps(&reply.size);
}
WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), (char *) &reply);
return Success;
......@@ -1502,7 +1497,6 @@ ProcRRGetCrtcGamma(ClientPtr client)
RRCrtcPtr crtc;
unsigned long len;
char *extra = NULL;
int n;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
......@@ -1526,9 +1520,9 @@ ProcRRGetCrtcGamma(ClientPtr client)
.size = crtc->gammaSize
};
if (client->swapped) {
swaps(&reply.sequenceNumber, n);
swapl(&reply.length, n);
swaps(&reply.size, n);
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swaps(&reply.size);
}
WriteToClient(client, sizeof(xRRGetCrtcGammaReply), (char *) &reply);
if (crtc->gammaSize) {
......@@ -1620,7 +1614,6 @@ transform_filter_encode(ClientPtr client, char *output,
CARD16 *nparamsFilter, RRTransformPtr transform)
{
int nbytes, nparams;
int n;
if (transform->filter == NULL) {
*nbytesFilter = 0;
......@@ -1636,8 +1629,8 @@ transform_filter_encode(ClientPtr client, char *output,
output[nbytes++] = 0;
memcpy(output + nbytes, transform->params, nparams * sizeof(xFixed));
if (client->swapped) {
swaps(nbytesFilter, n);
swaps(nparamsFilter, n);
swaps(nbytesFilter);
swaps(nparamsFilter);
SwapLongs((CARD32 *) (output + nbytes), nparams);
}
nbytes += nparams * sizeof(xFixed);
......@@ -1662,7 +1655,6 @@ ProcRRGetCrtcTransform(ClientPtr client)
int nextra;
RRTransformPtr current, pending;
char *extra;
int n;
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
......@@ -1695,8 +1687,8 @@ ProcRRGetCrtcTransform(ClientPtr client)
&reply->currentNparamsFilter, current);
if (client->swapped) {
swaps(&reply->sequenceNumber, n);
swapl(&reply->length, n);
swaps(&reply->sequenceNumber);
swapl(&reply->length);
}
WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra,
(char *) reply);
......
......@@ -35,8 +35,6 @@ RRClientKnowsRates(ClientPtr pClient)
static int
ProcRRQueryVersion(ClientPtr client)
{
int n;
xRRQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
......@@ -61,10 +59,10 @@ ProcRRQueryVersion(ClientPtr client)
}
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.majorVersion, n);
swapl(&rep.minorVersion, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.majorVersion);
swapl(&rep.minorVersion);
}
#ifndef NXAGENT_SERVER
WriteToClient(client, sizeof(xRRQueryVersionReply), &rep);
......
......@@ -344,7 +344,6 @@ ProcRRCreateMode(ClientPtr client)
char *name;
int error, rc;
RRModePtr mode;
int n;
REQUEST_AT_LEAST_SIZE(xRRCreateModeReq);
#ifndef NXAGENT_SERVER
......@@ -377,9 +376,9 @@ ProcRRCreateMode(ClientPtr client)
.mode = mode->mode.id
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.mode, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.mode);
}
WriteToClient(client, sizeof(xRRCreateModeReply), (char *) &rep);
/* Drop out reference to this mode */
......
......@@ -629,7 +629,7 @@ ProcRRGetMonitors(ClientPtr client)
RRMonitorPtr monitors;
int nmonitors;
int noutputs;
int m, n;
int m;
Bool get_active;
REQUEST_SIZE_MATCH(xRRGetMonitorsReq);
......@@ -661,11 +661,11 @@ ProcRRGetMonitors(ClientPtr client)
rep.noutputs = noutputs;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.timestamp, n);
swapl(&rep.nmonitors, n);
swapl(&rep.noutputs, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.timestamp);
swapl(&rep.nmonitors);
swapl(&rep.noutputs);
}
WriteToClient(client, sizeof(xRRGetMonitorsReply), (char *) &rep);
......@@ -686,14 +686,14 @@ ProcRRGetMonitors(ClientPtr client)
.heightInMillimeters = monitor->geometry.mmHeight,
};
if (client->swapped) {
swapl(&info.name, n);
swaps(&info.noutput, n);
swaps(&info.x, n);
swaps(&info.y, n);
swaps(&info.width, n);
swaps(&info.height, n);
swapl(&info.widthInMillimeters, n);
swapl(&info.heightInMillimeters, n);
swapl(&info.name);
swaps(&info.noutput);
swaps(&info.x);
swaps(&info.y);
swaps(&info.width);
swaps(&info.height);
swapl(&info.widthInMillimeters);
swapl(&info.heightInMillimeters);
}
WriteToClient(client, sizeof(xRRMonitorInfo), (char *) &info);
......
......@@ -463,7 +463,6 @@ ProcRRGetOutputInfo(ClientPtr client)
RROutput *clones;
char *name;
int i;
int n;
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
......@@ -509,7 +508,7 @@ ProcRRGetOutputInfo(ClientPtr client)
for (i = 0; i < output->numCrtcs; i++) {
crtcs[i] = output->crtcs[i]->id;
if (client->swapped)
swapl(&crtcs[i], n);
swapl(&crtcs[i]);
}
for (i = 0; i < output->numModes + output->numUserModes; i++) {
if (i < output->numModes)
......@@ -517,26 +516,26 @@ ProcRRGetOutputInfo(ClientPtr client)
else
modes[i] = output->userModes[i - output->numModes]->mode.id;
if (client->swapped)
swapl(&modes[i], n);
swapl(&modes[i]);
}
for (i = 0; i < output->numClones; i++) {
clones[i] = output->clones[i]->id;
if (client->swapped)
swapl(&clones[i], n);
swapl(&clones[i]);
}
memcpy(name, output->name, output->nameLength);
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.timestamp, n);
swapl(&rep.crtc, n);
swapl(&rep.mmWidth, n);
swapl(&rep.mmHeight, n);
swaps(&rep.nCrtcs, n);
swaps(&rep.nModes, n);
swaps(&rep.nPreferred, n);
swaps(&rep.nClones, n);
swaps(&rep.nameLength, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.timestamp);
swapl(&rep.crtc);
swapl(&rep.mmWidth);
swapl(&rep.mmHeight);
swaps(&rep.nCrtcs);
swaps(&rep.nModes);
swaps(&rep.nPreferred);
swaps(&rep.nClones);
swaps(&rep.nameLength);
}
WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *) &rep);
if (extraLen) {
......@@ -639,7 +638,6 @@ ProcRRGetOutputPrimary(ClientPtr client)
xRRGetOutputPrimaryReply rep;
RROutputPtr primary = NULL;
int rc;
int n;
REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
......@@ -663,8 +661,8 @@ ProcRRGetOutputPrimary(ClientPtr client)
.output = primary ? primary->id : None
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.output, n);
swaps(&rep.sequenceNumber);
swapl(&rep.output);
}
WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), (char *) &rep);
......
......@@ -405,7 +405,6 @@ ProcRRListOutputProperties(ClientPtr client)
int numProps = 0;
RROutputPtr output;
RRPropertyPtr prop;
int n;
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
......@@ -428,9 +427,9 @@ ProcRRListOutputProperties(ClientPtr client)
.nAtoms = numProps
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.nAtoms, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nAtoms);
}
WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char *) &rep);
......@@ -455,7 +454,6 @@ ProcRRQueryOutputProperty(ClientPtr client)
RROutputPtr output;
RRPropertyPtr prop;
char *extra = NULL;
int n;
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
......@@ -484,8 +482,8 @@ ProcRRQueryOutputProperty(ClientPtr client)
.immutable = prop->immutable
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), (char *) &rep);
if (prop->num_valid) {
......@@ -609,7 +607,6 @@ ProcRRGetOutputProperty(ClientPtr client)
RROutputPtr output;
xRRGetOutputPropertyReply reply;
char *extra = NULL;
int m;
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
if (stuff->delete)
......@@ -645,11 +642,11 @@ ProcRRGetOutputProperty(ClientPtr client)
reply.propertyType = None;
reply.format = 0;
if (client->swapped) {
swaps(&reply.sequenceNumber, m);
swapl(&reply.length, m);
swapl(&reply.propertyType, m);
swapl(&reply.bytesAfter, m);
swapl(&reply.nItems, m);
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetOutputPropertyReply),
(char *) &reply);
......@@ -674,11 +671,11 @@ ProcRRGetOutputProperty(ClientPtr client)
reply.nItems = 0;
reply.propertyType = prop_value->type;
if (client->swapped) {
swaps(&reply.sequenceNumber, n);
swapl(&reply.length, n);
swapl(&reply.propertyType, n);
swapl(&reply.bytesAfter, n);
swapl(&reply.nItems, n);
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetOutputPropertyReply),
(char *) &reply);
......@@ -728,11 +725,11 @@ ProcRRGetOutputProperty(ClientPtr client)
}
if (client->swapped) {
swaps(&reply.sequenceNumber, n);
swapl(&reply.length, n);
swapl(&reply.propertyType, n);
swapl(&reply.bytesAfter, n);
swapl(&reply.nItems, n);
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xGenericReply), (char *) &reply);
if (len) {
......
......@@ -43,7 +43,7 @@ RRProviderInitErrorValue(void)
if (pScrPriv->provider) { \
providers[count_providers] = pScrPriv->provider->id; \
if (client->swapped) \
swapl(&providers[count_providers], n); \
swapl(&providers[count_providers]); \
count_providers++; \
} \
} while(0)
......@@ -64,7 +64,6 @@ ProcRRGetProviders(ClientPtr client)
#ifndef NXAGENT_SERVER
ScreenPtr iter;
#endif
int n;
REQUEST_SIZE_MATCH(xRRGetProvidersReq);
#ifndef NXAGENT_SERVER
......@@ -143,10 +142,10 @@ ProcRRGetProviders(ClientPtr client)
}
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.timestamp, n);
swaps(&rep.nProviders, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.timestamp);
swaps(&rep.nProviders);
}
WriteToClient(client, sizeof(xRRGetProvidersReply), (char *) &rep);
if (extraLen)
......@@ -179,7 +178,6 @@ ProcRRGetProviderInfo(ClientPtr client)
#endif
RRProvider *providers;
uint32_t *prov_cap;
int n;
REQUEST_SIZE_MATCH(xRRGetProviderInfoReq);
VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess);
......@@ -233,31 +231,31 @@ ProcRRGetProviderInfo(ClientPtr client)
for (i = 0; i < pScrPriv->numCrtcs; i++) {
crtcs[i] = pScrPriv->crtcs[i]->id;
if (client->swapped)
swapl(&crtcs[i], n);
swapl(&crtcs[i]);
}
for (i = 0; i < pScrPriv->numOutputs; i++) {
outputs[i] = pScrPriv->outputs[i]->id;
if (client->swapped)
swapl(&outputs[i], n);
swapl(&outputs[i]);
}
i = 0;
if (provider->offload_sink) {
providers[i] = provider->offload_sink->id;
if (client->swapped)
swapl(&providers[i], n);
swapl(&providers[i]);
prov_cap[i] = RR_Capability_SinkOffload;
if (client->swapped)
swapl(&prov_cap[i], n);
swapl(&prov_cap[i]);
i++;
}
if (provider->output_source) {
providers[i] = provider->output_source->id;
if (client->swapped)
swapl(&providers[i], n);
swapl(&providers[i]);
prov_cap[i] = RR_Capability_SourceOutput;
swapl(&prov_cap[i], n);
swapl(&prov_cap[i]);
i++;
}
#ifndef NXAGENT_SERVER
......@@ -284,12 +282,12 @@ ProcRRGetProviderInfo(ClientPtr client)
#endif
memcpy(name, provider->name, rep.nameLength);
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.capabilities, n);
swaps(&rep.nCrtcs, n);
swaps(&rep.nOutputs, n);
swaps(&rep.nameLength, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.capabilities);
swaps(&rep.nCrtcs);
swaps(&rep.nOutputs);
swaps(&rep.nameLength);
}
WriteToClient(client, sizeof(xRRGetProviderInfoReply), (char *) &rep);
if (extraLen)
......
......@@ -401,7 +401,6 @@ ProcRRListProviderProperties(ClientPtr client)
int numProps = 0;
RRProviderPtr provider;
RRPropertyPtr prop;
int n;
REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq);
......@@ -424,9 +423,9 @@ ProcRRListProviderProperties(ClientPtr client)
.nAtoms = numProps
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.nAtoms, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nAtoms);
}
temppAtoms = pAtoms;
for (prop = provider->properties; prop; prop = prop->next)
......@@ -450,7 +449,6 @@ ProcRRQueryProviderProperty(ClientPtr client)
RRProviderPtr provider;
RRPropertyPtr prop;
char *extra = NULL;
int n;
REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq);
......@@ -478,8 +476,8 @@ ProcRRQueryProviderProperty(ClientPtr client)
.immutable = prop->immutable
};
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), (char *) &rep);
if (prop->num_valid) {
......@@ -637,11 +635,11 @@ ProcRRGetProviderProperty(ClientPtr client)
reply.propertyType = None;
reply.format = 0;
if (client->swapped) {
swaps(&reply.sequenceNumber, n);
swapl(&reply.length, n);
swapl(&reply.propertyType, n);
swapl(&reply.bytesAfter, n);
swapl(&reply.nItems, n);
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetProviderPropertyReply),
(char *) &reply);
......@@ -666,11 +664,11 @@ ProcRRGetProviderProperty(ClientPtr client)
reply.nItems = 0;
reply.propertyType = prop_value->type;
if (client->swapped) {
swaps(&reply.sequenceNumber, n);
swapl(&reply.length, n);
swapl(&reply.propertyType, n);
swapl(&reply.bytesAfter, n);
swapl(&reply.nItems, n);
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetProviderPropertyReply),
(char *) &reply);
......@@ -720,11 +718,11 @@ ProcRRGetProviderProperty(ClientPtr client)
}
if (client->swapped) {
swaps(&reply.sequenceNumber, n);
swapl(&reply.length, n);
swapl(&reply.propertyType, n);
swapl(&reply.bytesAfter, n);
swapl(&reply.nItems, n);
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.propertyType);
swapl(&reply.bytesAfter);
swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xGenericReply), (char *) &reply);
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