aboutsummaryrefslogtreecommitdiff
path: root/sunrpc/xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/xdr.c')
-rw-r--r--sunrpc/xdr.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/sunrpc/xdr.c b/sunrpc/xdr.c
index d99a9985c4..21e339b4ee 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
- u_long l;
+ long l;
switch (xdrs->x_op)
{
@@ -144,7 +144,7 @@ xdr_u_int (XDR *xdrs, u_int *up)
{
return FALSE;
}
- *up = (u_int) l;
+ *up = (u_int) (u_long) l;
case XDR_FREE:
return TRUE;
}
@@ -225,8 +225,7 @@ INTDEF(xdr_u_long)
bool_t
xdr_hyper (XDR *xdrs, quad_t *llp)
{
- long t1;
- unsigned long int t2;
+ long int t1, t2;
if (xdrs->x_op == XDR_ENCODE)
{
@@ -240,7 +239,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 |= t2;
+ *llp |= (uint32_t) t2;
return TRUE;
}
@@ -259,8 +258,7 @@ INTDEF(xdr_hyper)
bool_t
xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
{
- unsigned long t1;
- unsigned long t2;
+ long int t1, t2;
if (xdrs->x_op == XDR_ENCODE)
{
@@ -274,7 +272,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 |= t2;
+ *ullp |= (uint32_t) t2;
return TRUE;
}
@@ -332,7 +330,7 @@ INTDEF(xdr_short)
bool_t
xdr_u_short (XDR *xdrs, u_short *usp)
{
- u_long l;
+ long l;
switch (xdrs->x_op)
{
@@ -345,7 +343,7 @@ xdr_u_short (XDR *xdrs, u_short *usp)
{
return FALSE;
}
- *usp = (u_short) l;
+ *usp = (u_short) (u_long) l;
return TRUE;
case XDR_FREE:
@@ -565,12 +563,7 @@ xdr_bytes (xdrs, cpp, sizep, maxsize)
}
if (sp == NULL)
{
-#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);
+ (void) __fxprintf (NULL, "%s", _("xdr_bytes: out of memory\n"));
return FALSE;
}
/* fall into ... */
@@ -722,13 +715,7 @@ xdr_string (xdrs, cpp, maxsize)
*cpp = sp = (char *) mem_alloc (nodesize);
if (sp == NULL)
{
-#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);
+ (void) __fxprintf (NULL, "%s", _("xdr_string: out of memory\n"));
return FALSE;
}
sp[size] = 0;