diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-04 16:37:55 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-04 16:37:55 +0200 |
commit | 27b0b5723ccbcc92bbcc80dff8fb698b69e74944 (patch) | |
tree | 3b27e6dd17a7d4d00266819545ae97defa11cf81 /nx-X11/programs/Xserver/render/render.c | |
parent | d1d859dfdec4b4665e06401383ab71926e4e731c (diff) | |
parent | 286d83260216e8e53db701eed5c785aae1c716bf (diff) | |
download | nx-libs-27b0b5723ccbcc92bbcc80dff8fb698b69e74944.tar.gz nx-libs-27b0b5723ccbcc92bbcc80dff8fb698b69e74944.tar.bz2 nx-libs-27b0b5723ccbcc92bbcc80dff8fb698b69e74944.zip |
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
Diffstat (limited to 'nx-X11/programs/Xserver/render/render.c')
-rw-r--r-- | nx-X11/programs/Xserver/render/render.c | 443 |
1 files changed, 207 insertions, 236 deletions
diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index c6cb7bce7..b97c63775 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -283,7 +283,7 @@ ProcRenderQueryVersion (ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient (client); xRenderQueryVersionReply rep; - register int n; + REQUEST(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq); @@ -298,10 +298,10 @@ ProcRenderQueryVersion (ClientPtr client) rep.majorVersion = SERVER_RENDER_MAJOR_VERSION; rep.minorVersion = SERVER_RENDER_MINOR_VERSION; 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); @@ -456,16 +456,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++; } @@ -495,8 +495,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++; @@ -506,7 +506,7 @@ ProcRenderQueryPictFormats (ClientPtr client) pictDepth->nPictVisuals = nvisual; if (client->swapped) { - swaps (&pictDepth->nPictVisuals, n); + swaps (&pictDepth->nPictVisuals); } ndepth++; pictDepth = (xPictDepth *) pictVisual; @@ -519,8 +519,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; } @@ -536,20 +536,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); @@ -563,7 +563,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) PictFormatPtr pFormat; int num; int rlength; - int i, n; + int i; REQUEST(xRenderQueryPictIndexValuesReq); xRenderQueryPictIndexValuesReply *reply; xIndexValue *values; @@ -605,15 +605,15 @@ ProcRenderQueryPictIndexValues (ClientPtr client) { for (i = 0; i < num; i++) { - swapl (&values[i].pixel, n); - swaps (&values[i].red, n); - swaps (&values[i].green, n); - swaps (&values[i].blue, n); - swaps (&values[i].alpha, n); + swapl (&values[i].pixel); + swaps (&values[i].red); + swaps (&values[i].green); + swaps (&values[i].blue); + swaps (&values[i].alpha); } - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numIndexValues, n); + swaps (&reply->sequenceNumber); + swapl (&reply->length); + swapl (&reply->numIndexValues); } WriteToClient(client, rlength, (char *) reply); @@ -1807,16 +1807,14 @@ ProcRenderQueryFilters (ClientPtr client) if (client->swapped) { - register int n; - for (i = 0; i < reply->numAliases; i++) { - swaps (&aliases[i], n); + swaps (&aliases[i]); } - swaps(&reply->sequenceNumber, n); - swapl(&reply->length, n); - swapl(&reply->numAliases, n); - swapl(&reply->numFilters, n); + swaps(&reply->sequenceNumber); + swapl(&reply->length); + swapl(&reply->numAliases); + swapl(&reply->numFilters); } WriteToClient(client, total_bytes, (char *) reply); free (reply); @@ -2039,34 +2037,31 @@ ProcRenderDispatch (ClientPtr client) static int SProcRenderQueryVersion (ClientPtr client) { - register int n; REQUEST(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); + swaps(&stuff->length); + swapl(&stuff->majorVersion); + swapl(&stuff->minorVersion); return (*ProcRenderVector[stuff->renderReqType])(client); } static int SProcRenderQueryPictFormats (ClientPtr client) { - register int n; REQUEST(xRenderQueryPictFormatsReq); REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryPictIndexValues (ClientPtr client) { - register int n; REQUEST(xRenderQueryPictIndexValuesReq); REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); - swaps(&stuff->length, n); - swapl(&stuff->format, n); + swaps(&stuff->length); + swapl(&stuff->format); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2079,14 +2074,13 @@ SProcRenderQueryDithers (ClientPtr client) static int SProcRenderCreatePicture (ClientPtr client) { - register int n; REQUEST(xRenderCreatePictureReq); REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swapl(&stuff->format, n); - swapl(&stuff->mask, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->drawable); + swapl(&stuff->format); + swapl(&stuff->mask); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2094,12 +2088,11 @@ SProcRenderCreatePicture (ClientPtr client) static int SProcRenderChangePicture (ClientPtr client) { - register int n; REQUEST(xRenderChangePictureReq); REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->mask, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swapl(&stuff->mask); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2107,11 +2100,10 @@ SProcRenderChangePicture (ClientPtr client) static int SProcRenderSetPictureClipRectangles (ClientPtr client) { - register int n; REQUEST(xRenderSetPictureClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); + swaps(&stuff->length); + swapl(&stuff->picture); SwapRestS(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2119,68 +2111,64 @@ SProcRenderSetPictureClipRectangles (ClientPtr client) static int SProcRenderFreePicture (ClientPtr client) { - register int n; REQUEST(xRenderFreePictureReq); REQUEST_SIZE_MATCH(xRenderFreePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); + swaps(&stuff->length); + swapl(&stuff->picture); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderComposite (ClientPtr client) { - register int n; REQUEST(xRenderCompositeReq); REQUEST_SIZE_MATCH(xRenderCompositeReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->mask, n); - swapl(&stuff->dst, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xMask, n); - swaps(&stuff->yMask, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->mask); + swapl(&stuff->dst); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); + swaps(&stuff->xMask); + swaps(&stuff->yMask); + swaps(&stuff->xDst); + swaps(&stuff->yDst); + swaps(&stuff->width); + swaps(&stuff->height); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderScale (ClientPtr client) { - register int n; REQUEST(xRenderScaleReq); REQUEST_SIZE_MATCH(xRenderScaleReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->colorScale, n); - swapl(&stuff->alphaScale, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->colorScale); + swapl(&stuff->alphaScale); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); + swaps(&stuff->xDst); + swaps(&stuff->yDst); + swaps(&stuff->width); + swaps(&stuff->height); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderTrapezoids (ClientPtr client) { - register int n; REQUEST(xRenderTrapezoidsReq); REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps (&stuff->length); + swapl (&stuff->src); + swapl (&stuff->dst); + swapl (&stuff->maskFormat); + swaps (&stuff->xSrc); + swaps (&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2188,16 +2176,15 @@ SProcRenderTrapezoids (ClientPtr client) static int SProcRenderTriangles (ClientPtr client) { - register int n; REQUEST(xRenderTrianglesReq); REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps (&stuff->length); + swapl (&stuff->src); + swapl (&stuff->dst); + swapl (&stuff->maskFormat); + swaps (&stuff->xSrc); + swaps (&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2205,16 +2192,15 @@ SProcRenderTriangles (ClientPtr client) static int SProcRenderTriStrip (ClientPtr client) { - register int n; REQUEST(xRenderTriStripReq); REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps (&stuff->length); + swapl (&stuff->src); + swapl (&stuff->dst); + swapl (&stuff->maskFormat); + swaps (&stuff->xSrc); + swaps (&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2222,16 +2208,15 @@ SProcRenderTriStrip (ClientPtr client) static int SProcRenderTriFan (ClientPtr client) { - register int n; REQUEST(xRenderTriFanReq); REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps (&stuff->length); + swapl (&stuff->src); + swapl (&stuff->dst); + swapl (&stuff->maskFormat); + swaps (&stuff->xSrc); + swaps (&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2257,51 +2242,47 @@ SProcRenderTransform (ClientPtr client) static int SProcRenderCreateGlyphSet (ClientPtr client) { - register int n; REQUEST(xRenderCreateGlyphSetReq); REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->format, n); + swaps(&stuff->length); + swapl(&stuff->gsid); + swapl(&stuff->format); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderReferenceGlyphSet (ClientPtr client) { - register int n; REQUEST(xRenderReferenceGlyphSetReq); REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->existing, n); + swaps(&stuff->length); + swapl(&stuff->gsid); + swapl(&stuff->existing); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderFreeGlyphSet (ClientPtr client) { - register int n; REQUEST(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); + swaps(&stuff->length); + swapl(&stuff->glyphset); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderAddGlyphs (ClientPtr client) { - register int n; register int i; CARD32 *gids; void *end; xGlyphInfo *gi; REQUEST(xRenderAddGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - swapl(&stuff->nglyphs, n); + swaps(&stuff->length); + swapl(&stuff->glyphset); + swapl(&stuff->nglyphs); if (stuff->nglyphs & 0xe0000000) return BadLength; end = (CARD8 *) stuff + (client->req_len << 2); @@ -2313,13 +2294,13 @@ SProcRenderAddGlyphs (ClientPtr client) return BadLength; for (i = 0; i < stuff->nglyphs; i++) { - swapl (&gids[i], n); - swaps (&gi[i].width, n); - swaps (&gi[i].height, n); - swaps (&gi[i].x, n); - swaps (&gi[i].y, n); - swaps (&gi[i].xOff, n); - swaps (&gi[i].yOff, n); + swapl (&gids[i]); + swaps (&gi[i].width); + swaps (&gi[i].height); + swaps (&gi[i].x); + swaps (&gi[i].y); + swaps (&gi[i].xOff); + swaps (&gi[i].yOff); } return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2333,11 +2314,10 @@ SProcRenderAddGlyphsFromPicture (ClientPtr client) static int SProcRenderFreeGlyphs (ClientPtr client) { - register int n; REQUEST(xRenderFreeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); + swaps(&stuff->length); + swapl(&stuff->glyphset); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2345,7 +2325,6 @@ SProcRenderFreeGlyphs (ClientPtr client) static int SProcRenderCompositeGlyphs (ClientPtr client) { - register int n; xGlyphElt *elt; CARD8 *buffer; CARD8 *end; @@ -2362,13 +2341,13 @@ SProcRenderCompositeGlyphs (ClientPtr client) case X_RenderCompositeGlyphs32: size = 4; break; } - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->maskFormat, n); - swapl(&stuff->glyphset, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->maskFormat); + swapl(&stuff->glyphset); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); buffer = (CARD8 *) (stuff + 1); end = (CARD8 *) stuff + (client->req_len << 2); while (buffer + sizeof (xGlyphElt) < end) @@ -2376,13 +2355,13 @@ SProcRenderCompositeGlyphs (ClientPtr client) elt = (xGlyphElt *) buffer; buffer += sizeof (xGlyphElt); - swaps (&elt->deltax, n); - swaps (&elt->deltay, n); + swaps (&elt->deltax); + swaps (&elt->deltay); i = elt->len; if (i == 0xff) { - swapl (buffer, n); + swapl ((int *) buffer); buffer += 4; } else @@ -2395,14 +2374,14 @@ SProcRenderCompositeGlyphs (ClientPtr client) case 2: while (i--) { - swaps (buffer, n); + swaps ((short *) buffer); buffer += 2; } break; case 4: while (i--) { - swapl (buffer, n); + swapl ((int *) buffer); buffer += 4; } break; @@ -2417,16 +2396,15 @@ SProcRenderCompositeGlyphs (ClientPtr client) static int SProcRenderFillRectangles (ClientPtr client) { - register int n; REQUEST(xRenderFillRectanglesReq); REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->dst, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - swaps(&stuff->color.alpha, n); + swaps(&stuff->length); + swapl(&stuff->dst); + swaps(&stuff->color.red); + swaps(&stuff->color.green); + swaps(&stuff->color.blue); + swaps(&stuff->color.alpha); SwapRestS(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2434,73 +2412,68 @@ SProcRenderFillRectangles (ClientPtr client) static int SProcRenderCreateCursor (ClientPtr client) { - register int n; REQUEST(xRenderCreateCursorReq); REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - swapl(&stuff->src, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); + swaps(&stuff->length); + swapl(&stuff->cid); + swapl(&stuff->src); + swaps(&stuff->x); + swaps(&stuff->y); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderSetPictureTransform (ClientPtr client) { - register int n; REQUEST(xRenderSetPictureTransformReq); REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->transform.matrix11, n); - swapl(&stuff->transform.matrix12, n); - swapl(&stuff->transform.matrix13, n); - swapl(&stuff->transform.matrix21, n); - swapl(&stuff->transform.matrix22, n); - swapl(&stuff->transform.matrix23, n); - swapl(&stuff->transform.matrix31, n); - swapl(&stuff->transform.matrix32, n); - swapl(&stuff->transform.matrix33, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swapl(&stuff->transform.matrix11); + swapl(&stuff->transform.matrix12); + swapl(&stuff->transform.matrix13); + swapl(&stuff->transform.matrix21); + swapl(&stuff->transform.matrix22); + swapl(&stuff->transform.matrix23); + swapl(&stuff->transform.matrix31); + swapl(&stuff->transform.matrix32); + swapl(&stuff->transform.matrix33); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryFilters (ClientPtr client) { - register int n; REQUEST (xRenderQueryFiltersReq); REQUEST_SIZE_MATCH (xRenderQueryFiltersReq); - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); + swaps(&stuff->length); + swapl(&stuff->drawable); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderSetPictureFilter (ClientPtr client) { - register int n; REQUEST (xRenderSetPictureFilterReq); REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->nbytes, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swaps(&stuff->nbytes); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderCreateAnimCursor (ClientPtr client) { - register int n; REQUEST (xRenderCreateAnimCursorReq); REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq); - swaps(&stuff->length, n); - swapl(&stuff->cid, n); + swaps(&stuff->length); + swapl(&stuff->cid); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2508,14 +2481,13 @@ SProcRenderCreateAnimCursor (ClientPtr client) static int SProcRenderAddTraps (ClientPtr client) { - register int n; REQUEST (xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->xOff, n); - swaps(&stuff->yOff, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swaps(&stuff->xOff); + swaps(&stuff->yOff); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2523,49 +2495,50 @@ SProcRenderAddTraps (ClientPtr client) static int SProcRenderCreateSolidFill(ClientPtr client) { - register int n; REQUEST (xRenderCreateSolidFillReq); REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swaps(&stuff->color.alpha, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swaps(&stuff->color.alpha); + swaps(&stuff->color.red); + swaps(&stuff->color.green); + swaps(&stuff->color.blue); return (*ProcRenderVector[stuff->renderReqType]) (client); } static void swapStops(void *stuff, int num) { - int i, n; + int i; CARD32 *stops; + CARD16 *colors; + stops = (CARD32 *)(stuff); for (i = 0; i < num; ++i) { - swapl(stops, n); + swapl(stops); ++stops; } + colors = (CARD16 *) (stops); for (i = 0; i < 4*num; ++i) { - swaps(stops, n); - ++stops; + swaps(colors); + ++colors; } } static int SProcRenderCreateLinearGradient (ClientPtr client) { - register int n; int len; REQUEST (xRenderCreateLinearGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->p1.x, n); - swapl(&stuff->p1.y, n); - swapl(&stuff->p2.x, n); - swapl(&stuff->p2.y, n); - swapl(&stuff->nStops, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->p1.x); + swapl(&stuff->p1.y); + swapl(&stuff->p2.x); + swapl(&stuff->p2.y); + swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) @@ -2581,20 +2554,19 @@ SProcRenderCreateLinearGradient (ClientPtr client) static int SProcRenderCreateRadialGradient (ClientPtr client) { - register int n; int len; REQUEST (xRenderCreateRadialGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->inner.x, n); - swapl(&stuff->inner.y, n); - swapl(&stuff->outer.x, n); - swapl(&stuff->outer.y, n); - swapl(&stuff->inner_radius, n); - swapl(&stuff->outer_radius, n); - swapl(&stuff->nStops, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->inner.x); + swapl(&stuff->inner.y); + swapl(&stuff->outer.x); + swapl(&stuff->outer.y); + swapl(&stuff->inner_radius); + swapl(&stuff->outer_radius); + swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) @@ -2610,17 +2582,16 @@ SProcRenderCreateRadialGradient (ClientPtr client) static int SProcRenderCreateConicalGradient (ClientPtr client) { - register int n; int len; REQUEST (xRenderCreateConicalGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->center.x, n); - swapl(&stuff->center.y, n); - swapl(&stuff->angle, n); - swapl(&stuff->nStops, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->center.x); + swapl(&stuff->center.y); + swapl(&stuff->angle); + swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) |