From f5d737a3212e25ea18d58ec892a010bd33fd7d15 Mon Sep 17 00:00:00 2001 From: delphij Date: Thu, 30 May 2019 02:23:57 +0000 Subject: [PATCH] Unexpand be32dec(). MFC after: 2 weeks --- stand/libsa/zfs/zfsimpl.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index 36bc67fc82eb..3c352634c283 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); * Stand-alone ZFS file reader. */ +#include #include #include @@ -128,10 +129,7 @@ zfs_free(void *ptr, size_t size) static int xdr_int(const unsigned char **xdr, int *ip) { - *ip = ((*xdr)[0] << 24) - | ((*xdr)[1] << 16) - | ((*xdr)[2] << 8) - | ((*xdr)[3] << 0); + *ip = be32dec(*xdr); (*xdr) += 4; return (0); } @@ -139,10 +137,7 @@ xdr_int(const unsigned char **xdr, int *ip) static int xdr_u_int(const unsigned char **xdr, u_int *ip) { - *ip = ((*xdr)[0] << 24) - | ((*xdr)[1] << 16) - | ((*xdr)[2] << 8) - | ((*xdr)[3] << 0); + *ip = be32dec(*xdr); (*xdr) += 4; return (0); }