diff options
author | Matt Turner <mattst88@gmail.com> | 2011-08-04 15:35:41 -0400 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2011-09-21 17:12:04 -0400 |
commit | 2c7c520cfe0df30f4bc3adba59d9c62582823bf8 (patch) | |
tree | f47282ce2f815acc691cfe188850adf8d6fbfcc3 /xfixes | |
parent | c10bad3d3e8ff1b90014770fd470f9c67263e46f (diff) |
Use internal temp variable for swap macros
Also, fix whitespace, mainly around
swaps(&rep.sequenceNumber)
Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'xfixes')
-rw-r--r-- | xfixes/cursor.c | 122 | ||||
-rw-r--r-- | xfixes/region.c | 156 | ||||
-rw-r--r-- | xfixes/saveset.c | 5 | ||||
-rw-r--r-- | xfixes/select.c | 9 | ||||
-rw-r--r-- | xfixes/xfixes.c | 16 |
5 files changed, 136 insertions, 172 deletions
diff --git a/xfixes/cursor.c b/xfixes/cursor.c index ecbed4016..2950e4579 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -309,12 +309,11 @@ GetBit (unsigned char *line, int x) int SProcXFixesSelectCursorInput (ClientPtr client) { - register int n; REQUEST(xXFixesSelectCursorInputReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swapl(&stuff->eventMask, n); + swaps(&stuff->length); + swapl(&stuff->window); + swapl(&stuff->eventMask); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -418,16 +417,15 @@ ProcXFixesGetCursorImage (ClientPtr client) CopyCursorToImage (pCursor, image); if (client->swapped) { - int n; - swaps (&rep->sequenceNumber, n); - swapl (&rep->length, n); - swaps (&rep->x, n); - swaps (&rep->y, n); - swaps (&rep->width, n); - swaps (&rep->height, n); - swaps (&rep->xhot, n); - swaps (&rep->yhot, n); - swapl (&rep->cursorSerial, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->x); + swaps(&rep->y); + swaps(&rep->width); + swaps(&rep->height); + swaps(&rep->xhot); + swaps(&rep->yhot); + swapl(&rep->cursorSerial); SwapLongs (image, npixels); } WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + @@ -439,9 +437,8 @@ ProcXFixesGetCursorImage (ClientPtr client) int SProcXFixesGetCursorImage (ClientPtr client) { - int n; REQUEST(xXFixesGetCursorImageReq); - swaps (&stuff->length, n); + swaps(&stuff->length); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -467,13 +464,12 @@ ProcXFixesSetCursorName (ClientPtr client) int SProcXFixesSetCursorName (ClientPtr client) { - int n; REQUEST(xXFixesSetCursorNameReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); - swapl (&stuff->cursor, n); - swaps (&stuff->nbytes, n); + swapl(&stuff->cursor); + swaps(&stuff->nbytes); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -501,11 +497,10 @@ ProcXFixesGetCursorName (ClientPtr client) reply.nbytes = len; if (client->swapped) { - int n; - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swapl (&reply.atom, n); - swaps (&reply.nbytes, n); + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swapl(&reply.atom); + swaps(&reply.nbytes); } WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply); WriteToClient(client, len, str); @@ -516,12 +511,11 @@ ProcXFixesGetCursorName (ClientPtr client) int SProcXFixesGetCursorName (ClientPtr client) { - int n; REQUEST(xXFixesGetCursorNameReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); - swapl (&stuff->cursor, n); + swapl(&stuff->cursor); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -576,18 +570,17 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) memcpy ((image + npixels), name, nbytes); if (client->swapped) { - int n; - swaps (&rep->sequenceNumber, n); - swapl (&rep->length, n); - swaps (&rep->x, n); - swaps (&rep->y, n); - swaps (&rep->width, n); - swaps (&rep->height, n); - swaps (&rep->xhot, n); - swaps (&rep->yhot, n); - swapl (&rep->cursorSerial, n); - swapl (&rep->cursorName, n); - swaps (&rep->nbytes, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->x); + swaps(&rep->y); + swaps(&rep->width); + swaps(&rep->height); + swaps(&rep->xhot); + swaps(&rep->yhot); + swapl(&rep->cursorSerial); + swapl(&rep->cursorName); + swaps(&rep->nbytes); SwapLongs (image, npixels); } WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + @@ -599,9 +592,8 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) int SProcXFixesGetCursorImageAndName (ClientPtr client) { - int n; REQUEST(xXFixesGetCursorImageAndNameReq); - swaps (&stuff->length, n); + swaps(&stuff->length); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -734,13 +726,12 @@ ProcXFixesChangeCursor (ClientPtr client) int SProcXFixesChangeCursor (ClientPtr client) { - int n; REQUEST(xXFixesChangeCursorReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -772,13 +763,12 @@ ProcXFixesChangeCursorByName (ClientPtr client) int SProcXFixesChangeCursorByName (ClientPtr client) { - int n; REQUEST(xXFixesChangeCursorByNameReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE (xXFixesChangeCursorByNameReq); - swapl (&stuff->source, n); - swaps (&stuff->nbytes, n); + swapl(&stuff->source); + swaps(&stuff->nbytes); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -933,12 +923,11 @@ ProcXFixesHideCursor (ClientPtr client) int SProcXFixesHideCursor (ClientPtr client) { - int n; REQUEST(xXFixesHideCursorReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesHideCursorReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -984,12 +973,11 @@ ProcXFixesShowCursor (ClientPtr client) int SProcXFixesShowCursor (ClientPtr client) { - int n; REQUEST(xXFixesShowCursorReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesShowCursorReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -1350,18 +1338,17 @@ ProcXFixesCreatePointerBarrier (ClientPtr client) int SProcXFixesCreatePointerBarrier (ClientPtr client) { - int n; REQUEST(xXFixesCreatePointerBarrierReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq); - swapl(&stuff->barrier, n); - swapl(&stuff->window, n); - swaps(&stuff->x1, n); - swaps(&stuff->y1, n); - swaps(&stuff->x2, n); - swaps(&stuff->y2, n); - swapl(&stuff->directions, n); + swapl(&stuff->barrier); + swapl(&stuff->window); + swaps(&stuff->x1); + swaps(&stuff->y1); + swaps(&stuff->x2); + swaps(&stuff->y2); + swapl(&stuff->directions); return ProcXFixesVector[stuff->xfixesReqType](client); } @@ -1412,12 +1399,11 @@ ProcXFixesDestroyPointerBarrier (ClientPtr client) int SProcXFixesDestroyPointerBarrier (ClientPtr client) { - int n; REQUEST(xXFixesDestroyPointerBarrierReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq); - swapl(&stuff->barrier, n); + swapl(&stuff->barrier); return ProcXFixesVector[stuff->xfixesReqType](client); } diff --git a/xfixes/region.c b/xfixes/region.c index be2d391dd..4c2263702 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -93,12 +93,11 @@ ProcXFixesCreateRegion (ClientPtr client) int SProcXFixesCreateRegion (ClientPtr client) { - register int n; REQUEST(xXFixesCreateRegionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq); - swapl(&stuff->region, n); + swapl(&stuff->region); SwapRestS(stuff); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -138,13 +137,12 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) int SProcXFixesCreateRegionFromBitmap (ClientPtr client) { - int n; REQUEST (xXFixesCreateRegionFromBitmapReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromBitmapReq); - swapl(&stuff->region, n); - swapl(&stuff->bitmap, n); + swapl(&stuff->region); + swapl(&stuff->bitmap); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -200,13 +198,12 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client) int SProcXFixesCreateRegionFromWindow (ClientPtr client) { - int n; REQUEST (xXFixesCreateRegionFromWindowReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromWindowReq); - swapl(&stuff->region, n); - swapl(&stuff->window, n); + swapl(&stuff->region); + swapl(&stuff->window); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -250,13 +247,12 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) int SProcXFixesCreateRegionFromGC (ClientPtr client) { - int n; REQUEST (xXFixesCreateRegionFromGCReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq); - swapl(&stuff->region, n); - swapl(&stuff->gc, n); + swapl(&stuff->region); + swapl(&stuff->gc); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -297,13 +293,12 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) int SProcXFixesCreateRegionFromPicture (ClientPtr client) { - int n; REQUEST (xXFixesCreateRegionFromPictureReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq); - swapl(&stuff->region, n); - swapl(&stuff->picture, n); + swapl(&stuff->region); + swapl(&stuff->picture); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -322,12 +317,11 @@ ProcXFixesDestroyRegion (ClientPtr client) int SProcXFixesDestroyRegion (ClientPtr client) { - int n; REQUEST (xXFixesDestroyRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); - swapl (&stuff->region, n); + swapl(&stuff->region); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -361,12 +355,11 @@ ProcXFixesSetRegion (ClientPtr client) int SProcXFixesSetRegion (ClientPtr client) { - int n; REQUEST (xXFixesSetRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq); - swapl (&stuff->region, n); + swapl(&stuff->region); SwapRestS(stuff); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -389,13 +382,12 @@ ProcXFixesCopyRegion (ClientPtr client) int SProcXFixesCopyRegion (ClientPtr client) { - int n; REQUEST (xXFixesCopyRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesCopyRegionReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -431,14 +423,13 @@ ProcXFixesCombineRegion (ClientPtr client) int SProcXFixesCombineRegion (ClientPtr client) { - int n; REQUEST (xXFixesCombineRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); - swapl (&stuff->source1, n); - swapl (&stuff->source2, n); - swapl (&stuff->destination, n); + swapl(&stuff->source1); + swapl(&stuff->source2); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -475,17 +466,16 @@ ProcXFixesInvertRegion (ClientPtr client) int SProcXFixesInvertRegion (ClientPtr client) { - int n; REQUEST(xXFixesInvertRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); - swapl (&stuff->source, n); - swaps (&stuff->x, n); - swaps (&stuff->y, n); - swaps (&stuff->width, n); - swaps (&stuff->height, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swaps(&stuff->x); + swaps(&stuff->y); + swaps(&stuff->width); + swaps(&stuff->height); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -505,14 +495,13 @@ ProcXFixesTranslateRegion (ClientPtr client) int SProcXFixesTranslateRegion (ClientPtr client) { - int n; REQUEST(xXFixesTranslateRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); - swapl (&stuff->region, n); - swaps (&stuff->dx, n); - swaps (&stuff->dy, n); + swapl(&stuff->region); + swaps(&stuff->dx); + swaps(&stuff->dy); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -534,13 +523,12 @@ ProcXFixesRegionExtents (ClientPtr client) int SProcXFixesRegionExtents (ClientPtr client) { - int n; REQUEST(xXFixesRegionExtentsReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -584,13 +572,12 @@ ProcXFixesFetchRegion (ClientPtr client) } if (client->swapped) { - int n; - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swaps (&reply->x, n); - swaps (&reply->y, n); - swaps (&reply->width, n); - swaps (&reply->height, n); + swaps(&reply->sequenceNumber); + swapl(&reply->length); + swaps(&reply->x); + swaps(&reply->y); + swaps(&reply->width); + swaps(&reply->height); SwapShorts ((INT16 *) pRect, nBox * 4); } (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) + @@ -602,12 +589,11 @@ ProcXFixesFetchRegion (ClientPtr client) int SProcXFixesFetchRegion (ClientPtr client) { - int n; REQUEST(xXFixesFetchRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); - swapl (&stuff->region, n); + swapl(&stuff->region); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -645,15 +631,14 @@ ProcXFixesSetGCClipRegion (ClientPtr client) int SProcXFixesSetGCClipRegion (ClientPtr client) { - int n; REQUEST(xXFixesSetGCClipRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); - swapl (&stuff->gc, n); - swapl (&stuff->region, n); - swaps (&stuff->xOrigin, n); - swaps (&stuff->yOrigin, n); + swapl(&stuff->gc); + swapl(&stuff->region); + swaps(&stuff->xOrigin); + swaps(&stuff->yOrigin); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -739,15 +724,14 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) int SProcXFixesSetWindowShapeRegion (ClientPtr client) { - int n; REQUEST(xXFixesSetWindowShapeRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq); - swapl (&stuff->dest, n); - swaps (&stuff->xOff, n); - swaps (&stuff->yOff, n); - swapl (&stuff->region, n); + swapl(&stuff->dest); + swaps(&stuff->xOff); + swaps(&stuff->yOff); + swapl(&stuff->region); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -769,15 +753,14 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) int SProcXFixesSetPictureClipRegion (ClientPtr client) { - int n; REQUEST(xXFixesSetPictureClipRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); - swapl (&stuff->picture, n); - swapl (&stuff->region, n); - swaps (&stuff->xOrigin, n); - swaps (&stuff->yOrigin, n); + swapl(&stuff->picture); + swapl(&stuff->region); + swaps(&stuff->xOrigin); + swaps(&stuff->yOrigin); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -824,17 +807,16 @@ ProcXFixesExpandRegion (ClientPtr client) int SProcXFixesExpandRegion (ClientPtr client) { - int n; REQUEST (xXFixesExpandRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesExpandRegionReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); - swaps (&stuff->left, n); - swaps (&stuff->right, n); - swaps (&stuff->top, n); - swaps (&stuff->bottom, n); + swapl(&stuff->source); + swapl(&stuff->destination); + swaps(&stuff->left); + swaps(&stuff->right); + swaps(&stuff->top); + swaps(&stuff->bottom); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } diff --git a/xfixes/saveset.c b/xfixes/saveset.c index 35d8e17e0..ba959c22b 100644 --- a/xfixes/saveset.c +++ b/xfixes/saveset.c @@ -63,10 +63,9 @@ ProcXFixesChangeSaveSet(ClientPtr client) int SProcXFixesChangeSaveSet(ClientPtr client) { - register int n; REQUEST(xXFixesChangeSaveSetReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); + swaps(&stuff->length); + swapl(&stuff->window); return (*ProcXFixesVector[stuff->xfixesReqType])(client); } diff --git a/xfixes/select.c b/xfixes/select.c index baf1ef8f4..2bf13f3fd 100644 --- a/xfixes/select.c +++ b/xfixes/select.c @@ -220,13 +220,12 @@ ProcXFixesSelectSelectionInput (ClientPtr client) int SProcXFixesSelectSelectionInput (ClientPtr client) { - register int n; REQUEST(xXFixesSelectSelectionInputReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swapl(&stuff->selection, n); - swapl(&stuff->eventMask, n); + swaps(&stuff->length); + swapl(&stuff->window); + swapl(&stuff->selection); + swapl(&stuff->eventMask); return (*ProcXFixesVector[stuff->xfixesReqType])(client); } diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c index e0ebedd80..96d33c00b 100644 --- a/xfixes/xfixes.c +++ b/xfixes/xfixes.c @@ -61,7 +61,6 @@ ProcXFixesQueryVersion(ClientPtr client) { XFixesClientPtr pXFixesClient = GetXFixesClient (client); xXFixesQueryVersionReply rep; - register int n; REQUEST(xXFixesQueryVersionReq); REQUEST_SIZE_MATCH(xXFixesQueryVersionReq); @@ -83,10 +82,10 @@ ProcXFixesQueryVersion(ClientPtr client) pXFixesClient->major_version = rep.majorVersion; pXFixesClient->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(xXFixesQueryVersionReply), (char *)&rep); return Success; @@ -161,12 +160,11 @@ ProcXFixesDispatch (ClientPtr client) static int SProcXFixesQueryVersion(ClientPtr client) { - register int n; REQUEST(xXFixesQueryVersionReq); - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); + swaps(&stuff->length); + swapl(&stuff->majorVersion); + swapl(&stuff->minorVersion); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } |