[PATCH 14/18] xfixes: switch to byte counting functions

Peter Hutterer peter.hutterer at who-t.net
Wed Jul 8 17:05:12 PDT 2009


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 xfixes/cursor.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 534c826..3548fb1 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -488,7 +488,7 @@ ProcXFixesGetCursorName (ClientPtr client)
     len = strlen (str);
     
     reply.type = X_Reply;
-    reply.length = (len + 3) >> 2;
+    reply.length = num_dwords_for_bytes(len);
     reply.sequenceNumber = client->sequence;
     reply.atom = pCursor->name;
     reply.nbytes = len;
@@ -545,7 +545,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
     npixels = width * height;
     name = pCursor->name ? NameForAtom (pCursor->name) : "";
     nbytes = strlen (name);
-    nbytesRound = (nbytes + 3) & ~3;
+    nbytesRound = pad_to_dwords(nbytes);
     rep = xalloc (sizeof (xXFixesGetCursorImageAndNameReply) +
 		  npixels * sizeof (CARD32) + nbytesRound);
     if (!rep)
@@ -553,7 +553,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
 
     rep->type = X_Reply;
     rep->sequenceNumber = client->sequence;
-    rep->length = npixels + (nbytesRound >> 2);
+    rep->length = npixels + num_dwords_for_bytes(nbytesRound);
     rep->width = width;
     rep->height = height;
     rep->x = x;
-- 
1.6.3.rc1.2.g0164.dirty



More information about the xorg-devel mailing list