From 86b239ff9c4d01685c357ca2b1ef761d167e3224 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 6 Jul 2009 12:24:27 +1000 Subject: randr: switch to byte counting functions Signed-off-by: Peter Hutterer --- randr/rrcrtc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'randr/rrcrtc.c') diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 32a09922b..0e14b36dd 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -775,7 +775,7 @@ ProcRRSetCrtcConfig (ClientPtr client) int rc, i, j; REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); - numOutputs = (stuff->length - (SIZEOF (xRRSetCrtcConfigReq) >> 2)); + numOutputs = (stuff->length - bytes_to_int32(SIZEOF (xRRSetCrtcConfigReq))); VERIFY_RR_CRTC(stuff->crtc, crtc, DixSetAttrAccess); @@ -1205,7 +1205,7 @@ ProcRRGetCrtcGamma (ClientPtr client) reply.type = X_Reply; reply.sequenceNumber = client->sequence; - reply.length = (len + 3) >> 2; + reply.length = bytes_to_int32(len); reply.size = crtc->gammaSize; if (client->swapped) { swaps (&reply.sequenceNumber, n); @@ -1234,7 +1234,7 @@ ProcRRSetCrtcGamma (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); - len = client->req_len - (sizeof (xRRSetCrtcGammaReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof (xRRSetCrtcGammaReq)); if (len < (stuff->size * 3 + 1) >> 1) return BadLength; @@ -1274,7 +1274,7 @@ ProcRRSetCrtcTransform (ClientPtr client) filter = (char *) (stuff + 1); nbytes = stuff->nbytesFilter; - params = (xFixed *) (filter + ((nbytes + 3) & ~3)); + params = (xFixed *) (filter + pad_to_int32(nbytes)); nparams = ((xFixed *) stuff + client->req_len) - params; if (nparams < 0) return BadLength; @@ -1295,7 +1295,7 @@ transform_filter_length (RRTransformPtr transform) return 0; nbytes = strlen (transform->filter->name); nparams = transform->nparams; - return ((nbytes + 3) & ~3) + (nparams * sizeof (xFixed)); + return pad_to_int32(nbytes) + (nparams * sizeof (xFixed)); } static int @@ -1334,7 +1334,7 @@ transform_encode (ClientPtr client, xRenderTransform *wire, PictTransform *pict) { xRenderTransform_from_PictTransform (wire, pict); if (client->swapped) - SwapLongs ((CARD32 *) wire, sizeof (xRenderTransform) >> 2); + SwapLongs ((CARD32 *) wire, bytes_to_int32(sizeof(xRenderTransform))); } int @@ -1363,7 +1363,7 @@ ProcRRGetCrtcTransform (ClientPtr client) extra = (char *) (reply + 1); reply->type = X_Reply; reply->sequenceNumber = client->sequence; - reply->length = (CrtcTransformExtra + nextra) >> 2; + reply->length = bytes_to_int32(CrtcTransformExtra + nextra); reply->hasTransforms = crtc->transforms; -- cgit v1.2.3