summaryrefslogtreecommitdiff
path: root/randr/rrcrtc.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-06 12:24:27 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-14 10:14:01 +1000
commit86b239ff9c4d01685c357ca2b1ef761d167e3224 (patch)
tree59ee2462a0132037df8d634644c7c866f98a4266 /randr/rrcrtc.c
parent7b9e84e320a6f6449fe7bc58a8d6a094ae37b86c (diff)
randr: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'randr/rrcrtc.c')
-rw-r--r--randr/rrcrtc.c14
1 files changed, 7 insertions, 7 deletions
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;