diff options
Diffstat (limited to 'tools/src')
-rw-r--r-- | tools/src/h5import/h5import.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 1eef5ab..179dac4 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -4707,14 +4707,14 @@ static int process(struct Options *opt) return (0); } -uint16_t swap_uint16( uint16_t val) +uint16_t swap_uint16(uint16_t val) { - return (val << 8) | (val >> 8); + return (uint16_t)(((val & 0xff) << 8) | ((val & 0xff00) >> 8)); } int16_t swap_int16(int16_t val) { - return (val << 8) | ((val >> 8) & 0xFF); + return (uint16_t)(((val & 0xff) << 8) | ((val & 0xff00) >> 8)); } uint32_t swap_uint32(uint32_t val) |