From cc479c5abf86e0014cf6bc3492bbf53a47f503fc Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 23 Jan 2006 23:22:10 +0000 Subject: sync with glibc --- libc/inet/rpc/xdr_stdio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libc/inet/rpc/xdr_stdio.c') diff --git a/libc/inet/rpc/xdr_stdio.c b/libc/inet/rpc/xdr_stdio.c index 8bd08590d..32689e132 100644 --- a/libc/inet/rpc/xdr_stdio.c +++ b/libc/inet/rpc/xdr_stdio.c @@ -61,7 +61,7 @@ static bool_t xdrstdio_getbytes (XDR *, caddr_t, u_int); static bool_t xdrstdio_putbytes (XDR *, const char *, u_int); static u_int xdrstdio_getpos (const XDR *); static bool_t xdrstdio_setpos (XDR *, u_int); -static int32_t *xdrstdio_inline (XDR *, int); +static int32_t *xdrstdio_inline (XDR *, u_int); static void xdrstdio_destroy (XDR *); static bool_t xdrstdio_getint32 (XDR *, int32_t *); static bool_t xdrstdio_putint32 (XDR *, const int32_t *); @@ -114,20 +114,20 @@ xdrstdio_destroy (XDR *xdrs) static bool_t xdrstdio_getlong (XDR *xdrs, long *lp) { - int32_t mycopy; + u_int32_t mycopy; - if (fread ((caddr_t) & mycopy, 4, 1, (FILE *) xdrs->x_private) != 1) + if (fread ((caddr_t) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1) return FALSE; - *lp = (int32_t) ntohl (mycopy); + *lp = (long) ntohl (mycopy); return TRUE; } static bool_t xdrstdio_putlong (XDR *xdrs, const long *lp) { - long mycopy = htonl (*lp); - lp = &mycopy; - if (fwrite ((caddr_t) lp, 4, 1, (FILE *) xdrs->x_private) != 1) + int32_t mycopy = htonl ((u_int32_t) *lp); + + if (fwrite ((caddr_t) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1) return FALSE; return TRUE; } @@ -163,7 +163,7 @@ xdrstdio_setpos (XDR *xdrs, u_int pos) } static int32_t * -xdrstdio_inline (XDR *xdrs attribute_unused, int len attribute_unused) +xdrstdio_inline (XDR *xdrs attribute_unused, u_int len attribute_unused) { /* * Must do some work to implement this: must insure -- cgit v1.2.3