From fbb0754872307460f78291028cf4338e7fe6ebf5 Mon Sep 17 00:00:00 2001 From: pfg Date: Thu, 9 Jun 2016 19:44:47 +0000 Subject: libc/rpc: Make use of some xdr_* macros. xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD but were fixed in r296394. Give them some use hoping they help make the code somewhat more readable. --- lib/libc/rpc/rpc_prot.c | 4 ++-- lib/libc/rpc/rpcb_prot.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/rpc/rpc_prot.c b/lib/libc/rpc/rpc_prot.c index 53fc70a..cd38ac1 100644 --- a/lib/libc/rpc/rpc_prot.c +++ b/lib/libc/rpc/rpc_prot.c @@ -217,8 +217,8 @@ xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) (xdrs->x_op == XDR_ENCODE) && xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) && xdr_enum(xdrs, (enum_t *) prm_direction) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) ) + xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_rpcvers)) && + xdr_rpcprog(xdrs, &(cmsg->rm_call.cb_prog)) ) return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers))); return (FALSE); } diff --git a/lib/libc/rpc/rpcb_prot.c b/lib/libc/rpc/rpcb_prot.c index 2b87f34..c462e19 100644 --- a/lib/libc/rpc/rpcb_prot.c +++ b/lib/libc/rpc/rpcb_prot.c @@ -56,10 +56,10 @@ __FBSDID("$FreeBSD$"); bool_t xdr_rpcb(XDR *xdrs, RPCB *objp) { - if (!xdr_u_int32_t(xdrs, &objp->r_prog)) { + if (!xdr_rpcprog(xdrs, &objp->r_prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->r_vers)) { + if (!xdr_rpcvers(xdrs, &objp->r_vers)) { return (FALSE); } if (!xdr_string(xdrs, &objp->r_netid, (u_int)~0)) { @@ -243,13 +243,13 @@ xdr_rpcb_rmtcallargs(XDR *xdrs, struct rpcb_rmtcallargs *p) buf = XDR_INLINE(xdrs, 3 * BYTES_PER_XDR_UNIT); if (buf == NULL) { - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } } else { -- cgit v1.1