summaryrefslogtreecommitdiff
path: root/sunrpc/rpc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-12-17 06:41:01 +0000
committerUlrich Drepper <drepper@redhat.com>1998-12-17 06:41:01 +0000
commit04166d6ee15cdcc3f1a5f384fdeb76ba892ecaf5 (patch)
treee54a18edd70f73e486cb966f80b4d741ff37ed68 /sunrpc/rpc
parentb76e5a4e6b295e0917120e8f0db1cf3f987b7f86 (diff)
downloadglibc-04166d6ee15cdcc3f1a5f384fdeb76ba892ecaf5.tar.gz
Update.
1998-12-16 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * sysdeps/posix/tempname.c (__path_search): Add casts for format string. 1998-12-16 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * sunrpc/rpc/xdr.h (XDR_DESTROY, xdr_destroy): Avoid dangling else problem. (IXDR_PUT_INT32): Fully parenthesize parameters. (IXDR_GET_LONG, IXDR_PUT_LONG): Mark GCC extension. Fully parenthesize parameter.
Diffstat (limited to 'sunrpc/rpc')
-rw-r--r--sunrpc/rpc/xdr.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/sunrpc/rpc/xdr.h b/sunrpc/rpc/xdr.h
index e1657c73e3..a4c2747ad5 100644
--- a/sunrpc/rpc/xdr.h
+++ b/sunrpc/rpc/xdr.h
@@ -209,12 +209,16 @@ typedef bool_t (*xdrproc_t) __PMT ((XDR *, void *,...));
#define xdr_inline(xdrs, len) \
(*(xdrs)->x_ops->x_inline)(xdrs, len)
-#define XDR_DESTROY(xdrs) \
- if ((xdrs)->x_ops->x_destroy) \
- (*(xdrs)->x_ops->x_destroy)(xdrs)
-#define xdr_destroy(xdrs) \
- if ((xdrs)->x_ops->x_destroy) \
- (*(xdrs)->x_ops->x_destroy)(xdrs)
+#define XDR_DESTROY(xdrs) \
+ do { \
+ if ((xdrs)->x_ops->x_destroy) \
+ (*(xdrs)->x_ops->x_destroy)(xdrs) \
+ } while (0)
+#define xdr_destroy(xdrs) \
+ do { \
+ if ((xdrs)->x_ops->x_destroy) \
+ (*(xdrs)->x_ops->x_destroy)(xdrs) \
+ } while (0)
/*
* Support struct for discriminated unions.
@@ -250,18 +254,20 @@ struct xdr_discrim
*/
#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_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_PUT_U_INT32(buf, v) IXDR_PUT_INT32(buf, (int32_t)(v))
/* 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_LONG(buf) \
+ ((long)ntohl((u_long)*__extension__((u_int32_t*)(buf))++))
+#define IXDR_PUT_LONG(buf, v) \
+ (*__extension__((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_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))
#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
@@ -269,10 +275,10 @@ struct xdr_discrim
#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)))
+#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.