diff options
author | Kimmy Mu <kmu@hdfgroup.org> | 2020-01-23 22:21:06 (GMT) |
---|---|---|
committer | Kimmy Mu <kmu@hdfgroup.org> | 2020-01-23 22:21:06 (GMT) |
commit | f3a4e8164f99d733e6804acddfe1b3b0dfe63634 (patch) | |
tree | 73215fc5e017510c1aafe91d514069619cc96eca /tools/src | |
parent | a9aaad9be317ed92150ccc6b4e8574e596447dba (diff) | |
parent | af5c33afabdae2e39bb45eb1b3e9c8366da01145 (diff) | |
download | hdf5-f3a4e8164f99d733e6804acddfe1b3b0dfe63634.zip hdf5-f3a4e8164f99d733e6804acddfe1b3b0dfe63634.tar.gz hdf5-f3a4e8164f99d733e6804acddfe1b3b0dfe63634.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')
-rw-r--r-- | tools/src/h5import/h5import.c | 8 | ||||
-rw-r--r-- | tools/src/h5ls/h5ls.c | 4 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_parse.c | 2 | ||||
-rw-r--r-- | tools/src/misc/h5clear.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 0c0e0fb..fc4d431 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -4728,15 +4728,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) diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 80ae814..3dfbb49 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1656,7 +1656,7 @@ dump_dataset_values(hid_t dset) init_acc_pos(&ctx, total_size); ctx.need_prefix = TRUE; - if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), ndims))) { + if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { H5TOOLS_DEBUG("H5Dread reference read"); if(H5Dread(dset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_buf) < 0) { HDfree(ref_buf); @@ -1827,7 +1827,7 @@ dump_attribute_values(hid_t attr) init_acc_pos(&ctx, total_size); ctx.need_prefix = TRUE; - if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), ndims))) { + if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { H5TOOLS_DEBUG("H5Aread reference read"); if(H5Aread(attr, H5T_STD_REF, ref_buf) < 0) { HDfree(ref_buf); diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 03fcf0e..95cacc1 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -228,7 +228,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, l = 0; } else if (f == -1) { - filt->filt_flag = HDstrtoul(stype, NULL, 0); + filt->filt_flag = (unsigned)HDstrtoul(stype, NULL, 0); f = 0; } else if (p == -1) { diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index 927167b..38fa6a2 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -175,7 +175,7 @@ parse_command_line(int argc, const char **argv) usage(h5tools_getprogname()); goto done; } - increment = HDatoi(opt_arg); + increment = (hsize_t)HDatoi(opt_arg); } break; |