summaryrefslogtreecommitdiffstats
path: root/libc/inet/rpc/xdr_stdio.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
commitcb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8 (patch)
tree520f8e8d113184cfa7954ebd274564b8c255fa9a /libc/inet/rpc/xdr_stdio.c
parente4461be66e2655058aef358b00050bc70ac72861 (diff)
downloaduClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.bz2
uClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.xz
Merge from trunk. Going pretty good so far. Kind of. Okay, not really.
Diffstat (limited to 'libc/inet/rpc/xdr_stdio.c')
-rw-r--r--libc/inet/rpc/xdr_stdio.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libc/inet/rpc/xdr_stdio.c b/libc/inet/rpc/xdr_stdio.c
index 5c8aec6f9..32689e132 100644
--- a/libc/inet/rpc/xdr_stdio.c
+++ b/libc/inet/rpc/xdr_stdio.c
@@ -37,12 +37,6 @@
* from the stream.
*/
-#define fread __fread
-#define fwrite __fwrite
-#define fseek __fseek
-#define fflush __fflush
-#define ftell __ftell
-
#include <rpc/types.h>
#include <stdio.h>
#include <rpc/xdr.h>
@@ -55,13 +49,19 @@
# define fwrite(p, m, n, s) _IO_fwrite (p, m, n, s)
#endif
+libc_hidden_proto(fread)
+libc_hidden_proto(fwrite)
+libc_hidden_proto(fseek)
+libc_hidden_proto(fflush)
+libc_hidden_proto(ftell)
+
static bool_t xdrstdio_getlong (XDR *, long *);
static bool_t xdrstdio_putlong (XDR *, const long *);
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