From 3df101ed0d44b7f22d18890973fe400cb2551d73 Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Thu, 10 Jul 2025 18:32:49 +0200 Subject: nfs: Clean xdr_encode/decode_64bit Better use the stdint. Also export them, they will be useful generally. --- nfs/nfs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'nfs/nfs.c') diff --git a/nfs/nfs.c b/nfs/nfs.c index d89cfcb1..7ec08eaa 100644 --- a/nfs/nfs.c +++ b/nfs/nfs.c @@ -163,11 +163,11 @@ xdr_encode_data (int *p, const char *data, size_t len) return p + nints; } -/* Encode a 64 bit integer. */ +/* Encode a 64 bit unsigned integer. */ int * -xdr_encode_64bit (int *p, long long n) +xdr_encode_64bit (int *p, uint64_t n) { - *(p++) = htonl (n & 0xffffffff00000000LL >> 32); + *(p++) = htonl ((n & 0xffffffff00000000ULL) >> 32); *(p++) = htonl (n & 0xffffffff); return p; } @@ -391,12 +391,12 @@ xdr_encode_sattr_stat (int *p, } -/* Decode *P into a long long; return the address of the following +/* Decode *P into a uint64_t; return the address of the following data. */ int * -xdr_decode_64bit (int *p, long long *n) +xdr_decode_64bit (int *p, uint64_t *n) { - long long high, low; + uint64_t high, low; high = ntohl (*p); p++; low = ntohl (*p); @@ -456,7 +456,7 @@ xdr_decode_fattr (int *p, struct stat *st) } else { - long long size; + uint64_t size; int major, minor; p = xdr_decode_64bit (p, &size); st->st_size = size; -- cgit v1.2.3