diff options
-rw-r--r-- | ChangeLog | 37 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | Makerules | 4 | ||||
-rw-r--r-- | locale/iso-4217.def | 141 | ||||
-rw-r--r-- | posix/glob.h | 2 | ||||
-rw-r--r-- | sunrpc/portmap.c | 2 | ||||
-rw-r--r-- | sunrpc/svc.c | 2 | ||||
-rw-r--r-- | sunrpc/xdr.c | 196 | ||||
-rw-r--r-- | sunrpc/xdr_mem.c | 2 | ||||
-rw-r--r-- | sunrpc/xdr_stdio.c | 2 |
10 files changed, 290 insertions, 100 deletions
@@ -1,3 +1,40 @@ +Sat Jul 20 07:15:33 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * crypt/Makefile, crypt/nocrypt.c: Removed. It is illegal to export + from the USA any software that even makes it easy to drop in an + encryption module of foreign origin. + * Makerules (cryptobjdir): Variable removed. + ($(libdir)/libc.so): Remove dep on libcrypt.so$(libcrypt.so-version). + * Makefile (subdirs): Remove crypt. + +Fri Jul 19 15:10:37 1996 David Mosberger-Tang <davidm@azstarnet.com> + + * sunrpc/xdr_mem.c (xdrmem_putlong): Don't cast LP to int32 (the + old code would have failed on a big-endian 64-bit architecture). + * sunrpc/xdr_stdio.c (xdrstdio_putlong): Ditto. + + * sunrpc/xdr.c (xdr_int): Handle XDR_FREE case. + (xdr_u_long): Use switch instead of chain of if-statements. + Remove gratitous parentheses around return expressions. + (xdr_enum): Open code case where INT_MAX<LONG_MAX. + + * sunrpc/svc.c (svc_getreqset): Increment SOCK by 32, not NFDBITS. + + * sunrpc/portmap.c (reg_service): Declare ANS and PORT as long, + not int. + +Fri Jul 19 16:56:41 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * dlfcn.h, db.h: New wrapper headers. + + * posix/glob.h [!_AMIGA && !VMS]: Check this instead of just [!_AMIGA] + for `struct stat;' forward decl. + +Fri Jul 19 22:25:19 1996 Ulrich Drepper <drepper@cygnus.com> + + * locale/iso-4217.def: Add some more standardized currency + symbols. + Fri Jul 19 13:18:02 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * hurd/report-wait.c (describe_number): Use unsigned long int for J. @@ -54,7 +54,7 @@ endif subdirs = csu assert ctype db locale intl catgets math setjmp signal stdlib \ stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd\ posix io termios resource misc login socket sysvipc gmon gnulib \ - wctype manual $(sysdep-subdirs) nss elf crypt po + wctype manual $(sysdep-subdirs) nss elf po export subdirs := $(subdirs) # Benign, useless in GNU make before 3.63. # The mach and hurd subdirectories have many generated header files which @@ -584,11 +584,9 @@ ifndef subdir # the special object libc-syms.so that contains just the dynamic symbol # table of the shared libc object. install: $(libdir)/libc.so -cryptobjdir := $(firstword $(objdir) $(patsubst ../$(subdir),.,$(..)crypt)) $(libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \ $(elfobjdir)/$(rtld-installed-name) \ - $(common-objpfx)libc.a \ - $(cryptobjdir)/libcrypt.so$(libcrypt.so-version) + $(common-objpfx)libc.a (echo '/* Use the shared library, but some functions are only in';\ echo ' the static library, so try that secondarily.'; \ echo ' The dynamic linker defines some functions used by $(<F),';\ diff --git a/locale/iso-4217.def b/locale/iso-4217.def index 849420365e..67802b31f3 100644 --- a/locale/iso-4217.def +++ b/locale/iso-4217.def @@ -2,35 +2,170 @@ * Defines the valid international currency symbols according to ISO-4217. * This is used in monetary.c(monetary_check). * + * If you find something missing or wrong contact <bug-glibc@prep.ai.mit.edu> + * * !!! The list has to be sorted !!! */ -DEFINE_INT_CURR("ATS ") /* Austria */ -DEFINE_INT_CURR("BEF ") /* Belgium */ +DEFINE_INT_CURR("AED ") /* United Arab Emirats */ +DEFINE_INT_CURR("AFA ") /* Afghanistan */ +DEFINE_INT_CURR("ALL ") /* Albania */ +DEFINE_INT_CURR("ANG ") /* Netherlands Antilles */ +DEFINE_INT_CURR("AOK ") /* Angola */ +DEFINE_INT_CURR("ARP ") /* Argentina */ +DEFINE_INT_CURR("ATS ") /* Austria */ +DEFINE_INT_CURR("AUD ") /* Australia */ +DEFINE_INT_CURR("BBD ") /* Barbados */ +DEFINE_INT_CURR("BDT ") /* Bangladesh */ +DEFINE_INT_CURR("BEF ") /* Belgium */ +DEFINE_INT_CURR("BGL ") /* Bulgaria */ +DEFINE_INT_CURR("BHD ") /* Bahrain */ +DEFINE_INT_CURR("BIF ") /* Burundi */ +DEFINE_INT_CURR("BMD ") /* Burmuda */ +DEFINE_INT_CURR("BND ") /* Brunei */ +DEFINE_INT_CURR("BOP ") /* Bolivia */ +DEFINE_INT_CURR("BRC ") /* Brazil */ +DEFINE_INT_CURR("BSD ") /* Bahamas */ +DEFINE_INT_CURR("BUK ") /* Burma */ +DEFINE_INT_CURR("BWP ") /* Botswana */ +DEFINE_INT_CURR("BZD ") /* Belize */ DEFINE_INT_CURR("CAD ") /* Canada */ -DEFINE_INT_CURR("CHF ") /* Switzerland */ +DEFINE_INT_CURR("CHF ") /* Switzerland, Liechtenstein */ +DEFINE_INT_CURR("CLP ") /* Chile */ +DEFINE_INT_CURR("CNY ") /* China */ +DEFINE_INT_CURR("COP ") /* Colombia */ +DEFINE_INT_CURR("CRC ") /* Costa Rica */ +DEFINE_INT_CURR("CSK ") /* Czechoslovakia */ +DEFINE_INT_CURR("CUP ") /* Cuba */ +DEFINE_INT_CURR("CVE ") /* Cape Verde */ +DEFINE_INT_CURR("CYP ") /* Cyprus */ DEFINE_INT_CURR("DEM ") /* Germany */ +DEFINE_INT_CURR("DJF ") /* Djibouti */ DEFINE_INT_CURR("DKK ") /* Denmark */ +DEFINE_INT_CURR("DOP ") /* Dominican Republic */ +DEFINE_INT_CURR("DZD ") /* Algeria */ +DEFINE_INT_CURR("ECS ") /* Ecuador */ DEFINE_INT_CURR("EEK ") /* Estonia */ +DEFINE_INT_CURR("EGP ") /* Egypt */ DEFINE_INT_CURR("ESP ") /* Spain */ +DEFINE_INT_CURR("ETB ") /* Ethiopia */ DEFINE_INT_CURR("FIM ") /* Finland */ +DEFINE_INT_CURR("FJD ") /* Fiji */ +DEFINE_INT_CURR("FKP ") /* Falkland Islands (Malvinas) */ DEFINE_INT_CURR("FRF ") /* France */ DEFINE_INT_CURR("GBP ") /* Great Britain */ +DEFINE_INT_CURR("GHC ") /* Ghana */ +DEFINE_INT_CURR("GIP ") /* Gibraltar */ +DEFINE_INT_CURR("GMD ") /* Gambia */ +DEFINE_INT_CURR("GNS ") /* Guinea */ +DEFINE_INT_CURR("GQE ") /* Equatorial Guinea */ DEFINE_INT_CURR("GRD ") /* Greece */ +DEFINE_INT_CURR("GTQ ") /* Guatemala */ +DEFINE_INT_CURR("GWP ") /* Guinea-Bissau */ +DEFINE_INT_CURR("GYD ") /* Guyana */ +DEFINE_INT_CURR("HKD ") /* Hong Kong */ +DEFINE_INT_CURR("HNL ") /* Honduras */ DEFINE_INT_CURR("HRD ") /* Croatia */ +DEFINE_INT_CURR("HTG ") /* Haiti */ DEFINE_INT_CURR("HUF ") /* Hungary */ +DEFINE_INT_CURR("IDR ") /* Indonesia */ DEFINE_INT_CURR("IEP ") /* Ireland */ DEFINE_INT_CURR("ILS ") /* Israel */ +DEFINE_INT_CURR("INR ") /* Bhutan */ +DEFINE_INT_CURR("IQD ") /* Iraq */ +DEFINE_INT_CURR("IRR ") /* Iran */ DEFINE_INT_CURR("ISK ") /* Iceland */ DEFINE_INT_CURR("ITL ") /* Italy */ +DEFINE_INT_CURR("JMD ") /* Jamaica */ +DEFINE_INT_CURR("JOD ") /* Jordan */ +DEFINE_INT_CURR("JPY ") /* Japan */ +DEFINE_INT_CURR("KES ") /* Kenya */ +DEFINE_INT_CURR("KHR ") /* Democratic Kampuchea */ +DEFINE_INT_CURR("KMF ") /* Comoros */ +DEFINE_INT_CURR("KPW ") /* Democratic People's of Korea */ +DEFINE_INT_CURR("KRW ") /* Republic of Korea */ +DEFINE_INT_CURR("KWD ") /* Kuwait */ +DEFINE_INT_CURR("KYD ") /* Cayman Islands */ +DEFINE_INT_CURR("LAK ") /* Lao People's Democratic Republic */ +DEFINE_INT_CURR("LBP ") /* Lebanon */ +DEFINE_INT_CURR("LKR ") /* Sri Lanka */ +DEFINE_INT_CURR("LRD ") /* Liberia */ +DEFINE_INT_CURR("LSM ") /* Lesotho */ DEFINE_INT_CURR("LTL ") /* Lithuania */ DEFINE_INT_CURR("LUF ") /* Luxemburg */ DEFINE_INT_CURR("LVL ") /* Latvia */ +DEFINE_INT_CURR("LYD ") /* Libyan Arab Jamahiriya */ +DEFINE_INT_CURR("MAD ") /* Morocco */ +DEFINE_INT_CURR("MGF ") /* Madagascar */ +DEFINE_INT_CURR("MLF ") /* Mali */ +DEFINE_INT_CURR("MNT ") /* Mongolia */ +DEFINE_INT_CURR("MOP ") /* Macau */ +DEFINE_INT_CURR("MRO ") /* Mauritania */ +DEFINE_INT_CURR("MTP ") /* Malta */ +DEFINE_INT_CURR("MUR ") /* Mauritius */ +DEFINE_INT_CURR("MVR ") /* Maldives */ +DEFINE_INT_CURR("MWK ") /* Malawi */ +DEFINE_INT_CURR("MXP ") /* Mexico */ +DEFINE_INT_CURR("MYR ") /* Malaysia */ +DEFINE_INT_CURR("MZM ") /* Mozambique */ +DEFINE_INT_CURR("NGN ") /* Nigeria */ +DEFINE_INT_CURR("NIC ") /* Nicaragua */ DEFINE_INT_CURR("NLG ") /* Netherlands */ DEFINE_INT_CURR("NOK ") /* Norway */ +DEFINE_INT_CURR("NPR ") /* Nepal */ +DEFINE_INT_CURR("NZD ") /* New Zealand */ +DEFINE_INT_CURR("OMR ") /* Oman */ +DEFINE_INT_CURR("PAB ") /* Panama */ +DEFINE_INT_CURR("PES ") /* Peru */ +DEFINE_INT_CURR("PGK ") /* Papau New Guinea */ +DEFINE_INT_CURR("PHP ") /* Philippines */ +DEFINE_INT_CURR("PKR ") /* Pakistan */ DEFINE_INT_CURR("PLZ ") /* Poland */ DEFINE_INT_CURR("PTE ") /* Portugal */ +DEFINE_INT_CURR("PYG ") /* Paraguay */ +DEFINE_INT_CURR("QAR ") /* Qatar */ DEFINE_INT_CURR("ROL ") /* Romania */ DEFINE_INT_CURR("RUR ") /* Russia */ +DEFINE_INT_CURR("RWF ") /* Rwanda */ +DEFINE_INT_CURR("SAR ") /* Saudi Arabia */ +DEFINE_INT_CURR("SBD ") /* Solomon Islands */ +DEFINE_INT_CURR("SCR ") /* Seychelles */ +DEFINE_INT_CURR("SDP ") /* Sudan */ DEFINE_INT_CURR("SEK ") /* Sweden */ +DEFINE_INT_CURR("SGD ") /* Singapore */ +DEFINE_INT_CURR("SHP ") /* St. Helena */ DEFINE_INT_CURR("SIT ") /* Slovenia */ +DEFINE_INT_CURR("SLL ") /* Sierra Leone */ +DEFINE_INT_CURR("SOS ") /* Somalia */ +DEFINE_INT_CURR("SRG ") /* Suriname */ +DEFINE_INT_CURR("STD ") /* Sao Tome and Principe */ +DEFINE_INT_CURR("SUR ") /* Ukrainian, Byelorussion */ +DEFINE_INT_CURR("SVC ") /* El Salvador */ +DEFINE_INT_CURR("SYP ") /* Syrian Arab Republic */ +DEFINE_INT_CURR("SZL ") /* Swaziland */ +DEFINE_INT_CURR("THB ") /* Thailand */ +DEFINE_INT_CURR("TND ") /* Tunisia */ +DEFINE_INT_CURR("TOP ") /* Tonga */ +DEFINE_INT_CURR("TPE ") /* East Timor */ +DEFINE_INT_CURR("TRL ") /* Turkey */ +DEFINE_INT_CURR("TTD ") /* Trinidad and Tobago */ +DEFINE_INT_CURR("TWD ") /* Taiwan, Province of China */ +DEFINE_INT_CURR("TZS ") /* United Republic of Tanzania */ +DEFINE_INT_CURR("UGS ") /* Uganda */ DEFINE_INT_CURR("USD ") /* United States */ +DEFINE_INT_CURR("UYP ") /* Uruguay */ +DEFINE_INT_CURR("VEB ") /* Venezuela */ +DEFINE_INT_CURR("VND ") /* Viet Nam */ +DEFINE_INT_CURR("VUV ") /* Vanuatu */ +DEFINE_INT_CURR("WST ") /* Samoa */ +DEFINE_INT_CURR("XAF ") /* United Republic of Cameroon, Central African Republic, Chad, Congo, Gabon */ +DEFINE_INT_CURR("XCD ") /* Antiqua, Dominica, Grenada, Montserrat, St. Kitts-Nevis-Anguilla, Saint Lucia, Saint Vincent and the Grenadines */ +DEFINE_INT_CURR("XOF ") /* Benin, Ivory Coast, Niger, Senegal, Togo, Upper Volta */ +DEFINE_INT_CURR("XPF ") /* French polynesia, New Caledonia, Wallis and Futuna Islands */ +DEFINE_INT_CURR("YDD ") /* Democratic Yemen */ +DEFINE_INT_CURR("YER ") /* Yemen */ +DEFINE_INT_CURR("YUD ") /* Yugoslavia */ +DEFINE_INT_CURR("ZAL ") /* South Africa */ +DEFINE_INT_CURR("ZAR ") /* Lesotho, Namibia */ +DEFINE_INT_CURR("ZMK ") /* Zambia */ +DEFINE_INT_CURR("ZRZ ") /* Zaire */ +DEFINE_INT_CURR("ZWD ") /* Zimbabwe */ diff --git a/posix/glob.h b/posix/glob.h index 8607e9f04c..ba24d890c4 100644 --- a/posix/glob.h +++ b/posix/glob.h @@ -65,7 +65,7 @@ extern "C" #define GLOB_NOMATCH 3 /* No matches found. */ /* Structure describing a globbing run. */ -#ifndef _AMIGA /* Buggy compiler. */ +#if !defined (_AMIGA) && !defined (VMS) /* Buggy compiler. */ struct stat; #endif typedef struct diff --git a/sunrpc/portmap.c b/sunrpc/portmap.c index b43c47cf76..bbe9dbb246 100644 --- a/sunrpc/portmap.c +++ b/sunrpc/portmap.c @@ -166,7 +166,7 @@ reg_service(rqstp, xprt) { struct pmap reg; struct pmaplist *pml, *prevpml, *fnd; - int ans, port; + long ans, port; caddr_t t; #ifdef DEBUG diff --git a/sunrpc/svc.c b/sunrpc/svc.c index 7bfe680718..e0af7107be 100644 --- a/sunrpc/svc.c +++ b/sunrpc/svc.c @@ -412,7 +412,7 @@ svc_getreqset(readfds) #ifdef FD_SETSIZE setsize = _rpc_dtablesize(); maskp = (u_int32_t *)readfds->fds_bits; - for (sock = 0; sock < setsize; sock += NFDBITS) { + for (sock = 0; sock < setsize; sock += 32) { for (mask = *maskp++; bit = ffs(mask); mask ^= (1 << (bit - 1))) { /* sock has input waiting */ xprt = xports[sock + bit - 1]; diff --git a/sunrpc/xdr.c b/sunrpc/xdr.c index 56953e07ef..99a47bf42c 100644 --- a/sunrpc/xdr.c +++ b/sunrpc/xdr.c @@ -112,8 +112,10 @@ xdr_int(xdrs, ip) return FALSE; } *ip = (int) l; + case XDR_FREE: return TRUE; } + return FALSE; # elif INT_MAX == LONG_MAX return xdr_long(xdrs, (long *)ip); # elif INT_MAX == SHRT_MAX @@ -149,8 +151,10 @@ xdr_u_int(xdrs, up) return FALSE; } *up = (u_int) l; + case XDR_FREE: return TRUE; } + return FALSE; # elif UINT_MAX == ULONG_MAX return xdr_u_long(xdrs, (u_long *)up); # elif UINT_MAX == USHRT_MAX @@ -192,14 +196,17 @@ xdr_u_long(xdrs, ulp) register XDR *xdrs; u_long *ulp; { + switch (xdrs->x_op) { + case XDR_DECODE: + return XDR_GETLONG(xdrs, (long *)ulp); - if (xdrs->x_op == XDR_DECODE) - return (XDR_GETLONG(xdrs, (long *)ulp)); - if (xdrs->x_op == XDR_ENCODE) - return (XDR_PUTLONG(xdrs, (long *)ulp)); - if (xdrs->x_op == XDR_FREE) - return (TRUE); - return (FALSE); + case XDR_ENCODE: + return XDR_PUTLONG(xdrs, (long *)ulp); + + case XDR_FREE: + return TRUE; + } + return FALSE; } /* @@ -213,22 +220,21 @@ xdr_short(xdrs, sp) long l; switch (xdrs->x_op) { - - case XDR_ENCODE: + case XDR_ENCODE: l = (long) *sp; - return (XDR_PUTLONG(xdrs, &l)); + return XDR_PUTLONG(xdrs, &l); - case XDR_DECODE: + case XDR_DECODE: if (!XDR_GETLONG(xdrs, &l)) { - return (FALSE); + return FALSE; } *sp = (short) l; - return (TRUE); + return TRUE; - case XDR_FREE: - return (TRUE); + case XDR_FREE: + return TRUE; } - return (FALSE); + return FALSE; } /* @@ -242,22 +248,21 @@ xdr_u_short(xdrs, usp) u_long l; switch (xdrs->x_op) { - - case XDR_ENCODE: + case XDR_ENCODE: l = (u_long) *usp; - return (XDR_PUTLONG(xdrs, &l)); + return XDR_PUTLONG(xdrs, &l); - case XDR_DECODE: + case XDR_DECODE: if (!XDR_GETLONG(xdrs, &l)) { - return (FALSE); + return FALSE; } *usp = (u_short) l; - return (TRUE); + return TRUE; - case XDR_FREE: - return (TRUE); + case XDR_FREE: + return TRUE; } - return (FALSE); + return FALSE; } @@ -273,10 +278,10 @@ xdr_char(xdrs, cp) i = (*cp); if (!xdr_int(xdrs, &i)) { - return (FALSE); + return FALSE; } *cp = i; - return (TRUE); + return TRUE; } /* @@ -285,16 +290,16 @@ xdr_char(xdrs, cp) bool_t xdr_u_char(xdrs, cp) XDR *xdrs; - char *cp; + u_char *cp; { u_int u; u = (*cp); if (!xdr_u_int(xdrs, &u)) { - return (FALSE); + return FALSE; } *cp = u; - return (TRUE); + return TRUE; } /* @@ -308,22 +313,21 @@ xdr_bool(xdrs, bp) long lb; switch (xdrs->x_op) { - - case XDR_ENCODE: + case XDR_ENCODE: lb = *bp ? XDR_TRUE : XDR_FALSE; - return (XDR_PUTLONG(xdrs, &lb)); + return XDR_PUTLONG(xdrs, &lb); - case XDR_DECODE: + case XDR_DECODE: if (!XDR_GETLONG(xdrs, &lb)) { - return (FALSE); + return FALSE; } *bp = (lb == XDR_FALSE) ? FALSE : TRUE; - return (TRUE); + return TRUE; - case XDR_FREE: - return (TRUE); + case XDR_FREE: + return TRUE; } - return (FALSE); + return FALSE; } /* @@ -341,16 +345,36 @@ xdr_enum(xdrs, ep) * enums are treated as ints */ if (sizeof (enum sizecheck) == 4) { +# if INT_MAX < LONG_MAX + long l; + + switch (xdrs->x_op) { + case XDR_ENCODE: + l = *ep; + return XDR_PUTLONG(xdrs, &l); + + case XDR_DECODE: + if (!XDR_GETLONG(xdrs, &l)) { + return FALSE; + } + *ep = l; + case XDR_FREE: + return TRUE; + + } + return FALSE; +# else return (xdr_long(xdrs, (long *)ep)); +# endif } else if (sizeof (enum sizecheck) == sizeof (short)) { - return (xdr_short(xdrs, (short *)ep)); + return xdr_short(xdrs, (short *)ep); } else { - return (FALSE); + return FALSE; } -#else +#else /* lint */ (void) (xdr_short(xdrs, (short *)ep)); return (xdr_long(xdrs, (long *)ep)); -#endif +#endif /* lint */ } /* @@ -371,7 +395,7 @@ xdr_opaque(xdrs, cp, cnt) * if no data we are done */ if (cnt == 0) - return (TRUE); + return TRUE; /* * round byte count to full xdr units @@ -380,29 +404,27 @@ xdr_opaque(xdrs, cp, cnt) if (rndup > 0) rndup = BYTES_PER_XDR_UNIT - rndup; - if (xdrs->x_op == XDR_DECODE) { + switch (xdrs->x_op) { + case XDR_DECODE: if (!XDR_GETBYTES(xdrs, cp, cnt)) { - return (FALSE); + return FALSE; } if (rndup == 0) - return (TRUE); - return (XDR_GETBYTES(xdrs, crud, rndup)); - } + return TRUE; + return XDR_GETBYTES(xdrs, crud, rndup); - if (xdrs->x_op == XDR_ENCODE) { + case XDR_ENCODE: if (!XDR_PUTBYTES(xdrs, cp, cnt)) { - return (FALSE); + return FALSE; } if (rndup == 0) - return (TRUE); - return (XDR_PUTBYTES(xdrs, xdr_zero, rndup)); - } + return TRUE; + return XDR_PUTBYTES(xdrs, xdr_zero, rndup); - if (xdrs->x_op == XDR_FREE) { - return (TRUE); + case XDR_FREE: + return TRUE; } - - return (FALSE); + return FALSE; } /* @@ -424,42 +446,41 @@ xdr_bytes(xdrs, cpp, sizep, maxsize) * first deal with the length since xdr bytes are counted */ if (! xdr_u_int(xdrs, sizep)) { - return (FALSE); + return FALSE; } nodesize = *sizep; if ((nodesize > maxsize) && (xdrs->x_op != XDR_FREE)) { - return (FALSE); + return FALSE; } /* * now deal with the actual bytes */ switch (xdrs->x_op) { - - case XDR_DECODE: + case XDR_DECODE: if (nodesize == 0) { - return (TRUE); + return TRUE; } if (sp == NULL) { *cpp = sp = (char *)mem_alloc(nodesize); } if (sp == NULL) { (void) fprintf(stderr, "xdr_bytes: out of memory\n"); - return (FALSE); + return FALSE; } /* fall into ... */ - case XDR_ENCODE: - return (xdr_opaque(xdrs, sp, nodesize)); + case XDR_ENCODE: + return xdr_opaque(xdrs, sp, nodesize); - case XDR_FREE: + case XDR_FREE: if (sp != NULL) { mem_free(sp, nodesize); *cpp = NULL; } - return (TRUE); + return TRUE; } - return (FALSE); + return FALSE; } /* @@ -471,7 +492,7 @@ xdr_netobj(xdrs, np) struct netobj *np; { - return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ)); + return xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ); } /* @@ -499,7 +520,7 @@ xdr_union(xdrs, dscmp, unp, choices, dfault) * we deal with the discriminator; it's an enum */ if (! xdr_enum(xdrs, dscmp)) { - return (FALSE); + return FALSE; } dscm = *dscmp; @@ -509,7 +530,7 @@ xdr_union(xdrs, dscmp, unp, choices, dfault) */ for (; choices->proc != NULL_xdrproc_t; choices++) { if (choices->value == dscm) - return ((*(choices->proc))(xdrs, unp, LASTUNSIGNED)); + return (*(choices->proc))(xdrs, unp, LASTUNSIGNED); } /* @@ -548,20 +569,20 @@ xdr_string(xdrs, cpp, maxsize) * first deal with the length since xdr strings are counted-strings */ switch (xdrs->x_op) { - case XDR_FREE: + case XDR_FREE: if (sp == NULL) { - return(TRUE); /* already free */ + return TRUE; /* already free */ } /* fall through... */ - case XDR_ENCODE: + case XDR_ENCODE: size = strlen(sp); break; } if (! xdr_u_int(xdrs, &size)) { - return (FALSE); + return FALSE; } if (size > maxsize) { - return (FALSE); + return FALSE; } nodesize = size + 1; @@ -569,29 +590,28 @@ xdr_string(xdrs, cpp, maxsize) * now deal with the actual bytes */ switch (xdrs->x_op) { - - case XDR_DECODE: + case XDR_DECODE: if (nodesize == 0) { - return (TRUE); + return TRUE; } if (sp == NULL) *cpp = sp = (char *)mem_alloc(nodesize); if (sp == NULL) { (void) fprintf(stderr, "xdr_string: out of memory\n"); - return (FALSE); + return FALSE; } sp[size] = 0; /* fall into ... */ - case XDR_ENCODE: - return (xdr_opaque(xdrs, sp, size)); + case XDR_ENCODE: + return xdr_opaque(xdrs, sp, size); - case XDR_FREE: + case XDR_FREE: mem_free(sp, nodesize); *cpp = NULL; - return (TRUE); + return TRUE; } - return (FALSE); + return FALSE; } /* @@ -604,7 +624,7 @@ xdr_wrapstring(xdrs, cpp) char **cpp; { if (xdr_string(xdrs, cpp, LASTUNSIGNED)) { - return (TRUE); + return TRUE; } - return (FALSE); + return FALSE; } diff --git a/sunrpc/xdr_mem.c b/sunrpc/xdr_mem.c index ac7c9541d0..d6241e7f7d 100644 --- a/sunrpc/xdr_mem.c +++ b/sunrpc/xdr_mem.c @@ -112,7 +112,7 @@ xdrmem_putlong(xdrs, lp) if ((xdrs->x_handy -= 4) < 0) return (FALSE); - *(int32_t *)xdrs->x_private = (long)htonl((u_long)(*(int32_t*)lp)); + *(int32_t *)xdrs->x_private = htonl(*lp); xdrs->x_private += 4; return (TRUE); } diff --git a/sunrpc/xdr_stdio.c b/sunrpc/xdr_stdio.c index 5f016993e7..151e5e48e4 100644 --- a/sunrpc/xdr_stdio.c +++ b/sunrpc/xdr_stdio.c @@ -118,7 +118,7 @@ xdrstdio_putlong(xdrs, lp) long *lp; { - int32_t mycopy = htonl(*(int32_t*)lp); + int32_t mycopy = htonl(*lp); lp = &mycopy; if (fwrite((caddr_t)lp, 4, 1, (FILE *)xdrs->x_private) != 1) return (FALSE); |