diff options
author | kmu <kmu@hdfgroup.org> | 2019-11-25 18:48:51 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:20:23 (GMT) |
commit | bb53a566e8a45490b3179290774c3f1450d7d8dd (patch) | |
tree | f63980b1e4a4aed7a0a3cf4c3d7a3f83496c10e1 /src/H5Fprivate.h | |
parent | 540e50df2898be8cacc151f9e2930d250337a62f (diff) | |
download | hdf5-bb53a566e8a45490b3179290774c3f1450d7d8dd.zip hdf5-bb53a566e8a45490b3179290774c3f1450d7d8dd.tar.gz hdf5-bb53a566e8a45490b3179290774c3f1450d7d8dd.tar.bz2 |
fix issues from previous PR comments
Diffstat (limited to 'src/H5Fprivate.h')
-rw-r--r-- | src/H5Fprivate.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index aca5113..d82a2ac 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -178,19 +178,19 @@ typedef struct H5F_t H5F_t; /* Decode a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ -# define DECODE_VAR(p, n, l) { \ +# define DECODE_VAR(p, typ, n, l) { \ size_t _i; \ \ n = 0; \ (p) += l; \ for (_i = 0; _i < l; _i++) \ - n = (uint16_t)((n << 8) | *(--p)); \ + n = (typ)((n << 8) | *(--p)); \ (p) += l; \ } /* Decode a variable-sized buffer into a 32-bit unsigned integer */ /* (Assumes that the high bits of the integer will be zero) */ -# define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, n, l) +# define UINT32DECODE_VAR(p, n, l) DECODE_VAR(p, uint32_t, n, l) # define INT64DECODE(p, n) { \ /* WE DON'T CHECK FOR OVERFLOW! */ \ @@ -230,14 +230,14 @@ uint64_decode(uint8_t **pp) /* Decode a variable-sized buffer into a 64-bit unsigned integer */ /* (Assumes that the high bits of the integer will be zero) */ -# define UINT64DECODE_VAR(p, n, l) DECODE_VAR(p, n, l) +# define UINT64DECODE_VAR(p, n, l) DECODE_VAR(p, uint64_t, n, l) /* Decode a 64-bit unsigned integer and its length from a variable-sized buffer */ /* (Assumes that the high bits of the integer will be zero) */ # define UINT64DECODE_VARLEN(p, n) { \ unsigned _s = *(p)++; \ \ - UINT64DECODE_VAR(p, n, _s); \ + UINT64DECODE_VAR(p, uint64_t, n, _s); \ } # define H5_DECODE_UNSIGNED(p, n) { \ |