aboutsummaryrefslogtreecommitdiff
path: root/sunrpc/rpc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-12-01 11:25:26 +0000
committerUlrich Drepper <drepper@redhat.com>1998-12-01 11:25:26 +0000
commitee586e0ec492d818be9aa0c77dd44095d42f486f (patch)
tree21172ee5bbec6a0a0be049d633b6b9e7d9034c90 /sunrpc/rpc
parent28ab8526f2cf0dfbe0da8b4a6ef46e5efb8c3e4b (diff)
downloadglibc-ee586e0ec492d818be9aa0c77dd44095d42f486f.zip
glibc-ee586e0ec492d818be9aa0c77dd44095d42f486f.tar.gz
glibc-ee586e0ec492d818be9aa0c77dd44095d42f486f.tar.bz2
Update.
1998-12-01 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * sunrpc/auth_des.c: Use new XDR int32 functions for integers. * sunrpc/rpc/xdr.h: Add IXDR INT32 functions. * sunrpc/rpc_hout.c: Remove (u_long) casts in defines to avoid conflicts with new solaris version. * sunrpc/rpc_main.c: Fix bug in generating Makefile name (malloc doesn't zero allocated memory). * sunrpc/rpc_svcout.c: Local variables now starts with a _ to avoid conflicts with xdr functions. Solves PR libc/877. * nis/rpcsvc/nis.x: Use always uint32_t. * nis/rpcsvc/nis.h: Likewise. * nis/rpcsvc/nis_object.x: Likewise. 1998-12-01 Ulrich Drepper <drepper@cygnus.com> * math/libm-test.c: Various cleanups. Patch by Zack Weinberg. * sysdeps/unix/sysv/linux/alpha/setfpucw.c: Use correct type for parameter. Patch by Christian Gafton. * string/envz.h: Add prototype for envz_remove. Reported by Andreas Jaeger.
Diffstat (limited to 'sunrpc/rpc')
-rw-r--r--sunrpc/rpc/xdr.h37
1 files changed, 23 insertions, 14 deletions
diff --git a/sunrpc/rpc/xdr.h b/sunrpc/rpc/xdr.h
index dd9959a..cd28717 100644
--- a/sunrpc/rpc/xdr.h
+++ b/sunrpc/rpc/xdr.h
@@ -154,6 +154,7 @@ struct XDR
*/
typedef bool_t (*xdrproc_t) __PMT ((XDR *, void *,...));
+
/*
* Operations defined on a XDR handle
*
@@ -247,20 +248,28 @@ struct xdr_discrim
* N.B. and frozen for all time: each data type here uses 4 bytes
* of external representation.
*/
-#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_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
-#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
-#define IXDR_GET_U_LONG(buf) ((u_long)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_U_LONG(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_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. */
+#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)))
/*
* These are the "generic" xdr routines.