Commit 1a8cc666 authored by Demi Marie Obenour's avatar Demi Marie Obenour
Browse files

Remove a bunch of code from XFixes SProcs

`stuff->length` can be swapped once, rather than having to be swapped in
each sproc.
parent e30679b4
Pipeline #371088 passed with stages
in 7 minutes and 19 seconds
......@@ -300,7 +300,6 @@ SProcXFixesSelectCursorInput(ClientPtr client)
REQUEST(xXFixesSelectCursorInputReq);
REQUEST_SIZE_MATCH(xXFixesSelectCursorInputReq);
swaps(&stuff->length);
swapl(&stuff->window);
swapl(&stuff->eventMask);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
......@@ -418,9 +417,7 @@ ProcXFixesGetCursorImage(ClientPtr client)
int _X_COLD
SProcXFixesGetCursorImage(ClientPtr client)
{
REQUEST(xXFixesGetCursorImageReq);
swaps(&stuff->length);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
return ProcXFixesGetCursorImage(client);
}
int
......@@ -448,7 +445,6 @@ SProcXFixesSetCursorName(ClientPtr client)
{
REQUEST(xXFixesSetCursorNameReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq);
swapl(&stuff->cursor);
swaps(&stuff->nbytes);
......@@ -497,7 +493,6 @@ SProcXFixesGetCursorName(ClientPtr client)
{
REQUEST(xXFixesGetCursorNameReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
swapl(&stuff->cursor);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
......@@ -575,9 +570,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
int _X_COLD
SProcXFixesGetCursorImageAndName(ClientPtr client)
{
REQUEST(xXFixesGetCursorImageAndNameReq);
swaps(&stuff->length);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
return ProcXFixesGetCursorImageAndName(client);
}
/*
......@@ -702,7 +695,6 @@ SProcXFixesChangeCursor(ClientPtr client)
{
REQUEST(xXFixesChangeCursorReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesChangeCursorReq);
swapl(&stuff->source);
swapl(&stuff->destination);
......@@ -741,7 +733,6 @@ SProcXFixesChangeCursorByName(ClientPtr client)
{
REQUEST(xXFixesChangeCursorByNameReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesChangeCursorByNameReq);
swapl(&stuff->source);
swaps(&stuff->nbytes);
......@@ -901,7 +892,6 @@ SProcXFixesHideCursor(ClientPtr client)
{
REQUEST(xXFixesHideCursorReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesHideCursorReq);
swapl(&stuff->window);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
......@@ -952,7 +942,6 @@ SProcXFixesShowCursor(ClientPtr client)
{
REQUEST(xXFixesShowCursorReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesShowCursorReq);
swapl(&stuff->window);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
......@@ -1021,13 +1010,13 @@ SProcXFixesCreatePointerBarrier(ClientPtr client)
{
REQUEST(xXFixesCreatePointerBarrierReq);
int i;
CARD16 *in_devices = (CARD16 *) &stuff[1];
CARD16 *in_devices;
REQUEST_AT_LEAST_SIZE(xXFixesCreatePointerBarrierReq);
swaps(&stuff->length);
swaps(&stuff->num_devices);
REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices));
in_devices = (CARD16 *) (stuff + 1);
swapl(&stuff->barrier);
swapl(&stuff->window);
......@@ -1058,7 +1047,6 @@ SProcXFixesDestroyPointerBarrier(ClientPtr client)
{
REQUEST(xXFixesDestroyPointerBarrierReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq);
swapl(&stuff->barrier);
return ProcXFixesVector[stuff->xfixesReqType] (client);
......
......@@ -78,8 +78,6 @@ SProcXFixesSetClientDisconnectMode(ClientPtr client)
{
REQUEST(xXFixesSetClientDisconnectModeReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesSetClientDisconnectModeReq);
swapl(&stuff->disconnect_mode);
......@@ -115,8 +113,6 @@ SProcXFixesGetClientDisconnectMode(ClientPtr client)
{
REQUEST(xXFixesGetClientDisconnectModeReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesGetClientDisconnectModeReq);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
......
......@@ -96,7 +96,6 @@ SProcXFixesCreateRegion(ClientPtr client)
{
REQUEST(xXFixesCreateRegionReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq);
swapl(&stuff->region);
SwapRestS(stuff);
......@@ -140,7 +139,6 @@ SProcXFixesCreateRegionFromBitmap(ClientPtr client)
{
REQUEST(xXFixesCreateRegionFromBitmapReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromBitmapReq);
swapl(&stuff->region);
swapl(&stuff->bitmap);
......@@ -199,7 +197,6 @@ SProcXFixesCreateRegionFromWindow(ClientPtr client)
{
REQUEST(xXFixesCreateRegionFromWindowReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromWindowReq);
swapl(&stuff->region);
swapl(&stuff->window);
......@@ -242,7 +239,6 @@ SProcXFixesCreateRegionFromGC(ClientPtr client)
{
REQUEST(xXFixesCreateRegionFromGCReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromGCReq);
swapl(&stuff->region);
swapl(&stuff->gc);
......@@ -284,7 +280,6 @@ SProcXFixesCreateRegionFromPicture(ClientPtr client)
{
REQUEST(xXFixesCreateRegionFromPictureReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromPictureReq);
swapl(&stuff->region);
swapl(&stuff->picture);
......@@ -308,7 +303,6 @@ SProcXFixesDestroyRegion(ClientPtr client)
{
REQUEST(xXFixesDestroyRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
swapl(&stuff->region);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
......@@ -346,7 +340,6 @@ SProcXFixesSetRegion(ClientPtr client)
{
REQUEST(xXFixesSetRegionReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq);
swapl(&stuff->region);
SwapRestS(stuff);
......@@ -375,7 +368,6 @@ SProcXFixesCopyRegion(ClientPtr client)
{
REQUEST(xXFixesCopyRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesCopyRegionReq);
swapl(&stuff->source);
swapl(&stuff->destination);
......@@ -417,7 +409,6 @@ SProcXFixesCombineRegion(ClientPtr client)
{
REQUEST(xXFixesCombineRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesCombineRegionReq);
swapl(&stuff->source1);
swapl(&stuff->source2);
......@@ -461,7 +452,6 @@ SProcXFixesInvertRegion(ClientPtr client)
{
REQUEST(xXFixesInvertRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesInvertRegionReq);
swapl(&stuff->source);
swaps(&stuff->x);
......@@ -491,7 +481,6 @@ SProcXFixesTranslateRegion(ClientPtr client)
{
REQUEST(xXFixesTranslateRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq);
swapl(&stuff->region);
swaps(&stuff->dx);
......@@ -520,7 +509,6 @@ SProcXFixesRegionExtents(ClientPtr client)
{
REQUEST(xXFixesRegionExtentsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq);
swapl(&stuff->source);
swapl(&stuff->destination);
......@@ -585,7 +573,6 @@ SProcXFixesFetchRegion(ClientPtr client)
{
REQUEST(xXFixesFetchRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
swapl(&stuff->region);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
......@@ -628,7 +615,6 @@ SProcXFixesSetGCClipRegion(ClientPtr client)
{
REQUEST(xXFixesSetGCClipRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
swapl(&stuff->gc);
swapl(&stuff->region);
......@@ -718,7 +704,6 @@ SProcXFixesSetWindowShapeRegion(ClientPtr client)
{
REQUEST(xXFixesSetWindowShapeRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
swapl(&stuff->dest);
swaps(&stuff->xOff);
......@@ -751,7 +736,6 @@ SProcXFixesSetPictureClipRegion(ClientPtr client)
{
REQUEST(xXFixesSetPictureClipRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq);
swapl(&stuff->picture);
swapl(&stuff->region);
......@@ -804,7 +788,6 @@ SProcXFixesExpandRegion(ClientPtr client)
{
REQUEST(xXFixesExpandRegionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesExpandRegionReq);
swapl(&stuff->source);
swapl(&stuff->destination);
......
......@@ -64,7 +64,6 @@ SProcXFixesChangeSaveSet(ClientPtr client)
REQUEST(xXFixesChangeSaveSetReq);
REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq);
swaps(&stuff->length);
swapl(&stuff->window);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
......@@ -203,7 +203,6 @@ SProcXFixesSelectSelectionInput(ClientPtr client)
REQUEST(xXFixesSelectSelectionInputReq);
REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq);
swaps(&stuff->length);
swapl(&stuff->window);
swapl(&stuff->selection);
swapl(&stuff->eventMask);
......
......@@ -217,6 +217,7 @@ SProcXFixesDispatch(ClientPtr client)
REQUEST(xXFixesReq);
XFixesClientPtr pXFixesClient = GetXFixesClient(client);
swaps(&stuff->length);
if (pXFixesClient->major_version >= ARRAY_SIZE(version_requests))
return BadRequest;
if (stuff->xfixesReqType > version_requests[pXFixesClient->major_version])
......
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