summaryrefslogtreecommitdiffstats
path: root/tools/src/h5import/h5import.c
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2019-12-04 02:52:55 (GMT)
committerkmu <kmu@hdfgroup.org>2019-12-04 02:52:55 (GMT)
commit132fa33dad6badacec90e80768d8dc8e8aa33172 (patch)
treeb296c329b62c9152fce3ca228c121a8cdf55d0c8 /tools/src/h5import/h5import.c
parentea0759d047dc6421da90375a9c27f7cde0a8e117 (diff)
downloadhdf5-132fa33dad6badacec90e80768d8dc8e8aa33172.zip
hdf5-132fa33dad6badacec90e80768d8dc8e8aa33172.tar.gz
hdf5-132fa33dad6badacec90e80768d8dc8e8aa33172.tar.bz2
fix intel compile warnings
Diffstat (limited to 'tools/src/h5import/h5import.c')
-rw-r--r--tools/src/h5import/h5import.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 65c2359..c627b6d 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -4707,14 +4707,17 @@ 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);
+ int16_t ret;
+
+ H5_CHECKED_ASSIGN(ret, int16_t, ((val & 0xff) << 8) | ((val & 0xff00) >> 8), int);
+ return ret;
}
uint32_t swap_uint32(uint32_t val)