From 2c7c520cfe0df30f4bc3adba59d9c62582823bf8 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 4 Aug 2011 15:35:41 -0400 Subject: Use internal temp variable for swap macros Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- os/connection.c | 6 +++--- os/io.c | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'os') diff --git a/os/connection.c b/os/connection.c index 0c580ab5e..b339f4e96 100644 --- a/os/connection.c +++ b/os/connection.c @@ -905,9 +905,9 @@ ErrorConnMax(XtransConnInfo trans_conn) if (((*(char *) &whichbyte) && (byteOrder == 'B')) || (!(*(char *) &whichbyte) && (byteOrder == 'l'))) { - swaps(&csp.majorVersion, whichbyte); - swaps(&csp.minorVersion, whichbyte); - swaps(&csp.length, whichbyte); + swaps(&csp.majorVersion); + swaps(&csp.minorVersion); + swaps(&csp.length); } iov[0].iov_len = sz_xConnSetupPrefix; iov[0].iov_base = (char *) &csp; diff --git a/os/io.c b/os/io.c index 421023807..068f5f028 100644 --- a/os/io.c +++ b/os/io.c @@ -598,8 +598,7 @@ ResetCurrentRequest(ClientPtr client) ((xBigReq *)oci->bufptr)->length = client->req_len; if (client->swapped) { - char n; - swapl(&((xBigReq *)oci->bufptr)->length, n); + swapl(&((xBigReq *)oci->bufptr)->length); } } if (gotnow >= (needed << 2)) @@ -822,11 +821,10 @@ WriteToClient (ClientPtr who, int count, const void *__buf) { /* start of new reply */ CARD32 replylen; unsigned long bytesleft; - char n; replylen = ((xGenericReply *)buf)->length; if (who->swapped) - swapl(&replylen, n); + swapl(&replylen); bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes; replyinfo.startOfReply = TRUE; replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft; -- cgit v1.2.3