diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-06 12:41:29 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-14 10:14:02 +1000 |
commit | 0dc11da57562a7bbb6830ab657a2b818c596a537 (patch) | |
tree | f7699d87ebb65055375540d677d3ced8c8cb578c /hw | |
parent | 34bfaa9d9ecd90cfe8413bc275179fdcc193eab3 (diff) |
ephyr: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/kdrive/ephyr/ephyrdriext.c | 14 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyrhostglx.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 6e915abae..84885d8f0 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -701,8 +701,8 @@ ProcXF86DRIOpenConnection (register ClientPtr client) rep.busIdStringLength = 0; if (busIdString) rep.busIdStringLength = strlen(busIdString); - rep.length = (SIZEOF(xXF86DRIOpenConnectionReply) - SIZEOF(xGenericReply) + - ((rep.busIdStringLength + 3) & ~3)) >> 2; + rep.length = bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) - SIZEOF(xGenericReply) + + pad_to_int32(rep.busIdStringLength)); rep.hSAREALow = (CARD32)(hSAREA & 0xffffffff); #if defined(LONG64) && !defined(__linux__) @@ -789,9 +789,9 @@ ProcXF86DRIGetClientDriverName (register ClientPtr client) rep.clientDriverNameLength = 0; if (clientDriverName) rep.clientDriverNameLength = strlen(clientDriverName); - rep.length = (SIZEOF(xXF86DRIGetClientDriverNameReply) - + rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetClientDriverNameReply) - SIZEOF(xGenericReply) + - ((rep.clientDriverNameLength + 3) & ~3)) >> 2; + pad_to_int32(rep.clientDriverNameLength)); WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), (char *)&rep); @@ -1235,7 +1235,7 @@ ProcXF86DRIGetDrawableInfo (register ClientPtr client) EPHYR_LOG ("num host clip rects:%d\n", (int)rep.numClipRects) ; EPHYR_LOG ("num host back clip rects:%d\n", (int)rep.numBackClipRects) ; - rep.length = ((rep.length + 3) & ~3) >> 2; + rep.length = bytes_to_int32(rep.length); WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *)&rep); @@ -1297,9 +1297,9 @@ ProcXF86DRIGetDeviceInfo (register ClientPtr client) rep.length = 0; if (rep.devPrivateSize) { - rep.length = (SIZEOF(xXF86DRIGetDeviceInfoReply) - + rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) - SIZEOF(xGenericReply) + - ((rep.devPrivateSize + 3) & ~3)) >> 2; + pad_to_int32(rep.devPrivateSize)); } WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *)&rep); diff --git a/hw/kdrive/ephyr/ephyrhostglx.c b/hw/kdrive/ephyr/ephyrhostglx.c index a05bba2e3..728687b46 100644 --- a/hw/kdrive/ephyr/ephyrhostglx.c +++ b/hw/kdrive/ephyr/ephyrhostglx.c @@ -428,7 +428,7 @@ ephyrHostGLXSendClientInfo (int32_t a_major, int32_t a_minor, req->minor = a_minor; size = strlen (a_extension_list) + 1; - req->length += (size + 3) >> 2; + req->length += bytes_to_int32(size); req->numbytes = size; Data (dpy, a_extension_list, size); |