From d9fee042e252b229f8f967bf36492c97ec112fa8 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 7 Aug 2017 19:55:34 +0000 Subject: Consistently use uintN_t not u_intN_t everywhere. This patch changes the remaining uses of the old nonstandard u_intN_t types in glibc to use the C99 uintN_t instead, except for the definitions of those typedefs and the tests of them in the c++-types test. This follows the previous such fix for libm, and being consistent in using uintN_t makes sense as a global cleanup. Tested for x86_64, and with build-many-glibcs.py. * catgets/catgets.c (catgets): Use uintN_t instead of u_intN_t. * catgets/catgetsinfo.h (struct catalog_obj): Likewise. (struct catalog_info): Likewise. * inet/htontest.c (lo): Likewise. (foo): Likewise. * inet/inet_lnaof.c (inet_lnaof): Likewise. * inet/inet_net.c (inet_network): Likewise. * inet/inet_netof.c (inet_netof): Likewise. * inet/rcmd.c (__ivaliduser): Likewise. (iruserok): Likewise. * locale/loadlocale.c (_nl_intern_locale_data): Likewise. * locale/programs/locale-spec.c (locale_special): Likewise. * nis/nis_findserv.c (struct findserv_req): Likewise. (__nis_findfastest_with_timeout): Likewise. * nss/test-netdb.c (test_network): Likewise. * resolv/inet_neta.c (inet_neta): Likewise. * resolv/ns_date.c (ns_datetosecs): Likewise. (SECS_PER_DAY): Likewise. * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise. * resolv/res_comp.c (__putlong): Likewise. (__putshort): Likewise. (_getlong): Likewise. (_getshort): Likewise. * resolv/res_debug.c (p_time): Likewise. (precsize_ntoa): Likewise. (precsize_aton): Likewise. (latlon2ul): Likewise. (loc_aton): Likewise. (loc_ntoa): Likewise. * resolv/res_hconf.c (struct netaddr): Likewise. (_res_hconf_reorder_addrs): Likewise. * sunrpc/clnt_tcp.c (clnttcp_call): Likewise. (clnttcp_control): Likewise. * sunrpc/clnt_udp.c (clntudp_call): Likewise. (clntudp_control): Likewise. * sunrpc/clnt_unix.c (clntunix_call): Likewise. (clntunix_control): Likewise. * sunrpc/pmap_rmt.c (clnt_broadcast): Likewise. * sunrpc/rpc/auth.h (union des_block): Likewise. * sunrpc/tst-udp-nonblocking.c (do_test): Likewise. * sunrpc/xdr_rec.c (struct rec_strm): Likewise. (xdrrec_create): Likewise. (xdrrec_endofrecord): Likewise. (flush_out): Likewise. * sunrpc/xdr_stdio.c (xdrstdio_getlong): Likewise. (xdrstdio_putlong): Likewise. * sysdeps/unix/sysv/linux/errqueue.h (struct sock_extended_err): Likewise. --- sunrpc/clnt_tcp.c | 6 +++--- sunrpc/clnt_udp.c | 4 ++-- sunrpc/clnt_unix.c | 4 ++-- sunrpc/pmap_rmt.c | 4 ++-- sunrpc/rpc/auth.h | 4 ++-- sunrpc/tst-udp-nonblocking.c | 2 +- sunrpc/xdr_rec.c | 8 ++++---- sunrpc/xdr_stdio.c | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) (limited to 'sunrpc') diff --git a/sunrpc/clnt_tcp.c b/sunrpc/clnt_tcp.c index e311b35..249e9c3 100644 --- a/sunrpc/clnt_tcp.c +++ b/sunrpc/clnt_tcp.c @@ -233,7 +233,7 @@ clnttcp_call (CLIENT *h, u_long proc, xdrproc_t xdr_args, caddr_t args_ptr, XDR *xdrs = &(ct->ct_xdrs); struct rpc_msg reply_msg; u_long x_id; - u_int32_t *msg_x_id = (u_int32_t *) (ct->ct_mcall); /* yuk */ + uint32_t *msg_x_id = (uint32_t *) (ct->ct_mcall); /* yuk */ bool_t shipnow; int refreshes = 2; @@ -291,7 +291,7 @@ call_again: continue; return ct->ct_error.re_status; } - if ((u_int32_t) reply_msg.rm_xid == (u_int32_t) x_id) + if ((uint32_t) reply_msg.rm_xid == (uint32_t) x_id) break; } @@ -356,7 +356,7 @@ clnttcp_control (CLIENT *cl, int request, char *info) { struct ct_data *ct = (struct ct_data *) cl->cl_private; u_long ul; - u_int32_t ui32; + uint32_t ui32; switch (request) diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c index df21e28..c2436e3 100644 --- a/sunrpc/clnt_udp.c +++ b/sunrpc/clnt_udp.c @@ -465,7 +465,7 @@ send_again: if (inlen >= 4 && (xargs == NULL || memcmp (cu->cu_inbuf, cu->cu_outbuf, - sizeof (u_int32_t)) == 0)) + sizeof (uint32_t)) == 0)) break; next_response: @@ -543,7 +543,7 @@ clntudp_control (CLIENT *cl, int request, char *info) { struct cu_data *cu = (struct cu_data *) cl->cl_private; u_long ul; - u_int32_t ui32; + uint32_t ui32; switch (request) { diff --git a/sunrpc/clnt_unix.c b/sunrpc/clnt_unix.c index 8591be5..33a02cc 100644 --- a/sunrpc/clnt_unix.c +++ b/sunrpc/clnt_unix.c @@ -212,7 +212,7 @@ clntunix_call (CLIENT *h, u_long proc, xdrproc_t xdr_args, caddr_t args_ptr, XDR *xdrs = &(ct->ct_xdrs); struct rpc_msg reply_msg; u_long x_id; - u_int32_t *msg_x_id = (u_int32_t *) (ct->ct_mcall); /* yuk */ + uint32_t *msg_x_id = (uint32_t *) (ct->ct_mcall); /* yuk */ bool_t shipnow; int refreshes = 2; @@ -332,7 +332,7 @@ clntunix_control (CLIENT *cl, int request, char *info) { struct ct_data *ct = (struct ct_data *) cl->cl_private; u_long ul; - u_int32_t ui32; + uint32_t ui32; switch (request) { diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c index 6d4ed72..3bdffce 100644 --- a/sunrpc/pmap_rmt.c +++ b/sunrpc/pmap_rmt.c @@ -352,7 +352,7 @@ clnt_broadcast (/* program number */ xdrmem_create (xdrs, inbuf, (u_int) inlen, XDR_DECODE); if (xdr_replymsg (xdrs, &msg)) { - if (((u_int32_t) msg.rm_xid == (u_int32_t) xid) && + if (((uint32_t) msg.rm_xid == (uint32_t) xid) && (msg.rm_reply.rp_stat == MSG_ACCEPTED) && (msg.acpted_rply.ar_stat == SUCCESS)) { @@ -365,7 +365,7 @@ clnt_broadcast (/* program number */ { #ifdef notdef /* some kind of deserialization problem ... */ - if ((u_int32_t) msg.rm_xid == (u_int32_t) xid) + if ((uint32_t) msg.rm_xid == (uint32_t) xid) fprintf (stderr, "Broadcast deserialization problem"); /* otherwise, just random garbage */ #endif diff --git a/sunrpc/rpc/auth.h b/sunrpc/rpc/auth.h index b25dcfc..e01b077 100644 --- a/sunrpc/rpc/auth.h +++ b/sunrpc/rpc/auth.h @@ -68,8 +68,8 @@ enum auth_stat { union des_block { struct { - u_int32_t high; - u_int32_t low; + uint32_t high; + uint32_t low; } key; char c[8]; }; diff --git a/sunrpc/tst-udp-nonblocking.c b/sunrpc/tst-udp-nonblocking.c index 1d6a7f4..c6a6849 100644 --- a/sunrpc/tst-udp-nonblocking.c +++ b/sunrpc/tst-udp-nonblocking.c @@ -249,7 +249,7 @@ do_test (void) /* Reset the xid because it is changed by each invocation of clnt_call. Subtract one to compensate for the xid update during the call. */ - *((u_int32_t *) (cu->cu_outbuf)) = servers[i].xid - 1; + *((uint32_t *) (cu->cu_outbuf)) = servers[i].xid - 1; cu->cu_raddr = servers[i].address; struct test_query query = { .a = 100, .b = i + 1 }; diff --git a/sunrpc/xdr_rec.c b/sunrpc/xdr_rec.c index fafa591..9dee4f0 100644 --- a/sunrpc/xdr_rec.c +++ b/sunrpc/xdr_rec.c @@ -102,7 +102,7 @@ typedef struct rec_strm caddr_t out_base; /* output buffer (points to frag header) */ caddr_t out_finger; /* next output position */ caddr_t out_boundry; /* data cannot up to this address */ - u_int32_t *frag_header; /* beginning of curren fragment */ + uint32_t *frag_header; /* beginning of curren fragment */ bool_t frag_sent; /* true if buffer sent in middle of record */ /* * in-coming bits @@ -181,7 +181,7 @@ xdrrec_create (XDR *xdrs, u_int sendsize, rstrm->readit = readit; rstrm->writeit = writeit; rstrm->out_finger = rstrm->out_boundry = rstrm->out_base; - rstrm->frag_header = (u_int32_t *) rstrm->out_base; + rstrm->frag_header = (uint32_t *) rstrm->out_base; rstrm->out_finger += 4; rstrm->out_boundry += sendsize; rstrm->frag_sent = FALSE; @@ -526,7 +526,7 @@ xdrrec_endofrecord (XDR *xdrs, bool_t sendnow) len = (rstrm->out_finger - (char *) rstrm->frag_header - BYTES_PER_XDR_UNIT); *rstrm->frag_header = htonl ((u_long) len | LAST_FRAG); - rstrm->frag_header = (u_int32_t *) rstrm->out_finger; + rstrm->frag_header = (uint32_t *) rstrm->out_finger; rstrm->out_finger += BYTES_PER_XDR_UNIT; return TRUE; } @@ -549,7 +549,7 @@ flush_out (RECSTREAM *rstrm, bool_t eor) if ((*(rstrm->writeit)) (rstrm->tcp_handle, rstrm->out_base, (int) len) != (int) len) return FALSE; - rstrm->frag_header = (u_int32_t *) rstrm->out_base; + rstrm->frag_header = (uint32_t *) rstrm->out_base; rstrm->out_finger = (caddr_t) rstrm->out_base + BYTES_PER_XDR_UNIT; return TRUE; } diff --git a/sunrpc/xdr_stdio.c b/sunrpc/xdr_stdio.c index 6ab514b..0c2cbb7 100644 --- a/sunrpc/xdr_stdio.c +++ b/sunrpc/xdr_stdio.c @@ -106,7 +106,7 @@ xdrstdio_destroy (XDR *xdrs) static bool_t xdrstdio_getlong (XDR *xdrs, long *lp) { - u_int32_t mycopy; + uint32_t mycopy; if (fread ((caddr_t) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1) return FALSE; @@ -117,7 +117,7 @@ xdrstdio_getlong (XDR *xdrs, long *lp) static bool_t xdrstdio_putlong (XDR *xdrs, const long *lp) { - int32_t mycopy = htonl ((u_int32_t) *lp); + int32_t mycopy = htonl ((uint32_t) *lp); if (fwrite ((caddr_t) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1) return FALSE; -- cgit v1.1