summaryrefslogtreecommitdiff
path: root/Xext/security.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-06 12:20:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-14 10:14:01 +1000
commit7b9e84e320a6f6449fe7bc58a8d6a094ae37b86c (patch)
tree570039663c3361ee3b885ace9d42084d94010fe6 /Xext/security.c
parentaa19d355125a10b1a385c8f134d68e79d3d609c7 (diff)
Xext: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xext/security.c')
-rw-r--r--Xext/security.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Xext/security.c b/Xext/security.c
index bae95a3b5..8b72e179e 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -450,9 +450,9 @@ ProcSecurityGenerateAuthorization(
/* check request length */
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
- len = SIZEOF(xSecurityGenerateAuthorizationReq) >> 2;
- len += (stuff->nbytesAuthProto + (unsigned)3) >> 2;
- len += (stuff->nbytesAuthData + (unsigned)3) >> 2;
+ len = bytes_to_int32(SIZEOF(xSecurityGenerateAuthorizationReq));
+ len += bytes_to_int32(stuff->nbytesAuthProto);
+ len += bytes_to_int32(stuff->nbytesAuthData);
values = ((CARD32 *)stuff) + len;
len += Ones(stuff->valueMask);
if (client->req_len != len)
@@ -520,7 +520,7 @@ ProcSecurityGenerateAuthorization(
}
protoname = (char *)&stuff[1];
- protodata = protoname + ((stuff->nbytesAuthProto + (unsigned)3) >> 2);
+ protodata = protoname + bytes_to_int32(stuff->nbytesAuthProto);
/* call os layer to generate the authorization */
@@ -580,7 +580,7 @@ ProcSecurityGenerateAuthorization(
/* tell client the auth id and data */
rep.type = X_Reply;
- rep.length = (authdata_len + 3) >> 2;
+ rep.length = bytes_to_int32(authdata_len);
rep.sequenceNumber = client->sequence;
rep.authId = authId;
rep.dataLength = authdata_len;
@@ -688,10 +688,10 @@ SProcSecurityGenerateAuthorization(
swaps(&stuff->nbytesAuthProto, n);
swaps(&stuff->nbytesAuthData, n);
swapl(&stuff->valueMask, n);
- values_offset = ((stuff->nbytesAuthProto + (unsigned)3) >> 2) +
- ((stuff->nbytesAuthData + (unsigned)3) >> 2);
+ values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
+ bytes_to_int32(stuff->nbytesAuthData);
if (values_offset >
- stuff->length - (sz_xSecurityGenerateAuthorizationReq >> 2))
+ stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
return BadLength;
values = (CARD32 *)(&stuff[1]) + values_offset;
nvalues = (((CARD32 *)stuff) + stuff->length) - values;