diff options
author | kmu <kmu@hdfgroup.org> | 2019-12-06 20:12:57 (GMT) |
---|---|---|
committer | kmu <kmu@hdfgroup.org> | 2019-12-06 20:12:57 (GMT) |
commit | 189935ff260cae6fb4e061fa68bd7b93e219c635 (patch) | |
tree | 835e1ace051ca3cd146ee86b62b884a96fc04721 /tools | |
parent | 132fa33dad6badacec90e80768d8dc8e8aa33172 (diff) | |
download | hdf5-189935ff260cae6fb4e061fa68bd7b93e219c635.zip hdf5-189935ff260cae6fb4e061fa68bd7b93e219c635.tar.gz hdf5-189935ff260cae6fb4e061fa68bd7b93e219c635.tar.bz2 |
remove unnecessary check macro
Diffstat (limited to 'tools')
-rw-r--r-- | tools/src/h5import/h5import.c | 5 | ||||
-rw-r--r-- | tools/test/h5diff/dynlib_diff.c | 5 | ||||
-rw-r--r-- | tools/test/h5dump/dynlib_dump.c | 5 | ||||
-rw-r--r-- | tools/test/h5dump/h5dumpgentest.c | 8 | ||||
-rw-r--r-- | tools/test/h5ls/dynlib_ls.c | 5 |
5 files changed, 11 insertions, 17 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index c627b6d..7ca12c2 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -4714,10 +4714,7 @@ uint16_t swap_uint16(uint16_t val) int16_t swap_int16(int16_t val) { - int16_t ret; - - H5_CHECKED_ASSIGN(ret, int16_t, ((val & 0xff) << 8) | ((val & 0xff00) >> 8), int); - return ret; + return (uint16_t)(((val & 0xff) << 8) | ((val & 0xff00) >> 8)); } uint32_t swap_uint32(uint32_t val) diff --git a/tools/test/h5diff/dynlib_diff.c b/tools/test/h5diff/dynlib_diff.c index ceff5e1..661a6dc 100644 --- a/tools/test/h5diff/dynlib_diff.c +++ b/tools/test/h5diff/dynlib_diff.c @@ -16,7 +16,6 @@ #include <stdlib.h> #include <stdio.h> #include "H5PLextern.h" -#include "H5private.h" #define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 @@ -70,7 +69,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp - MULTIPLIER, int); + *int_ptr = (int8_t)(temp - MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ @@ -79,7 +78,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Add the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp + MULTIPLIER, int); + *int_ptr = (int8_t)(temp + MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ diff --git a/tools/test/h5dump/dynlib_dump.c b/tools/test/h5dump/dynlib_dump.c index ceff5e1..661a6dc 100644 --- a/tools/test/h5dump/dynlib_dump.c +++ b/tools/test/h5dump/dynlib_dump.c @@ -16,7 +16,6 @@ #include <stdlib.h> #include <stdio.h> #include "H5PLextern.h" -#include "H5private.h" #define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 @@ -70,7 +69,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp - MULTIPLIER, int); + *int_ptr = (int8_t)(temp - MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ @@ -79,7 +78,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Add the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp + MULTIPLIER, int); + *int_ptr = (int8_t)(temp + MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 29c8245..ed0287c 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -2565,7 +2565,7 @@ static void gent_bitfields(void) goto error; for(i = 0; i < sizeof buf; i++) - H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + buf[i] = (uint8_t)(0xff ^ i); if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; if(H5Sclose(space) < 0) goto error; @@ -2579,7 +2579,7 @@ static void gent_bitfields(void) (dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; for(i = 0; i < sizeof buf; i++) - H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + buf[i] = (uint8_t)(0xff ^ i); if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; if(H5Sclose(space) < 0) goto error; @@ -9814,7 +9814,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + buf[i] = (uint8_t)(0xff ^ i); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); H5Dclose(dset); @@ -9829,7 +9829,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - H5_CHECKED_ASSIGN(buf2[i], uint16_t, 0xffff ^ (i * 16), size_t); + buf2[i] = (uint16_t)(0xffff ^ (i * 16)); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); H5Dclose(dset); diff --git a/tools/test/h5ls/dynlib_ls.c b/tools/test/h5ls/dynlib_ls.c index ceff5e1..661a6dc 100644 --- a/tools/test/h5ls/dynlib_ls.c +++ b/tools/test/h5ls/dynlib_ls.c @@ -16,7 +16,6 @@ #include <stdlib.h> #include <stdio.h> #include "H5PLextern.h" -#include "H5private.h" #define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 @@ -70,7 +69,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp - MULTIPLIER, int); + *int_ptr = (int8_t)(temp - MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ @@ -79,7 +78,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Add the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp + MULTIPLIER, int); + *int_ptr = (int8_t)(temp + MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ |