diff options
author | Kimmy Mu <kmu@hdfgroup.org> | 2020-01-23 22:21:06 (GMT) |
---|---|---|
committer | kmu <kmu@hdfgroup.org> | 2020-01-28 02:47:06 (GMT) |
commit | fe75e8f66f79c16d083d80ccdca303f267e96745 (patch) | |
tree | 345d20f70d273b8512aa6cf309a72d7c7b441ab4 /tools/src/h5import | |
parent | b87a4362a12428613c2b8bd3ba2aa33828b4d5af (diff) | |
download | hdf5-fe75e8f66f79c16d083d80ccdca303f267e96745.zip hdf5-fe75e8f66f79c16d083d80ccdca303f267e96745.tar.gz hdf5-fe75e8f66f79c16d083d80ccdca303f267e96745.tar.bz2 |
Merge pull request #2300 in HDFFV/hdf5 from ~KMU/hdf5:squashed_cast to develop
* commit 'af5c33afabdae2e39bb45eb1b3e9c8366da01145':
remove unnecessary stuff
squash cast warning fix
Diffstat (limited to 'tools/src/h5import')
-rw-r--r-- | tools/src/h5import/h5import.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 81f9a32..00fe7cf 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -4725,15 +4725,15 @@ uint32_t swap_uint32(uint32_t val) int32_t swap_int32(int32_t val) { - val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF); + val = (int32_t)(((uint32_t)(val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF)); return (val << 16) | ((val >> 16) & 0xFFFF); } int64_t swap_int64(int64_t val) { - val = ((val << 8) & 0xFF00FF00FF00FF00ULL) | ((val >> 8) & 0x00FF00FF00FF00FFULL); - val = ((val << 16) & 0xFFFF0000FFFF0000ULL) | ((val >> 16) & 0x0000FFFF0000FFFFULL); - return (val << 32) | ((val >> 32) & 0xFFFFFFFFULL); + val = (int64_t)(((uint64_t)(val << 8) & 0xFF00FF00FF00FF00ULL) | ((uint64_t)(val >> 8) & 0x00FF00FF00FF00FFULL)); + val = (int64_t)(((uint64_t)(val << 16) & 0xFFFF0000FFFF0000ULL) | ((uint64_t)(val >> 16) & 0x0000FFFF0000FFFFULL)); + return (int64_t)((uint64_t)(val << 32) | ((uint64_t)(val >> 32) & 0xFFFFFFFFULL)); } uint64_t swap_uint64(uint64_t val) |