summaryrefslogtreecommitdiff
path: root/nfs/nfs.c
diff options
context:
space:
mode:
authorMichael Kelly <mike@weatherwax.co.uk>2025-07-10 18:32:49 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-07-10 18:33:00 +0200
commit3df101ed0d44b7f22d18890973fe400cb2551d73 (patch)
treefba953455aeeef7106bc001f1ed020414057ad63 /nfs/nfs.c
parent7dfabcb3764da7f39179c591325e57ab44de06bf (diff)
nfs: Clean xdr_encode/decode_64bit
Better use the stdint. Also export them, they will be useful generally.
Diffstat (limited to 'nfs/nfs.c')
-rw-r--r--nfs/nfs.c14
1 files changed, 7 insertions, 7 deletions
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;