summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-06 12:25:39 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-14 10:14:01 +1000
commit1d6b71b8d0dc24355e84391ba413170a03ccdbf4 (patch)
tree4a0ca1d70b282607cdd2923097dda211e6584a89 /os
parent86b239ff9c4d01685c357ca2b1ef761d167e3224 (diff)
os: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'os')
-rw-r--r--os/access.c4
-rw-r--r--os/io.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/os/access.c b/os/access.c
index 34478768b..65765799b 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1458,7 +1458,7 @@ GetHosts (
for (host = validhosts; host; host = host->next)
{
nHosts++;
- n += (((host->len + 3) >> 2) << 2) + sizeof(xHostEntry);
+ n += pad_to_int32(host->len) + sizeof(xHostEntry);
}
if (n)
{
@@ -1474,7 +1474,7 @@ GetHosts (
((xHostEntry *)ptr)->length = len;
ptr += sizeof(xHostEntry);
acopy (host->addr, ptr, len);
- ptr += ((len + 3) >> 2) << 2;
+ ptr += pad_to_int32(len);
}
} else {
*data = NULL;
diff --git a/os/io.c b/os/io.c
index 45e193801..53b37b7ce 100644
--- a/os/io.c
+++ b/os/io.c
@@ -273,7 +273,7 @@ ReadRequestFromClient(ClientPtr client)
if (gotnow < sizeof(xBigReq))
{
/* Still need more data to tell just how big. */
- needed = sizeof(xBigReq) >> 2; /* needed is in CARD32s now */
+ needed = bytes_to_int32(sizeof(xBigReq)); /* needed is in CARD32s now */
need_header = TRUE;
}
else
@@ -377,7 +377,7 @@ ReadRequestFromClient(ClientPtr client)
{
move_header = TRUE;
if (gotnow < sizeof(xBigReq))
- needed = sizeof(xBigReq) >> 2;
+ needed = bytes_to_int32(sizeof(xBigReq));
else
needed = get_big_req_len(request, client);
}
@@ -445,7 +445,7 @@ ReadRequestFromClient(ClientPtr client)
oci->bufptr += (sizeof(xBigReq) - sizeof(xReq));
*(xReq *)oci->bufptr = *request;
oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq));
- client->req_len -= (sizeof(xBigReq) - sizeof(xReq)) >> 2;
+ client->req_len -= bytes_to_int32(sizeof(xBigReq) - sizeof(xReq));
}
client->requestBuffer = (pointer)oci->bufptr;
#ifdef DEBUG_COMMUNICATION