summaryrefslogtreecommitdiff
path: root/render/render.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-06 12:27:23 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-14 10:14:01 +1000
commite216527107fda470b92b7e526f3db22465962a43 (patch)
tree80fa6f8936f18bc92842cb3b7432d241da66e6f7 /render/render.c
parent1d6b71b8d0dc24355e84391ba413170a03ccdbf4 (diff)
render: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'render/render.c')
-rw-r--r--render/render.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/render/render.c b/render/render.c
index 5622994e3..0e850e3ad 100644
--- a/render/render.c
+++ b/render/render.c
@@ -369,7 +369,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
return BadAlloc;
reply->type = X_Reply;
reply->sequenceNumber = client->sequence;
- reply->length = (rlength - sizeof(xGenericReply)) >> 2;
+ reply->length = bytes_to_int32(rlength - sizeof(xGenericReply));
reply->numFormats = nformat;
reply->numScreens = numScreens;
reply->numDepths = ndepth;
@@ -537,7 +537,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
reply->type = X_Reply;
reply->sequenceNumber = client->sequence;
- reply->length = (rlength - sizeof(xGenericReply)) >> 2;
+ reply->length = bytes_to_int32(rlength - sizeof(xGenericReply));
reply->numIndexValues = num;
values = (xIndexValue *) (reply + 1);
@@ -594,7 +594,7 @@ ProcRenderCreatePicture (ClientPtr client)
if (pFormat->depth != pDrawable->depth)
return BadMatch;
- len = client->req_len - (sizeof(xRenderCreatePictureReq) >> 2);
+ len = client->req_len - bytes_to_int32(sizeof(xRenderCreatePictureReq));
if (Ones(stuff->mask) != len)
return BadLength;
@@ -623,7 +623,7 @@ ProcRenderChangePicture (ClientPtr client)
VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
RenderErrBase + BadPicture);
- len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2);
+ len = client->req_len - bytes_to_int32(sizeof(xRenderChangePictureReq));
if (Ones(stuff->mask) != len)
return BadLength;
@@ -1235,7 +1235,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
client->errorValue = stuff->glyphset;
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc;
}
- nglyph = ((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)) >> 2;
+ nglyph = bytes_to_int32((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq));
gids = (CARD32 *) (stuff + 1);
while (nglyph-- > 0)
{
@@ -1735,7 +1735,7 @@ ProcRenderQueryFilters (ClientPtr client)
nbytesName += 1 + strlen (ps->filterAliases[i].alias);
nnames = ps->nfilters + ps->nfilterAliases;
}
- len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2);
+ len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName);
total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2);
reply = (xRenderQueryFiltersReply *) xalloc (total_bytes);
if (!reply)
@@ -1827,7 +1827,7 @@ ProcRenderSetPictureFilter (ClientPtr client)
VERIFY_PICTURE (pPicture, stuff->picture, client, DixSetAttrAccess,
RenderErrBase + BadPicture);
name = (char *) (stuff + 1);
- params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3));
+ params = (xFixed *) (name + pad_to_int32(stuff->nbytes));
nparams = ((xFixed *) stuff + client->req_len) - params;
result = SetPictureFilter (pPicture, name, stuff->nbytes, params, nparams);
return result;
@@ -1849,7 +1849,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
LEGAL_NEW_RESOURCE(stuff->cid, client);
if (client->req_len & 1)
return BadLength;
- ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1;
+ ncursor = (client->req_len - (bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1;
cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32)));
if (!cursors)
return BadAlloc;