aboutsummaryrefslogtreecommitdiff
path: root/sunrpc/xdr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /sunrpc/xdr.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.bz2
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sunrpc/xdr.c')
-rw-r--r--sunrpc/xdr.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/sunrpc/xdr.c b/sunrpc/xdr.c
index 21e339b4ee..d99a9985c4 100644
--- a/sunrpc/xdr.c
+++ b/sunrpc/xdr.c
@@ -131,7 +131,7 @@ bool_t
xdr_u_int (XDR *xdrs, u_int *up)
{
#if UINT_MAX < ULONG_MAX
- long l;
+ u_long l;
switch (xdrs->x_op)
{
@@ -144,7 +144,7 @@ xdr_u_int (XDR *xdrs, u_int *up)
{
return FALSE;
}
- *up = (u_int) (u_long) l;
+ *up = (u_int) l;
case XDR_FREE:
return TRUE;
}
@@ -225,7 +225,8 @@ INTDEF(xdr_u_long)
bool_t
xdr_hyper (XDR *xdrs, quad_t *llp)
{
- long int t1, t2;
+ long t1;
+ unsigned long int t2;
if (xdrs->x_op == XDR_ENCODE)
{
@@ -239,7 +240,7 @@ xdr_hyper (XDR *xdrs, quad_t *llp)
if (!XDR_GETLONG(xdrs, &t1) || !XDR_GETLONG(xdrs, &t2))
return FALSE;
*llp = ((quad_t) t1) << 32;
- *llp |= (uint32_t) t2;
+ *llp |= t2;
return TRUE;
}
@@ -258,7 +259,8 @@ INTDEF(xdr_hyper)
bool_t
xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
{
- long int t1, t2;
+ unsigned long t1;
+ unsigned long t2;
if (xdrs->x_op == XDR_ENCODE)
{
@@ -272,7 +274,7 @@ xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
if (!XDR_GETLONG(xdrs, &t1) || !XDR_GETLONG(xdrs, &t2))
return FALSE;
*ullp = ((u_quad_t) t1) << 32;
- *ullp |= (uint32_t) t2;
+ *ullp |= t2;
return TRUE;
}
@@ -330,7 +332,7 @@ INTDEF(xdr_short)
bool_t
xdr_u_short (XDR *xdrs, u_short *usp)
{
- long l;
+ u_long l;
switch (xdrs->x_op)
{
@@ -343,7 +345,7 @@ xdr_u_short (XDR *xdrs, u_short *usp)
{
return FALSE;
}
- *usp = (u_short) (u_long) l;
+ *usp = (u_short) l;
return TRUE;
case XDR_FREE:
@@ -563,7 +565,12 @@ xdr_bytes (xdrs, cpp, sizep, maxsize)
}
if (sp == NULL)
{
- (void) __fxprintf (NULL, "%s", _("xdr_bytes: out of memory\n"));
+#ifdef USE_IN_LIBIO
+ if (_IO_fwide (stderr, 0) > 0)
+ (void) __fwprintf (stderr, L"%s", _("xdr_bytes: out of memory\n"));
+ else
+#endif
+ (void) fputs (_("xdr_bytes: out of memory\n"), stderr);
return FALSE;
}
/* fall into ... */
@@ -715,7 +722,13 @@ xdr_string (xdrs, cpp, maxsize)
*cpp = sp = (char *) mem_alloc (nodesize);
if (sp == NULL)
{
- (void) __fxprintf (NULL, "%s", _("xdr_string: out of memory\n"));
+#ifdef USE_IN_LIBIO
+ if (_IO_fwide (stderr, 0) > 0)
+ (void) __fwprintf (stderr, L"%s",
+ _("xdr_string: out of memory\n"));
+ else
+#endif
+ (void) fputs (_("xdr_string: out of memory\n"), stderr);
return FALSE;
}
sp[size] = 0;