diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2021-03-10 21:51:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 21:51:21 (GMT) |
commit | bf4399bd25eef9886dab5dcb115e2e439e3a2ac9 (patch) | |
tree | b54cb4ef5e607a222a5589400976c0a4e06e4821 /src | |
parent | e5a2d01cd9e3b5fd34d265fe281f638316894f7a (diff) | |
download | hdf5-bf4399bd25eef9886dab5dcb115e2e439e3a2ac9.zip hdf5-bf4399bd25eef9886dab5dcb115e2e439e3a2ac9.tar.gz hdf5-bf4399bd25eef9886dab5dcb115e2e439e3a2ac9.tar.bz2 |
Hdf5 merge issue 435 v110 (#462)
* close #195. (#196)
* Update HDF5PluginMacros.cmake
* Update HDF5PluginMacros.cmake
* Modify temporary rpath for testing in java example scripts. (#230)
* Fix undefined left shifting of negative numbers (#338)
Undefined Bahavior Sanitizer errored here about left shifting negative numbers.
* Update license url (#332)
* Modify temporary rpath for testing in java example scripts.
* Update URL in source file Copyright headers for web copy of COPYING
file - src and test directories.
* Fixed clang-tidy readability-misleading-indentation warnings (#427)
* Fixed clang-tidy readability-misleading-indentation warnings
* Reformatted src/H5Zscaleoffset.c with clang v10.0.1.
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
* Fixed clang-tidy readability-redundant-control-flow warnings (#428)
* Fixed clang-tidy readability-redundant-control-flow warnings
Just removed useless trailing return statements.
* Removed blank lines from h5diffgentest.c with clang-format v10.0.1.
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
* Removed bad function pointer casts (#434)
* Removed bad function pointer casts
In one case fixed the actual function signature to be correct.
* Reformat source with clang v10.0.1.
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
* fix block coordinate printing example (#437)
Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org>
Co-authored-by: Sean McBride <sean@rogue-research.com>
Co-authored-by: Mike Smith <grimbough@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 3 | ||||
-rw-r--r-- | src/H5C.c | 3 | ||||
-rw-r--r-- | src/H5Cdbg.c | 2 | ||||
-rw-r--r-- | src/H5Oalloc.c | 6 | ||||
-rw-r--r-- | src/H5Oint.c | 10 | ||||
-rw-r--r-- | src/H5Zscaleoffset.c | 303 |
6 files changed, 161 insertions, 166 deletions
@@ -713,9 +713,6 @@ H5__debug_mask(const char *s) s++; } /* end if-else */ } /* end while */ - - return; - } /* end H5__debug_mask() */ #ifdef H5_HAVE_PARALLEL @@ -686,9 +686,6 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, HDfprintf(stdout, "%sAuto cache resize -- unknown status code.\n", cache_ptr->prefix); break; } - - return; - } /* H5C_def_auto_resize_rpt_fcn() */ /*------------------------------------------------------------------------- diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 4157c20..f96f387 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -832,8 +832,6 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED *cache_ptr) #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ #endif /* H5C_COLLECT_CACHE_STATS */ - - return; } /* H5C_stats__reset() */ extern void H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, hbool_t dump_parents, diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index f7da32a..ca3070b 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -1234,10 +1234,10 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx) /* Keep first one found */ if (found_null < 0) found_null = (ssize_t)idx; - else - /* Check for better fit */ - if (oh->mesg[idx].raw_size < oh->mesg[found_null].raw_size) + /* Check for better fit */ + else if (oh->mesg[idx].raw_size < oh->mesg[found_null].raw_size) { found_null = (ssize_t)idx; + } else { /* If they are the same size, choose the one in the earliest chunk */ if (oh->mesg[idx].raw_size == oh->mesg[found_null].raw_size) { diff --git a/src/H5Oint.c b/src/H5Oint.c index 0dfd757..3274932 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -443,12 +443,16 @@ H5O__apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t ini #if H5_SIZEOF_SIZE_T > H5_SIZEOF_INT32_T if (size_hint > 4294967295UL) oh->flags |= H5O_HDR_CHUNK0_8; - else -#endif /* H5_SIZEOF_SIZE_T > H5_SIZEOF_INT32_T */ - if (size_hint > 65535) + else if (size_hint > 65535) oh->flags |= H5O_HDR_CHUNK0_4; else if (size_hint > 255) oh->flags |= H5O_HDR_CHUNK0_2; +#else + if (size_hint > 65535) + oh->flags |= H5O_HDR_CHUNK0_4; + else if (size_hint > 255) + oh->flags |= H5O_HDR_CHUNK0_2; +#endif } else { /* Reset unused time fields */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index d79cfa1..9890c13 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -198,7 +198,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ /* Set the fill value parameter in cd_values[] for unsigned integer type */ #define H5Z_scaleoffset_set_filval_1(type, dcpl_plist, dt, cd_values, need_convert) \ - { \ + do { \ type fill_val; \ \ /* Get dataset fill value */ \ @@ -209,11 +209,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \ \ H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \ - } + } while (0) /* Set the fill value parameter in cd_values[] for signed integer type */ #define H5Z_scaleoffset_set_filval_2(type, dcpl_plist, dt, cd_values, need_convert) \ - { \ + do { \ type fill_val; \ \ /* Get dataset fill value */ \ @@ -224,11 +224,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \ \ H5Z_scaleoffset_save_filval(unsigned type, cd_values, fill_val) \ - } + } while (0) /* Set the fill value parameter in cd_values[] for character integer type */ #define H5Z_scaleoffset_set_filval_3(type, dcpl_plist, dt, cd_values, need_convert) \ - { \ + do { \ type fill_val; \ \ /* Get dataset fill value */ \ @@ -237,11 +237,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ \ /* Store the fill value as the last entry in cd_values[] */ \ (cd_values)[H5Z_SCALEOFFSET_PARM_FILVAL] = (unsigned)((unsigned char)fill_val); \ - } + } while (0) /* Set the fill value parameter in cd_values[] for floating-point type */ #define H5Z_scaleoffset_set_filval_4(type, dcpl_plist, dt, cd_values, need_convert) \ - { \ + do { \ type fill_val; \ \ /* Get dataset fill value */ \ @@ -252,7 +252,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \ \ H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \ - } + } while (0) /* Get the fill value for integer type */ #define H5Z_scaleoffset_get_filval_1(type, cd_values, fill_val) \ @@ -451,7 +451,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ /* Precompress for unsigned integer type */ #define H5Z_scaleoffset_precompress_1(type, data, d_nelmts, filavail, cd_values, minbits, minval) \ - { \ + do { \ type * buf = (type *)data, min = 0, max = 0, span, filval = 0; \ unsigned i; \ \ @@ -484,11 +484,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ for (i = 0; i < d_nelmts; i++) buf[i] = (type)(buf[i] - min); \ } \ *minval = min; \ - } + } while (0) /* Precompress for signed integer type */ #define H5Z_scaleoffset_precompress_2(type, data, d_nelmts, filavail, cd_values, minbits, minval) \ - { \ + do { \ type * buf = (type *)data, min = 0, max = 0, filval = 0; \ unsigned type span; \ unsigned i; \ @@ -522,7 +522,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ for (i = 0; i < d_nelmts; i++) buf[i] = (type)(buf[i] - min); \ } \ *minval = (unsigned long long)min; \ - } + } while (0) /* Modify values of data in precompression if fill value defined for floating-point type */ #define H5Z_scaleoffset_modify_1(i, type, pow_fun, abs_fun, lround_fun, llround_fun, buf, d_nelmts, filval, \ @@ -596,7 +596,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ /* Precompress for floating-point type using variable-minimum-bits method */ #define H5Z_scaleoffset_precompress_3(type, pow_fun, abs_fun, round_fun, lround_fun, llround_fun, data, \ d_nelmts, filavail, cd_values, minbits, minval, D_val) \ - { \ + do { \ type * buf = (type *)data, min = 0, max = 0, filval = 0; \ unsigned long long span; \ unsigned i; \ @@ -626,11 +626,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ D_val) \ } \ H5Z_scaleoffset_save_min(i, type, minval, min) \ - } + } while (0) /* Postdecompress for unsigned integer type */ #define H5Z_scaleoffset_postdecompress_1(type, data, d_nelmts, filavail, cd_values, minbits, minval) \ - { \ + do { \ type * buf = (type *)data, filval = 0; \ unsigned i; \ \ @@ -641,11 +641,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ else /* fill value undefined */ \ for (i = 0; i < d_nelmts; i++) \ buf[i] = (type)(buf[i] + (type)(minval)); \ - } + } while (0) /* Postdecompress for signed integer type */ #define H5Z_scaleoffset_postdecompress_2(type, data, d_nelmts, filavail, cd_values, minbits, minval) \ - { \ + do { \ type * buf = (type *)data, filval = 0; \ unsigned i; \ \ @@ -657,7 +657,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ else /* fill value undefined */ \ for (i = 0; i < d_nelmts; i++) \ buf[i] = (type)(buf[i] + (type)(minval)); \ - } + } while (0) /* Retrive minimum value of floating-point type */ #define H5Z_scaleoffset_get_min(type, minval, min) \ @@ -721,7 +721,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ /* Postdecompress for floating-point type using variable-minimum-bits method */ #define H5Z_scaleoffset_postdecompress_3(type, pow_fun, data, d_nelmts, filavail, cd_values, minbits, \ minval, D_val) \ - { \ + do { \ type * buf = (type *)data, filval = 0, min = 0; \ unsigned i; \ \ @@ -734,7 +734,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } \ else /* fill value undefined */ \ H5Z_scaleoffset_modify_4(i, type, pow_fun, buf, d_nelmts, min, D_val) \ - } + } while (0) /*------------------------------------------------------------------------- * Function: H5Z__can_apply_scaleoffset @@ -884,35 +884,32 @@ H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum FUNC_ENTER_STATIC if (scale_type == t_uchar) - H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == t_ushort) - H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == t_uint) - H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == t_ulong) - H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == t_ulong_long) - H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == t_schar) - H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values, - need_convertd) else if (scale_type == t_short) - H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == t_int) - H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == t_long) - H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == - t_long_long) - H5Z_scaleoffset_set_filval_2( - long long, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == t_float) - H5Z_scaleoffset_set_filval_4( - float, dcpl_plist, type, cd_values, - need_convert) else if (scale_type == t_double) - H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type, - cd_values, need_convert) - - done : FUNC_LEAVE_NOAPI(ret_value) + H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_ushort) + H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_uint) + H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_ulong) + H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_ulong_long) + H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_schar) + H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values, need_convertd); + else if (scale_type == t_short) + H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_int) + H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_long) + H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_long_long) + H5Z_scaleoffset_set_filval_2(long long, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_float) + H5Z_scaleoffset_set_filval_4(float, dcpl_plist, type, cd_values, need_convert); + else if (scale_type == t_double) + H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type, cd_values, need_convert); + +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__scaleoffset_set_parms_fillval() */ /*------------------------------------------------------------------------- @@ -1443,76 +1440,75 @@ H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffs const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval) { if (type == t_uchar) - H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_ushort) - H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_uint) - H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_ulong) - H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_ulong_long) - H5Z_scaleoffset_precompress_1(unsigned long long, data, d_nelmts, filavail, cd_values, - minbits, minval) else if (type == t_schar) - { - signed char * buf = (signed char *)data, min = 0, max = 0, filval = 0; - unsigned char span; - unsigned i; - - if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ - H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval); - if (*minbits == - H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */ - H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, - min) if ((unsigned char)(max - min) > - (unsigned char)(~(unsigned char)0 - 2)) - { - *minbits = sizeof(signed char) * 8; - return; - } - span = (unsigned char)(max - min + 1); - *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1)); + H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_ushort) + H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_uint) + H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_ulong) + H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_ulong_long) + H5Z_scaleoffset_precompress_1(unsigned long long, data, d_nelmts, filavail, cd_values, minbits, + minval); + else if (type == t_schar) { + signed char * buf = (signed char *)data, min = 0, max = 0, filval = 0; + unsigned char span; + unsigned i; + + if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ + H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval); + if (*minbits == + H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */ + H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, + min) if ((unsigned char)(max - min) > + (unsigned char)(~(unsigned char)0 - 2)) + { + *minbits = sizeof(signed char) * 8; + return; } - else /* minbits already set, only calculate min */ - H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, - min) if (*minbits != - sizeof(signed char) * - 8) /* change values if minbits != full precision */ - for (i = 0; i < d_nelmts; i++) buf[i] = - (signed char)((buf[i] == filval) ? (((unsigned char)1 << *minbits) - 1) - : (buf[i] - min)); + span = (unsigned char)(max - min + 1); + *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1)); } - else { /* fill value undefined */ - if (*minbits == - H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */ - H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, - min) if ((unsigned char)(max - min) > - (unsigned char)(~(unsigned char)0 - 2)) - { - *minbits = sizeof(signed char) * 8; - *minval = (unsigned long long)min; - return; - } - span = (unsigned char)(max - min + 1); - *minbits = H5Z__scaleoffset_log2((unsigned long long)span); + else /* minbits already set, only calculate min */ + H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, + min) if (*minbits != + sizeof(signed char) * + 8) /* change values if minbits != full precision */ + for (i = 0; i < d_nelmts; i++) buf[i] = + (signed char)((buf[i] == filval) ? (((unsigned char)1 << *minbits) - 1) + : (buf[i] - min)); + } + else { /* fill value undefined */ + if (*minbits == + H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */ + H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, + min) if ((unsigned char)(max - min) > + (unsigned char)(~(unsigned char)0 - 2)) + { + *minbits = sizeof(signed char) * 8; + *minval = (unsigned long long)min; + return; } - else /* minbits already set, only calculate min */ - H5Z_scaleoffset_min_2(i, d_nelmts, buf, - min) if (*minbits != - sizeof(signed char) * - 8) /* change values if minbits != full precision */ - for (i = 0; i < d_nelmts; i++) buf[i] = (signed char)(buf[i] - min); + span = (unsigned char)(max - min + 1); + *minbits = H5Z__scaleoffset_log2((unsigned long long)span); } - *minval = (unsigned long long)min; + else /* minbits already set, only calculate min */ + H5Z_scaleoffset_min_2(i, d_nelmts, buf, + min) if (*minbits != + sizeof(signed char) * + 8) /* change values if minbits != full precision */ + for (i = 0; i < d_nelmts; i++) buf[i] = (signed char)(buf[i] - min); } + *minval = (unsigned long long)min; + } else if (type == t_short) - H5Z_scaleoffset_precompress_2(short, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_int) - H5Z_scaleoffset_precompress_2(int, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_long) - H5Z_scaleoffset_precompress_2(long, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_long_long) - H5Z_scaleoffset_precompress_2(long long, data, d_nelmts, filavail, cd_values, minbits, - minval) + H5Z_scaleoffset_precompress_2(short, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_int) + H5Z_scaleoffset_precompress_2(int, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_long) + H5Z_scaleoffset_precompress_2(long, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_long_long) + H5Z_scaleoffset_precompress_2(long long, data, d_nelmts, filavail, cd_values, minbits, minval); } /* postdecompress for integer type */ @@ -1524,39 +1520,38 @@ H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleo long long sminval = *(long long *)&minval; /* for signed integer types */ if (type == t_uchar) - H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_ushort) - H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_uint) - H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits, - minval) else if (type == t_ulong) - H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, cd_values, - minbits, minval) else if (type == t_ulong_long) - H5Z_scaleoffset_postdecompress_1(unsigned long long, data, d_nelmts, filavail, - cd_values, minbits, minval) else if (type == t_schar) - { - signed char *buf = (signed char *)data, filval = 0; - unsigned i; - - if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ - H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval) for (i = 0; i < d_nelmts; i++) - buf[i] = - (signed char)((buf[i] == (((unsigned char)1 << minbits) - 1)) ? filval - : (buf[i] + sminval)); - } - else /* fill value undefined */ - for (i = 0; i < d_nelmts; i++) - buf[i] = (signed char)(buf[i] + sminval); + H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_ushort) + H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits, + minval); + else if (type == t_uint) + H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_ulong) + H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, cd_values, minbits, minval); + else if (type == t_ulong_long) + H5Z_scaleoffset_postdecompress_1(unsigned long long, data, d_nelmts, filavail, cd_values, minbits, + minval); + else if (type == t_schar) { + signed char *buf = (signed char *)data, filval = 0; + unsigned i; + + if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ + H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval) for (i = 0; i < d_nelmts; + i++) buf[i] = + (signed char)((buf[i] == (((unsigned char)1 << minbits) - 1)) ? filval : (buf[i] + sminval)); } + else /* fill value undefined */ + for (i = 0; i < d_nelmts; i++) + buf[i] = (signed char)(buf[i] + sminval); + } else if (type == t_short) - H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, cd_values, minbits, - sminval) else if (type == t_int) - H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, cd_values, minbits, - sminval) else if (type == t_long) - H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, cd_values, minbits, - sminval) else if (type == t_long_long) - H5Z_scaleoffset_postdecompress_2(long long, data, d_nelmts, filavail, cd_values, minbits, - sminval) + H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, cd_values, minbits, sminval); + else if (type == t_int) + H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, cd_values, minbits, sminval); + else if (type == t_long) + H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, cd_values, minbits, sminval); + else if (type == t_long_long) + H5Z_scaleoffset_postdecompress_2(long long, data, d_nelmts, filavail, cd_values, minbits, sminval); } /* precompress for floating-point type, variable-minimum-bits method @@ -1572,11 +1567,13 @@ H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoff if (type == t_float) H5Z_scaleoffset_precompress_3(float, HDpowf, HDfabsf, HDroundf, HDlroundf, HDllroundf, data, d_nelmts, - filavail, cd_values, minbits, minval, D_val) else if (type == t_double) - H5Z_scaleoffset_precompress_3(double, HDpow, HDfabs, HDround, HDlround, HDllround, data, d_nelmts, - filavail, cd_values, minbits, minval, D_val) + filavail, cd_values, minbits, minval, D_val); + else if (type == t_double) + H5Z_scaleoffset_precompress_3(double, HDpow, HDfabs, HDround, HDlround, HDllround, data, d_nelmts, + filavail, cd_values, minbits, minval, D_val); - done : FUNC_LEAVE_NOAPI(ret_value) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* postdecompress for floating-point type, variable-minimum-bits method @@ -1593,11 +1590,13 @@ H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scale if (type == t_float) H5Z_scaleoffset_postdecompress_3(float, HDpowf, data, d_nelmts, filavail, cd_values, minbits, sminval, - D_val) else if (type == t_double) - H5Z_scaleoffset_postdecompress_3(double, HDpow, data, d_nelmts, filavail, cd_values, minbits, - sminval, D_val) + D_val); + else if (type == t_double) + H5Z_scaleoffset_postdecompress_3(double, HDpow, data, d_nelmts, filavail, cd_values, minbits, sminval, + D_val); - done : FUNC_LEAVE_NOAPI(ret_value) +done: + FUNC_LEAVE_NOAPI(ret_value) } static void |