From d8a167a5e5c30bc3ec7d6d978241d0afe097fad4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 16 Dec 1998 11:10:36 +0000 Subject: Update. 1998-12-16 Thorsten Kukuk * sunrpc/rpc/xdr.h: Revert patch from 1998-12-14, partly revert patch from 1998-12-01. --- sunrpc/rpc/xdr.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'sunrpc/rpc') diff --git a/sunrpc/rpc/xdr.h b/sunrpc/rpc/xdr.h index 192a9a8712..e1657c73e3 100644 --- a/sunrpc/rpc/xdr.h +++ b/sunrpc/rpc/xdr.h @@ -249,29 +249,31 @@ struct xdr_discrim * of external representation. */ -#define IXDR_GET_INT32(buf) ((int32_t)ntohl(*((uint32_t *) buf)++)) -#define IXDR_PUT_INT32(buf, v) (*((int32_t *) buf)++ \ - = (int32_t)htonl((uint32_t)v)) +#define IXDR_GET_INT32(buf) ((int32_t)ntohl((uint32_t)*(buf)++)) +#define IXDR_PUT_INT32(buf, v) (*(buf)++ = (int32_t)htonl((uint32_t)v)) #define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf)) #define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32((buf), ((int32_t)(v))) -#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_INT32(buf)) -#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_INT32(buf)) -#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_INT32(buf)) -#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_INT32(buf)) - -#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_INT32((buf), ((int)(v))) -#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_INT32((buf), ((int)(v))) -#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_INT32((buf), ((int)(v))) -#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_INT32((buf), ((int)(v))) - -/* This defines are removed from Sun for new platforms and shouldn't - be used any longer. */ +/* WARNING: The IXDR_*_LONG defines are removed by Sun for new platforms + * and shouldn't be used any longer. Code which use this defines or longs + * in the RPC code will not work on 64bit Solaris platforms ! + */ #define IXDR_GET_LONG(buf) ((long)ntohl((u_long)*((u_int32_t*)buf)++)) #define IXDR_PUT_LONG(buf, v) (*((u_int32_t*)(buf))++ = (long)htonl((u_long)v)) #define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf)) #define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), ((long)(v))) + +#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf)) +#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf)) +#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf)) +#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf)) + +#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), ((long)(v))) +#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), ((long)(v))) +#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v))) +#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v))) + /* * These are the "generic" xdr routines. * None of these can have const applied because it's not possible to -- cgit 1.4.1