diff options
34 files changed, 276 insertions, 440 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 45dd9cb..dbf9d25 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -398,13 +398,13 @@ test_tconv(H5File &file) /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encode and decode enabled */ - "bogus", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)filter_bogus, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encode and decode enabled */ + "bogus", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 1ded033..2df88b2 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -49,20 +49,18 @@ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, /* Temporary filter IDs used for testing */ const int H5Z_FILTER_BOGUS = 305; -#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead -static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); -#endif -static size_t filter_bogus(size_t nbytes); +static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf); + /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "bogus", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)filter_bogus, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "bogus", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- @@ -79,13 +77,15 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ *------------------------------------------------------------------------- */ static size_t -#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead -filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, - const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, - size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) -#endif -filter_bogus(size_t nbytes) +filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) { + (void)flags; + (void)cd_nelmts; + (void)cd_values; + (void)buf_size; + (void)buf; + return nbytes; } diff --git a/examples/h5_vds.c b/examples/h5_vds.c index 6bef06f..e036204 100644 --- a/examples/h5_vds.c +++ b/examples/h5_vds.c @@ -60,7 +60,7 @@ main(void) hsize_t start_out[2], stride_out[2], count_out[2], block_out[2]; int wdata[DIM0], /* Write buffer for source dataset */ rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */ - i, j, k, l; + i, j, k, l, block_inc; int fill_value = -1; /* Fill value for VDS */ H5D_layout_t layout; /* Storage layout */ size_t num_map; /* Number of mappings */ @@ -178,13 +178,14 @@ main(void) buf = (hsize_t *)malloc(sizeof(hsize_t) * 2 * RANK2 * nblocks); status = H5Sget_select_hyper_blocklist(vspace, (hsize_t)0, nblocks, buf); for (l = 0; l < nblocks; l++) { + block_inc = 2 * RANK2 * l; printf("("); for (k = 0; k < RANK2 - 1; k++) - printf("%d,", (int)buf[k]); - printf("%d ) - (", (int)buf[k]); + printf("%d,", (int)buf[block_inc + k]); + printf("%d) - (", (int)buf[block_inc + k]); for (k = 0; k < RANK2 - 1; k++) - printf("%d,", (int)buf[RANK2 + k]); - printf("%d)\n", (int)buf[RANK2 + k]); + printf("%d,", (int)buf[block_inc + RANK2 + k]); + printf("%d)\n", (int)buf[block_inc + RANK2 + k]); } /* We also can use new APIs to get start, stride, count and block */ if (H5Sis_regular_hyperslab(vspace)) { @@ -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 diff --git a/test/cache.c b/test/cache.c index 7cab442..92cc50d 100644 --- a/test/cache.c +++ b/test/cache.c @@ -3210,8 +3210,6 @@ check_flush_cache__empty_cache(H5F_t *file_ptr) "flush with flags = 0x10 failed on empty cache.\n") } - return; - } /* check_flush_cache__empty_cache() */ /*------------------------------------------------------------------------- @@ -4413,8 +4411,6 @@ check_flush_cache__multi_entry(H5F_t *file_ptr) check_flush_cache__pe_multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec); } - return; - } /* check_flush_cache__multi_entry() */ /*------------------------------------------------------------------------- @@ -4599,8 +4595,6 @@ check_flush_cache__multi_entry_test(H5F_t *file_ptr, int test_num, unsigned int u++; } - return; - } /* check_flush_cache__multi_entry_test() */ /*------------------------------------------------------------------------- @@ -4794,8 +4788,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t *file_ptr, int test_num, unsigned i u++; } - return; - } /* check_flush_cache__pe_multi_entry_test() */ /*------------------------------------------------------------------------- @@ -7991,8 +7983,6 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) /* finally finish up with the flush ops eviction test */ check_flush_cache__flush_op_eviction_test(file_ptr); - return; - } /* check_flush_cache__flush_ops() */ /*------------------------------------------------------------------------- @@ -8394,8 +8384,6 @@ check_flush_cache__flush_op_test(H5F_t *file_ptr, int test_num, unsigned int flu i++; } - return; - } /* check_flush_cache__flush_op_test() */ /*------------------------------------------------------------------------- @@ -10546,8 +10534,6 @@ check_flush_cache__flush_op_eviction_test(H5F_t *file_ptr) reset_entries(); } - return; - } /* check_flush_cache__flush_op_eviction_test() */ /*------------------------------------------------------------------------- @@ -12171,8 +12157,6 @@ check_flush_cache__single_entry(H5F_t *file_ptr) } } - return; - } /* check_flush_cache__single_entry() */ /*------------------------------------------------------------------------- @@ -12312,8 +12296,6 @@ check_flush_cache__single_entry_test(H5F_t *file_ptr, int test_num, int entry_ty } } - return; - } /* check_flush_cache__single_entry_test() */ /*------------------------------------------------------------------------- @@ -12489,8 +12471,6 @@ check_flush_cache__pinned_single_entry_test(H5F_t *file_ptr, int test_num, int e } } - return; - } /* check_flush_cache__pinned_single_entry_test() */ /*------------------------------------------------------------------------- @@ -13639,8 +13619,6 @@ check_move_entry__run_test(H5F_t *file_ptr, unsigned test_num, struct move_entry /* put the entry back where it started from */ move_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, TRUE); - return; - } /* check_move_entry__run_test() */ /*------------------------------------------------------------------------- @@ -33880,8 +33858,6 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t *file_ptr) /* reset cache min clean size to its expected value */ cache_ptr->min_clean_size = (1 * 1024 * 1024); - return; - } /* cedds__expunge_dirty_entry_in_flush_test() */ /*------------------------------------------------------------------------- @@ -34240,8 +34216,6 @@ cedds__H5C_make_space_in_cache(H5F_t *file_ptr) /* reset cache min clean size to its expected value */ cache_ptr->min_clean_size = (1 * 1024 * 1024); - return; - } /* cedds__H5C_make_space_in_cache() */ /*------------------------------------------------------------------------- @@ -34638,8 +34612,6 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr) /* reset cache min clean size to its expected value */ cache_ptr->min_clean_size = (1 * 1024 * 1024); - return; - } /* cedds__H5C__autoadjust__ageout__evict_aged_out_entries() */ /*------------------------------------------------------------------------- @@ -35016,8 +34988,6 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t *file_ptr) /* reset cache min clean size to its expected value */ cache_ptr->min_clean_size = (1 * 1024 * 1024); - return; - } /* cedds__H5C_flush_invalidate_cache__bucket_scan() */ /*------------------------------------------------------------------------- @@ -35480,8 +35450,6 @@ check_stats__smoke_check_1(H5F_t *file_ptr) /* reset cache min clean size to its expected value */ cache_ptr->min_clean_size = (1 * 1024 * 1024); - return; - } /* check_stats__smoke_check_1() */ #endif /* H5C_COLLECT_CACHE_STATS */ @@ -35889,8 +35857,6 @@ takedown_cache(H5F_t *file_ptr, hbool_t dump_stats, hbool_t dump_detailed_stats) } } - return; - } /* takedown_cache() */ /*------------------------------------------------------------------------- diff --git a/test/cache_common.c b/test/cache_common.c index 6e031b9..7ac5abc 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -433,8 +433,6 @@ addr_to_type_and_index(haddr_t addr, int32_t *type_ptr, int32_t *index_ptr) *type_ptr = type; *index_ptr = idx; - return; - } /* addr_to_type_and_index() */ /* Call back functions: */ @@ -1534,8 +1532,6 @@ add_flush_op(int target_type, int target_idx, int op_code, int type, int idx, hb (target_entry_ptr->flush_ops)[i].order_ptr = order_ptr; } - return; - } /* add_flush_op() */ /*------------------------------------------------------------------------- @@ -1605,8 +1601,6 @@ create_pinned_entry_dependency(H5F_t *file_ptr, int pinning_type, int pinning_id (pinned_entry_ptr->pinning_ref_count)++; } - return; - } /* create_pinned_entry_dependency() */ /*------------------------------------------------------------------------- @@ -1679,8 +1673,6 @@ dirty_entry(H5F_t *file_ptr, int32_t type, int32_t idx, hbool_t dirty_pin) } } - return; - } /* dirty_entry() */ /*------------------------------------------------------------------------- @@ -1824,8 +1816,6 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o } } - return; - } /* execute_flush_op() */ /*------------------------------------------------------------------------- @@ -2051,8 +2041,6 @@ free_entry_arrays(void) HDfree(notify_entries); HDfree(orig_notify_entries); - return; - } /* free_entry_arrays() */ /*------------------------------------------------------------------------- @@ -2196,8 +2184,6 @@ reset_entries(void) } /* end for */ } /* end else */ - return; - } /* reset_entries() */ /*------------------------------------------------------------------------- @@ -2289,8 +2275,6 @@ resize_entry(H5F_t *file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_ } } - return; - } /* resize_entry() */ /*------------------------------------------------------------------------- @@ -2342,8 +2326,6 @@ verify_clean(void) } } - return; - } /* verify_clean() */ /*------------------------------------------------------------------------- @@ -2640,8 +2622,6 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_ i++; } /* while */ - return; - } /* verify_entry_status() */ /*------------------------------------------------------------------------- @@ -2695,8 +2675,6 @@ verify_unprotected(void) } } - return; - } /* verify_unprotected() */ /*------------------------------------------------------------------------- @@ -2760,8 +2738,6 @@ expunge_entry(H5F_t *file_ptr, int32_t type, int32_t idx) } } - return; - } /* expunge_entry() */ /*------------------------------------------------------------------------- @@ -2835,8 +2811,6 @@ flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_ } } - return; - } /* flush_cache() */ /*------------------------------------------------------------------------- @@ -3004,8 +2978,6 @@ insert_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags) HDassert(((entry_ptr->header).type)->id == type); } /* end if */ - return; - } /* insert_entry() */ /*------------------------------------------------------------------------- @@ -3065,8 +3037,6 @@ mark_entry_dirty(int32_t type, int32_t idx) HDassert(((entry_ptr->header).type)->id == type); } - return; - } /* mark_entry_dirty() */ /*------------------------------------------------------------------------- @@ -3165,8 +3135,6 @@ move_entry(H5C_t *cache_ptr, int32_t type, int32_t idx, hbool_t main_addr) HDassert(entry_ptr->is_dirty); } - return; - } /* move_entry() */ /*------------------------------------------------------------------------- @@ -3333,8 +3301,6 @@ protect_entry_ro(H5F_t *file_ptr, int32_t type, int32_t idx) HDassert(((entry_ptr->header).type)->id == type); } - return; - } /* protect_entry_ro() */ /*------------------------------------------------------------------------- @@ -3391,8 +3357,6 @@ pin_entry(int32_t type, int32_t idx) } } /* end if */ - return; - } /* pin_entry() */ /*------------------------------------------------------------------------- @@ -3450,8 +3414,6 @@ unpin_entry(int32_t type, int32_t idx) HDassert(((entry_ptr->header).type)->id == type); } - return; - } /* unpin_entry() */ /*------------------------------------------------------------------------- @@ -3561,8 +3523,6 @@ unprotect_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags) HDassert(entry_ptr->header.ro_ref_count == entry_ptr->ro_ref_count); } - return; - } /* unprotect_entry() */ /*------------------------------------------------------------------------- @@ -3991,8 +3951,6 @@ hl_row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h H5C_stats(cache_ptr, "test cache", display_detailed_stats); } - return; - } /* hl_row_major_scan_forward() */ /*------------------------------------------------------------------------- @@ -4253,8 +4211,6 @@ row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t H5C_stats(cache_ptr, "test cache", display_detailed_stats); } - return; - } /* row_major_scan_backward() */ /*------------------------------------------------------------------------- @@ -4347,8 +4303,6 @@ hl_row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, H5C_stats(cache_ptr, "test cache", display_detailed_stats); } - return; - } /* hl_row_major_scan_backward() */ /*------------------------------------------------------------------------- @@ -4441,8 +4395,6 @@ col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t H5C_stats(cache_ptr, "test cache", display_detailed_stats); } - return; - } /* col_major_scan_forward() */ /*------------------------------------------------------------------------- @@ -4546,8 +4498,6 @@ hl_col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h H5C_stats(cache_ptr, "test cache", display_detailed_stats); } - return; - } /* hl_col_major_scan_forward() */ /*------------------------------------------------------------------------- @@ -4652,8 +4602,6 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t if (verbose) HDfprintf(stdout, "%s: exiting.\n", FUNC); - return; - } /* col_major_scan_backward() */ /*------------------------------------------------------------------------- @@ -4757,8 +4705,6 @@ hl_col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, H5C_stats(cache_ptr, "test cache", display_detailed_stats); } - return; - } /* hl_col_major_scan_backward() */ /*------------------------------------------------------------------------- @@ -5127,8 +5073,6 @@ check_and_validate_cache_hit_rate(hid_t file_id, double *hit_rate_ptr, hbool_t d failure_mssg = "Unexpectedly low hit rate."; } - return; - } /* check_and_validate_cache_hit_rate() */ /*------------------------------------------------------------------------- @@ -5246,8 +5190,6 @@ check_and_validate_cache_size(hid_t file_id, size_t *max_size_ptr, size_t *min_c (long)min_clean_size, (long)cur_size, (long)cur_num_entries); } - return; - } /* check_and_validate_cache_size() */ H5_ATTR_PURE hbool_t @@ -5408,8 +5350,6 @@ validate_mdc_config(hid_t file_id, H5AC_cache_config_t *ext_config_ptr, hbool_t } } - return; - } /* validate_mdc_config() */ #if 0 /* debugging functions -- normally commented out */ diff --git a/test/cache_image.c b/test/cache_image.c index f6acd5f..966b22a 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -387,8 +387,6 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) } } - return; - } /* create_datasets() */ /*------------------------------------------------------------------------- @@ -460,8 +458,6 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset) if (show_progress) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - return; - } /* delete_datasets() */ /*------------------------------------------------------------------------- @@ -850,8 +846,6 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, hbool_t read_onl if (show_progress) HDfprintf(stdout, "%s: cp = %d -- exiting.\n", fcn_name, cp++); - return; - } /* open_hdf5_file() */ /*------------------------------------------------------------------------- @@ -960,8 +954,6 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, const hbool_t set_mdci_fa if (show_progress) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - return; - } /* attempt_swmr_open_hdf5_file() */ /*------------------------------------------------------------------------- @@ -1199,8 +1191,6 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) } } - return; - } /* verify_datasets() */ /****************************************************************************/ diff --git a/test/filter_plugin1_dsets.c b/test/filter_plugin1_dsets.c index 7f9a664..5d6c1ef 100644 --- a/test/filter_plugin1_dsets.c +++ b/test/filter_plugin1_dsets.c @@ -26,14 +26,14 @@ static size_t add_sub_value(unsigned int flags, size_t cd_nelmts, const unsigned /* Filter class struct */ const H5Z_class2_t FILTER_INFO[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - FILTER1_ID, /* Filter ID number */ - 1, /* Encoding enabled */ - 1, /* Decoding enabled */ - "test filter plugin 1", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)add_sub_value, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER1_ID, /* Filter ID number */ + 1, /* Encoding enabled */ + 1, /* Decoding enabled */ + "test filter plugin 1", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + add_sub_value, /* The actual filter function */ }}; H5PL_type_t diff --git a/test/filter_plugin2_dsets.c b/test/filter_plugin2_dsets.c index 08be78c..8f57121 100644 --- a/test/filter_plugin2_dsets.c +++ b/test/filter_plugin2_dsets.c @@ -27,14 +27,14 @@ static size_t mult_div_value(unsigned int flags, size_t cd_nelmts, const unsigne /* Filter class struct */ const H5Z_class2_t FILTER_INFO[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - FILTER2_ID, /* Filter ID number */ - 1, /* Encoding enabled */ - 1, /* Decoding enabled */ - "test filter plugin 2", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)mult_div_value, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER2_ID, /* Filter ID number */ + 1, /* Encoding enabled */ + 1, /* Decoding enabled */ + "test filter plugin 2", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + mult_div_value, /* The actual filter function */ }}; H5PL_type_t diff --git a/test/filter_plugin3_dsets.c b/test/filter_plugin3_dsets.c index 5d8d57f..618ce06 100644 --- a/test/filter_plugin3_dsets.c +++ b/test/filter_plugin3_dsets.c @@ -30,14 +30,14 @@ static size_t add_sub_value_hdf5(unsigned int flags, size_t cd_nelmts, const uns /* Filter class struct */ const H5Z_class2_t FILTER_INFO[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - FILTER3_ID, /* Filter ID number */ - 1, /* Encoding enabled */ - 1, /* Decoding enabled */ - "test filter plugin 3", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)add_sub_value_hdf5, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER3_ID, /* Filter ID number */ + 1, /* Encoding enabled */ + 1, /* Decoding enabled */ + "test filter plugin 3", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + add_sub_value_hdf5, /* The actual filter function */ }}; H5PL_type_t diff --git a/test/filter_plugin4_groups.c b/test/filter_plugin4_groups.c index 237642d..eeec269 100644 --- a/test/filter_plugin4_groups.c +++ b/test/filter_plugin4_groups.c @@ -29,14 +29,14 @@ static size_t append_to_group_name(unsigned int flags, size_t cd_nelmts, const u /* Filter class struct */ const H5Z_class2_t FILTER_INFO[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - FILTER4_ID, /* Filter ID number */ - 1, /* Encoding enabled */ - 1, /* Decoding enabled */ - "test filter plugin 4", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)append_to_group_name, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + FILTER4_ID, /* Filter ID number */ + 1, /* Encoding enabled */ + 1, /* Decoding enabled */ + "test filter plugin 4", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + append_to_group_name, /* The actual filter function */ }}; H5PL_type_t diff --git a/test/genall5.c b/test/genall5.c index 04f8741..87862b2 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -103,8 +103,6 @@ ns_grp_0(hid_t fid, const char *group_name) HDassert(ret >= 0); } - return; - } /* ns_grp_0 */ /*------------------------------------------------------------------------- @@ -222,7 +220,6 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) HDassert(ret >= 0); } - return; } /* vrfy_ns_grp_0() */ /*------------------------------------------------------------------------- @@ -363,8 +360,6 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) HDassert(ret >= 0); } - return; - } /* ns_grp_c() */ /*------------------------------------------------------------------------- @@ -632,7 +627,6 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) HDassert(ret >= 0); } - return; } /* vrfy_ns_grp_c() */ /*------------------------------------------------------------------------- @@ -768,7 +762,6 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) HDassert(ret >= 0); } - return; } /* ns_grp_d() */ /*------------------------------------------------------------------------- @@ -1034,8 +1027,6 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) HDassert(ret >= 0); } - return; - } /* vrfy_ns_grp_d() */ /*------------------------------------------------------------------------- @@ -1124,7 +1115,6 @@ os_grp_0(hid_t fid, const char *group_name) } } - return; } /* os_grp_0() */ /*------------------------------------------------------------------------- @@ -1241,7 +1231,6 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) HDassert(ret >= 0); } - return; } /* vrfy_os_grp_0() */ /*------------------------------------------------------------------------- @@ -1361,7 +1350,6 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) } } - return; } /* os_grp_n() */ /*------------------------------------------------------------------------- @@ -1579,7 +1567,6 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) HDassert(ret >= 0); } - return; } /* vrfy_os_grp_n() */ /*------------------------------------------------------------------------- @@ -1676,7 +1663,6 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) HDassert(ret >= 0); } - return; } /* ds_ctg_i */ /*------------------------------------------------------------------------- @@ -1895,8 +1881,6 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) HDassert(ret >= 0); } - return; - } /* vrfy_ds_ctg_i() */ /*------------------------------------------------------------------------- @@ -2023,7 +2007,6 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) HDassert(ret >= 0); } - return; } /* ds_chk_i */ /*------------------------------------------------------------------------- @@ -2257,7 +2240,6 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) HDassert(ret >= 0); } - return; } /* vrfy_ds_chk_i() */ /*------------------------------------------------------------------------- @@ -2385,8 +2367,6 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) HDassert(ret >= 0); } - return; - } /* ds_cpt_i() */ /*------------------------------------------------------------------------- @@ -2600,7 +2580,6 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) HDassert(ret >= 0); } - return; } /* vrfy_ds_cpt_i() */ /*------------------------------------------------------------------------- @@ -2749,7 +2728,6 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) HDassert(ret >= 0); } - return; } /* ds_ctg_v() */ /*------------------------------------------------------------------------- @@ -3014,7 +2992,6 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) HDassert(ret >= 0); } - return; } /* vrfy_ds_ctg_v() */ /*------------------------------------------------------------------------- @@ -3242,7 +3219,6 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) vrfy_ds_ctg_v(fid, full_path, TRUE); } - return; } /* create_zoo() */ /*------------------------------------------------------------------------- @@ -3390,5 +3366,4 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) vrfy_ds_ctg_v(fid, full_path, TRUE); } - return; } /* validate_zoo() */ diff --git a/test/h5test.c b/test/h5test.c index 86399ce..1b91fb6 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -166,8 +166,6 @@ h5_clean_files(const char *base_name[], hid_t fapl) /* Close the FAPL used to access the file */ H5Pclose(fapl); - - return; } /* end h5_clean_files() */ /*------------------------------------------------------------------------- @@ -244,7 +242,6 @@ h5_delete_test_file(const char *base_name, hid_t fapl) HDremove(filename); } /* end driver selection tree */ - return; } /* end h5_delete_test_file() */ H5_GCC_DIAG_ON("format-nonliteral") @@ -277,7 +274,6 @@ h5_delete_all_test_files(const char *base_name[], hid_t fapl) h5_delete_test_file(base_name[i], fapl); } /* end for */ - return; } /* end h5_delete_all_test_files() */ /*------------------------------------------------------------------------- @@ -336,8 +332,6 @@ h5_test_shutdown(void) /* Restore the original error reporting routine */ h5_restore_err(); - - return; } /* end h5_test_shutdown() */ /*------------------------------------------------------------------------- @@ -444,8 +438,6 @@ h5_test_init(void) HDassert(err_func == NULL); H5Eget_auto2(H5E_DEFAULT, &err_func, NULL); H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL); - - return; } /* end h5_test_init() */ /*------------------------------------------------------------------------- diff --git a/test/set_extent.c b/test/set_extent.c index a70e95e..bf061fb 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -2677,6 +2677,4 @@ test_random_rank4_dump(unsigned ndim_sets, hsize_t dim_log[][4], hsize_t cdims[4 (unsigned)dim_log[i][1], (unsigned)dim_log[i][2], (unsigned)dim_log[i][3]); if (j >= 0) HDprintf(" First incorrect value read: ( %d, %d, %d, %d )\n", j, k, l, m); - - return; } /* end test_random_rank4_dump */ diff --git a/test/tarray.c b/test/tarray.c index 072df28..9842247 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -1086,7 +1086,6 @@ test_array_free_custom(void *_mem, void *info) HDfree(mem); } /* end if */ - return; } /* end test_array_free_custom() */ /*------------------------------------------------------------------------- diff --git a/test/tmisc.c b/test/tmisc.c index 8dc7ec4..4fae77f 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -517,7 +517,6 @@ test_misc2_write_attribute(void) HDfree(string_att1); HDfree(string_att2); - return; } static void @@ -563,8 +562,6 @@ test_misc2_read_attribute(const char *filename, const char *att_name) ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - - return; } /**************************************************************** ** diff --git a/test/ttsafe.c b/test/ttsafe.c index ef5ec3c..05c84f4 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -70,8 +70,6 @@ tts_is_threadsafe(void) if (is_ts != should_be) TestErrPrintf("Thread-safety value incorrect - test failed\n"); - - return; } /* Routine to generate attribute names for numeric values */ diff --git a/test/tvlstr.c b/test/tvlstr.c index ecd5491..26b939f 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -659,8 +659,6 @@ test_write_vl_string_attribute(void) ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - - return; } /**************************************************************** @@ -739,8 +737,6 @@ test_read_vl_string_attribute(void) ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - - return; } /* Helper routine for test_vl_rewrite() */ @@ -864,8 +860,6 @@ test_vl_rewrite(void) ret = H5Fclose(file2); CHECK(ret, FAIL, "H5Fclose"); - - return; } /* end test_vl_rewrite() */ /**************************************************************** diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 5d04202..46f5389 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -3306,8 +3306,6 @@ get_member_types(hid_t tid, mcomp_t *members) get_member_types(members->ids[u], members->m[u]); } } - - return; } /*------------------------------------------------------------------------- diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 471af51..2dc02bc 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -5097,7 +5097,6 @@ help(char *name) (void)HDfprintf(stdout, "\t data-set will be compressed using GZIP and a compression level \n"); (void)HDfprintf(stdout, "\t of 7.\n"); (void)HDfprintf(stdout, "\t The dataset will be stored at \"/Second-set\"\n\n"); - return; } void @@ -5107,5 +5106,4 @@ usage(char *name) (void)HDfprintf(stdout, "\t%s <infile> -c[onfig] <configfile> \ [<infile> -c[config] <configfile>...] -o[utfile] <outfile> \n\n", name); - return; } diff --git a/tools/test/h5copy/dynlib_copy.c b/tools/test/h5copy/dynlib_copy.c index 57de3bc..d6e91fc 100644 --- a/tools/test/h5copy/dynlib_copy.c +++ b/tools/test/h5copy/dynlib_copy.c @@ -25,13 +25,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIBUD, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlibud", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlibud", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + H5Z_filter_dynlibud, /* The actual filter function */ }}; H5PL_type_t diff --git a/tools/test/h5diff/dynlib_diff.c b/tools/test/h5diff/dynlib_diff.c index 4568ca1..ce65f24 100644 --- a/tools/test/h5diff/dynlib_diff.c +++ b/tools/test/h5diff/dynlib_diff.c @@ -25,13 +25,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIBUD, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlibud", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlibud", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + H5Z_filter_dynlibud, /* The actual filter function */ }}; H5PL_type_t diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index ca5f59c..708f24a 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -5009,8 +5009,6 @@ error: H5Tclose(tid2); } H5E_END_TRY; - - return; } static hid_t @@ -8058,8 +8056,6 @@ error: H5Fclose(fid2); } H5E_END_TRY; - - return; } /*------------------------------------------------------------------------- diff --git a/tools/test/h5dump/dynlib_dump.c b/tools/test/h5dump/dynlib_dump.c index 4568ca1..ce65f24 100644 --- a/tools/test/h5dump/dynlib_dump.c +++ b/tools/test/h5dump/dynlib_dump.c @@ -25,13 +25,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIBUD, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlibud", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlibud", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + H5Z_filter_dynlibud, /* The actual filter function */ }}; H5PL_type_t diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 9d14f4b..b5d0f7f 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -153,13 +153,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIBUD, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlibud", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlibud", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + H5Z_filter_dynlibud, /* The actual filter function */ }}; /* A UD link traversal function. Shouldn't actually be called. */ @@ -6511,7 +6511,6 @@ out: H5Fclose(fid); } H5E_END_TRY; - return; } /*------------------------------------------------------------------------- @@ -6697,7 +6696,6 @@ out: H5Fclose(fid); } H5E_END_TRY; - return; } /*------------------------------------------------------------------------- @@ -6957,7 +6955,6 @@ out: H5Fclose(fid); } H5E_END_TRY; - return; } /*------------------------------------------------------------------------- diff --git a/tools/test/h5ls/dynlib_ls.c b/tools/test/h5ls/dynlib_ls.c index 4568ca1..ce65f24 100644 --- a/tools/test/h5ls/dynlib_ls.c +++ b/tools/test/h5ls/dynlib_ls.c @@ -25,13 +25,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIBUD, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlibud", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlibud", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + H5Z_filter_dynlibud, /* The actual filter function */ }}; H5PL_type_t diff --git a/tools/test/h5repack/dynlib_rpk.c b/tools/test/h5repack/dynlib_rpk.c index e64e67b..b228344 100644 --- a/tools/test/h5repack/dynlib_rpk.c +++ b/tools/test/h5repack/dynlib_rpk.c @@ -27,13 +27,13 @@ static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, const uns /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIB1[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB1, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlib1", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB1, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib1", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + H5Z_filter_dynlib1, /* The actual filter function */ }}; H5PL_type_t diff --git a/tools/test/h5repack/dynlib_vrpk.c b/tools/test/h5repack/dynlib_vrpk.c index 2db97da..5eac4f2 100644 --- a/tools/test/h5repack/dynlib_vrpk.c +++ b/tools/test/h5repack/dynlib_vrpk.c @@ -27,13 +27,13 @@ static size_t H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts, const uns /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIB4[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB4, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlib4", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib4, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB4, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib4", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + H5Z_filter_dynlib4, /* The actual filter function */ }}; H5PL_type_t diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index a93d673..d8ed9ec 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -818,8 +818,10 @@ main(int argc, char **argv) goto error; #ifdef H5_HAVE_PARALLEL if (facc_type != FACC_DEFAULT && MAINPROCESS) -#endif /*H5_HAVE_PARALLEL*/ printf("All metadata performance tests passed.\n"); +#else + printf("All metadata performance tests passed.\n"); +#endif /*H5_HAVE_PARALLEL*/ return 0; |