From 7a5b440fa89538b94088cc89a1188aef27033e74 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 6 May 2021 19:48:58 -0700 Subject: Brings H5Z and many test changes from develop --- src/H5Z.c | 137 ++- src/H5Zdeflate.c | 32 +- src/H5Zfletcher32.c | 39 +- src/H5Zmodule.h | 8 +- src/H5Znbit.c | 339 ++++---- src/H5Zprivate.h | 2 + src/H5Zpublic.h | 680 ++++++++++++--- src/H5Zscaleoffset.c | 581 +++++++------ src/H5Zshuffle.c | 38 +- src/H5Zszip.c | 48 +- src/H5Ztrans.c | 308 +++---- src/H5system.c | 2 +- test/big.c | 6 +- test/chunk_info.c | 17 +- test/dtypes.c | 80 +- test/earray.c | 29 +- test/farray.c | 12 +- test/fheap.c | 1853 +++++++++++++++++++--------------------- test/fillval.c | 18 +- test/filter_plugin1_dsets.c | 16 +- test/filter_plugin2_dsets.c | 18 +- test/filter_plugin3_dsets.c | 16 +- test/filter_plugin4_groups.c | 18 +- test/freespace.c | 15 +- test/gen_new_array.c | 2 +- test/gen_new_fill.c | 2 +- test/gen_new_group.c | 2 +- test/gen_new_mtime.c | 2 +- test/gen_new_super.c | 2 +- test/gen_old_array.c | 2 +- test/gen_old_group.c | 2 +- test/gen_old_layout.c | 2 +- test/gen_old_mtime.c | 2 +- test/gen_plist.c | 2 +- test/gen_sizes_lheap.c | 2 +- test/gen_specmetaread.c | 2 +- test/gen_udlinks.c | 2 +- test/hyperslab.c | 4 +- test/links_env.c | 4 +- test/mf.c | 100 ++- test/mount.c | 54 +- test/mtime.c | 4 +- test/ntypes.c | 228 +++-- test/pool.c | 14 +- test/reserved.c | 6 +- test/ros3.c | 105 +-- test/s3comms.c | 118 +-- test/set_extent.c | 10 +- test/space_overflow.c | 2 +- test/stab.c | 10 +- test/tarray.c | 46 +- test/tattr.c | 57 +- test/tchecksum.c | 2 +- test/tcoords.c | 20 +- test/testerror.sh.in | 6 + test/testexternal_env.sh.in | 8 +- test/testflushrefresh.sh.in | 16 +- test/testframe.c | 12 +- test/testlinks_env.sh.in | 4 +- test/testmeta.c | 4 +- test/testvds_env.sh.in | 4 +- test/tselect.c | 32 +- test/tunicode.c | 8 +- test/tvlstr.c | 25 +- test/tvltypes.c | 144 ++-- test/twriteorder.c | 20 +- test/unlink.c | 6 +- test/use_append_chunk.c | 10 +- test/use_append_chunk_mirror.c | 10 +- test/use_append_mchunks.c | 20 +- test/use_common.c | 14 +- test/use_disable_mdc_flushes.c | 10 +- test/vds.c | 2 +- test/vds_env.c | 2 +- 74 files changed, 2950 insertions(+), 2529 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index cf397d2..ea92a01 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -68,7 +68,7 @@ static H5Z_stats_t *H5Z_stat_table_g = NULL; #endif /* H5Z_DEBUG */ /* Local functions */ -static int H5Z_find_idx(H5Z_filter_t id); +static int H5Z__find_idx(H5Z_filter_t id); static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key); static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key); static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); @@ -137,8 +137,15 @@ H5Z_term_package(void) if (H5DEBUG(Z)) { for (i = 0; i < H5Z_table_used_g; i++) { for (dir = 0; dir < 2; dir++) { + struct { + char *user; + char *system; + char *elapsed; + } timestrs = {H5_timer_get_time_string(H5Z_stat_table_g[i].stats[dir].times.user), + H5_timer_get_time_string(H5Z_stat_table_g[i].stats[dir].times.system), + H5_timer_get_time_string(H5Z_stat_table_g[i].stats[dir].times.elapsed)}; if (0 == H5Z_stat_table_g[i].stats[dir].total) - continue; + goto next; if (0 == nprint++) { /* Print column headers */ @@ -163,12 +170,14 @@ H5Z_term_package(void) H5Z_stat_table_g[i].stats[dir].times.elapsed); /* Print the statistics */ - HDfprintf(H5DEBUG(Z), " %s%-15s %10Hd %10Hd %8T %8T %8T %10s\n", (dir ? "<" : ">"), - comment, H5Z_stat_table_g[i].stats[dir].total, - H5Z_stat_table_g[i].stats[dir].errors, - H5Z_stat_table_g[i].stats[dir].times.user, - H5Z_stat_table_g[i].stats[dir].times.system, - H5Z_stat_table_g[i].stats[dir].times.elapsed, bandwidth); + HDfprintf(H5DEBUG(Z), " %s%-15s %10" PRIdHSIZE " %10" PRIdHSIZE " %8s %8s %8s %10s\n", + (dir ? "<" : ">"), comment, H5Z_stat_table_g[i].stats[dir].total, + H5Z_stat_table_g[i].stats[dir].errors, timestrs.user, timestrs.system, + timestrs.elapsed, bandwidth); +next: + HDfree(timestrs.user); + HDfree(timestrs.system); + HDfree(timestrs.elapsed); } /* end for */ } /* end for */ } /* end if */ @@ -696,7 +705,7 @@ done: } /* end H5Z_filter_avail() */ /*------------------------------------------------------------------------- - * Function: H5Z_prelude_callback + * Function: H5Z__prelude_callback * * Purpose: Makes a dataset creation "prelude" callback for the "can_apply" * or "set_local" routines. @@ -709,14 +718,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hid_t space_id, - H5Z_prelude_type_t prelude_type) +H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hid_t space_id, + H5Z_prelude_type_t prelude_type) { H5Z_class2_t *fclass; /* Individual filter information */ size_t u; /* Local index variable */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pline->nused > 0); @@ -774,10 +783,10 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hid done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_prelude_callback() */ +} /* end H5Z__prelude_callback() */ /*------------------------------------------------------------------------- - * Function: H5Z_prepare_prelude_callback_dcpl + * Function: H5Z__prepare_prelude_callback_dcpl * * Purpose: Prepares to make a dataset creation "prelude" callback * for the "can_apply" or "set_local" routines. @@ -790,13 +799,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) +H5Z__prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { hid_t space_id = -1; /* ID for dataspace describing chunk */ H5O_layout_t *dcpl_layout = NULL; /* Dataset's layout information */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); HDassert(H5I_DATATYPE == H5I_get_type(type_id)); @@ -844,7 +853,7 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type } /* Make the callbacks */ - if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) + if (H5Z__prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") } } @@ -858,7 +867,7 @@ done: dcpl_layout = (H5O_layout_t *)H5MM_xfree(dcpl_layout); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_prepare_prelude_callback_dcpl() */ +} /* end H5Z__prepare_prelude_callback_dcpl() */ /*------------------------------------------------------------------------- * Function: H5Z_can_apply @@ -883,7 +892,7 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "can apply" callbacks for filters in pipeline */ - if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) + if (H5Z__prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: @@ -913,7 +922,7 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "set local" callbacks for filters in pipeline */ - if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) + if (H5Z__prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: @@ -941,7 +950,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ - if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) + if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: @@ -973,7 +982,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ - if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) + if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: @@ -981,6 +990,70 @@ done: } /* end H5Z_set_local_direct() */ /*------------------------------------------------------------------------- + * Function: H5Z_ignore_filters + * + * Purpose: Determine whether filters can be ignored. + * + * Description: + * When the filters are optional (i.e., H5Z_FLAG_OPTIONAL is provided,) + * if any of the following conditions is met, the filters will be ignored: + * - dataspace is either H5S_NULL or H5S_SCALAR + * - datatype is variable-length (string or non-string) + * However, if any of these conditions exists and a filter is not + * optional, the function will produce an error. + * + * Return: Non-negative(TRUE/FALSE) on success + * Negative on failure + * + *------------------------------------------------------------------------- + */ +htri_t +H5Z_ignore_filters(hid_t dcpl_id, const H5T_t *type, const H5S_t *space) +{ + H5P_genplist_t *dc_plist; /* Dataset creation property list object */ + H5O_pline_t pline; /* Object's I/O pipeline information */ + H5S_class_t space_class; /* To check class of space */ + H5T_class_t type_class; /* To check if type is VL */ + hbool_t bad_for_filters = FALSE; /* Suitable to have filters */ + htri_t ret_value = FALSE; /* TRUE for ignoring filters */ + + FUNC_ENTER_NOAPI(FAIL) + + if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") + + /* Get pipeline information */ + if (H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") + + /* Get datatype and dataspace classes for quick access */ + space_class = H5S_GET_EXTENT_TYPE(space); + type_class = H5T_get_class(type, FALSE); + + /* These conditions are not suitable for filters */ + bad_for_filters = (H5S_NULL == space_class || H5S_SCALAR == space_class || H5T_VLEN == type_class || + (H5T_STRING == type_class && TRUE == H5T_is_variable_str(type))); + + /* When these conditions occur, if there are required filters in pline, + then report a failure, otherwise, set flag that they can be ignored */ + if (bad_for_filters) { + size_t ii; + if (pline.nused > 0) { + for (ii = 0; ii < pline.nused; ii++) { + if (!(pline.filter[ii].flags & H5Z_FLAG_OPTIONAL)) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "not suitable for filters") + } + + /* All filters are optional, we can ignore them */ + ret_value = TRUE; + } + } /* bad for filters */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z_ignore_filters() */ + +/*------------------------------------------------------------------------- * Function: H5Z_modify * * Purpose: Modify filter parameters for specified pipeline. @@ -1143,7 +1216,7 @@ done: } /* end H5Z_append() */ /*------------------------------------------------------------------------- - * Function: H5Z_find_idx + * Function: H5Z__find_idx * * Purpose: Given a filter ID return the offset in the global array * that holds all the registered filters. @@ -1153,12 +1226,12 @@ done: *------------------------------------------------------------------------- */ static int -H5Z_find_idx(H5Z_filter_t id) +H5Z__find_idx(H5Z_filter_t id) { size_t i; /* Local index variable */ int ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR for (i = 0; i < H5Z_table_used_g; i++) if (H5Z_table_g[i].id == id) @@ -1166,7 +1239,7 @@ H5Z_find_idx(H5Z_filter_t id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_find_idx() */ +} /* end H5Z__find_idx() */ /*------------------------------------------------------------------------- * Function: H5Z_find @@ -1187,7 +1260,7 @@ H5Z_find(H5Z_filter_t id) FUNC_ENTER_NOAPI(NULL) /* Get the index in the global table */ - if ((idx = H5Z_find_idx(id)) < 0) + if ((idx = H5Z__find_idx(id)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) /* Set return value */ @@ -1263,7 +1336,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), * try to load it dynamically and register it. Otherwise, return failure */ - if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { H5PL_key_t key; const H5Z_class2_t *filter_info; hbool_t issue_error = FALSE; @@ -1277,7 +1350,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i /* Search in the table of registered filters again to find the dynamic filter just loaded * and registered */ - if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; } else @@ -1340,7 +1413,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i failed |= (unsigned)1 << idx; continue; /* filter excluded */ } - if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { /* Check if filter is optional -- If it isn't, then error */ if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") @@ -1592,12 +1665,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) +H5Zget_filter_info(H5Z_filter_t filter, unsigned *filter_config_flags /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "Zf*Iu", filter, filter_config_flags); + H5TRACE2("e", "Zfx", filter, filter_config_flags); /* Get the filter info */ if (H5Z_get_filter_info(filter, filter_config_flags) < 0) diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 4cac005..d8fed41 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, August 27, 1999 */ @@ -33,25 +33,25 @@ #endif /* Local function prototypes */ -static size_t H5Z_filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, - size_t *buf_size, void **buf); +static size_t H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, + size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_DEFLATE[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DEFLATE, /* Filter id number */ - 1, /* encoder_present flag (set to true) */ - 1, /* decoder_present flag (set to true) */ - "deflate", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - H5Z_filter_deflate, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DEFLATE, /* Filter id number */ + 1, /* encoder_present flag (set to true) */ + 1, /* decoder_present flag (set to true) */ + "deflate", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + H5Z__filter_deflate, /* The actual filter function */ }}; #define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * (double)1.001f) + 12) /*------------------------------------------------------------------------- - * Function: H5Z_filter_deflate + * Function: H5Z__filter_deflate * * Purpose: Implement an I/O filter around the 'deflate' algorithm in * libz @@ -62,19 +62,17 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{ * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, - size_t *buf_size, void **buf) +H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, + size_t *buf_size, void **buf) { void * outbuf = NULL; /* Pointer to new buffer */ int status; /* Status from zlib operation */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(*buf_size > 0); diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index 74c1b24..4b0801c 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -25,25 +25,25 @@ #include "H5Zpkg.h" /* Data filters */ /* Local function prototypes */ -static size_t H5Z_filter_fletcher32(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], - size_t nbytes, size_t *buf_size, void **buf); +static size_t H5Z__filter_fletcher32(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], + size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_FLETCHER32[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_FLETCHER32, /* Filter id number */ - 1, /* encoder_present flag (set to true) */ - 1, /* decoder_present flag (set to true) */ - "fletcher32", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - H5Z_filter_fletcher32, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_FLETCHER32, /* Filter id number */ + 1, /* encoder_present flag (set to true) */ + 1, /* decoder_present flag (set to true) */ + "fletcher32", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + H5Z__filter_fletcher32, /* The actual filter function */ }}; #define FLETCHER_LEN 4 /*------------------------------------------------------------------------- - * Function: H5Z_filter_fletcher32 + * Function: H5Z__filter_fletcher32 * * Purpose: Implement an I/O filter of Fletcher32 Checksum * @@ -53,22 +53,11 @@ const H5Z_class2_t H5Z_FLETCHER32[1] = {{ * Programmer: Raymond Lu * Jan 3, 2003 * - * Modifications: - * Raymond Lu - * July 8, 2005 - * There was a bug in the calculating code of the Fletcher32 - * checksum in the library before v1.6.3. The checksum - * value wasn't consistent between big-endian and little-endian - * systems. This bug was fixed in Release 1.6.3. However, - * after fixing the bug, the checksum value is no longer the - * same as before on little-endian system. We'll check both - * the correct checksum and the wrong checksum to be consistent - * with Release 1.6.2 and before. *------------------------------------------------------------------------- */ static size_t -H5Z_filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, - const unsigned H5_ATTR_UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf) +H5Z__filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned H5_ATTR_UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void * outbuf = NULL; /* Pointer to new buffer */ unsigned char *src = (unsigned char *)(*buf); @@ -78,7 +67,7 @@ H5Z_filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, uint8_t tmp; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC HDassert(sizeof(uint32_t) >= 4); diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h index 25007b3..76a2380 100644 --- a/src/H5Zmodule.h +++ b/src/H5Zmodule.h @@ -77,11 +77,9 @@ * Custom filters that have been registered with the library will have * additional unique identifiers. * - * See \Emph{HDF5 Dynamically Loaded Filters} for more information on - * how an HDF5 application can apply a filter that is not registered - * with the HDF5 library. - * - * \todo Fix the reference. + * See \ref_dld_filters for more information on how an HDF5 + * application can apply a filter that is not registered with the HDF5 + * library. * * \defgroup H5ZPRE Predefined Filters * \ingroup H5Z diff --git a/src/H5Znbit.c b/src/H5Znbit.c index cb94945..b696085 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -34,35 +34,37 @@ typedef struct { } parms_atomic; /* Local function prototypes */ -static htri_t H5Z_can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static herr_t H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, - size_t *buf_size, void **buf); - -static void H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms); -static void H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms); -static herr_t H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms); -static herr_t H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms); - -static herr_t H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]); -static herr_t H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], +static htri_t H5Z__can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static herr_t H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, + size_t *buf_size, void **buf); + +static void H5Z__calc_parms_nooptype(size_t *cd_values_actual_nparms); +static void H5Z__calc_parms_atomic(size_t *cd_values_actual_nparms); +static herr_t H5Z__calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms); +static herr_t H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms); + +static herr_t H5Z__set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]); +static herr_t H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], + hbool_t *need_not_compress); +static herr_t H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress); -static herr_t H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress); -static herr_t H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress); - -static void H5Z_nbit_next_byte(size_t *j, size_t *buf_len); -static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, - unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, - size_t *buf_len, const parms_atomic *p, size_t datatype_len); -static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, - unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, - const parms_atomic *p, size_t datatype_len); -static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, size_t *buf_len, unsigned size); -static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, size_t *buf_len, const parms_atomic *p); +static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], + hbool_t *need_not_compress); + +static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len); +static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, + unsigned begin_i, unsigned end_i, const unsigned char *buffer, + size_t *j, size_t *buf_len, const parms_atomic *p, + size_t datatype_len); +static void H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, + unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, + size_t *buf_len, const parms_atomic *p, size_t datatype_len); +static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, + const unsigned char *buffer, size_t *j, size_t *buf_len, + unsigned size); +static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, size_t *buf_len, const parms_atomic *p); static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index); @@ -71,29 +73,27 @@ static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data const unsigned parms[], unsigned *parms_index); static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, const unsigned parms[]); -static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, size_t *buf_len, unsigned size); -static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, size_t *buf_len, const parms_atomic *p); -static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, size_t *buf_len, const unsigned parms[], - unsigned *parms_index); -static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, size_t *buf_len, const unsigned parms[], - unsigned *parms_index); -static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, - size_t *buffer_size, const unsigned parms[]); +static void H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size); +static void H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, size_t *buf_len, const unsigned parms[], + unsigned *parms_index); +static void H5Z__nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, size_t *buf_len, const unsigned parms[], + unsigned *parms_index); +static void H5Z__nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + size_t *buffer_size, const unsigned parms[]); /* This message derives from H5Z */ H5Z_class2_t H5Z_NBIT[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_NBIT, /* Filter id number */ - 1, /* Assume encoder present: check before registering */ - 1, /* decoder_present flag (set to true) */ - "nbit", /* Filter name for debugging */ - H5Z_can_apply_nbit, /* The "can apply" callback */ - H5Z_set_local_nbit, /* The "set local" callback */ - H5Z_filter_nbit, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_NBIT, /* Filter id number */ + 1, /* Assume encoder present: check before registering */ + 1, /* decoder_present flag (set to true) */ + "nbit", /* Filter name for debugging */ + H5Z__can_apply_nbit, /* The "can apply" callback */ + H5Z__set_local_nbit, /* The "set local" callback */ + H5Z__filter_nbit, /* The actual filter function */ }}; /* Local macros */ @@ -108,7 +108,7 @@ H5Z_class2_t H5Z_NBIT[1] = {{ /* Local variables */ /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_nbit + * Function: H5Z__can_apply_nbit * * Purpose: Check the parameters for nbit compression for validity and * whether they fit a particular dataset. @@ -122,12 +122,12 @@ H5Z_class2_t H5Z_NBIT[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get datatype */ if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -143,10 +143,10 @@ H5Z_can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UN done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_can_apply_nbit() */ +} /* end H5Z__can_apply_nbit() */ /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_nooptype + * Function: H5Z__calc_parms_nooptype * * Purpose: Calculate the number of parameters of array cd_values[] * of datatype that is not integer, nor floating-point, nor @@ -158,7 +158,7 @@ done: *------------------------------------------------------------------------- */ static void -H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms) +H5Z__calc_parms_nooptype(size_t *cd_values_actual_nparms) { /* Store datatype class code */ *cd_values_actual_nparms += 1; @@ -168,7 +168,7 @@ H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms) } /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_atomic + * Function: H5Z__calc_parms_atomic * * Purpose: Calculate the number of parameters of array cd_values[] * of atomic datatype whose datatype class is integer @@ -180,7 +180,7 @@ H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms) *------------------------------------------------------------------------- */ static void -H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms) +H5Z__calc_parms_atomic(size_t *cd_values_actual_nparms) { /* Store datatype class code */ *cd_values_actual_nparms += 1; @@ -199,7 +199,7 @@ H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms) } /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_array + * Function: H5Z__calc_parms_array * * Purpose: Calculate the number of parameters of array cd_values[] * for a given datatype identifier type_id @@ -214,13 +214,13 @@ H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms) *------------------------------------------------------------------------- */ static herr_t -H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) +H5Z__calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) { H5T_t * dtype_base = NULL; /* Array datatype's base datatype */ H5T_class_t dtype_base_class; /* Array datatype's base datatype's class */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Store datatype class code */ *cd_values_actual_nparms += 1; @@ -240,16 +240,16 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) switch (dtype_base_class) { case H5T_INTEGER: case H5T_FLOAT: - H5Z_calc_parms_atomic(cd_values_actual_nparms); + H5Z__calc_parms_atomic(cd_values_actual_nparms); break; case H5T_ARRAY: - if (H5Z_calc_parms_array(dtype_base, cd_values_actual_nparms) == FAIL) + if (H5Z__calc_parms_array(dtype_base, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; case H5T_COMPOUND: - if (H5Z_calc_parms_compound(dtype_base, cd_values_actual_nparms) == FAIL) + if (H5Z__calc_parms_compound(dtype_base, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; @@ -261,7 +261,7 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) case H5T_ENUM: case H5T_VLEN: /* Other datatype classes: nbit does no compression */ - H5Z_calc_parms_nooptype(cd_values_actual_nparms); + H5Z__calc_parms_nooptype(cd_values_actual_nparms); break; case H5T_NO_CLASS: @@ -278,10 +278,10 @@ done: HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_calc_parms_array() */ +} /* end H5Z__calc_parms_array() */ /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_compound + * Function: H5Z__calc_parms_compound * * Purpose: Calculate the number of parameters of array cd_values[] * for a given datatype identifier type_id @@ -296,14 +296,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) +H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) { int nmembers; /* Compound datatype's number of members */ H5T_t * dtype_member = NULL; /* Compound datatype's member datatype */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Store compound datatype class code */ *cd_values_actual_nparms += 1; @@ -337,16 +337,16 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) switch (dtype_member_class) { case H5T_INTEGER: case H5T_FLOAT: - H5Z_calc_parms_atomic(cd_values_actual_nparms); + H5Z__calc_parms_atomic(cd_values_actual_nparms); break; case H5T_ARRAY: - if (H5Z_calc_parms_array(dtype_member, cd_values_actual_nparms) == FAIL) + if (H5Z__calc_parms_array(dtype_member, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; case H5T_COMPOUND: - if (H5Z_calc_parms_compound(dtype_member, cd_values_actual_nparms) == FAIL) + if (H5Z__calc_parms_compound(dtype_member, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; @@ -358,7 +358,7 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) case H5T_ENUM: case H5T_VLEN: /* Other datatype classes: nbit does no compression */ - H5Z_calc_parms_nooptype(cd_values_actual_nparms); + H5Z__calc_parms_nooptype(cd_values_actual_nparms); break; case H5T_NO_CLASS: @@ -384,7 +384,7 @@ done: } /* end H5Z_calc_params_compound */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_nooptype + * Function: H5Z__set_parms_nooptype * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is not integer, nor @@ -400,12 +400,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]) +H5Z__set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]) { size_t dtype_size; /* No-op datatype's size (in bytes) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_NOOPTYPE; @@ -420,10 +420,10 @@ H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_parms_nooptype() */ +} /* end H5Z__set_parms_nooptype() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_atomic + * Function: H5Z__set_parms_atomic * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is integer or floating point @@ -437,8 +437,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress) +H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], + hbool_t *need_not_compress) { H5T_order_t dtype_order; /* Atomic datatype's endianness order */ size_t dtype_size; /* Atomic datatype's size (in bytes) */ @@ -447,7 +447,7 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_v unsigned dtype_offset; /* Atomic datatype's offset (in bits) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_ATOMIC; @@ -511,10 +511,10 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_v *need_not_compress = FALSE; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_parms_atomic() */ +} /* end H5Z__set_parms_atomic() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_array + * Function: H5Z__set_parms_array * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is array datatype @@ -528,8 +528,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress) +H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], + hbool_t *need_not_compress) { H5T_t * dtype_base = NULL; /* Array datatype's base datatype */ H5T_class_t dtype_base_class; /* Array datatype's base datatype's class */ @@ -537,7 +537,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_va htri_t is_vlstring; /* flag indicating if datatype is variable-length string */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_ARRAY; @@ -562,17 +562,17 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_va switch (dtype_base_class) { case H5T_INTEGER: case H5T_FLOAT: - if (H5Z_set_parms_atomic(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) + if (H5Z__set_parms_atomic(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_ARRAY: - if (H5Z_set_parms_array(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) + if (H5Z__set_parms_array(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_COMPOUND: - if (H5Z_set_parms_compound(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) + if (H5Z__set_parms_compound(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -586,7 +586,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_va if (dtype_base_class == H5T_VLEN || is_vlstring) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "datatype not supported by nbit") - if (H5Z_set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) + if (H5Z__set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -596,7 +596,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_va case H5T_OPAQUE: case H5T_REFERENCE: case H5T_ENUM: - if (H5Z_set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) + if (H5Z__set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -614,10 +614,10 @@ done: HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_parms_array() */ +} /* end H5Z__set_parms_array() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_compound + * Function: H5Z__set_parms_compound * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is compound datatype @@ -631,8 +631,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], - hbool_t *need_not_compress) +H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], + hbool_t *need_not_compress) { int snmembers; /* Compound datatype's number of members */ unsigned nmembers; /* Compound datatype's number of members */ @@ -645,7 +645,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set "local" parameter for compound datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_COMPOUND; @@ -687,17 +687,17 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd switch (dtype_member_class) { case H5T_INTEGER: case H5T_FLOAT: - if (H5Z_set_parms_atomic(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) + if (H5Z__set_parms_atomic(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_ARRAY: - if (H5Z_set_parms_array(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) + if (H5Z__set_parms_array(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_COMPOUND: - if (H5Z_set_parms_compound(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) + if (H5Z__set_parms_compound(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -737,7 +737,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd case H5T_REFERENCE: case H5T_ENUM: /* other datatype that nbit does no compression */ - if (H5Z_set_parms_nooptype(dtype_member, cd_values_index, cd_values) < 0) + if (H5Z__set_parms_nooptype(dtype_member, cd_values_index, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -764,7 +764,7 @@ done: } /* end H5Z_set_params_compound */ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_nbit + * Function: H5Z__set_local_nbit * * Purpose: Set the "local" dataset parameters for nbit compression. * @@ -777,7 +777,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) +H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t * type; /* Datatype */ @@ -792,7 +792,7 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) hbool_t need_not_compress; /* Flag if TRUE indicating no need to do nbit compression */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get datatype */ if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -812,16 +812,16 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) switch (dtype_class) { case H5T_INTEGER: case H5T_FLOAT: - H5Z_calc_parms_atomic(&cd_values_actual_nparms); + H5Z__calc_parms_atomic(&cd_values_actual_nparms); break; case H5T_ARRAY: - if (H5Z_calc_parms_array(type, &cd_values_actual_nparms) < 0) + if (H5Z__calc_parms_array(type, &cd_values_actual_nparms) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; case H5T_COMPOUND: - if (H5Z_calc_parms_compound(type, &cd_values_actual_nparms) < 0) + if (H5Z__calc_parms_compound(type, &cd_values_actual_nparms) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; @@ -883,17 +883,17 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) switch (dtype_class) { case H5T_INTEGER: case H5T_FLOAT: - if (H5Z_set_parms_atomic(type, &cd_values_index, cd_values, &need_not_compress) < 0) + if (H5Z__set_parms_atomic(type, &cd_values_index, cd_values, &need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_ARRAY: - if (H5Z_set_parms_array(type, &cd_values_index, cd_values, &need_not_compress) < 0) + if (H5Z__set_parms_array(type, &cd_values_index, cd_values, &need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_COMPOUND: - if (H5Z_set_parms_compound(type, &cd_values_index, cd_values, &need_not_compress) < 0) + if (H5Z__set_parms_compound(type, &cd_values_index, cd_values, &need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -932,10 +932,10 @@ done: H5MM_xfree(cd_values); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_nbit() */ +} /* end H5Z__set_local_nbit() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_nbit + * Function: H5Z__filter_nbit * * Purpose: Implement an I/O filter for storing packed nbit data * @@ -948,15 +948,15 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, - void **buf) +H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, + size_t *buf_size, void **buf) { unsigned char *outbuf; /* pointer to new output buffer */ size_t size_out = 0; /* size of output buffer */ unsigned d_nelmts = 0; /* number of elements in the chunk */ size_t ret_value = 0; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments * cd_values[0] stores actual number of parameters in cd_values[] @@ -996,7 +996,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], si HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit compression") /* compress the buffer, size_out will be changed */ - H5Z_nbit_compress((unsigned char *)*buf, d_nelmts, outbuf, &size_out, cd_values); + H5Z__nbit_compress((unsigned char *)*buf, d_nelmts, outbuf, &size_out, cd_values); } /* end else */ /* free the input buffer */ @@ -1009,7 +1009,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], si done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_filter_nbit() */ +} /* end H5Z__filter_nbit() */ /* ======== Nbit Algorithm =============================================== * assume one byte has 8 bit @@ -1020,16 +1020,16 @@ done: */ static void -H5Z_nbit_next_byte(size_t *j, size_t *buf_len) +H5Z__nbit_next_byte(size_t *j, size_t *buf_len) { ++(*j); *buf_len = 8 * sizeof(unsigned char); } static void -H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, - unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, - const parms_atomic *p, size_t datatype_len) +H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, + unsigned end_i, const unsigned char *buffer, size_t *j, size_t *buf_len, + const parms_atomic *p, size_t datatype_len) { size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */ size_t dat_offset; @@ -1064,7 +1064,7 @@ H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k data[data_offset + k] = (unsigned char)(((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len)) << dat_offset); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if (dat_len == 0) return; @@ -1077,8 +1077,8 @@ H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k } static void -H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, - size_t *buf_len, unsigned size) +H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, const unsigned char *buffer, + size_t *j, size_t *buf_len, unsigned size) { unsigned i; /* index */ size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1092,7 +1092,7 @@ H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsign data[data_offset + i] = (unsigned char)(((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len))); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if (dat_len == 0) continue; @@ -1104,8 +1104,8 @@ H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsign } static void -H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, - size_t *buf_len, const parms_atomic *p) +H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, + size_t *buf_len, const parms_atomic *p) { /* begin_i: the index of byte having first significant bit end_i: the index of byte having last significant bit */ @@ -1124,8 +1124,8 @@ H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned end_i = p->offset / 8; for (k = (int)begin_i; k >= (int)end_i; k--) - H5Z_nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, - p, datatype_len); + H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, + p, datatype_len); } else { /* big endian */ /* Sanity check */ @@ -1139,8 +1139,8 @@ H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned end_i = ((unsigned)datatype_len - p->offset) / 8 - 1; for (k = (int)begin_i; k <= (int)end_i; k++) - H5Z_nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, - p, datatype_len); + H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, + p, datatype_len); } } @@ -1170,7 +1170,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned n = total_size / p.size; for (i = 0; i < n; i++) - H5Z_nbit_decompress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p); + H5Z__nbit_decompress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p); break; case H5Z_NBIT_ARRAY: @@ -1199,7 +1199,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned case H5Z_NBIT_NOOPTYPE: (*parms_index)++; /* skip size of no-op type */ - H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z__nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; default: @@ -1245,7 +1245,7 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig if (p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset") - H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p); + H5Z__nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p); break; case H5Z_NBIT_ARRAY: @@ -1263,8 +1263,8 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig case H5Z_NBIT_NOOPTYPE: /* Advance past member size */ (*parms_index)++; - H5Z_nbit_decompress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len, - member_size); + H5Z__nbit_decompress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len, + member_size); break; default: @@ -1309,7 +1309,7 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset") for (i = 0; i < d_nelmts; i++) - H5Z_nbit_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, &p); + H5Z__nbit_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, &p); break; case H5Z_NBIT_ARRAY: @@ -1343,9 +1343,9 @@ done: } static void -H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, - unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, - const parms_atomic *p, size_t datatype_len) +H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, + unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, + const parms_atomic *p, size_t datatype_len) { size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */ unsigned char val; /* value to be copied in each data byte */ @@ -1375,7 +1375,7 @@ H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, buffer[*j] |= (unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len)); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if (dat_len == 0) return; @@ -1385,8 +1385,8 @@ H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, } static void -H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, - size_t *buf_len, unsigned size) +H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, size_t *buf_len, unsigned size) { unsigned i; /* index */ size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1400,7 +1400,7 @@ H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned buffer[*j] |= (unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len)); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if (dat_len == 0) continue; @@ -1410,8 +1410,8 @@ H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned } static void -H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, - size_t *buf_len, const parms_atomic *p) +H5Z__nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, + size_t *buf_len, const parms_atomic *p) { /* begin_i: the index of byte having first significant bit end_i: the index of byte having last significant bit */ @@ -1430,8 +1430,8 @@ H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned c end_i = p->offset / 8; for (k = (int)begin_i; k >= (int)end_i; k--) - H5Z_nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, - datatype_len); + H5Z__nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, + datatype_len); } else { /* big endian */ /* Sanity check */ @@ -1445,14 +1445,14 @@ H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned c end_i = ((unsigned)datatype_len - p->offset) / 8 - 1; for (k = (int)begin_i; k <= (int)end_i; k++) - H5Z_nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, - datatype_len); + H5Z__nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, + datatype_len); } } static void -H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, - size_t *buf_len, const unsigned parms[], unsigned *parms_index) +H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, + size_t *buf_len, const unsigned parms[], unsigned *parms_index) { unsigned i, total_size, base_class, base_size, n, begin_index; parms_atomic p; @@ -1468,7 +1468,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch p.offset = parms[(*parms_index)++]; n = total_size / p.size; for (i = 0; i < n; i++) - H5Z_nbit_compress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p); + H5Z__nbit_compress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p); break; case H5Z_NBIT_ARRAY: @@ -1476,8 +1476,8 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch n = total_size / base_size; /* number of base_type elements inside the array datatype */ begin_index = *parms_index; for (i = 0; i < n; i++) { - H5Z_nbit_compress_one_array(data, data_offset + i * base_size, buffer, j, buf_len, parms, - parms_index); + H5Z__nbit_compress_one_array(data, data_offset + i * base_size, buffer, j, buf_len, parms, + parms_index); *parms_index = begin_index; } break; @@ -1487,15 +1487,15 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch n = total_size / base_size; /* number of base_type elements inside the array datatype */ begin_index = *parms_index; for (i = 0; i < n; i++) { - H5Z_nbit_compress_one_compound(data, data_offset + i * base_size, buffer, j, buf_len, parms, - parms_index); + H5Z__nbit_compress_one_compound(data, data_offset + i * base_size, buffer, j, buf_len, parms, + parms_index); *parms_index = begin_index; } break; case H5Z_NBIT_NOOPTYPE: (*parms_index)++; /* skip size of no-op type */ - H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z__nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; default: @@ -1504,8 +1504,8 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch } static void -H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, - size_t *buf_len, const unsigned parms[], unsigned *parms_index) +H5Z__nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, + size_t *buf_len, const unsigned parms[], unsigned *parms_index) { unsigned i, nmembers, member_offset, member_class, size; parms_atomic p; @@ -1523,22 +1523,22 @@ H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned p.order = parms[(*parms_index)++]; p.precision = parms[(*parms_index)++]; p.offset = parms[(*parms_index)++]; - H5Z_nbit_compress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p); + H5Z__nbit_compress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p); break; case H5Z_NBIT_ARRAY: - H5Z_nbit_compress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms, - parms_index); + H5Z__nbit_compress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms, + parms_index); break; case H5Z_NBIT_COMPOUND: - H5Z_nbit_compress_one_compound(data, data_offset + member_offset, buffer, j, buf_len, parms, - parms_index); + H5Z__nbit_compress_one_compound(data, data_offset + member_offset, buffer, j, buf_len, parms, + parms_index); break; case H5Z_NBIT_NOOPTYPE: size = parms[(*parms_index)++]; - H5Z_nbit_compress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len, size); + H5Z__nbit_compress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len, size); break; default: @@ -1548,8 +1548,8 @@ H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned } static void -H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size, - const unsigned parms[]) +H5Z__nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size, + const unsigned parms[]) { /* i: index of data, new_size: index of buffer, buf_len: number of bits to be filled in current byte */ @@ -1574,14 +1574,15 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, p.offset = parms[7]; for (i = 0; i < d_nelmts; i++) - H5Z_nbit_compress_one_atomic(data, i * p.size, buffer, &new_size, &buf_len, &p); + H5Z__nbit_compress_one_atomic(data, i * p.size, buffer, &new_size, &buf_len, &p); break; case H5Z_NBIT_ARRAY: size = parms[4]; parms_index = 4; for (i = 0; i < d_nelmts; i++) { - H5Z_nbit_compress_one_array(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index); + H5Z__nbit_compress_one_array(data, i * size, buffer, &new_size, &buf_len, parms, + &parms_index); parms_index = 4; } break; @@ -1590,8 +1591,8 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size = parms[4]; parms_index = 4; for (i = 0; i < d_nelmts; i++) { - H5Z_nbit_compress_one_compound(data, i * size, buffer, &new_size, &buf_len, parms, - &parms_index); + H5Z__nbit_compress_one_compound(data, i * size, buffer, &new_size, &buf_len, parms, + &parms_index); parms_index = 4; } break; diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index b90fafb..51690b4 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -26,6 +26,7 @@ typedef struct H5Z_filter_info_t H5Z_filter_info_t; /* Private headers needed by this file */ #include "H5Tprivate.h" /* Datatypes */ +#include "H5Sprivate.h" /* Dataspace */ /**************************/ /* Library Private Macros */ @@ -86,6 +87,7 @@ H5_DLL herr_t H5Z_can_apply(hid_t dcpl_id, hid_t type_id); H5_DLL herr_t H5Z_set_local(hid_t dcpl_id, hid_t type_id); H5_DLL herr_t H5Z_can_apply_direct(const struct H5O_pline_t *pline); H5_DLL herr_t H5Z_set_local_direct(const struct H5O_pline_t *pline); +H5_DLL htri_t H5Z_ignore_filters(hid_t dcpl_id, const H5T_t *type, const H5S_t *space); H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_filter_in_pline(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline); diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index e829eb1..90277cf 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -21,111 +21,231 @@ /* Public headers needed by this file */ #include "H5public.h" -/* - * Filter identifiers. Values 0 through 255 are for filters defined by the - * HDF5 library. Values 256 through 511 are available for testing new - * filters. Subsequent values should be obtained from the HDF5 development - * team at help@hdfgroup.org. These values will never change because they - * appear in the HDF5 files. +/** + * \brief Filter identifiers + * + * \details Values 0 through 255 are for filters defined by the HDF5 library. + * Values 256 through 511 are available for testing new filters. + * Subsequent values should be obtained from the HDF5 development team + * at mailto:help@hdfgroup.org. These values will never change because + * they appear in the HDF5 files. */ typedef int H5Z_filter_t; /* Filter IDs */ -#define H5Z_FILTER_ERROR (-1) /*no filter */ -#define H5Z_FILTER_NONE 0 /*reserved indefinitely */ -#define H5Z_FILTER_DEFLATE 1 /*deflation like gzip */ -#define H5Z_FILTER_SHUFFLE 2 /*shuffle the data */ -#define H5Z_FILTER_FLETCHER32 3 /*fletcher32 checksum of EDC */ -#define H5Z_FILTER_SZIP 4 /*szip compression */ -#define H5Z_FILTER_NBIT 5 /*nbit compression */ -#define H5Z_FILTER_SCALEOFFSET 6 /*scale+offset compression */ -#define H5Z_FILTER_RESERVED 256 /*filter ids below this value are reserved for library use */ - -#define H5Z_FILTER_MAX 65535 /*maximum filter id */ +/** + * no filter + */ +#define H5Z_FILTER_ERROR (-1) +/** + * reserved indefinitely + */ +#define H5Z_FILTER_NONE 0 +/** + * deflation like gzip + */ +#define H5Z_FILTER_DEFLATE 1 +/** + * shuffle the data + */ +#define H5Z_FILTER_SHUFFLE 2 +/** + * fletcher32 checksum of EDC + */ +#define H5Z_FILTER_FLETCHER32 3 +/** + * szip compression + */ +#define H5Z_FILTER_SZIP 4 +/** + * nbit compression + */ +#define H5Z_FILTER_NBIT 5 +/** + * scale+offset compression + */ +#define H5Z_FILTER_SCALEOFFSET 6 +/** + * filter ids below this value are reserved for library use + */ +#define H5Z_FILTER_RESERVED 256 +/** + * maximum filter id + */ +#define H5Z_FILTER_MAX 65535 /* General macros */ -#define H5Z_FILTER_ALL 0 /* Symbol to remove all filters in H5Premove_filter */ -#define H5Z_MAX_NFILTERS 32 /* Maximum number of filters allowed in a pipeline */ - /* (should probably be allowed to be an - * unlimited amount, but currently each - * filter uses a bit in a 32-bit field, - * so the format would have to be - * changed to accommodate that) - */ +/** + * Symbol to remove all filters in H5Premove_filter() + */ +#define H5Z_FILTER_ALL 0 +/** + * Maximum number of filters allowed in a pipeline + * + * \internal (should probably be allowed to be an unlimited amount, but + * currently each filter uses a bit in a 32-bit field, so the format + * would have to be changed to accommodate that) + */ +#define H5Z_MAX_NFILTERS 32 /* Flags for filter definition (stored) */ -#define H5Z_FLAG_DEFMASK 0x00ff /*definition flag mask */ -#define H5Z_FLAG_MANDATORY 0x0000 /*filter is mandatory */ -#define H5Z_FLAG_OPTIONAL 0x0001 /*filter is optional */ +/** + * definition flag mask + */ +#define H5Z_FLAG_DEFMASK 0x00ff +/** + * filter is mandatory + */ +#define H5Z_FLAG_MANDATORY 0x0000 +/** + * filter is optional + */ +#define H5Z_FLAG_OPTIONAL 0x0001 /* Additional flags for filter invocation (not stored) */ -#define H5Z_FLAG_INVMASK 0xff00 /*invocation flag mask */ -#define H5Z_FLAG_REVERSE 0x0100 /*reverse direction; read */ -#define H5Z_FLAG_SKIP_EDC 0x0200 /*skip EDC filters for read */ +/** + * invocation flag mask + */ +#define H5Z_FLAG_INVMASK 0xff00 +/** + * reverse direction; read + */ +#define H5Z_FLAG_REVERSE 0x0100 +/** + * skip EDC filters for read + */ +#define H5Z_FLAG_SKIP_EDC 0x0200 /* Special parameters for szip compression */ /* [These are aliases for the similar definitions in szlib.h, which we can't * include directly due to the duplication of various symbols with the zlib.h * header file] */ +/** + * \ingroup SZIP */ #define H5_SZIP_ALLOW_K13_OPTION_MASK 1 -#define H5_SZIP_CHIP_OPTION_MASK 2 -#define H5_SZIP_EC_OPTION_MASK 4 -#define H5_SZIP_NN_OPTION_MASK 32 -#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32 +/** + * \ingroup SZIP */ +#define H5_SZIP_CHIP_OPTION_MASK 2 +/** + * \ingroup SZIP */ +#define H5_SZIP_EC_OPTION_MASK 4 +/** + * \ingroup SZIP */ +#define H5_SZIP_NN_OPTION_MASK 32 +/** + * \ingroup SZIP */ +#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32 /* Macros for the shuffle filter */ -#define H5Z_SHUFFLE_USER_NPARMS 0 /* Number of parameters that users can set */ -#define H5Z_SHUFFLE_TOTAL_NPARMS 1 /* Total number of parameters for filter */ +/** + * \ingroup SHUFFLE + * Number of parameters that users can set for the shuffle filter + */ +#define H5Z_SHUFFLE_USER_NPARMS 0 +/** + * \ingroup SHUFFLE + * Total number of parameters for the shuffle filter + */ +#define H5Z_SHUFFLE_TOTAL_NPARMS 1 /* Macros for the szip filter */ -#define H5Z_SZIP_USER_NPARMS 2 /* Number of parameters that users can set */ -#define H5Z_SZIP_TOTAL_NPARMS 4 /* Total number of parameters for filter */ -#define H5Z_SZIP_PARM_MASK 0 /* "User" parameter for option mask */ -#define H5Z_SZIP_PARM_PPB 1 /* "User" parameter for pixels-per-block */ -#define H5Z_SZIP_PARM_BPP 2 /* "Local" parameter for bits-per-pixel */ -#define H5Z_SZIP_PARM_PPS 3 /* "Local" parameter for pixels-per-scanline */ +/** + * \ingroup SZIP + * Number of parameters that users can set for SZIP + */ +#define H5Z_SZIP_USER_NPARMS 2 +/** + * \ingroup SZIP + * Total number of parameters for SZIP filter + */ +#define H5Z_SZIP_TOTAL_NPARMS 4 +/** + * \ingroup SZIP + * "User" parameter for option mask + */ +#define H5Z_SZIP_PARM_MASK 0 +/** + * \ingroup SZIP + * "User" parameter for pixels-per-block + */ +#define H5Z_SZIP_PARM_PPB 1 +/** + * \ingroup SZIP + * "Local" parameter for bits-per-pixel + */ +#define H5Z_SZIP_PARM_BPP 2 +/** + * \ingroup SZIP + * "Local" parameter for pixels-per-scanline + */ +#define H5Z_SZIP_PARM_PPS 3 /* Macros for the nbit filter */ +/** + * \ingroup NBIT + * Number of parameters that users can set for the N-bit filter + */ #define H5Z_NBIT_USER_NPARMS 0 /* Number of parameters that users can set */ /* Macros for the scale offset filter */ -#define H5Z_SCALEOFFSET_USER_NPARMS 2 /* Number of parameters that users can set */ +/** + * \ingroup SCALEOFFSET + * Number of parameters that users can set for the scale-offset filter + */ +#define H5Z_SCALEOFFSET_USER_NPARMS 2 /* Special parameters for ScaleOffset filter*/ +/** + * \ingroup SCALEOFFSET */ #define H5Z_SO_INT_MINBITS_DEFAULT 0 +/** + * \ingroup SCALEOFFSET */ typedef enum H5Z_SO_scale_type_t { H5Z_SO_FLOAT_DSCALE = 0, H5Z_SO_FLOAT_ESCALE = 1, H5Z_SO_INT = 2 } H5Z_SO_scale_type_t; -/* Current version of the H5Z_class_t struct */ +/** + * Current version of the H5Z_class_t struct + */ #define H5Z_CLASS_T_VERS (1) -/* Values to decide if EDC is enabled for reading data */ +/** + * \ingroup FLETCHER32 + * Values to decide if EDC is enabled for reading data + */ typedef enum H5Z_EDC_t { - H5Z_ERROR_EDC = -1, /* error value */ + H5Z_ERROR_EDC = -1, /**< error value */ H5Z_DISABLE_EDC = 0, H5Z_ENABLE_EDC = 1, - H5Z_NO_EDC = 2 /* must be the last */ + H5Z_NO_EDC = 2 /**< sentinel */ } H5Z_EDC_t; /* Bit flags for H5Zget_filter_info */ #define H5Z_FILTER_CONFIG_ENCODE_ENABLED (0x0001) #define H5Z_FILTER_CONFIG_DECODE_ENABLED (0x0002) -/* Return values for filter callback function */ +/** + * Return values for filter callback function + */ typedef enum H5Z_cb_return_t { - H5Z_CB_ERROR = -1, - H5Z_CB_FAIL = 0, /* I/O should fail if filter fails. */ - H5Z_CB_CONT = 1, /* I/O continues if filter fails. */ - H5Z_CB_NO = 2 + H5Z_CB_ERROR = -1, /**< error value */ + H5Z_CB_FAIL = 0, /**< I/O should fail if filter fails. */ + H5Z_CB_CONT = 1, /**< I/O continues if filter fails. */ + H5Z_CB_NO = 2 /**< sentinel */ } H5Z_cb_return_t; -/* Filter callback function definition */ +//! +/** + * Filter callback function definition + */ typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void *buf, size_t buf_size, void *op_data); +//! -/* Structure for filter callback property */ +/** + * Structure for filter callback property + */ typedef struct H5Z_cb_t { H5Z_filter_func_t func; void * op_data; @@ -135,87 +255,411 @@ typedef struct H5Z_cb_t { extern "C" { #endif -/* - * Before a dataset gets created, the "can_apply" callbacks for any filters used - * in the dataset creation property list are called - * with the dataset's dataset creation property list, the dataset's datatype and - * a dataspace describing a chunk (for chunked dataset storage). +/** + * \brief This callback determines if a filter can be applied to the dataset + * with the characteristics provided + * + * \dcpl_id + * \type_id + * \space_id + * + * \return \htri_t * - * The "can_apply" callback must determine if the combination of the dataset - * creation property list setting, the datatype and the dataspace represent a - * valid combination to apply this filter to. For example, some cases of - * invalid combinations may involve the filter not operating correctly on - * certain datatypes (or certain datatype sizes), or certain sizes of the chunk - * dataspace. + * \details Before a dataset gets created, the \ref H5Z_can_apply_func_t + * callbacks for any filters used in the dataset creation property list + * are called with the dataset's dataset creation property list, the + * dataset's datatype and a dataspace describing a chunk (for chunked + * dataset storage). * - * The "can_apply" callback can be the NULL pointer, in which case, the library - * will assume that it can apply to any combination of dataset creation - * property list values, datatypes and dataspaces. + * The \ref H5Z_can_apply_func_t callback must determine if the + * combination of the dataset creation property list setting, the + * datatype and the dataspace represent a valid combination to apply + * this filter to. For example, some cases of invalid combinations may + * involve the filter not operating correctly on certain datatypes (or + * certain datatype sizes), or certain sizes of the chunk dataspace. * - * The "can_apply" callback returns positive a valid combination, zero for an - * invalid combination and negative for an error. + * The \ref H5Z_can_apply_func_t callback can be the NULL pointer, in + * which case, the library will assume that it can apply to any + * combination of dataset creation property list values, datatypes and + * dataspaces. + * + * The \ref H5Z_can_apply_func_t callback returns positive a valid + * combination, zero for an invalid combination and negative for an + * error. */ +//! typedef htri_t (*H5Z_can_apply_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id); - -/* - * After the "can_apply" callbacks are checked for new datasets, the "set_local" - * callbacks for any filters used in the dataset creation property list are - * called. These callbacks receive the dataset's private copy of the dataset - * creation property list passed in to H5Dcreate (i.e. not the actual property - * list passed in to H5Dcreate) and the datatype ID passed in to H5Dcreate - * (which is not copied and should not be modified) and a dataspace describing - * the chunk (for chunked dataset storage) (which should also not be modified). +//! +/** + * \brief The filter operation callback function, defining a filter's operation + * on data + * + * \dcpl_id + * \type_id + * \space_id * - * The "set_local" callback must set any parameters that are specific to this - * dataset, based on the combination of the dataset creation property list - * values, the datatype and the dataspace. For example, some filters perform - * different actions based on different datatypes (or datatype sizes) or - * different number of dimensions or dataspace sizes. + * \return \herr_t * - * The "set_local" callback can be the NULL pointer, in which case, the library - * will assume that there are no dataset-specific settings for this filter. + * \details After the \ref H5Z_can_apply_func_t callbacks are checked for new + * datasets, the \ref H5Z_set_local_func_t callbacks for any filters + * used in the dataset creation property list are called. These + * callbacks receive the dataset's private copy of the dataset creation + * property list passed in to H5Dcreate() (i.e. not the actual property + * list passed in to H5Dcreate()) and the datatype ID passed in to + * H5Dcreate() (which is not copied and should not be modified) and a + * dataspace describing the chunk (for chunked dataset storage) (which + * should also not be modified). * - * The "set_local" callback must return non-negative on success and negative - * for an error. + * The \ref H5Z_set_local_func_t callback must set any parameters that + * are specific to this dataset, based on the combination of the + * dataset creation property list values, the datatype and the + * dataspace. For example, some filters perform different actions based + * on different datatypes (or datatype sizes) or different number of + * dimensions or dataspace sizes. + * + * The \ref H5Z_set_local_func_t callback can be the NULL pointer, in + * which case, the library will assume that there are no + * dataset-specific settings for this filter. + * + * The \ref H5Z_set_local_func_t callback must return non-negative on + * success and negative for an error. */ +//! typedef herr_t (*H5Z_set_local_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id); +//! -/* - * A filter gets definition flags and invocation flags (defined above), the - * client data array and size defined when the filter was added to the - * pipeline, the size in bytes of the data on which to operate, and pointers - * to a buffer and its allocated size. +/** + * \brief The filter operation callback function, defining a filter's operation + * on data + * + * \param[in] flags Bit vector specifying certain general properties of the filter + * \param[in] cd_nelmts Number of elements in \p cd_values + * \param[in] cd_values Auxiliary data for the filter + * \param[in] nbytes The number of valid bytes in \p buf to be filtered + * \param[in,out] buf_size The size of \p buf + * \param[in,out] buf The filter buffer + * + * \return Returns the number of valid bytes of data contained in \p buf. In the + * case of failure, the return value is 0 (zero) and all pointer + * arguments are left unchanged. * - * The filter should store the result in the supplied buffer if possible, - * otherwise it can allocate a new buffer, freeing the original. The - * allocated size of the new buffer should be returned through the BUF_SIZE - * pointer and the new buffer through the BUF pointer. + * \details A filter gets definition flags and invocation flags (defined + * above), the client data array and size defined when the filter was + * added to the pipeline, the size in bytes of the data on which to + * operate, and pointers to a buffer and its allocated size. * - * The return value from the filter is the number of bytes in the output - * buffer. If an error occurs then the function should return zero and leave - * all pointer arguments unchanged. + * The filter should store the result in the supplied buffer if + * possible, otherwise it can allocate a new buffer, freeing the + * original. The allocated size of the new buffer should be returned + * through the \p buf_size pointer and the new buffer through the \p + * buf pointer. + * + * The return value from the filter is the number of bytes in the + * output buffer. If an error occurs then the function should return + * zero and leave all pointer arguments unchanged. */ +//! typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[], size_t nbytes, size_t *buf_size, void **buf); - -/* +//! +/** * The filter table maps filter identification numbers to structs that * contain a pointers to the filter function and timing statistics. */ +//! typedef struct H5Z_class2_t { - int version; /* Version number of the H5Z_class_t struct */ - H5Z_filter_t id; /* Filter ID number */ - unsigned encoder_present; /* Does this filter have an encoder? */ - unsigned decoder_present; /* Does this filter have a decoder? */ - const char * name; /* Comment for debugging */ - H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ - H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ - H5Z_func_t filter; /* The actual filter function */ + int version; /**< Version number of the H5Z_class_t struct */ + H5Z_filter_t id; /**< Filter ID number */ + unsigned encoder_present; /**< Does this filter have an encoder? */ + unsigned decoder_present; /**< Does this filter have a decoder? */ + const char * name; /**< Comment for debugging */ + H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */ + H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */ + H5Z_func_t filter; /**< The actual filter function */ } H5Z_class2_t; +//! +/** + * \ingroup H5Z + * + * \brief Registers a new filter with the HDF5 library + * + * \param[in] cls A pointer to a buffer for the struct containing the + * filter-definition + * + * \return \herr_t + * + * \details H5Zregister() registers a new filter with the HDF5 library. + * + * \details Making a new filter available to an application is a two-step + * process. The first step is to write the three filter callback + * functions described below: \c can_apply, \c set_local, and \c + * filter. This call to H5Zregister(), registering the filter with the + * library, is the second step. The can_apply and set_local fields can + * be set to NULL if they are not required for the filter being + * registered. + * + * H5Zregister() accepts a single parameter, a pointer to a buffer for + * the \p cls data structure. That data structure must conform to one + * of the following definitions: + * \snippet this H5Z_class1_t_snip + * or + * \snippet this H5Z_class2_t_snip + * + * \c version is a library-defined value reporting the version number + * of the #H5Z_class_t struct. This currently must be set to + * #H5Z_CLASS_T_VERS. + * + * \c id is the identifier for the new filter. This is a user-defined + * value between #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX. These + * values are defined in the HDF5 source file H5Zpublic.h, but the + * symbols #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX should always be + * used instead of the literal values. + * + * \c encoder_present is a library-defined value indicating whether + * the filter’s encoding capability is available to the application. + * + * \c decoder_present is a library-defined value indicating whether + * the filter’s encoding capability is available to the application. + * + * \c name is a descriptive comment used for debugging, may contain a + * descriptive name for the filter, and may be the null pointer. + * + * \c can_apply, described in detail below, is a user-defined callback + * function which determines whether the combination of the dataset + * creation property list values, the datatype, and the dataspace + * represent a valid combination to apply this filter to. + * + * \c set_local, described in detail below, is a user-defined callback + * function which sets any parameters that are specific to this + * dataset, based on the combination of the dataset creation property + * list values, the datatype, and the dataspace. + * + * \c filter, described in detail below, is a user-defined callback + * function which performs the action of the filter. + * + * The statistics associated with a filter are not reset by this + * function; they accumulate over the life of the library. + * + * #H5Z_class_t is a macro which maps to either H5Z_class1_t or + * H5Z_class2_t, depending on the needs of the application. To affect + * only this macro, H5Z_class_t_vers may be defined to either 1 or 2. + * Otherwise, it will behave in the same manner as other API + * compatibility macros. See API Compatibility Macros in HDF5 for more + * information. H5Z_class1_t matches the #H5Z_class_t structure that is + * used in the 1.6.x versions of the HDF5 library. + * + * H5Zregister() will automatically detect which structure type has + * been passed in, regardless of the mapping of the #H5Z_class_t macro. + * However, the application must make sure that the fields are filled + * in according to the correct structure definition if the macro is + * used to declare the structure. + * + * \Bold{The callback functions:}\n Before H5Zregister() can link a + * filter into an application, three callback functions must be + * defined as described in the HDF5 library header file H5Zpublic.h. + * + * When a filter is applied to the fractal heap for a group (e.g., + * when compressing group metadata) and if the can apply and set local + * callback functions have been defined for that filter, HDF5 passes + * the value -1 for all parameters for those callback functions. This + * is done to ensure that the filter will not be applied to groups if + * it relies on these parameters, as they are not applicable to group + * fractal heaps; to operate on group fractal heaps, a filter must be + * capable of operating on an opaque block of binary data. + * + * The \Emph{can apply} callback function must return a positive value + * for a valid combination, zero for an invalid combination, and a + * negative value for an error. + * \snippet this H5Z_can_apply_func_t_snip + * + * Before a dataset is created, the \Emph{can apply} callbacks for any + * filters used in the dataset creation property list are called with + * the dataset's dataset creation property list, \c dcpl_id, the + * dataset's datatype, \p type_id, and a dataspace describing a chunk, + * \p space_id, (for chunked dataset storage). + * + * This callback must determine whether the combination of the dataset + * creation property list settings, the datatype, and the dataspace + * represent a valid combination to which to apply this filter. For + * example, an invalid combination may involve the filter not + * operating correctly on certain datatypes, on certain datatype + * sizes, or on certain sizes of the chunk dataspace. If this filter + * is enabled through H5Pset_filter() as optional and the can apply + * function returns 0, the library will skip the filter in the filter + * pipeline. + * + * This callback can be the NULL pointer, in which case the library + * will assume that the filter can be applied to a dataset with any + * combination of dataset creation property list values, datatypes, + * and dataspaces. + * + * The \Emph{set local} callback function is defined as follows: + * \snippet this H5Z_set_local_func_t_snip + * + * After the can apply callbacks are checked for a new dataset, the + * \Emph{set local} callback functions for any filters used in the + * dataset creation property list are called. These callbacks receive + * \c dcpl_id, the dataset's private copy of the dataset creation + * property list passed in to H5Dcreate() (i.e. not the actual + * property list passed in to H5Dcreate()); \c type_id, the datatype + * identifier passed in to H5Dcreate(), which is not copied and should + * not be modified; and \c space_id, a dataspace describing the chunk + * (for chunked dataset storage), which should also not be modified. + * + * The set local callback must set any filter parameters that are + * specific to this dataset, based on the combination of the dataset + * creation property list values, the datatype, and the dataspace. For + * example, some filters perform different actions based on different + * datatypes, datatype sizes, numbers of dimensions, or dataspace + * sizes. + * + * The \Emph{set local} callback may be the NULL pointer, in which + * case, the library will assume that there are no dataset-specific + * settings for this filter. + * + * The \Emph{set local} callback function must return a non-negative + * value on success and a negative value for an error. + * + * The \Emph{filter operation} callback function, defining the + * filter's operation on the data, is defined as follows: + * \snippet this H5Z_func_t_snip + * + * The parameters \c flags, \c cd_nelmts, and \c cd_values are the + * same as for the function H5Pset_filter(). The one exception is that + * an additional flag, #H5Z_FLAG_REVERSE, is set when the filter is + * called as part of the input pipeline. + * + * The parameter \c buf points to the input buffer which has a size of + * \c buf_size bytes, \c nbytes of which are valid data. + * + * The filter should perform the transformation in place if possible. + * If the transformation cannot be done in place, then the filter + * should allocate a new buffer with malloc() and assign it to \c buf, + * assigning the allocated size of that buffer to \c buf_size. The old + * buffer should be freed by calling free(). + * + * If successful, the \Emph{filter operation} callback function + * returns the number of valid bytes of data contained in \c buf. In + * the case of failure, the return value is 0 (zero) and all pointer + * arguments are left unchanged. + * + * \version 1.8.6 Return type for the \Emph{can apply} callback function, + * \ref H5Z_can_apply_func_t, changed to \ref htri_t. + * \version 1.8.5 Semantics of the \Emph{can apply} and \Emph{set local} + * callback functions changed to accommodate the use of filters + * with group fractal heaps. + * \version 1.8.3 #H5Z_class_t renamed to H5Z_class2_t, H5Z_class1_t structure + * introduced for backwards compatibility with release 1.6.x, + * and #H5Z_class_t macro introduced in this release. Function + * modified to accept either structure type. + * \version 1.8.0 The fields \c version, \c encoder_present, and + * \c decoder_present were added to the #H5Z_class_t \c struct + * in this release. + * \version 1.6.0 This function was substantially revised in Release 1.6.0 with + * a new #H5Z_class_t struct and new set local and can apply + * callback functions. + * + */ H5_DLL herr_t H5Zregister(const void *cls); +/** + * \ingroup H5Z + * + * \brief Unregisters a filter. + * + * \param[in] id Identifier of the filter to be unregistered. + * \return \herr_t + * + * \details H5Zunregister() unregisters the filter specified in \p id. + * + * \details This function first iterates through all opened datasets and + * groups. If an open object that uses this filter is found, the + * function will fail with a message indicating that an object using + * the filter is still open. All open files are then flushed to make + * sure that all cached data that may use this filter are written out. + * + * If the application is a parallel program, all processes that + * participate in collective data write should call this function to + * ensure that all data is flushed. + * + * After a call to H5Zunregister(), the filter specified in filter + * will no longer be available to the application. + * + * \version 1.8.12 Function modified to check for open objects using the + * filter. + * \since 1.6.0 + */ H5_DLL herr_t H5Zunregister(H5Z_filter_t id); +/** + * \ingroup H5Z + * + * \brief Determines whether a filter is available + * + * \param[in] id Filter identifier + * \return \htri_t + * + * \details H5Zfilter_avail() determines whether the filter specified in \p id + * is available to the application. + * + * \since 1.6.0 + */ H5_DLL htri_t H5Zfilter_avail(H5Z_filter_t id); +/** + * \ingroup H5Z + * + * \brief Retrieves information about a filter + * + * \param[in] filter Filter identifier + * \param[out] filter_config_flags A bit field encoding the returned filter + * information + * \return \herr_t + * + * \details H5Zget_filter_info() retrieves information about a filter. At + * present, this means that the function retrieves a filter's + * configuration flags, indicating whether the filter is configured to + * decode data, to encode data, neither, or both. + * + * If \p filter_config_flags is not set to NULL prior to the function + * call, the returned parameter contains a bit field specifying the + * available filter configuration. The configuration flag values can + * then be determined through a series of bitwise AND operations, as + * described below. + * + * Valid filter configuration flags include the following: + * + * + * + * + * + *
#H5Z_FILTER_CONFIG_ENCODE_ENABLEDEncoding is enabled for this filter
#H5Z_FILTER_CONFIG_DECODE_ENABLEDDecoding is enabled for this filter
+ * + * A bitwise AND of the returned \p filter_config_flags and a valid + * filter configuration flag will reveal whether the related + * configuration option is available. For example, if the value of + * \code + * H5Z_FILTER_CONFIG_ENCODE_ENABLED & filter_config_flags + * \endcode + * is true, i.e., greater than 0 (zero), the queried filter + * is configured to encode data; if the value is \c FALSE, i.e., equal to + * 0 (zero), the filter is not so configured. + * + * If a filter is not encode-enabled, the corresponding \c H5Pset_* + * function will return an error if the filter is added to a dataset + * creation property list (which is required if the filter is to be + * used to encode that dataset). For example, if the + * #H5Z_FILTER_CONFIG_ENCODE_ENABLED flag is not returned for the SZIP + * filter, #H5Z_FILTER_SZIP, a call to H5Pset_szip() will fail. + * + * If a filter is not decode-enabled, the application will not be able + * to read an existing file encoded with that filter. + * + * This function should be called, and the returned \p + * filter_config_flags analyzed, before calling any other function, + * such as H5Pset_szip() , that might require a particular filter + * configuration. + * + * \since 1.6.3 + */ H5_DLL herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags); /* Symbols defined for compatibility with previous versions of the HDF5 API. @@ -224,17 +668,19 @@ H5_DLL herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_confi */ #ifndef H5_NO_DEPRECATED_SYMBOLS -/* +/** * The filter table maps filter identification numbers to structs that * contain a pointers to the filter function and timing statistics. */ +//! typedef struct H5Z_class1_t { - H5Z_filter_t id; /* Filter ID number */ - const char * name; /* Comment for debugging */ - H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ - H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ - H5Z_func_t filter; /* The actual filter function */ + H5Z_filter_t id; /**< Filter ID number */ + const char * name; /**< Comment for debugging */ + H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */ + H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */ + H5Z_func_t filter; /**< The actual filter function */ } H5Z_class1_t; +//! #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 281bb7f..5310f7d 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -48,57 +48,57 @@ enum H5Z_scaleoffset_t { }; /* Local function prototypes */ -static htri_t H5Z_can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static enum H5Z_scaleoffset_t H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, - unsigned dtype_sign); -static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, - enum H5Z_scaleoffset_t scale_type, unsigned cd_values[], - int need_convert); -static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], - size_t nbytes, size_t *buf_size, void **buf); -static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size); -static H5_ATTR_CONST unsigned H5Z_scaleoffset_log2(unsigned long long num); -static void H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, - unsigned filavail, const unsigned cd_values[], uint32_t *minbits, - unsigned long long *minval); -static void H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, - unsigned filavail, const unsigned cd_values[], uint32_t minbits, - unsigned long long minval); -static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, +static htri_t H5Z__can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static enum H5Z_scaleoffset_t H5Z__scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, + unsigned dtype_sign); +static herr_t H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, + enum H5Z_scaleoffset_t scale_type, unsigned cd_values[], + int need_convert); +static herr_t H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], + size_t nbytes, size_t *buf_size, void **buf); +static void H5Z__scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size); +static H5_ATTR_CONST unsigned H5Z__scaleoffset_log2(unsigned long long num); +static void H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t *minbits, - unsigned long long *minval, double D_val); -static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, - unsigned filavail, const unsigned cd_values[], - uint32_t minbits, unsigned long long minval, double D_val); -static void H5Z_scaleoffset_next_byte(size_t *j, unsigned *buf_len); -static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, - unsigned begin_i, unsigned char *buffer, size_t *j, - unsigned *buf_len, parms_atomic p, unsigned dtype_len); -static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, - unsigned begin_i, unsigned char *buffer, size_t *j, - unsigned *buf_len, parms_atomic p, unsigned dtype_len); -static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, unsigned *buf_len, - parms_atomic p); -static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, unsigned *buf_len, - parms_atomic p); -static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, - parms_atomic p); -static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, - size_t buffer_size, parms_atomic p); + unsigned long long *minval); +static void H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, + unsigned filavail, const unsigned cd_values[], uint32_t minbits, + unsigned long long minval); +static herr_t H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, + unsigned filavail, const unsigned cd_values[], + uint32_t *minbits, unsigned long long *minval, double D_val); +static herr_t H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, + unsigned filavail, const unsigned cd_values[], + uint32_t minbits, unsigned long long minval, double D_val); +static void H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len); +static void H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, + unsigned begin_i, const unsigned char *buffer, size_t *j, + unsigned *buf_len, parms_atomic p, unsigned dtype_len); +static void H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, + unsigned begin_i, unsigned char *buffer, size_t *j, + unsigned *buf_len, parms_atomic p, unsigned dtype_len); +static void H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, unsigned *buf_len, + parms_atomic p); +static void H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, unsigned *buf_len, + parms_atomic p); +static void H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + parms_atomic p); +static void H5Z__scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + size_t buffer_size, parms_atomic p); /* This message derives from H5Z */ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_SCALEOFFSET, /* Filter id number */ - 1, /* Assume encoder present: check before registering */ - 1, /* decoder_present flag (set to true) */ - "scaleoffset", /* Filter name for debugging */ - H5Z_can_apply_scaleoffset, /* The "can apply" callback */ - H5Z_set_local_scaleoffset, /* The "set local" callback */ - H5Z_filter_scaleoffset, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_SCALEOFFSET, /* Filter id number */ + 1, /* Assume encoder present: check before registering */ + 1, /* decoder_present flag (set to true) */ + "scaleoffset", /* Filter name for debugging */ + H5Z__can_apply_scaleoffset, /* The "can apply" callback */ + H5Z__set_local_scaleoffset, /* The "set local" callback */ + H5Z__filter_scaleoffset, /* The actual filter function */ }}; /* Local macros */ @@ -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 */ \ @@ -206,14 +206,14 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if (need_convert) \ - H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \ + 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 */ \ @@ -221,14 +221,14 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if (need_convert) \ - H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \ + 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 */ \ @@ -249,10 +249,10 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if (need_convert) \ - H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \ + 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) \ @@ -364,12 +364,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ #define H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \ { \ i = 0; \ - while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \ + while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \ i++; \ if (i < d_nelmts) \ min = max = buf[i]; \ for (; i < d_nelmts; i++) { \ - if (HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \ + if (HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \ continue; /* ignore fill value */ \ if (buf[i] > max) \ max = buf[i]; \ @@ -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; \ \ @@ -461,7 +461,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ { /* minbits not set yet, calculate max, min, and minbits */ \ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \ H5Z_scaleoffset_check_1(type, max, min, minbits) span = (type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)(span + 1)); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1)); \ } \ else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_1( \ @@ -475,7 +475,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ 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) \ H5Z_scaleoffset_check_1(type, max, min, minbits) span = (type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)span); \ } \ else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_2( \ @@ -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; \ @@ -499,7 +499,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ { /* minbits not set yet, calculate max, min, and minbits */ \ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \ H5Z_scaleoffset_check_2(type, max, min, minbits) span = (unsigned type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)(span + 1)); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1)); \ } \ else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_1( \ @@ -513,7 +513,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ 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) \ H5Z_scaleoffset_check_2(type, max, min, minbits) span = (unsigned type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)span); \ } \ else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_2( \ @@ -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; \ @@ -609,7 +609,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - \ min * pow_fun(10.0f, (type)D_val)) + \ 1); \ - *minbits = H5Z_scaleoffset_log2(span + 1); \ + *minbits = H5Z__scaleoffset_log2(span + 1); \ if (*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ H5Z_scaleoffset_modify_1(i, type, pow_fun, abs_fun, lround_fun, llround_fun, buf, d_nelmts, \ filval, minbits, min, D_val) \ @@ -620,17 +620,17 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - \ min * pow_fun(10.0f, (type)D_val)) + \ 1); \ - *minbits = H5Z_scaleoffset_log2(span); \ + *minbits = H5Z__scaleoffset_log2(span); \ if (*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ H5Z_scaleoffset_modify_2(i, type, pow_fun, lround_fun, llround_fun, buf, d_nelmts, min, \ 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,10 +734,10 @@ 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 + * Function: H5Z__can_apply_scaleoffset * * Purpose: Check the parameters for scaleoffset compression for * validity and whether they fit a particular dataset. @@ -751,14 +751,14 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ H5T_class_t dtype_class; /* Datatype's class */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get datatype */ if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -786,10 +786,10 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_can_apply_scaleoffset() */ +} /* end H5Z__can_apply_scaleoffset() */ /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_get_type + * Function: H5Z__scaleoffset_get_type * * Purpose: Get the specific integer type based on datatype size and sign * or floating-point type based on size @@ -803,12 +803,12 @@ done: *------------------------------------------------------------------------- */ static enum H5Z_scaleoffset_t -H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign) +H5Z__scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign) { enum H5Z_scaleoffset_t type = t_bad; /* integer type */ enum H5Z_scaleoffset_t ret_value = t_bad; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if (dtype_class == H5Z_SCALEOFFSET_CLS_INTEGER) { if (dtype_sign == H5Z_SCALEOFFSET_SGN_NONE) { /* unsigned integer */ @@ -863,7 +863,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_set_parms_fillval + * Function: H5Z__scaleoffset_set_parms_fillval * * Purpose: Get the fill value of the dataset and store in cd_values[] * @@ -876,47 +876,44 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, - unsigned cd_values[], int need_convert) +H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, + unsigned cd_values[], int need_convert) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + 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) -} /* end H5Z_scaleoffset_set_parms_fillval() */ + 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() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_scaleoffset + * Function: H5Z__set_local_scaleoffset * * Purpose: Set the "local" dataset parameters for scaleoffset * compression. @@ -930,7 +927,7 @@ H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) +H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t * dcpl_plist; /* Property list pointer */ H5T_t * type; /* Datatype */ @@ -947,7 +944,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) H5D_fill_value_t status; /* Status of fill value in property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the plist structure */ if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -1074,13 +1071,13 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) need_convert = TRUE; /* Before getting fill value, get its type */ - if ((scale_type = H5Z_scaleoffset_get_type(cd_values[H5Z_SCALEOFFSET_PARM_CLASS], - cd_values[H5Z_SCALEOFFSET_PARM_SIZE], - cd_values[H5Z_SCALEOFFSET_PARM_SIGN])) == 0) + if ((scale_type = H5Z__scaleoffset_get_type(cd_values[H5Z_SCALEOFFSET_PARM_CLASS], + cd_values[H5Z_SCALEOFFSET_PARM_SIZE], + cd_values[H5Z_SCALEOFFSET_PARM_SIGN])) == 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot use C integer datatype for cast") /* Get dataset fill value and store in cd_values[] */ - if (H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0) + if (H5Z__scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "unable to set fill value") } /* end else */ @@ -1091,10 +1088,10 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_scaleoffset() */ +} /* end H5Z__set_local_scaleoffset() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_scaleoffset + * Function: H5Z__filter_scaleoffset * * Purpose: Implement an I/O filter for storing packed integer * data using scale and offset method. @@ -1105,13 +1102,11 @@ done: * Programmer: Xiaowen Wu * Monday, February 7, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, - size_t *buf_size, void **buf) +H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, + size_t *buf_size, void **buf) { size_t ret_value = 0; /* return value */ size_t size_out = 0; /* size of output buffer */ @@ -1131,7 +1126,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value unsigned i; /* index */ parms_atomic p; /* parameters needed for compress/decompress functions */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ if (cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS) @@ -1260,7 +1255,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* convert to dataset datatype endianness order if needed */ if (need_convert) - H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); + H5Z__scaleoffset_convert(outbuf, d_nelmts, p.size); *buf = outbuf; outbuf = NULL; @@ -1271,7 +1266,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* decompress the buffer if minbits not equal to zero */ if (minbits != 0) - H5Z_scaleoffset_decompress(outbuf, d_nelmts, (unsigned char *)(*buf) + buf_offset, p); + H5Z__scaleoffset_decompress(outbuf, d_nelmts, (unsigned char *)(*buf) + buf_offset, p); else { /* fill value is not defined and all data elements have the same value */ for (i = 0; i < size_out; i++) @@ -1279,23 +1274,23 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value } /* before postprocess, get memory type */ - if ((type = H5Z_scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0) + if ((type = H5Z__scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot use C integer datatype for cast") /* postprocess after decompression */ if (dtype_class == H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, cd_values, minbits, minval); + H5Z__scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, cd_values, minbits, minval); if (dtype_class == H5Z_SCALEOFFSET_CLS_FLOAT) if (scale_type == 0) { /* variable-minimum-bits method */ - if (H5Z_scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, cd_values, minbits, - minval, D_val) == FAIL) + if (H5Z__scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, cd_values, minbits, + minval, D_val) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "post-decompression failed") } /* after postprocess, convert to dataset datatype endianness order if needed */ if (need_convert) - H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); + H5Z__scaleoffset_convert(outbuf, d_nelmts, p.size); } /* output; compress */ else { @@ -1303,20 +1298,20 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* before preprocess, convert to memory endianness order if needed */ if (need_convert) - H5Z_scaleoffset_convert(*buf, d_nelmts, p.size); + H5Z__scaleoffset_convert(*buf, d_nelmts, p.size); /* before preprocess, get memory type */ - if ((type = H5Z_scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0) + if ((type = H5Z__scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot use C integer datatype for cast") /* preprocess before compression */ if (dtype_class == H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, cd_values, &minbits, &minval); + H5Z__scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, cd_values, &minbits, &minval); if (dtype_class == H5Z_SCALEOFFSET_CLS_FLOAT) if (scale_type == 0) { /* variable-minimum-bits method */ - if (H5Z_scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, cd_values, &minbits, - &minval, D_val) == FAIL) + if (H5Z__scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, cd_values, &minbits, + &minval, D_val) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed") } @@ -1370,8 +1365,8 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value * all data elements have the same value */ if (minbits != 0) - H5Z_scaleoffset_compress((unsigned char *)*buf, d_nelmts, outbuf + buf_offset, - size_out - buf_offset, p); + H5Z__scaleoffset_compress((unsigned char *)*buf, d_nelmts, outbuf + buf_offset, + size_out - buf_offset, p); } /* free the input buffer */ @@ -1401,7 +1396,7 @@ done: * or from big-endian to little-endian 2/21/2005 */ static void -H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) +H5Z__scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) { if (dtype_size > 1) { size_t i, j; @@ -1416,13 +1411,13 @@ H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) buffer[i + dtype_size - 1 - j] = temp; } /* end for */ } /* end if */ -} /* end H5Z_scaleoffset_convert() */ +} /* end H5Z__scaleoffset_convert() */ /* return ceiling of floating-point log2 function * receive unsigned integer as argument 3/10/2005 */ static unsigned -H5Z_scaleoffset_log2(unsigned long long num) +H5Z__scaleoffset_log2(unsigned long long num) { unsigned v = 0; unsigned long long lower_bound = 1; /* is power of 2, largest value <= num */ @@ -1441,178 +1436,180 @@ H5Z_scaleoffset_log2(unsigned long long num) /* precompress for integer type */ static void -H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, - const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval) +H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, + 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 */ static void -H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, - unsigned filavail, const unsigned cd_values[], uint32_t minbits, - unsigned long long minval) +H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, + unsigned filavail, const unsigned cd_values[], uint32_t minbits, + unsigned long long minval) { 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 success: non-negative, failure: negative 4/15/05 */ static herr_t -H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, - const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval, - double D_val) +H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, + const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval, + double D_val) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC 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 success: non-negative, failure: negative 4/15/05 */ static herr_t -H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, - unsigned filavail, const unsigned cd_values[], uint32_t minbits, - unsigned long long minval, double D_val) +H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, + unsigned filavail, const unsigned cd_values[], uint32_t minbits, + unsigned long long minval, double D_val) { long long sminval = (long long)minval; /* for signed integer types */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC 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 -H5Z_scaleoffset_next_byte(size_t *j, unsigned *buf_len) +H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len) { ++(*j); *buf_len = 8 * sizeof(unsigned char); } static void -H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, - unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, - unsigned dtype_len) +H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, + const unsigned char *buffer, size_t *j, unsigned *buf_len, + parms_atomic p, unsigned dtype_len) { unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */ unsigned char val; /* value to be copied in each data byte */ @@ -1633,7 +1630,7 @@ H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, uns data[data_offset + k] = (unsigned char)((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len)); dat_len -= *buf_len; - H5Z_scaleoffset_next_byte(j, buf_len); + H5Z__scaleoffset_next_byte(j, buf_len); if (dat_len == 0) return; @@ -1645,8 +1642,8 @@ H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, uns } static void -H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, unsigned *buf_len, parms_atomic p) +H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, unsigned *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ unsigned begin_i; @@ -1661,8 +1658,8 @@ H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, u begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; for (k = (int)begin_i; k >= 0; k--) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, - p, dtype_len); + H5Z__scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, + p, dtype_len); } else { /* big endian */ HDassert(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE); @@ -1670,13 +1667,13 @@ H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, u begin_i = (dtype_len - p.minbits) / 8; for (k = (int)begin_i; k <= (int)(p.size - 1); k++) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, - p, dtype_len); + H5Z__scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, + p, dtype_len); } } static void -H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p) +H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p) { /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ @@ -1693,13 +1690,13 @@ H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char /* decompress */ for (i = 0; i < d_nelmts; i++) - H5Z_scaleoffset_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); + H5Z__scaleoffset_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); } static void -H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, - unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, - unsigned dtype_len) +H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, + unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, + parms_atomic p, unsigned dtype_len) { unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */ unsigned char val; /* value to be copied in each data byte */ @@ -1719,7 +1716,7 @@ H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsig buffer[*j] |= (unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len)); dat_len -= *buf_len; - H5Z_scaleoffset_next_byte(j, buf_len); + H5Z__scaleoffset_next_byte(j, buf_len); if (dat_len == 0) return; @@ -1729,8 +1726,8 @@ H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsig } static void -H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, - unsigned *buf_len, parms_atomic p) +H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, unsigned *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ unsigned begin_i; @@ -1745,22 +1742,22 @@ H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, uns begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; for (k = (int)begin_i; k >= 0; k--) - H5Z_scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, - dtype_len); + H5Z__scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, + dtype_len); } else { /* big endian */ HDassert(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE); begin_i = (dtype_len - p.minbits) / 8; for (k = (int)begin_i; k <= (int)(p.size - 1); k++) - H5Z_scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, - dtype_len); + H5Z__scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, + dtype_len); } } static void -H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size, - parms_atomic p) +H5Z__scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size, + parms_atomic p) { /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ @@ -1777,5 +1774,5 @@ H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char * /* compress */ for (i = 0; i < d_nelmts; i++) - H5Z_scaleoffset_compress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); + H5Z__scaleoffset_compress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); } diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 5786b5f..df164b3 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -22,27 +22,27 @@ #include "H5Zpkg.h" /* Data filters */ /* Local function prototypes */ -static herr_t H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, - size_t *buf_size, void **buf); +static herr_t H5Z__set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, + size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_SHUFFLE[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_SHUFFLE, /* Filter id number */ - 1, /* encoder_present flag (set to true) */ - 1, /* decoder_present flag (set to true) */ - "shuffle", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - H5Z_set_local_shuffle, /* The "set local" callback */ - H5Z_filter_shuffle, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_SHUFFLE, /* Filter id number */ + 1, /* encoder_present flag (set to true) */ + 1, /* decoder_present flag (set to true) */ + "shuffle", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + H5Z__set_local_shuffle, /* The "set local" callback */ + H5Z__filter_shuffle, /* The actual filter function */ }}; /* Local macros */ #define H5Z_SHUFFLE_PARM_SIZE 0 /* "Local" parameter for shuffling size */ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_shuffle + * Function: H5Z__set_local_shuffle * * Purpose: Set the "local" dataset parameter for data shuffling to be * the size of the datatype. @@ -56,7 +56,7 @@ const H5Z_class2_t H5Z_SHUFFLE[1] = {{ *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t * type; /* Datatype */ @@ -65,7 +65,7 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_i unsigned cd_values[H5Z_SHUFFLE_TOTAL_NPARMS]; /* Filter parameters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Get the plist structure */ if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -91,10 +91,10 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_i done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_shuffle() */ +} /* end H5Z__set_local_shuffle() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_shuffle + * Function: H5Z__filter_shuffle * * Purpose: Implement an I/O filter which "de-interlaces" a block of data * by putting all the bytes in a byte-position for each element @@ -112,8 +112,8 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, - size_t *buf_size, void **buf) +H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, + size_t *buf_size, void **buf) { void * dest = NULL; /* Buffer to deposit [un]shuffled bytes into */ unsigned char *_src = NULL; /* Alias for source buffer */ @@ -127,7 +127,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t leftover; /* Extra bytes at end of buffer */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC /* Check arguments */ if (cd_nelmts != H5Z_SHUFFLE_TOTAL_NPARMS || cd_values[H5Z_SHUFFLE_PARM_SIZE] == 0) diff --git a/src/H5Zszip.c b/src/H5Zszip.c index a2da0c4..a5b544a 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -31,25 +31,25 @@ #endif /* Local function prototypes */ -static htri_t H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static herr_t H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, - size_t *buf_size, void **buf); +static htri_t H5Z__can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static herr_t H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, + size_t *buf_size, void **buf); /* This message derives from H5Z */ H5Z_class2_t H5Z_SZIP[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_SZIP, /* Filter id number */ - 1, /* Assume encoder present: check before registering */ - 1, /* decoder_present flag (set to true) */ - "szip", /* Filter name for debugging */ - H5Z_can_apply_szip, /* The "can apply" callback */ - H5Z_set_local_szip, /* The "set local" callback */ - H5Z_filter_szip, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_SZIP, /* Filter id number */ + 1, /* Assume encoder present: check before registering */ + 1, /* decoder_present flag (set to true) */ + "szip", /* Filter name for debugging */ + H5Z__can_apply_szip, /* The "can apply" callback */ + H5Z__set_local_szip, /* The "set local" callback */ + H5Z__filter_szip, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_szip + * Function: H5Z__can_apply_szip * * Purpose: Check the parameters for szip compression for validity and * whether they fit a particular dataset. @@ -70,14 +70,14 @@ H5Z_class2_t H5Z_SZIP[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ unsigned dtype_size; /* Datatype's size (in bits) */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Get datatype */ if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -102,10 +102,10 @@ H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UN done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_can_apply_szip() */ +} /* end H5Z__can_apply_szip() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_szip + * Function: H5Z__set_local_szip * * Purpose: Set the "local" dataset parameters for szip compression. * @@ -118,7 +118,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) +H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t * type; /* Datatype */ @@ -135,7 +135,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) hsize_t scanline; /* Size of dataspace's fastest changing dimension */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Get the plist structure */ if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -242,10 +242,10 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_szip() */ +} /* end H5Z__set_local_szip() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_szip + * Function: H5Z__filter_szip * * Purpose: Implement an I/O filter around the 'rice' algorithm in * libsz @@ -259,8 +259,8 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, - void **buf) +H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, + size_t *buf_size, void **buf) { size_t ret_value = 0; /* Return value */ size_t size_out = 0; /* Size of output buffer */ @@ -268,7 +268,7 @@ H5Z_filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], si unsigned char *newbuf = NULL; /* Pointer to input buffer */ SZ_com_t sz_param; /* szip parameter block */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC /* Sanity check to make certain that we haven't drifted out of date with * the mask options from the szlib.h header */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 9469ebd..7d55efd 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -81,26 +81,21 @@ typedef struct { } H5Z_token; /* Local function prototypes */ -static H5Z_token *H5Z_get_token(H5Z_token *current); -static H5Z_node * H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers); -static H5Z_node * H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers); -static H5Z_node * H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers); -static H5Z_node * H5Z_new_node(H5Z_token_type type); -static void H5Z_do_op(H5Z_node *tree); -static hbool_t H5Z_op_is_numbs(H5Z_node *_tree); -static hbool_t H5Z_op_is_numbs2(H5Z_node *_tree); -static hid_t H5Z_xform_find_type(const H5T_t *type); -static herr_t H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, - H5Z_result *res); -static void H5Z_xform_destroy_parse_tree(H5Z_node *tree); -static void * H5Z_xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers); -static void * H5Z_xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers, - H5Z_datval_ptrs *new_dat_val_pointers); -static void H5Z_xform_reduce_tree(H5Z_node *tree); -#ifdef H5Z_XFORM_DEBUG -static void H5Z_XFORM_DEBUG(H5Z_node *tree); -static void H5Z_print(H5Z_node *tree, FILE *stream); -#endif /* H5Z_XFORM_DEBUG */ +static H5Z_token *H5Z__get_token(H5Z_token *current); +static H5Z_node * H5Z__parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers); +static H5Z_node * H5Z__parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers); +static H5Z_node * H5Z__parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers); +static H5Z_node * H5Z__new_node(H5Z_token_type type); +static void H5Z__do_op(H5Z_node *tree); +static hbool_t H5Z__op_is_numbs(H5Z_node *_tree); +static hbool_t H5Z__op_is_numbs2(H5Z_node *_tree); +static hid_t H5Z__xform_find_type(const H5T_t *type); +static herr_t H5Z__xform_eval_full(H5Z_node *tree, size_t array_size, hid_t array_type, H5Z_result *res); +static void H5Z__xform_destroy_parse_tree(H5Z_node *tree); +static void * H5Z__xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers); +static void * H5Z__xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers, + H5Z_datval_ptrs *new_dat_val_pointers); +static void H5Z__xform_reduce_tree(H5Z_node *tree); /* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before * doing the operation. So I break down the command into two lines: @@ -310,12 +305,12 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); ret_value->type = (TYPE); \ if (tree->lchild) \ ret_value->lchild = \ - (H5Z_node *)H5Z_xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \ + (H5Z_node *)H5Z__xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \ else \ ret_value->lchild = NULL; \ if (tree->rchild) \ ret_value->rchild = \ - (H5Z_node *)H5Z_xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \ + (H5Z_node *)H5Z__xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \ else \ ret_value->rchild = NULL; \ } \ @@ -330,7 +325,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); /* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand * is empty, like -x or +x. The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't - * accept operations like *x or /x. So in H5Z_do_op, these two macros are called in different ways. (SLU + * accept operations like *x or /x. So in H5Z__do_op, these two macros are called in different ways. (SLU * 2012/3/20) */ #define H5Z_XFORM_DO_OP6(OP) \ @@ -392,7 +387,8 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); */ /*------------------------------------------------------------------------- - * Function: H5Z_unget_token + * Function: H5Z__unget_token + * * Purpose: Rollback the H5Z_token to the previous H5Z_token retrieved. There * should only need to be one level of rollback necessary * for our grammar. @@ -405,9 +401,9 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); *------------------------------------------------------------------------- */ static void -H5Z_unget_token(H5Z_token *current) +H5Z__unget_token(H5Z_token *current) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(current); @@ -420,7 +416,7 @@ H5Z_unget_token(H5Z_token *current) } /*------------------------------------------------------------------------- - * Function: H5Z_get_token + * Function: H5Z__get_token * * Purpose: Determine what the next valid H5Z_token is in the expression * string. The current position within the H5Z_token string is @@ -438,11 +434,11 @@ H5Z_unget_token(H5Z_token *current) *------------------------------------------------------------------------- */ static H5Z_token * -H5Z_get_token(H5Z_token *current) +H5Z__get_token(H5Z_token *current) { H5Z_token *ret_value = current; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(current); @@ -569,7 +565,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5Z_xform_destroy_parse_tree + * Function: H5Z__xform_destroy_parse_tree * Purpose: Recursively destroys the expression tree. * Return: Nothing * Programmer: Bill Wendling @@ -578,13 +574,13 @@ done: *------------------------------------------------------------------------- */ static void -H5Z_xform_destroy_parse_tree(H5Z_node *tree) +H5Z__xform_destroy_parse_tree(H5Z_node *tree) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if (tree) { - H5Z_xform_destroy_parse_tree(tree->lchild); - H5Z_xform_destroy_parse_tree(tree->rchild); + H5Z__xform_destroy_parse_tree(tree->lchild); + H5Z__xform_destroy_parse_tree(tree->rchild); H5MM_xfree(tree); tree = NULL; } @@ -606,12 +602,12 @@ H5Z_xform_destroy_parse_tree(H5Z_node *tree) *------------------------------------------------------------------------- */ static void * -H5Z_xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers) +H5Z__xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers) { H5Z_token tok; void * ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC if (!expression) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "No expression provided?") @@ -619,16 +615,16 @@ H5Z_xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers) /* Set up the initial H5Z_token for parsing */ tok.tok_expr = tok.tok_begin = tok.tok_end = expression; - ret_value = (void *)H5Z_parse_expression(&tok, dat_val_pointers); + ret_value = (void *)H5Z__parse_expression(&tok, dat_val_pointers); - H5Z_xform_reduce_tree((H5Z_node *)ret_value); + H5Z__xform_reduce_tree((H5Z_node *)ret_value); done: FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- - * Function: H5Z_parse_expression + * Function: H5Z__parse_expression * Purpose: Beginning of the recursive descent parser to parse the * expression. An expression is: * @@ -643,34 +639,34 @@ done: *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) +H5Z__parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) { H5Z_node *expr; H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - expr = H5Z_parse_term(current, dat_val_pointers); + expr = H5Z__parse_term(current, dat_val_pointers); for (;;) { H5Z_node *new_node; - current = H5Z_get_token(current); + current = H5Z__get_token(current); switch (current->tok_type) { case H5Z_XFORM_PLUS: - new_node = H5Z_new_node(H5Z_XFORM_PLUS); + new_node = H5Z__new_node(H5Z_XFORM_PLUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(expr); + H5Z__xform_destroy_parse_tree(expr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = expr; - new_node->rchild = H5Z_parse_term(current, dat_val_pointers); + new_node->rchild = H5Z__parse_term(current, dat_val_pointers); if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -678,18 +674,18 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) break; case H5Z_XFORM_MINUS: - new_node = H5Z_new_node(H5Z_XFORM_MINUS); + new_node = H5Z__new_node(H5Z_XFORM_MINUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(expr); + H5Z__xform_destroy_parse_tree(expr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = expr; - new_node->rchild = H5Z_parse_term(current, dat_val_pointers); + new_node->rchild = H5Z__parse_term(current, dat_val_pointers); if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -697,7 +693,7 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) break; case H5Z_XFORM_RPAREN: - H5Z_unget_token(current); + H5Z__unget_token(current); HGOTO_DONE(expr) case H5Z_XFORM_END: @@ -711,7 +707,7 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) case H5Z_XFORM_DIVIDE: case H5Z_XFORM_LPAREN: default: - H5Z_xform_destroy_parse_tree(expr); + H5Z__xform_destroy_parse_tree(expr); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } } @@ -721,7 +717,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5Z_parse_term + * Function: H5Z__parse_term * Purpose: Parses a term in our expression language. A term is: * * term := factor | factor '*' factor | factor '/' factor @@ -735,34 +731,34 @@ done: *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) +H5Z__parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) { H5Z_node *term = NULL; H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - term = H5Z_parse_factor(current, dat_val_pointers); + term = H5Z__parse_factor(current, dat_val_pointers); for (;;) { H5Z_node *new_node; - current = H5Z_get_token(current); + current = H5Z__get_token(current); switch (current->tok_type) { case H5Z_XFORM_MULT: - new_node = H5Z_new_node(H5Z_XFORM_MULT); + new_node = H5Z__new_node(H5Z_XFORM_MULT); if (!new_node) { - H5Z_xform_destroy_parse_tree(term); + H5Z__xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = term; - new_node->rchild = H5Z_parse_factor(current, dat_val_pointers); + new_node->rchild = H5Z__parse_factor(current, dat_val_pointers); if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -770,25 +766,25 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) break; case H5Z_XFORM_DIVIDE: - new_node = H5Z_new_node(H5Z_XFORM_DIVIDE); + new_node = H5Z__new_node(H5Z_XFORM_DIVIDE); if (!new_node) { - H5Z_xform_destroy_parse_tree(term); + H5Z__xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = term; - new_node->rchild = H5Z_parse_factor(current, dat_val_pointers); + new_node->rchild = H5Z__parse_factor(current, dat_val_pointers); term = new_node; if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } break; case H5Z_XFORM_RPAREN: - H5Z_unget_token(current); + H5Z__unget_token(current); HGOTO_DONE(term) case H5Z_XFORM_END: @@ -800,12 +796,12 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) case H5Z_XFORM_PLUS: case H5Z_XFORM_MINUS: case H5Z_XFORM_LPAREN: - H5Z_unget_token(current); + H5Z__unget_token(current); HGOTO_DONE(term) case H5Z_XFORM_ERROR: default: - H5Z_xform_destroy_parse_tree(term); + H5Z__xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "bad transform type passed to data transform expression") } /* end switch */ @@ -816,7 +812,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5Z_parse_factor + * Function: H5Z__parse_factor * Purpose: Parses a factor in our expression language. A factor is: * * factor := number | // C long or double @@ -834,19 +830,19 @@ done: *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) +H5Z__parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) { H5Z_node *factor = NULL; H5Z_node *new_node; H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - current = H5Z_get_token(current); + current = H5Z__get_token(current); switch (current->tok_type) { case H5Z_XFORM_INTEGER: - factor = H5Z_new_node(H5Z_XFORM_INTEGER); + factor = H5Z__new_node(H5Z_XFORM_INTEGER); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") @@ -854,7 +850,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) break; case H5Z_XFORM_FLOAT: - factor = H5Z_new_node(H5Z_XFORM_FLOAT); + factor = H5Z__new_node(H5Z_XFORM_FLOAT); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") @@ -862,7 +858,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) break; case H5Z_XFORM_SYMBOL: - factor = H5Z_new_node(H5Z_XFORM_SYMBOL); + factor = H5Z__new_node(H5Z_XFORM_SYMBOL); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") @@ -872,41 +868,41 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) break; case H5Z_XFORM_LPAREN: - factor = H5Z_parse_expression(current, dat_val_pointers); + factor = H5Z__parse_expression(current, dat_val_pointers); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") - current = H5Z_get_token(current); + current = H5Z__get_token(current); if (current->tok_type != H5Z_XFORM_RPAREN) { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error in data transform expression") } break; case H5Z_XFORM_RPAREN: /* We shouldn't see a ) right now */ - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error: unexpected ')' ") case H5Z_XFORM_PLUS: /* unary + */ - new_node = H5Z_parse_factor(current, dat_val_pointers); + new_node = H5Z__parse_factor(current, dat_val_pointers); if (new_node) { if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && new_node->type != H5Z_XFORM_SYMBOL) { - H5Z_xform_destroy_parse_tree(new_node); - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } factor = new_node; - new_node = H5Z_new_node(H5Z_XFORM_PLUS); + new_node = H5Z__new_node(H5Z_XFORM_PLUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -914,28 +910,28 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) factor = new_node; } else { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } break; case H5Z_XFORM_MINUS: /* unary - */ - new_node = H5Z_parse_factor(current, dat_val_pointers); + new_node = H5Z__parse_factor(current, dat_val_pointers); if (new_node) { if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && new_node->type != H5Z_XFORM_SYMBOL) { - H5Z_xform_destroy_parse_tree(new_node); - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } factor = new_node; - new_node = H5Z_new_node(H5Z_XFORM_MINUS); + new_node = H5Z__new_node(H5Z_XFORM_MINUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -943,7 +939,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers) factor = new_node; } else { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } break; @@ -966,7 +962,8 @@ done: } /*------------------------------------------------------------------------- - * Function: H5Z_new_node + * Function: H5Z__new_node + * * Purpose: Create and initialize a new H5Z_node structure. * * Return: Success: Valid H5Z_node ptr @@ -978,11 +975,11 @@ done: *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_new_node(H5Z_token_type type) +H5Z__new_node(H5Z_token_type type) { H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if (NULL == (ret_value = (H5Z_node *)H5MM_calloc(sizeof(H5Z_node)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, @@ -1021,7 +1018,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void *array, size_t array_size tree = data_xform_prop->parse_root; /* Get the datatype ID for the buffer's type */ - if ((array_type = H5Z_xform_find_type(buf_type)) < 0) + if ((array_type = H5Z__xform_find_type(buf_type)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Cannot perform data transform on this type.") /* After this point, we're assured that the type of the array is handled by the eval code, @@ -1084,7 +1081,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void *array, size_t array_size } /* end for */ } /* end else */ - if (H5Z_xform_eval_full(tree, array_size, array_type, &res) < 0) + if (H5Z__xform_eval_full(tree, array_size, array_type, &res) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") if (data_xform_prop->dat_val_pointers->num_ptrs > 1) @@ -1110,7 +1107,7 @@ done: } /* end H5Z_xform_eval() */ /*------------------------------------------------------------------------- - * Function: H5Z_xform_eval_full + * Function: H5Z__xform_eval_full * * Purpose: Does a full evaluation of the parse tree contained in tree * and applies this transform to array. @@ -1128,12 +1125,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result *res) +H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result *res) { H5Z_result resl, resr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(tree); @@ -1158,9 +1155,9 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_t res->value.dat_val = *((void **)(tree->value.dat_val)); } /* end if */ else { - if (tree->lchild && H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) + if (tree->lchild && H5Z__xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") - if (H5Z_xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) + if (H5Z__xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") res->type = H5Z_XFORM_SYMBOL; @@ -1210,7 +1207,7 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_t done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_xform_eval_full() */ +} /* end H5Z__xform_eval_full() */ /*------------------------------------------------------------------------- * Function: H5Z_find_type @@ -1222,12 +1219,12 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5Z_xform_find_type(const H5T_t *type) +H5Z__xform_find_type(const H5T_t *type) { H5T_t *tmp; /* Temporary datatype */ hid_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(type); @@ -1280,10 +1277,11 @@ H5Z_xform_find_type(const H5T_t *type) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_xform_find_type() */ +} /* end H5Z__xform_find_type() */ /*------------------------------------------------------------------------- - * Function: H5Z_xform_copy_tree + * Function: H5Z__xform_copy_tree + * * Purpose: Makes a copy of the parse tree passed in. * * Return: A pointer to a root for a new parse tree which is a copy @@ -1295,11 +1293,11 @@ done: *------------------------------------------------------------------------- */ static void * -H5Z_xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers, H5Z_datval_ptrs *new_dat_val_pointers) +H5Z__xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers, H5Z_datval_ptrs *new_dat_val_pointers) { H5Z_node *ret_value = NULL; - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC HDassert(tree); @@ -1351,9 +1349,11 @@ done: } /*------------------------------------------------------------------------- - * Function: H5Z_op_is_numbs + * Function: H5Z__op_is_numbs + * * Purpose: Internal function to facilitate the condition check in - * H5Z_xform_reduce_tree to reduce the bulkiness of the code. + * H5Z__xform_reduce_tree to reduce the bulkiness of the code. + * * Return: TRUE or FALSE * * Programmer: Raymond Lu @@ -1362,11 +1362,11 @@ done: *------------------------------------------------------------------------- */ static hbool_t -H5Z_op_is_numbs(H5Z_node *_tree) +H5Z__op_is_numbs(H5Z_node *_tree) { hbool_t ret_value = FALSE; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(_tree); @@ -1378,10 +1378,11 @@ H5Z_op_is_numbs(H5Z_node *_tree) } /*------------------------------------------------------------------------- - * Function: H5Z_op_is_numbs2 + * Function: H5Z__op_is_numbs2 + * * Purpose: Internal function to facilitate the condition check in - * H5Z_xform_reduce_tree to reduce the bulkiness of the code. - * The difference from H5Z_op_is_numbs is that the left child + * H5Z__xform_reduce_tree to reduce the bulkiness of the code. + * The difference from H5Z__op_is_numbs is that the left child * can be empty, like -x or +x. * * Return: TRUE or FALSE @@ -1392,11 +1393,11 @@ H5Z_op_is_numbs(H5Z_node *_tree) *------------------------------------------------------------------------- */ static hbool_t -H5Z_op_is_numbs2(H5Z_node *_tree) +H5Z__op_is_numbs2(H5Z_node *_tree) { hbool_t ret_value = FALSE; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(_tree); @@ -1412,7 +1413,8 @@ H5Z_op_is_numbs2(H5Z_node *_tree) } /*------------------------------------------------------------------------- - * Function: H5Z_xform_reduce_tree + * Function: H5Z__xform_reduce_tree + * * Purpose: Simplifies parse tree passed in by performing any obvious * and trivial arithemtic calculations. * @@ -1424,36 +1426,36 @@ H5Z_op_is_numbs2(H5Z_node *_tree) *------------------------------------------------------------------------- */ static void -H5Z_xform_reduce_tree(H5Z_node *tree) +H5Z__xform_reduce_tree(H5Z_node *tree) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if (tree) { if ((tree->type == H5Z_XFORM_DIVIDE) || (tree->type == H5Z_XFORM_MULT)) { - if (H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); + if (H5Z__op_is_numbs(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->lchild); - if (H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->lchild); + if (H5Z__op_is_numbs(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->rchild); - if (H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->rchild); + if (H5Z__op_is_numbs(tree)) + H5Z__do_op(tree); } } } else if ((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_MINUS)) { - if (H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); + if (H5Z__op_is_numbs2(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->lchild); - if (H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->lchild); + if (H5Z__op_is_numbs2(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->rchild); - if (H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->rchild); + if (H5Z__op_is_numbs2(tree)) + H5Z__do_op(tree); } } } @@ -1463,7 +1465,8 @@ H5Z_xform_reduce_tree(H5Z_node *tree) } /*------------------------------------------------------------------------- - * Function: H5Z_do_op + * Function: H5Z__do_op + * * Purpose: If the root of the tree passed in points to a simple * arithmetic operation and the left and right subtrees are both * integer or floating point values, this function does that @@ -1478,9 +1481,9 @@ H5Z_xform_reduce_tree(H5Z_node *tree) *------------------------------------------------------------------------- */ static void -H5Z_do_op(H5Z_node *tree) +H5Z__do_op(H5Z_node *tree) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if (tree->type == H5Z_XFORM_DIVIDE) H5Z_XFORM_DO_OP3(/) @@ -1495,7 +1498,7 @@ H5Z_do_op(H5Z_node *tree) } /*------------------------------------------------------------------------- - * Function: H5D_xform_create + * Function: H5Z_xform_create * * Purpose: Create a new data transform object from a string. * @@ -1537,9 +1540,18 @@ H5Z_xform_create(const char *expr) /* Find the number of times "x" is used in this equation, and allocate room for storing that many points * A more sophisticated check is needed to support scientific notation. */ - for (i = 0; i < HDstrlen(expr); i++) - if (HDisalpha(expr[i])) + for (i = 0; i < HDstrlen(expr); i++) { + if (HDisalpha(expr[i])) { + if ((i > 0) && (i < (HDstrlen(expr) - 1))) { + if (((expr[i] == 'E') || (expr[i] == 'e')) && + (HDisdigit(expr[i - 1]) || (expr[i - 1] == '.')) && + (HDisdigit(expr[i + 1]) || (expr[i + 1] == '-') || (expr[i + 1] == '+'))) + continue; + } + count++; + } + } /* When there are no "x"'s in the equation (ie, simple transform case), * we don't need to allocate any space since no array will have to be @@ -1556,7 +1568,7 @@ H5Z_xform_create(const char *expr) /* we generate the parse tree right here and store a pointer to its root in the property. */ if ((data_xform_prop->parse_root = - (H5Z_node *)H5Z_xform_parse(expr, data_xform_prop->dat_val_pointers)) == NULL) + (H5Z_node *)H5Z__xform_parse(expr, data_xform_prop->dat_val_pointers)) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to generate parse tree from expression") /* Sanity check @@ -1573,7 +1585,7 @@ done: if (ret_value == NULL) { if (data_xform_prop) { if (data_xform_prop->parse_root) - H5Z_xform_destroy_parse_tree(data_xform_prop->parse_root); + H5Z__xform_destroy_parse_tree(data_xform_prop->parse_root); if (data_xform_prop->xform_exp) H5MM_xfree(data_xform_prop->xform_exp); if (count > 0 && data_xform_prop->dat_val_pointers->ptr_dat_val) @@ -1609,7 +1621,7 @@ H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop) if (data_xform_prop) { /* Destroy the parse tree */ - H5Z_xform_destroy_parse_tree(data_xform_prop->parse_root); + H5Z__xform_destroy_parse_tree(data_xform_prop->parse_root); /* Free the expression */ H5MM_xfree(data_xform_prop->xform_exp); @@ -1689,7 +1701,7 @@ H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop) new_data_xform_prop->dat_val_pointers->num_ptrs = 0; /* Copy parse tree */ - if ((new_data_xform_prop->parse_root = (H5Z_node *)H5Z_xform_copy_tree( + if ((new_data_xform_prop->parse_root = (H5Z_node *)H5Z__xform_copy_tree( (*data_xform_prop)->parse_root, (*data_xform_prop)->dat_val_pointers, new_data_xform_prop->dat_val_pointers)) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "error copying the parse tree") @@ -1709,7 +1721,7 @@ done: if (ret_value < 0) { if (new_data_xform_prop) { if (new_data_xform_prop->parse_root) - H5Z_xform_destroy_parse_tree(new_data_xform_prop->parse_root); + H5Z__xform_destroy_parse_tree(new_data_xform_prop->parse_root); if (new_data_xform_prop->xform_exp) H5MM_xfree(new_data_xform_prop->xform_exp); H5MM_xfree(new_data_xform_prop); diff --git a/src/H5system.c b/src/H5system.c index 4dfdc30..52bb930 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1095,7 +1095,7 @@ done: static size_t H5__find_last_file_separator(const char *path, size_t len, hbool_t *no_separator) { - size_t i; + size_t i = len; FUNC_ENTER_STATIC_NOERR diff --git a/test/big.c b/test/big.c index 989e4bc..36fb27d 100644 --- a/test/big.c +++ b/test/big.c @@ -429,7 +429,7 @@ writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n) for (i = 0; i < wrt_n; i++) { /* start position must be at least hs_size from the end */ hs_start[0] = randll(size2[0] - hs_size[0], i); - HDfprintf(out, "#%03d 0x%016Hx\n", i, hs_start[0]); + HDfprintf(out, "#%03d 0x%016" PRIxHSIZE "\n", i, hs_start[0]); if (H5Sselect_hyperslab(space2, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL) < 0) goto error; for (j = 0; j < WRT_SIZE; j++) { @@ -524,7 +524,7 @@ reader(char *filename, hid_t fapl) break; i = (int)HDstrtol(ln + 1, &s, 10); hs_offset[0] = HDstrtoull(s, NULL, 0); - HDfprintf(stdout, "#%03d 0x%016Hx%47s", i, hs_offset[0], ""); + HDfprintf(stdout, "#%03d 0x%016" PRIxHSIZE "%47s", i, hs_offset[0], ""); HDfflush(stdout); if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) @@ -605,7 +605,7 @@ usage(void) "\t-c\tFile system Checking skipped. Caution: this test generates\n" "\t\tmany big files and may fill up the file system.\n" "\t-fsize\tChange family size default to where is\n" - "\t\ta positive float point number. Default value is %Hu.\n" + "\t\ta positive float point number. Default value is %" PRIuHSIZE ".\n" "Examples:\n" "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n" "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n" diff --git a/test/chunk_info.c b/test/chunk_info.c index 4a661eb..ada2d80 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -127,7 +127,7 @@ void reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size); static int verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type, hsize_t exp_num_chunks); static int verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, - hsize_t *exp_offset, unsigned exp_flt_msk); + const hsize_t *exp_offset, unsigned exp_flt_msk); static int verify_get_chunk_info_by_coord(hid_t dset, hsize_t *offset, hsize_t exp_chk_size, unsigned exp_flt_msk); static int verify_empty_chunk_info(hid_t dset, hsize_t *offset); @@ -169,8 +169,8 @@ reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size) *------------------------------------------------------------------------- */ static int -verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, hsize_t *exp_offset, - unsigned exp_flt_msk) +verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, + const hsize_t *exp_offset, unsigned exp_flt_msk) { unsigned read_flt_msk = 0; /* Read filter mask */ hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */ @@ -302,7 +302,7 @@ index_type_str(H5D_chunk_index_t idx_type) *------------------------------------------------------------------------- */ static int -verify_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end) +verify_selected_chunks(hid_t dset, hid_t plist, const hsize_t *start, const hsize_t *end) { int read_buf[CHUNK_NX][CHUNK_NY]; int expected_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY]; /* Expected data */ @@ -335,8 +335,9 @@ verify_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end) /* Verify that read chunk is the same as the corresponding written one */ if (HDmemcmp(expected_buf[chk_index], read_buf, CHUNK_NX * CHUNK_NY) != 0) { - HDfprintf(stderr, "Read chunk differs from written chunk at offset (%d,%d)\n", offset[0], - offset[1]); + HDfprintf(stderr, + "Read chunk differs from written chunk at offset (%" PRIuHSIZE ",%" PRIuHSIZE ")\n", + offset[0], offset[1]); return FAIL; } } @@ -363,7 +364,7 @@ error: *------------------------------------------------------------------------- */ static int -write_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end, unsigned flt_msk) +write_selected_chunks(hid_t dset, hid_t plist, const hsize_t *start, const hsize_t *end, unsigned flt_msk) { int direct_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY]; /* Data in chunks */ hsize_t offset[2]; /* Offset coordinates of a chunk */ @@ -420,7 +421,7 @@ verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type, hsi /* Ensure the correct chunk indexing scheme is used */ if (idx_type != exp_idx_type) { char msg[256]; - sprintf(msg, "Should be using %s.\n", index_type_str(idx_type)); + HDsprintf(msg, "Should be using %s.\n", index_type_str(idx_type)); FAIL_PUTS_ERROR(msg); } diff --git a/test/dtypes.c b/test/dtypes.c index 58b8b26..626c58c 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 9, 1997 * * Purpose: Tests the datatype interface (H5T) @@ -1183,7 +1183,7 @@ test_compound_5(void) H5Tclose(int_array); /* Check results */ - if (HDmemcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim != dst[1].tdim || + if (HDmemcmp(src[1].name, dst[1].name, sizeof(src[1].name)) != 0 || src[1].tdim != dst[1].tdim || src[1].coll_ids[0] != dst[1].coll_ids[0] || src[1].coll_ids[1] != dst[1].coll_ids[1] || src[1].coll_ids[2] != dst[1].coll_ids[2] || src[1].coll_ids[3] != dst[1].coll_ids[3]) { H5_FAILED(); @@ -1482,10 +1482,10 @@ test_compound_8(void) int b; } s1; - typedef struct s2 { + struct s2 { char c; s1 d; - } s2; + }; hid_t tid1, tid1_copy, tid2, tid2_copy, tid3, arr_tid; size_t tsize; hsize_t dims[1] = {ARRAY_DIM}; @@ -1868,7 +1868,7 @@ test_compound_9(void) goto error; } /* end if */ - if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) { + if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); @@ -1942,7 +1942,7 @@ test_compound_9(void) goto error; } /* end if */ - if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || strcmp(rdata.str, wdata.str)) { + if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); @@ -2132,7 +2132,7 @@ test_compound_10(void) for (i = 0; i < ARRAY_DIM; i++) { if (rdata[i].i1 != wdata[i].i1 || rdata[i].i2 != wdata[i].i2 || - HDstrcmp(rdata[i].str, wdata[i].str)) { + HDstrcmp(rdata[i].str, wdata[i].str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); @@ -2148,7 +2148,7 @@ test_compound_10(void) t1 = rdata[i].text.p; t2 = wdata[i].text.p; - if (strcmp((char *)t1, (char *)t2)) { + if (HDstrcmp((char *)t1, (char *)t2) != 0) { H5_FAILED(); AT(); HDprintf("incorrect VL read data\n"); @@ -2333,7 +2333,7 @@ test_compound_11(void) ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ - else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) { + else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) { HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u, ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR @@ -2384,7 +2384,7 @@ test_compound_11(void) ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ - else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) { + else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) { HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u, ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR @@ -2425,7 +2425,7 @@ test_compound_11(void) ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ - else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) { + else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) { HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u, ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR @@ -2556,7 +2556,7 @@ test_compound_12(void) H5E_END_TRY; if (ret >= 0) { H5_FAILED(); - puts(" Tries to cut off the last member. Should have failed."); + HDputs(" Tries to cut off the last member. Should have failed."); goto error; } @@ -3010,14 +3010,14 @@ test_compound_14(void) goto error; } /* end if */ - if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str)) { + if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); goto error; } /* end if */ - if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) || + if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) != 0 || rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 || rdata2.l4 != wdata2.l4) { H5_FAILED(); @@ -3108,14 +3108,14 @@ test_compound_14(void) goto error; } /* end if */ - if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || strcmp(rdata1.str, wdata1.str)) { + if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); goto error; } /* end if */ - if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) || + if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) != 0 || rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 || rdata2.l4 != wdata2.l4) { H5_FAILED(); @@ -3957,7 +3957,7 @@ test_query(void) HDprintf("Can't get name for enum member\n"); goto error; } /* end if */ - if (strcmp("YELLOW", enum_name)) { + if (HDstrcmp("YELLOW", enum_name) != 0) { H5_FAILED(); HDprintf("Incorrect name for enum member\n"); goto error; @@ -4597,14 +4597,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Truncated C-string test failed"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Extended C-string test failed"); goto error; @@ -4628,14 +4628,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Truncated C buffer test failed"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Extended C buffer test failed"); goto error; @@ -4659,14 +4659,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Truncated Fortran-string test failed"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde abcde ", (size_t)20)) { + if (HDmemcmp(buf, "abcde abcde ", (size_t)20) != 0) { H5_FAILED(); HDputs(" Extended Fortran-string test failed"); goto error; @@ -4693,7 +4693,7 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Non-terminated string test 1"); goto error; @@ -4704,7 +4704,7 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Non-terminated string test 2"); goto error; @@ -4712,7 +4712,7 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdeabcdexxxxxxxxxx", (size_t)20); if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Non-terminated string test 2"); goto error; @@ -4736,14 +4736,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20) != 0) { H5_FAILED(); HDputs(" C string to Fortran test 1"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C string test 1"); goto error; @@ -4755,14 +4755,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" C string to Fortran test 2"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C string test 2"); goto error; @@ -4778,14 +4778,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) { + if (HDmemcmp(buf, "abcd abcd ", (size_t)20) != 0) { H5_FAILED(); HDputs(" C string to Fortran test 3"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C string test 3"); goto error; @@ -4809,14 +4809,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" C buffer to Fortran test 1"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C buffer test 1"); goto error; @@ -4828,14 +4828,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" C buffer to Fortran test 2"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C buffer test 2"); goto error; @@ -4851,14 +4851,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) { + if (HDmemcmp(buf, "abcd abcd ", (size_t)20) != 0) { H5_FAILED(); HDputs(" C buffer to Fortran test 3"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C buffer test 3"); goto error; @@ -7373,7 +7373,7 @@ test_named_indirect_reopen(hid_t fapl) TEST_ERROR if (NULL == (tag_ret = H5Tget_tag(type))) TEST_ERROR - if (HDstrcmp(tag, tag_ret)) + if (HDstrcmp(tag, tag_ret) != 0) TEST_ERROR H5free_memory(tag_ret); tag_ret = NULL; @@ -7389,7 +7389,7 @@ test_named_indirect_reopen(hid_t fapl) TEST_ERROR if (NULL == (tag_ret = H5Tget_tag(type))) TEST_ERROR - if (HDstrcmp(tag, tag_ret)) + if (HDstrcmp(tag, tag_ret) != 0) TEST_ERROR H5free_memory(tag_ret); tag_ret = NULL; diff --git a/test/earray.c b/test/earray.c index fc0b87e..bf7dcf3 100644 --- a/test/earray.c +++ b/test/earray.c @@ -332,52 +332,63 @@ check_stats(const H5EA_t *ea, const earray_state_t *state) /* Compare information */ if (earray_stats.stored.max_idx_set != state->max_idx_set) { - HDfprintf(stdout, "earray_stats.stored.max_idx_set = %Hu, state->max_idx_set = %Hu\n", + HDfprintf(stdout, + "earray_stats.stored.max_idx_set = %" PRIuHSIZE ", state->max_idx_set = %" PRIuHSIZE "\n", earray_stats.stored.max_idx_set, state->max_idx_set); TEST_ERROR } /* end if */ if (earray_stats.stored.nelmts != state->nelmts) { - HDfprintf(stdout, "earray_stats.stored.nelmts = %Hu, state->nelmts = %Hu\n", + HDfprintf(stdout, "earray_stats.stored.nelmts = %" PRIuHSIZE ", state->nelmts = %" PRIuHSIZE "\n", earray_stats.stored.nelmts, state->nelmts); TEST_ERROR } /* end if */ if (earray_stats.computed.hdr_size != state->hdr_size) { - HDfprintf(stdout, "earray_stats.computed.hdr_size = %Hu, state->hdr_size = %Hu\n", + HDfprintf(stdout, + "earray_stats.computed.hdr_size = %" PRIuHSIZE ", state->hdr_size = %" PRIuHSIZE "\n", earray_stats.computed.hdr_size, state->hdr_size); TEST_ERROR } /* end if */ if (earray_stats.computed.nindex_blks != state->nindex_blks) { - HDfprintf(stdout, "earray_stats.computed.nindex_blks = %Hu, state->nindex_blks = %Hu\n", + HDfprintf(stdout, + "earray_stats.computed.nindex_blks = %" PRIuHSIZE ", state->nindex_blks = %" PRIuHSIZE "\n", earray_stats.computed.nindex_blks, state->nindex_blks); TEST_ERROR } /* end if */ if (earray_stats.computed.index_blk_size != state->index_blk_size) { - HDfprintf(stdout, "earray_stats.computed.index_blk_size = %Hu, state->index_blk_size = %Hu\n", + HDfprintf(stdout, + "earray_stats.computed.index_blk_size = %" PRIuHSIZE ", state->index_blk_size = %" PRIuHSIZE + "\n", earray_stats.computed.index_blk_size, state->index_blk_size); TEST_ERROR } /* end if */ if (earray_stats.stored.ndata_blks != state->ndata_blks) { - HDfprintf(stdout, "earray_stats.stored.ndata_blks = %Hu, state->ndata_blks = %Hu\n", + HDfprintf(stdout, + "earray_stats.stored.ndata_blks = %" PRIuHSIZE ", state->ndata_blks = %" PRIuHSIZE "\n", earray_stats.stored.ndata_blks, state->ndata_blks); TEST_ERROR } /* end if */ /* Don't compare this currently, it's very hard to compute */ #ifdef NOT_YET if (earray_stats.stored.data_blk_size != state->data_blk_size) { - HDfprintf(stdout, "earray_stats.stored.data_blk_size = %Hu, state->data_blk_size = %Hu\n", + HDfprintf(stdout, + "earray_stats.stored.data_blk_size = %" PRIuHSIZE ", state->data_blk_size = %" PRIuHSIZE + "\n", earray_stats.stored.data_blk_size, state->data_blk_size); TEST_ERROR } /* end if */ #endif /* NOT_YET */ if (earray_stats.stored.nsuper_blks != state->nsuper_blks) { - HDfprintf(stdout, "earray_stats.stored.nsuper_blks = %Hu, state->nsuper_blks = %Hu\n", + HDfprintf(stdout, + "earray_stats.stored.nsuper_blks = %" PRIuHSIZE ", state->nsuper_blks = %" PRIuHSIZE "\n", earray_stats.stored.nsuper_blks, state->nsuper_blks); TEST_ERROR } /* end if */ /* Don't compare this currently, it's very hard to compute */ #ifdef NOT_YET if (earray_stats.stored.super_blk_size != state->super_blk_size) { - HDfprintf(stdout, "earray_stats.stored.super_blk_size = %Hu, state->super_blk_size = %Hu\n", + HDfprintf(stdout, + "earray_stats.stored.super_blk_size = %" PRIuHSIZE ", state->super_blk_size = %" PRIuHSIZE + "\n", earray_stats.stored.super_blk_size, state->super_blk_size); TEST_ERROR } /* end if */ diff --git a/test/farray.c b/test/farray.c index 81f839f..bb5e3fc 100644 --- a/test/farray.c +++ b/test/farray.c @@ -178,20 +178,20 @@ check_stats(const H5FA_t *fa, const farray_state_t *state) /* Compare information */ if (farray_stats.hdr_size != state->hdr_size) { - HDfprintf(stdout, "farray_stats.hdr_size = %Hu, state->hdr_size = %Hu\n", farray_stats.hdr_size, - state->hdr_size); + HDfprintf(stdout, "farray_stats.hdr_size = %" PRIuHSIZE ", state->hdr_size = %" PRIuHSIZE "\n", + farray_stats.hdr_size, state->hdr_size); TEST_ERROR } if (farray_stats.dblk_size != state->dblk_size) { - HDfprintf(stdout, "farray_stats.dblk_size = %Hu, state->dblk_size = %Hu\n", farray_stats.dblk_size, - state->dblk_size); + HDfprintf(stdout, "farray_stats.dblk_size = %" PRIuHSIZE ", state->dblk_size = %" PRIuHSIZE "\n", + farray_stats.dblk_size, state->dblk_size); TEST_ERROR } if (farray_stats.nelmts != state->nelmts) { - HDfprintf(stdout, "farray_stats.nelmts = %Hu, state->nelmts = %Hu\n", farray_stats.nelmts, - state->nelmts); + HDfprintf(stdout, "farray_stats.nelmts = %" PRIuHSIZE ", state->nelmts = %" PRIuHSIZE "\n", + farray_stats.nelmts, state->nelmts); TEST_ERROR } diff --git a/test/fheap.c b/test/fheap.c index e8cde89..cb9c080 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -69,20 +69,22 @@ /* #define ALL_INSERT_TESTS */ /* Heap metadata macros */ -#define MAX_HEAP_ID_LEN 64 /* Max. # of bytes to use for heap ID */ -#define HEAP_ID_LEN 7 /* # of bytes to use for heap ID */ -#define SMALL_HEAP_ID_LEN 7 /* # of bytes to use for "small" heap's IDs */ -#define LARGE_HEAP_ID_LEN 12 /* # of bytes to use for "large" heap's IDs */ -#define HEAP_MAX_ROOT_ROWS(fh) H5HF_get_max_root_rows(fh) /* Max. # of rows in root indirect block */ -#define DTABLE_WIDTH(fh) H5HF_get_dtable_width_test(fh) /* Width of doubling table for heap */ -#define DTABLE_MAX_DROWS(fh) \ - H5HF_get_dtable_max_drows_test(fh) /* Max. # of direct block rows in any indirect block */ -#define IBLOCK_MAX_DROWS(fh, pos) \ - H5HF_get_iblock_max_drows_test(fh, pos) /* Max. # of direct block rows in a indirect block */ -#define DBLOCK_SIZE(fh, r) H5HF_get_dblock_size_test(fh, r) /* Size of a direct block in a given row */ -#define DBLOCK_FREE(fh, r) \ - H5HF_get_dblock_free_test(fh, r) /* Free space in a direct block of a given row \ - */ +#define MAX_HEAP_ID_LEN 64 /* Max. # of bytes to use for heap ID */ +#define HEAP_ID_LEN 7 /* # of bytes to use for heap ID */ +#define SMALL_HEAP_ID_LEN 7 /* # of bytes to use for "small" heap's IDs */ +#define LARGE_HEAP_ID_LEN 12 /* # of bytes to use for "large" heap's IDs */ +/* Max. # of rows in root indirect block */ +#define HEAP_MAX_ROOT_ROWS(fh) H5HF_get_max_root_rows(fh) +/* Width of doubling table for heap */ +#define DTABLE_WIDTH(fh) H5HF_get_dtable_width_test(fh) +/* Max. # of direct block rows in any indirect block */ +#define DTABLE_MAX_DROWS(fh) H5HF_get_dtable_max_drows_test(fh) +/* Max. # of direct block rows in a indirect block */ +#define IBLOCK_MAX_DROWS(fh, pos) H5HF_get_iblock_max_drows_test(fh, pos) +/* Size of a direct block in a given row */ +#define DBLOCK_SIZE(fh, r) H5HF_get_dblock_size_test(fh, r) +/* Free space in a direct block of a given row */ +#define DBLOCK_FREE(fh, r) H5HF_get_dblock_free_test(fh, r) /* The number of settings for testing: page buffering, file space strategy and persisting free-space */ #define NUM_PB_FS 6 @@ -176,16 +178,16 @@ static int del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_hea fheap_heap_ids_t *keep_ids); /*------------------------------------------------------------------------- - * Function: init_small_cparam + * Function: init_small_cparam * - * Purpose: Initialize heap creation parameter structure with small + * Purpose: Initialize heap creation parameter structure with small * settings * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -212,16 +214,16 @@ init_small_cparam(H5HF_create_t *cparam) } /* init_small_cparam() */ /*------------------------------------------------------------------------- - * Function: init_large_cparam + * Function: init_large_cparam * - * Purpose: Initialize heap creation parameter structure with large + * Purpose: Initialize heap creation parameter structure with large * settings * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -248,15 +250,15 @@ init_large_cparam(H5HF_create_t *cparam) } /* init_large_cparam() */ /*------------------------------------------------------------------------- - * Function: check_stats + * Function: check_stats * - * Purpose: Verify stats for a heap + * Purpose: Verify stats for a heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 6, 2006 * *------------------------------------------------------------------------- @@ -270,43 +272,45 @@ check_stats(const H5HF_t *fh, const fheap_heap_state_t *state) if (H5HF_stat_info(fh, &heap_stats) < 0) FAIL_STACK_ERROR if (heap_stats.man_nobjs != state->man_nobjs) { - HDfprintf(stdout, "heap_stats.man_nobjs = %Hu, state->man_nobjs = %Zu\n", heap_stats.man_nobjs, - state->man_nobjs); + HDfprintf(stdout, "heap_stats.man_nobjs = %" PRIuHSIZE ", state->man_nobjs = %zu\n", + heap_stats.man_nobjs, state->man_nobjs); TEST_ERROR } /* end if */ if (heap_stats.man_size != state->man_size) { - HDfprintf(stdout, "heap_stats.man_size = %Hu, state->man_size = %Hu\n", heap_stats.man_size, - state->man_size); + HDfprintf(stdout, "heap_stats.man_size = %" PRIuHSIZE ", state->man_size = %" PRIuHSIZE "\n", + heap_stats.man_size, state->man_size); TEST_ERROR } /* end if */ if (heap_stats.man_alloc_size != state->man_alloc_size) { - HDfprintf(stdout, "heap_stats.man_alloc_size = %Hu, state->man_alloc_size = %Hu\n", + HDfprintf(stdout, + "heap_stats.man_alloc_size = %" PRIuHSIZE ", state->man_alloc_size = %" PRIuHSIZE "\n", heap_stats.man_alloc_size, state->man_alloc_size); TEST_ERROR } /* end if */ if (heap_stats.man_free_space != state->man_free_space) { - HDfprintf(stdout, "heap_stats.man_free_space = %Hu, state->man_free_space = %Hu\n", + HDfprintf(stdout, + "heap_stats.man_free_space = %" PRIuHSIZE ", state->man_free_space = %" PRIuHSIZE "\n", heap_stats.man_free_space, state->man_free_space); TEST_ERROR } /* end if */ if (heap_stats.huge_nobjs != state->huge_nobjs) { - HDfprintf(stdout, "heap_stats.huge_nobjs = %Hu, state->huge_nobjs = %Zu\n", heap_stats.huge_nobjs, - state->huge_nobjs); + HDfprintf(stdout, "heap_stats.huge_nobjs = %" PRIuHSIZE ", state->huge_nobjs = %zu\n", + heap_stats.huge_nobjs, state->huge_nobjs); TEST_ERROR } /* end if */ if (heap_stats.huge_size != state->huge_size) { - HDfprintf(stdout, "heap_stats.huge_size = %Hu, state->huge_size = %Hu\n", heap_stats.huge_size, - state->huge_size); + HDfprintf(stdout, "heap_stats.huge_size = %" PRIuHSIZE ", state->huge_size = %" PRIuHSIZE "\n", + heap_stats.huge_size, state->huge_size); TEST_ERROR } /* end if */ if (heap_stats.tiny_nobjs != state->tiny_nobjs) { - HDfprintf(stdout, "heap_stats.tiny_nobjs = %Hu, state->tiny_nobjs = %Zu\n", heap_stats.tiny_nobjs, - state->tiny_nobjs); + HDfprintf(stdout, "heap_stats.tiny_nobjs = %" PRIuHSIZE ", state->tiny_nobjs = %zu\n", + heap_stats.tiny_nobjs, state->tiny_nobjs); TEST_ERROR } /* end if */ if (heap_stats.tiny_size != state->tiny_size) { - HDfprintf(stdout, "heap_stats.tiny_size = %Hu, state->tiny_size = %Hu\n", heap_stats.tiny_size, - state->tiny_size); + HDfprintf(stdout, "heap_stats.tiny_size = %" PRIuHSIZE ", state->tiny_size = %" PRIuHSIZE "\n", + heap_stats.tiny_size, state->tiny_size); TEST_ERROR } /* end if */ @@ -318,15 +322,15 @@ error: } /* check_stats() */ /*------------------------------------------------------------------------- - * Function: op_memcpy + * Function: op_memcpy * - * Purpose: Perform 'memcpy' for an object + * Purpose: Perform 'memcpy' for an object * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, September 11, 2006 * *------------------------------------------------------------------------- @@ -341,9 +345,9 @@ op_memcpy(const void *obj, size_t obj_len, void *op_data) } /* op_memcpy() */ /*------------------------------------------------------------------------- - * Function: add_obj + * Function: add_obj * - * Purpose: Add an object to heap + * Purpose: Add an object to heap * * Note: The following fields in the 'state' structure are set to * the values expected _after_ any block created for the object: @@ -355,11 +359,11 @@ op_memcpy(const void *obj, size_t obj_len, void *op_data) * the current state, before any block has been created: * nobjs * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -420,7 +424,7 @@ add_obj(H5HF_t *fh, size_t obj_off, size_t obj_size, fheap_heap_state_t *state, TEST_ERROR if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(obj, shared_robj_g, obj_size)) + if (HDmemcmp(obj, shared_robj_g, obj_size) != 0) TEST_ERROR /* If the heap IDs are to be retained, append them to the list */ @@ -463,15 +467,15 @@ error: } /* add_obj() */ /*------------------------------------------------------------------------- - * Function: get_del_string + * Function: get_del_string * - * Purpose: Return string describing the kind of deletion to perform + * Purpose: Return string describing the kind of deletion to perform * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 6, 2006 * *------------------------------------------------------------------------- @@ -499,14 +503,14 @@ get_del_string(const fheap_test_param_t *tparam) } /* get_del_string() */ /*------------------------------------------------------------------------- - * Function: get_fill_size + * Function: get_fill_size * - * Purpose: Retrieve the size of objects to "bulk" fill blocks with + * Purpose: Retrieve the size of objects to "bulk" fill blocks with * - * Return: Size of object to pass down to "fill_heap" routine on + * Return: Size of object to pass down to "fill_heap" routine on * success/can't fail * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 27, 2006 * *------------------------------------------------------------------------- @@ -530,15 +534,15 @@ get_fill_size(const fheap_test_param_t *tparam) } /* get_fill_size() */ /*------------------------------------------------------------------------- - * Function: begin_test + * Function: begin_test * - * Purpose: Perform common "test being" operations + * Purpose: Perform common "test being" operations * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 4, 2006 * *------------------------------------------------------------------------- @@ -561,8 +565,11 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t * */ del_str = get_del_string(tparam); HDassert(del_str); - TESTING(base_desc, del_str); + test_desc = (char *)H5MM_malloc(HDstrlen(del_str) + HDstrlen(base_desc)); + HDsprintf(test_desc, base_desc, del_str); + TESTING(test_desc); H5MM_xfree(del_str); + H5MM_xfree(test_desc); /* Initialize the heap ID structure */ HDmemset(keep_ids, 0, sizeof(fheap_heap_ids_t)); @@ -577,14 +584,14 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t * H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- - * Function: reopen_file + * Function: reopen_file * - * Purpose: Perform common "re-open" operations on file & heap for testing + * Purpose: Perform common "re-open" operations on file & heap for testing * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 18, 2006 * *------------------------------------------------------------------------- @@ -632,15 +639,15 @@ error: } /* end reopen_file() */ /*------------------------------------------------------------------------- - * Function: open_heap + * Function: open_heap * - * Purpose: Perform common "open" operations on file & heap for testing + * Purpose: Perform common "open" operations on file & heap for testing * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 4, 2006 * *------------------------------------------------------------------------- @@ -743,15 +750,15 @@ error: } /* end open_heap() */ /*------------------------------------------------------------------------- - * Function: reopen_heap + * Function: reopen_heap * - * Purpose: Perform common "re-open" operations on heap for testing + * Purpose: Perform common "re-open" operations on heap for testing * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 4, 2006 * *------------------------------------------------------------------------- @@ -779,14 +786,14 @@ error: } /* end reopen_heap() */ /*------------------------------------------------------------------------- - * Function: close_heap + * Function: close_heap * - * Purpose: Perform common "close" operations on file & heap for testing + * Purpose: Perform common "close" operations on file & heap for testing * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 4, 2006 * *------------------------------------------------------------------------- @@ -844,15 +851,15 @@ error: } /* end close_heap() */ /*------------------------------------------------------------------------- - * Function: del_objs_half_refill + * Function: del_objs_half_refill * - * Purpose: Remove half of objects from heap and refill + * Purpose: Remove half of objects from heap and refill * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 6, 2006 * *------------------------------------------------------------------------- @@ -936,15 +943,15 @@ error: } /* del_objs_half_refill() */ /*------------------------------------------------------------------------- - * Function: del_objs + * Function: del_objs * - * Purpose: Remove objects from heap + * Purpose: Remove objects from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 6, 2006 * *------------------------------------------------------------------------- @@ -1017,9 +1024,9 @@ error: } /* del_objs() */ /*------------------------------------------------------------------------- - * Function: fill_heap + * Function: fill_heap * - * Purpose: Insert (small) objects to fill up the free space in a heap block + * Purpose: Insert (small) objects to fill up the free space in a heap block * * Note: The following fields in the 'state' structure are set to * the values expected _after_ the block has been created: @@ -1031,11 +1038,11 @@ error: * the current state, before the block has been created: * nobjs * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 7, 2006 * *------------------------------------------------------------------------- @@ -1185,7 +1192,7 @@ fill_heap(H5HF_t *fh, unsigned block_row, size_t obj_size, fheap_heap_state_t *s /* Check that object is correct */ wobj = &shared_wobj_g[*curr_off_ptr]; - if (HDmemcmp(wobj, shared_robj_g, *curr_len_ptr)) + if (HDmemcmp(wobj, shared_robj_g, *curr_len_ptr) != 0) TEST_ERROR /* Adjust object & ID pointers */ @@ -1227,15 +1234,15 @@ error: } /* fill_heap() */ /*------------------------------------------------------------------------- - * Function: fill_root_row + * Function: fill_root_row * - * Purpose: Fill up a row of direct blocks in the root indirect block + * Purpose: Fill up a row of direct blocks in the root indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1323,15 +1330,15 @@ error: } /* fill_root_row() */ /*------------------------------------------------------------------------- - * Function: fill_partial row + * Function: fill_partial row * - * Purpose: Fill up part of a row of direct blocks in an non-root indirect block + * Purpose: Fill up part of a row of direct blocks in an non-root indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 11, 2006 * *------------------------------------------------------------------------- @@ -1368,15 +1375,15 @@ error: } /* fill_partial_row() */ /*------------------------------------------------------------------------- - * Function: fill_row + * Function: fill_row * - * Purpose: Fill up entire row of direct blocks in an non-root indirect block + * Purpose: Fill up entire row of direct blocks in an non-root indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1400,18 +1407,18 @@ error: } /* fill_row() */ /*------------------------------------------------------------------------- - * Function: fill_root_direct + * Function: fill_root_direct * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in the root indirect block * (Generally used to create & fill up direct blocks in a new * indirect block) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 3, 2006 * *------------------------------------------------------------------------- @@ -1439,17 +1446,17 @@ error: } /* fill_root_direct() */ /*------------------------------------------------------------------------- - * Function: fill_2nd_indirect + * Function: fill_2nd_indirect * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a second-level indirect block (which only has * direct blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1478,16 +1485,16 @@ error: } /* fill_2nd_direct() */ /*------------------------------------------------------------------------- - * Function: fill_all_direct + * Function: fill_all_direct * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks up to the maximum direct block size * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1515,17 +1522,17 @@ error: } /* fill_all_direct() */ /*------------------------------------------------------------------------- - * Function: fill_2nd_indirect_row + * Function: fill_2nd_indirect_row * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a row of second-level indirect block (which only * have direct blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1553,17 +1560,17 @@ error: } /* fill_2nd_direct_row() */ /*------------------------------------------------------------------------- - * Function: fill_all_2nd_indirect_rows + * Function: fill_all_2nd_indirect_rows * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in all rows of second-level indirect blocks (which only * have direct blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1590,17 +1597,17 @@ error: } /* fill_2nd_direct_row() */ /*------------------------------------------------------------------------- - * Function: fill_3rd_indirect + * Function: fill_3rd_indirect * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a third-level indirect block (which * has one more level of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 18, 2006 * *------------------------------------------------------------------------- @@ -1628,17 +1635,17 @@ error: } /* fill_3rd_indirect() */ /*------------------------------------------------------------------------- - * Function: fill_3rd_indirect_row + * Function: fill_3rd_indirect_row * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a row of third-level indirect block (which * have one more level of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1667,17 +1674,17 @@ error: } /* fill_3rd_direct_row() */ /*------------------------------------------------------------------------- - * Function: fill_all_3rd_indirect_rows + * Function: fill_all_3rd_indirect_rows * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in all rows of third-level indirect blocks (which * have one more level of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1705,17 +1712,17 @@ error: } /* fill_all_3rd_direct_rows() */ /*------------------------------------------------------------------------- - * Function: fill_4th_indirect_row + * Function: fill_4th_indirect_row * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a row of fourth-level indirect blocks (which * have two more levels of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1754,17 +1761,17 @@ error: } /* fill_4th_direct_row() */ /*------------------------------------------------------------------------- - * Function: fill_all_4th_indirect_rows + * Function: fill_all_4th_indirect_rows * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in all rows of fourth-level indirect blocks (which * have two more levels of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1810,14 +1817,14 @@ error: } /* fill_all_4th_direct_rows() */ /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Create fractal heap + * Purpose: Create fractal heap * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 24, 2006 * *------------------------------------------------------------------------- @@ -1929,14 +1936,14 @@ error: } /* test_create() */ /*------------------------------------------------------------------------- - * Function: test_reopen + * Function: test_reopen * - * Purpose: Create & reopen a fractal heap + * Purpose: Create & reopen a fractal heap * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 18, 2006 * *------------------------------------------------------------------------- @@ -2082,14 +2089,14 @@ error: } /* test_reopen() */ /*------------------------------------------------------------------------- - * Function: test_open_twice + * Function: test_open_twice * - * Purpose: Open a fractal heap twice + * Purpose: Open a fractal heap twice * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 18, 2006 * *------------------------------------------------------------------------- @@ -2260,14 +2267,14 @@ error: } /* test_open_twice() */ /*------------------------------------------------------------------------- - * Function: test_delete_open + * Function: test_delete_open * - * Purpose: Delete opened fractal heap (& open deleted heap) + * Purpose: Delete opened fractal heap (& open deleted heap) * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 5, 2007 * *------------------------------------------------------------------------- @@ -2438,14 +2445,14 @@ error: } /* test_delete_open() */ /*------------------------------------------------------------------------- - * Function: test_id_limits + * Function: test_id_limits * - * Purpose: Test limits for heap ID lengths + * Purpose: Test limits for heap ID lengths * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -2776,14 +2783,14 @@ error: } /* test_id_limits() */ /*------------------------------------------------------------------------- - * Function: test_filtered_create + * Function: test_filtered_create * - * Purpose: Test creating a heap with I/O filters + * Purpose: Test creating a heap with I/O filters * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -2898,14 +2905,14 @@ error: } /* test_filtered_create() */ /*------------------------------------------------------------------------- - * Function: test_size + * Function: test_size * - * Purpose: Test querying heap size + * Purpose: Test querying heap size * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, August 14, 2007 * *------------------------------------------------------------------------- @@ -3171,17 +3178,15 @@ error: return (1); } /* test_reopen_hdr() */ -#ifndef QAK2 - /*------------------------------------------------------------------------- - * Function: test_man_insert_weird + * Function: test_man_insert_weird * - * Purpose: Test inserting "weird" sized objects into absolute heap + * Purpose: Test inserting "weird" sized objects into absolute heap * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 18, 2006 * *------------------------------------------------------------------------- @@ -3288,15 +3293,15 @@ error: #ifdef ALL_INSERT_TESTS /*------------------------------------------------------------------------- - * Function: test_man_insert_first + * Function: test_man_insert_first * - * Purpose: Test inserting first object into absolute heap + * Purpose: Test inserting first object into absolute heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 24, 2006 * *------------------------------------------------------------------------- @@ -3389,15 +3394,15 @@ error: } /* test_man_insert_first() */ /*------------------------------------------------------------------------- - * Function: test_man_insert_second + * Function: test_man_insert_second * - * Purpose: Test inserting two objects into absolute heap + * Purpose: Test inserting two objects into absolute heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 6, 2006 * *------------------------------------------------------------------------- @@ -3484,16 +3489,16 @@ error: } /* test_man_insert_second() */ /*------------------------------------------------------------------------- - * Function: test_man_insert_root_mult + * Function: test_man_insert_root_mult * - * Purpose: Test inserting mult. objects into absolute heap, up to the + * Purpose: Test inserting mult. objects into absolute heap, up to the * limit of a root direct block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 6, 2006 * *------------------------------------------------------------------------- @@ -3582,17 +3587,17 @@ error: } /* test_man_insert_root_mult() */ /*------------------------------------------------------------------------- - * Function: test_man_insert_force_indirect + * Function: test_man_insert_force_indirect * - * Purpose: Test inserting mult. objects into absolute heap, filling the + * Purpose: Test inserting mult. objects into absolute heap, filling the * root direct block and forcing the root block to be converted * into an indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 6, 2006 * *------------------------------------------------------------------------- @@ -3688,17 +3693,17 @@ error: } /* test_man_insert_force_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_insert_fill_second + * Function: test_man_insert_fill_second * - * Purpose: Test inserting mult. objects into absolute heap, filling the + * Purpose: Test inserting mult. objects into absolute heap, filling the * root direct block, forcing the root block to be converted * into an indirect block and filling the secnod indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 7, 2006 * *------------------------------------------------------------------------- @@ -3794,18 +3799,18 @@ error: } /* test_man_insert_fill_second() */ /*------------------------------------------------------------------------- - * Function: test_man_insert_third_direct + * Function: test_man_insert_third_direct * - * Purpose: Test inserting mult. objects into absolute heap, filling the + * Purpose: Test inserting mult. objects into absolute heap, filling the * root direct block, forcing the root block to be converted * into an indirect block, filling the secnod indirect block and * creating a third direct block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 7, 2006 * *------------------------------------------------------------------------- @@ -3906,17 +3911,17 @@ error: } /* test_man_insert_third_direct() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_first_row + * Function: test_man_fill_first_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first row of root indirect * block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 13, 2006 * *------------------------------------------------------------------------- @@ -4002,17 +4007,17 @@ error: } /* test_man_fill_first_row() */ /*------------------------------------------------------------------------- - * Function: test_man_start_second_row + * Function: test_man_start_second_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first row of root indirect * block, then add another object to start second row. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 14, 2006 * *------------------------------------------------------------------------- @@ -4105,17 +4110,17 @@ error: } /* test_man_start_second_row() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_second_row + * Function: test_man_fill_second_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first row of root indirect * block, then fill the second row also. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 14, 2006 * *------------------------------------------------------------------------- @@ -4205,18 +4210,18 @@ error: } /* test_man_fill_second_row() */ /*------------------------------------------------------------------------- - * Function: test_man_start_third_row + * Function: test_man_start_third_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first row of root indirect * block, fill the second row also, then add another object to * start the third row. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * *------------------------------------------------------------------------- @@ -4316,17 +4321,17 @@ error: } /* test_man_start_third_row() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_fourth_row + * Function: test_man_fill_fourth_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first four rows of root indirect * block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * *------------------------------------------------------------------------- @@ -4414,17 +4419,17 @@ error: } /* test_man_fill_fourth_row() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_all_root_direct + * Function: test_man_fill_all_root_direct * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * *------------------------------------------------------------------------- @@ -4510,17 +4515,17 @@ error: } /* test_man_fill_all_root_direct() */ /*------------------------------------------------------------------------- - * Function: test_man_first_recursive_indirect + * Function: test_man_first_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block and create first recursive indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * *------------------------------------------------------------------------- @@ -4611,18 +4616,18 @@ error: } /* test_man_first_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_second_direct_recursive_indirect + * Function: test_man_second_direct_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block and start second * direct block in that indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -4721,18 +4726,18 @@ error: } /* test_man_second_direct_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_first_recursive_indirect + * Function: test_man_fill_first_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block and filling all * direct blocks in that indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -4823,19 +4828,19 @@ error: } /* test_man_fill_first_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_second_recursive_indirect + * Function: test_man_second_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block, filling all * direct blocks in that indirect block and adding another * object to force creation of second recursive indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -4933,20 +4938,20 @@ error: } /* test_man_second_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_second_recursive_indirect + * Function: test_man_fill_second_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block, filling all * direct blocks in that indirect block and then create second * recursive indirect block and fill all direct blocks in that * indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -5041,20 +5046,20 @@ error: } /* test_man_fill_second_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_recursive_indirect_row + * Function: test_man_fill_recursive_indirect_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block, filling all * direct blocks in that indirect block and then create second * recursive indirect block and fill all direct blocks in that * indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -5141,18 +5146,18 @@ error: } /* test_man_fill_recursive_indirect_row() */ /*------------------------------------------------------------------------- - * Function: test_man_start_2nd_recursive_indirect + * Function: test_man_start_2nd_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the first row of indirect * blocks and start on first block in second row of indirect blocks * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5250,18 +5255,18 @@ error: } /* test_man_start_2nd_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_recursive_indirect_two_deep + * Function: test_man_recursive_indirect_two_deep * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5352,19 +5357,19 @@ error: } /* test_man_recursive_indirect_two_deep() */ /*------------------------------------------------------------------------- - * Function: test_man_start_3rd_recursive_indirect + * Function: test_man_start_3rd_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep and start first direct block * in 3rd level of indirect blocks * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5462,19 +5467,19 @@ error: } /* test_man_start_3rd_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_first_3rd_recursive_indirect + * Function: test_man_fill_first_3rd_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep and fill first indirect block * in 3rd level of indirect blocks * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5573,19 +5578,19 @@ error: } /* test_man_fill_first_3rd_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_recursive_indirect_row + * Function: test_man_fill_3rd_recursive_indirect_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep and fill all indirect blocks * first row of 3rd level of indirect blocks * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5681,19 +5686,19 @@ error: } /* test_man_fill_3rd_recursive_indirect_row() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_all_3rd_recursive_indirect + * Function: test_man_fill_all_3rd_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep and fill all indirect blocks * that are three levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5789,20 +5794,20 @@ error: } /* test_man_fill_all_3rd_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_start_4th_recursive_indirect + * Function: test_man_start_4th_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks * that are three levels deep and start first direct block that * is four levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5904,20 +5909,20 @@ error: } /* test_man_start_4th_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_first_4th_recursive_indirect + * Function: test_man_fill_first_4th_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks * that are three levels deep and fill the first (3rd level) * indirect block that is four levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -6025,20 +6030,20 @@ error: } /* test_man_fill_first_4th_recursive_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_4th_recursive_indirect_row + * Function: test_man_fill_4th_recursive_indirect_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks * that are three levels deep and fill the first row of * indirect block that is four levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -6137,20 +6142,20 @@ error: } /* test_man_fill_4th_recursive_indirect_row() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_all_4th_recursive_indirect + * Function: test_man_fill_all_4th_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks * that are three levels deep and fill all rows of * indirect blocks that are four levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -6249,12 +6254,10 @@ error: } /* test_man_fill_all_4th_recursive_indirect() */ #endif /* ALL_INSERT_TESTS */ -#ifndef QAK - /*------------------------------------------------------------------------- - * Function: test_man_start_5th_recursive_indirect + * Function: test_man_start_5th_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks @@ -6262,11 +6265,11 @@ error: * that are four levels deep and start first direct block in * indirect blocks five levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -6383,20 +6386,17 @@ error: H5E_END_TRY; return (1); } /* test_man_start_5th_recursive_indirect() */ -#endif /* QAK */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_man_remove_bogus + * Function: test_man_remove_bogus * - * Purpose: Test removing bogus heap IDs + * Purpose: Test removing bogus heap IDs * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 15, 2006 * *------------------------------------------------------------------------- @@ -6462,10 +6462,10 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK - /* seed = (unsigned long)1155438845; */ - HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#if 0 +/* seed = (unsigned long)1155438845; */ +HDfprintf(stderr, "Random # seed was: %lu\n", seed); +#endif HDsrandom((unsigned)seed); /* Set heap ID to random (non-null) value */ @@ -6548,15 +6548,15 @@ error: } /* test_man_remove_bogus() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_one + * Function: test_man_remove_one * - * Purpose: Test removing single object from heap + * Purpose: Test removing single object from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 15, 2006 * *------------------------------------------------------------------------- @@ -6712,15 +6712,15 @@ error: } /* test_man_remove_one() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_two + * Function: test_man_remove_two * - * Purpose: Test removing two objects from heap + * Purpose: Test removing two objects from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 22, 2006 * *------------------------------------------------------------------------- @@ -6905,16 +6905,16 @@ error: } /* test_man_remove_two() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_one_larger + * Function: test_man_remove_one_larger * - * Purpose: Test removing single larger (but < standalone size) object + * Purpose: Test removing single larger (but < standalone size) object * from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 6, 2006 * *------------------------------------------------------------------------- @@ -7074,16 +7074,16 @@ error: } /* test_man_remove_one_larger() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_two_larger + * Function: test_man_remove_two_larger * - * Purpose: Test removing two larger (but < standalone size) objects + * Purpose: Test removing two larger (but < standalone size) objects * from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, June 10, 2006 * *------------------------------------------------------------------------- @@ -7293,11 +7293,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR - /* Verify the file is correct size */ -#ifdef QAK - HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ + /* Verify the file is correct size */ if (file_size != empty_size) TEST_ERROR @@ -7318,16 +7314,16 @@ error: } /* test_man_remove_two_larger() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_three_larger + * Function: test_man_remove_three_larger * - * Purpose: Test removing three larger (but < standalone size) objects + * Purpose: Test removing three larger (but < standalone size) objects * from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 12, 2006 * *------------------------------------------------------------------------- @@ -7597,11 +7593,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR - /* Verify the file is correct size */ -#ifdef QAK - HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ + /* Verify the file is correct size */ if (file_size != empty_size) TEST_ERROR @@ -7622,14 +7614,14 @@ error: } /* test_man_remove_three_larger() */ /*------------------------------------------------------------------------- - * Function: test_man_incr_insert_remove + * Function: test_man_incr_insert_remove * - * Purpose: Test incremental insert & removal of objects in heap + * Purpose: Test incremental insert & removal of objects in heap * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, April 1, 2012 * *------------------------------------------------------------------------- @@ -7748,21 +7740,18 @@ error: return 1; } /* test_man_incr_insert_remove() */ -#endif /* QAK */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_man_remove_root_direct + * Function: test_man_remove_root_direct * - * Purpose: Test filling and removing all objects from root direct block in + * Purpose: Test filling and removing all objects from root direct block in * heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 22, 2006 * *------------------------------------------------------------------------- @@ -7779,8 +7768,8 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "removing all objects from root direct block of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from root direct block of absolute heap %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -7826,16 +7815,16 @@ error: } /* test_man_remove_root_direct() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_two_direct + * Function: test_man_remove_two_direct * - * Purpose: Test filling and removing all objects from (first) two direct + * Purpose: Test filling and removing all objects from (first) two direct * blocks in heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 22, 2006 * *------------------------------------------------------------------------- @@ -7852,8 +7841,8 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "removing all objects from two direct blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from two direct blocks of absolute heap %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -7914,16 +7903,16 @@ error: } /* test_man_remove_two_direct() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_first_row + * Function: test_man_remove_first_row * - * Purpose: Test filling and removing all objects from first row of direct + * Purpose: Test filling and removing all objects from first row of direct * blocks in heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 5, 2006 * *------------------------------------------------------------------------- @@ -7940,8 +7929,8 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "removing all objects from first row of direct blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from first row of direct blocks of absolute heap %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -7984,16 +7973,16 @@ error: } /* test_man_remove_first_row() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_first_two_rows + * Function: test_man_remove_first_two_rows * - * Purpose: Test filling and removing all objects from first two rows of + * Purpose: Test filling and removing all objects from first two rows of * direct blocks in heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 12, 2006 * *------------------------------------------------------------------------- @@ -8010,9 +7999,8 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "removing all objects from first two rows of direct blocks of absolute heap %s"; /* Test description - */ + /* Test description */ + const char *base_desc = "removing all objects from first two rows of direct blocks of absolute heap %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8057,16 +8045,16 @@ error: } /* test_man_remove_first_two_rows() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_first_four_rows + * Function: test_man_remove_first_four_rows * - * Purpose: Test filling and removing all objects from first four rows of + * Purpose: Test filling and removing all objects from first four rows of * direct blocks in heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 13, 2006 * *------------------------------------------------------------------------- @@ -8083,9 +8071,8 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "removing all objects from first four rows of direct blocks of absolute heap %s"; /* Test description - */ + /* Test description */ + const char *base_desc = "removing all objects from first four rows of direct blocks of absolute heap %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8134,16 +8121,16 @@ error: } /* test_man_remove_first_four_rows() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_all_root_direct + * Function: test_man_remove_all_root_direct * - * Purpose: Test filling and removing all objects from all direct blocks + * Purpose: Test filling and removing all objects from all direct blocks * in root indirect block of heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 13, 2006 * *------------------------------------------------------------------------- @@ -8160,9 +8147,8 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "removing all objects from all direct blocks of root group in absolute heap %s"; /* Test description - */ + /* Test description */ + const char *base_desc = "removing all objects from all direct blocks of root group in absolute heap %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8205,16 +8191,16 @@ error: } /* test_man_remove_all_root_direct() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_2nd_indirect + * Function: test_man_remove_2nd_indirect * - * Purpose: Test filling and removing all objects up to 2nd level indirect + * Purpose: Test filling and removing all objects up to 2nd level indirect * blocks of heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 13, 2006 * *------------------------------------------------------------------------- @@ -8231,8 +8217,8 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "removing all objects from 2nd level indirect blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from 2nd level indirect blocks of absolute heap %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8279,16 +8265,16 @@ error: } /* test_man_remove_2nd_indirect() */ /*------------------------------------------------------------------------- - * Function: test_man_remove_3rd_indirect + * Function: test_man_remove_3rd_indirect * - * Purpose: Test filling and removing all objects up to 3rd level indirect + * Purpose: Test filling and removing all objects up to 3rd level indirect * blocks of heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, July 24, 2006 * *------------------------------------------------------------------------- @@ -8305,8 +8291,8 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "removing all objects from 3rd level indirect blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from 3rd level indirect blocks of absolute heap %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8355,24 +8341,21 @@ error: H5E_END_TRY; return (1); } /* test_man_remove_3rd_indirect() */ -#endif /* QAK */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_man_skip_start_block + * Function: test_man_skip_start_block * - * Purpose: Test inserting object into absolute heap which is too large + * Purpose: Test inserting object into absolute heap which is too large * for starting block size, which forces root indirect block * creation * * Then, remove all the objects, in various ways * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -8389,9 +8372,9 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "inserting object that is too large for starting block, then remove all objects %s"; /* Test - description */ + /* Test description */ + const char *base_desc = + "inserting object that is too large for starting block, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -8441,17 +8424,17 @@ error: } /* test_man_skip_start_block() */ /*------------------------------------------------------------------------- - * Function: test_man_skip_start_block_add_back + * Function: test_man_skip_start_block_add_back * - * Purpose: Test inserting object into absolute heap which is too large + * Purpose: Test inserting object into absolute heap which is too large * for starting block size, which forces root indirect block * creation, then add object which fits in skipped direct block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 28, 2006 * *------------------------------------------------------------------------- @@ -8468,10 +8451,9 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "skipping starting block, then adding object back to first block, then remove " - "all objects %s"; /* Test - description - */ + /* Test description */ + const char *base_desc = + "skipping starting block, then adding object back to first block, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -8540,18 +8522,18 @@ error: } /* test_man_skip_start_block_add_back() */ /*------------------------------------------------------------------------- - * Function: test_man_skip_start_block_add_skipped + * Function: test_man_skip_start_block_add_skipped * - * Purpose: Test inserting object into absolute heap which is too large + * Purpose: Test inserting object into absolute heap which is too large * for starting block size, which forces root indirect block * creation, then add objects to fill skipped direct blocks * and add another object to start on next "normal" block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 28, 2006 * *------------------------------------------------------------------------- @@ -8569,8 +8551,9 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "skipping starting block, then adding objects to backfill and extend, then " - "remove all objects %s"; /* Test description */ + /* Test description */ + const char *base_desc = + "skipping starting block, then adding objects to backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8649,18 +8632,18 @@ error: } /* test_man_skip_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_skip_2nd_block + * Function: test_man_skip_2nd_block * - * Purpose: Test inserting object into absolute heap which is small + * Purpose: Test inserting object into absolute heap which is small * enough for starting block size, then add object too large * for any blocks in first row of direct blocks, to force * early creation of indirect block (and range of skipped blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 1, 2006 * *------------------------------------------------------------------------- @@ -8677,8 +8660,9 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ + /* Test description */ const char *base_desc = "insert object to initial block, then add object too large for starting direct " - "blocks, then remove all objects %s"; /* Test description */ + "blocks, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -8742,9 +8726,9 @@ error: } /* test_man_skip_2nd_block() */ /*------------------------------------------------------------------------- - * Function: test_man_skip_2nd_block_add_skipped + * Function: test_man_skip_2nd_block_add_skipped * - * Purpose: Test inserting object into absolute heap which is small + * Purpose: Test inserting object into absolute heap which is small * enough for starting block size, then add object too large * for any blocks in first row of direct blocks, to force * early creation of indirect block (and range of skipped blocks). @@ -8752,11 +8736,11 @@ error: * block and all the skipped blocks, and one more object (to * start next "normal" block). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 1, 2006 * *------------------------------------------------------------------------- @@ -8774,10 +8758,10 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "insert object to initial block, then add object too large for starting direct blocks, then backfill " - "and extend, then remove all objects %s"; /* Test description */ - unsigned v; /* Local index variables */ + unsigned v; /* Local index variables */ + /* Test description */ + const char *base_desc = "insert object to initial block, then add object too large for starting direct " + "blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8885,9 +8869,9 @@ error: } /* test_man_skip_2nd_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_one_partial_skip_2nd_block_add_skipped + * Function: test_man_fill_one_partial_skip_2nd_block_add_skipped * - * Purpose: Test filling initial direct block, then add object small enough + * Purpose: Test filling initial direct block, then add object small enough * for initial block size (to create root indirect block), then * add object too large for any blocks in first three rows of * direct blocks, to force extension of indirect block (and range @@ -8897,11 +8881,11 @@ error: * block and all the skipped blocks, and one more object (to * start next "normal" block). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 3, 2006 * *------------------------------------------------------------------------- @@ -8920,11 +8904,10 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "skipping blocks with indirect root, then backfill and extend, then remove all " - "objects %s"; /* Test - description - */ - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ + /* Test description */ + const char *base_desc = + "skipping blocks with indirect root, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9054,9 +9037,9 @@ error: } /* test_man_fill_one_partial_skip_2nd_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_row_skip_add_skipped + * Function: test_man_fill_row_skip_add_skipped * - * Purpose: Test filling first row of direct blocks, then + * Purpose: Test filling first row of direct blocks, then * add object too large for any blocks in first three rows of * direct blocks, to force extension of indirect block (and range * of skipped blocks). @@ -9065,11 +9048,11 @@ error: * block and all the skipped blocks, and one more object (to * start next "normal" block). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 15, 2006 * *------------------------------------------------------------------------- @@ -9087,10 +9070,9 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling first row, then skipping rows, then backfill and extend, then remove " - "all objects %s"; /* Test - description - */ + /* Test description */ + const char *base_desc = + "filling first row, then skipping rows, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9185,19 +9167,19 @@ error: } /* test_man_fill_row_skip_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_skip_direct_skip_indirect_two_rows_add_skipped + * Function: test_man_skip_direct_skip_indirect_two_rows_add_skipped * - * Purpose: Test adding object too large for all but the last row in the + * Purpose: Test adding object too large for all but the last row in the * direct blocks in root indirect block, then * add object too large for initial block in first two rows of * indirect blocks, to force extension of non-root * indirect block (and range of skipped blocks). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 15, 2006 * *------------------------------------------------------------------------- @@ -9217,10 +9199,10 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "skipping direct blocks to last row and skipping two rows of root indirect block, then backfill and " - "extend, then remove all objects %s"; /* Test description */ - unsigned v; /* Local index variables */ + unsigned v; /* Local index variables */ + /* Test description */ + const char *base_desc = "skipping direct blocks to last row and skipping two rows of root indirect " + "block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -9314,18 +9296,18 @@ error: } /* test_man_skip_direct_skip_indirect_two_rows_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_indirect_start_block_add_skipped + * Function: test_man_fill_direct_skip_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for initial block in first row of direct * blocks in indirect block, to force extension of non-root * indirect block (and range of skipped blocks). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 3, 2006 * *------------------------------------------------------------------------- @@ -9344,8 +9326,9 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ + /* Test description */ const char *base_desc = "filling direct blocks and skipping blocks in non-root indirect block, then " - "backfill and extend, then remove all objects %s"; /* Test description */ + "backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9437,19 +9420,19 @@ error: } /* test_man_fill_direct_skip_indirect_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped + * Function: test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for all direct blocks in first row of * indirect blocks, to force skipping a row of indirect blocks * (and range of skipped blocks), then backfill all direct blocks * skipped and extend to next "normal" direct block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 3, 2006 * *------------------------------------------------------------------------- @@ -9464,16 +9447,17 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ - unsigned row; /* Current row in indirect block */ - h5_stat_size_t empty_size; /* Size of a file with an empty heap */ - size_t obj_size; /* Size of object */ - size_t fill_size; /* Size of objects for "bulk" filled blocks */ - fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then " - "backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u; /* Local index variable */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the */ + /* first indirect blocks */ + unsigned row; /* Current row in indirect block */ + h5_stat_size_t empty_size; /* Size of a file with an empty heap */ + size_t obj_size; /* Size of object */ + size_t fill_size; /* Size of objects for "bulk" filled blocks */ + fheap_heap_state_t state; /* State of fractal heap */ + unsigned u; /* Local index variable */ + /* Test description */ + const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then " + "backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9567,20 +9551,20 @@ error: } /* test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped + * Function: test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, except the last * one, then insert object insert object that is too large to * hold in row of 2nd level indirect blocks (forcing the use of * the next row of 2nd level blocks), then backfill all skipped * direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 18, 2006 * *------------------------------------------------------------------------- @@ -9601,13 +9585,11 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, except last one, and " - "insert object too " - "large for 2nd level indirect blocks, then backfill and extend, then remove all " - "objects %s"; /* Test - description - */ - unsigned u; /* Local index variables */ + unsigned u; /* Local index variables */ + /* Test description */ + const char *base_desc = + "filling direct blocks, filling 2nd level indirect blocks, except last one, and insert object too " + "large for 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9643,9 +9625,6 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9715,9 +9694,9 @@ error: } /* test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped + * Function: test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for all direct blocks in first row of * indirect blocks, to force skipping a row of indirect blocks * (and range of skipped blocks), then add object that is too @@ -9727,11 +9706,11 @@ error: * too large for initial block size in skipped indirect block * row's direct blocks). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -9753,10 +9732,10 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "filling direct blocks and skipping row of non-root indirect blocks, then skip row of direct blocks, " - "then backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ + /* Test description */ + const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then skip " + "row of direct blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9782,9 +9761,6 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9804,9 +9780,6 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 /* Insert object too large for initial block size in skipped indirect blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, 4); if (add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9817,9 +9790,6 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 /* Insert object to fill space in (medium) block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 4) - obj_size; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9892,18 +9862,18 @@ error: } /* test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_indirect_two_rows_add_skipped + * Function: test_man_fill_direct_skip_indirect_two_rows_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for initial block in first two rows of * indirect blocks, to force extension of non-root * indirect block (and range of skipped blocks). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 15, 2006 * *------------------------------------------------------------------------- @@ -9925,9 +9895,10 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = "filling direct blocks and skipping two rows of root indirect block, then " - "backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, then " + "backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10045,20 +10016,20 @@ error: } /* test_man_fill_direct_skip_indirect_two_rows_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped + * Function: test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for initial block in first two rows of * indirect blocks, to force extension of non-root * indirect block, then add object too large for first row of * indirect blocks, (and ranges of skipped blocks), then backfill * and extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 11, 2006 * *------------------------------------------------------------------------- @@ -10080,10 +10051,11 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, skip one row of root indirect " - "block, then backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + "block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10229,19 +10201,19 @@ error: } /* test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_skip_start_block_add_skipped + * Function: test_man_fill_2nd_direct_skip_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, the insert object * that is too large to hold in first row of direct blocks of * 3rd level indirect block, then backfill & extend all skipped * 3rd level indirect block's direct blocks. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -10260,10 +10232,10 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, and skip first rows of direct blocks of " - "3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description - */ + "3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10358,9 +10330,9 @@ error: } /* test_man_fill_2nd_direct_skip_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped + * Function: test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks in 3rd level indirect block, then insert object * that is too large to hold in first row of direct blocks of @@ -10368,11 +10340,11 @@ error: * backfill & extend all skipped 2nd level indirect block's direct * blocks. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -10391,10 +10363,11 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct " "blocks, and skip first rows of direct blocks of 3rd level indirect block's 2nd level indirect " - "block, then backfill and extend, then remove all objects %s"; /* Test description */ + "block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10499,20 +10472,20 @@ error: } /* test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped + * Function: test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks in 3rd level indirect block, then insert object * that is too large to hold in first row of 2nd level indirect * blocks of 3rd level indirect block, then backfill & extend all * skipped direct blocks. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -10534,11 +10507,11 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct " - "blocks, and skip first row of indirect blocks of 3rd level indirect block, then backfill and " - "extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level " + "indirect block's direct blocks, and skip first row of indirect blocks of 3rd " + "level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10580,9 +10553,6 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10654,21 +10624,21 @@ error: } /* test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped + * Function: test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks in 3rd level indirect block, then insert object * that is too large to hold in first & second rows of 2nd level * indirect blocks (although this 3rd level indirect block only * has one row of 2nd level indirect blocks) of 3rd level indirect - * block, then backfill & extend all skipped direct blocks. + * block, then backfill & extend all skipped direct blocks. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -10690,11 +10660,11 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct " - "blocks, and skip first two rows of indirect blocks of 3rd level indirect block, then backfill and " - "extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level " + "indirect block's direct blocks, and skip first two rows of indirect blocks of " + "3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10706,9 +10676,6 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); -#ifdef QAK - HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); -#endif /* QAK */ /* Fill direct blocks in root indirect block */ if (fill_root_direct(fh, fill_size, &state, &keep_ids)) @@ -10739,9 +10706,6 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10752,9 +10716,6 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows + 1) - obj_size; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10820,9 +10781,9 @@ error: } /* test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped + * Function: test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, all 3rd level * indirect blocks in first row except the last one, fill direct * blocks in last 3rd level indirect block, then insert object @@ -10831,11 +10792,11 @@ error: * use of the next row of 3rd level blocks), then backfill all * skipped direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tues, April 18, 2006 * *------------------------------------------------------------------------- @@ -10856,12 +10817,12 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd " - "level indirect blocks, except last one, fill all direct blocks in last 3rd level " - "indirect block, and insert object too large for it's 2nd level indirect blocks, then " - "backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = + "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect " + "blocks, except last one, fill all direct blocks in last 3rd level indirect block, and insert object " + "too large for it's 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10913,9 +10874,6 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10986,9 +10944,9 @@ error: } /* test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped + * Function: test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, all 3rd level * indirect blocks in first row, fill direct blocks in 2nd row 3rd * level indirect block, fill all direct blocks in 1st row of @@ -10998,11 +10956,11 @@ error: * next row of 2nd level blocks), then backfill all skipped direct * blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tues, April 18, 2006 * *------------------------------------------------------------------------- @@ -11019,16 +10977,16 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ - h5_stat_size_t empty_size; /* Size of a file with an empty heap */ - size_t obj_size; /* Size of object */ - size_t fill_size; /* Size of objects for "bulk" filled blocks */ - fheap_heap_state_t state; /* State of fractal heap */ + h5_stat_size_t empty_size; /* Size of a file with an empty heap */ + size_t obj_size; /* Size of object */ + size_t fill_size; /* Size of objects for "bulk" filled blocks */ + fheap_heap_state_t state; /* State of fractal heap */ + unsigned u; /* Local index variables */ /* Test description */ const char * base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect " "blocks, fill all direct blocks in next 3rd level indirect block, fill all 1st row of 2nd level " "indirect blocks, except last one, and insert object too large for 2nd level indirect block, then " - "backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u; /* Local index variables */ + "backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11087,9 +11045,6 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11159,9 +11114,9 @@ error: } /* test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped + * Function: test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, then * fill all direct blocks in 4th level indirect block, then @@ -11169,11 +11124,11 @@ error: * level indirect blocks of 4th level indirect block, then * backfill all skipped direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 15, 2006 * *------------------------------------------------------------------------- @@ -11194,11 +11149,12 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill " "4th level indirect block's direct blocks, and skip first row of 2nd indirect blocks of 4th level " - "indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + "indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11248,9 +11204,6 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11322,9 +11275,9 @@ error: } /* test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped() */ /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped + * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, then * fill all direct blocks and 2nd level indirect blocks in 4th @@ -11334,11 +11287,11 @@ error: * 3rd level indirect block, then * backfill all skipped direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2006 * *------------------------------------------------------------------------- @@ -11359,12 +11312,13 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill " "4th level indirect block's direct, 2nd level indirect blocks and 3rd level direct block, and skip " "first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then " - "backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + "backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11430,9 +11384,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11507,7 +11458,7 @@ error: * Function: *test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, fill all * direct & indirect blocks in first row of 4th level indirect @@ -11519,11 +11470,11 @@ error: * 3rd level indirect block (in 4th level indirect block), then * backfill all skipped direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2006 * *------------------------------------------------------------------------- @@ -11544,13 +11495,14 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill " "first row of 4th level indirect blocks, fill 2nd row 4th level indirect block's direct, 2nd level " "indirect blocks, first row of 3rd level indirect blocks, 3rd level direct block in 2nd row, and " "skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then " - "backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + "backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11649,9 +11601,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11727,7 +11676,7 @@ error: * Function: *test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, fill all * direct & indirect blocks in 4th level indirect @@ -11741,11 +11690,11 @@ error: * 4th level block), then backfill all skipped direct blocks & * extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2006 * *------------------------------------------------------------------------- @@ -11766,17 +11715,13 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level " - "indirect blocks, fill " - "first row of 3rd level indirect blocks in 4th level indirect block except last " - "3rd level block, " - "fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of " - "4th level indirect " - "block's 3rd level indirect block, then backfill and extend, then remove all " - "objects %s"; /* Test - description - */ - unsigned u, v; /* Local index variables */ + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = + "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill " + "first row of 3rd level indirect blocks in 4th level indirect block except last 3rd level block, " + "fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect " + "block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11857,9 +11802,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11934,7 +11876,7 @@ error: * Function: *test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, fill all * direct & indirect blocks in first row of 4th level indirect @@ -11948,11 +11890,11 @@ error: * next row of 4th level blocks), then backfill all skipped direct * blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2006 * *------------------------------------------------------------------------- @@ -11973,13 +11915,14 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill " "first row of 4th level indirect blocks, except last one, fill first row of 3rd level indirect " "blocks in last 4th level indirect block except last 3rd level block, fill direct blocks in 3rd " "level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect " - "block, then backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + "block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -12096,9 +12039,6 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK - HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -12169,25 +12109,22 @@ error: return (1); } /* test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped() */ -#endif /* QAK */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_man_frag_simple + * Function: test_man_frag_simple * - * Purpose: Test inserting objects small enough to fit into first row of + * Purpose: Test inserting objects small enough to fit into first row of * direct blocks, but not to share a block with another object, * until start-block-size * 2 blocks are reached. Then, go back * and fill in the space in the blocks skipped. * * Then, remove all the objects, in various ways * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, July 24, 2006 * *------------------------------------------------------------------------- @@ -12204,10 +12141,9 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "fragmenting small blocks, then backfill and extend, then remove all objects %s"; /* Test description - */ - unsigned u; /* Local index variables */ + unsigned u; /* Local index variables */ + /* Test description */ + const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12307,19 +12243,19 @@ error: } /* test_man_frag_simple() */ /*------------------------------------------------------------------------- - * Function: test_man_frag_direct + * Function: test_man_frag_direct * - * Purpose: Test inserting small object to fit into each direct block + * Purpose: Test inserting small object to fit into each direct block * in root block, but not to share a block with another object, * Then, go back and fill in the space in the blocks skipped. * * Then, go back and remove all objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 25, 2006 * *------------------------------------------------------------------------- @@ -12337,10 +12273,9 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "fragmenting direct blocks, then backfill and extend, then remove all objects %s"; /* Test description - */ - unsigned u, v; /* Local index variables */ + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12477,9 +12412,9 @@ error: } /* test_man_frag_direct() */ /*------------------------------------------------------------------------- - * Function: test_man_frag_2nd_direct + * Function: test_man_frag_2nd_direct * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * inserting small object to fit into each direct block * in 2nd level indirect block, but not to share a block with * another object. @@ -12487,11 +12422,11 @@ error: * * Then, go back and remove all the objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 25, 2006 * *------------------------------------------------------------------------- @@ -12511,10 +12446,10 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "fill root direct blocks, then fragment 2nd level indirect block's direct blocks, then backfill and " - "extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "fill root direct blocks, then fragment 2nd level indirect block's direct " + "blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -12526,9 +12461,6 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * /* Compute # of bits used in first row */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); -#ifdef QAK - HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); -#endif /* QAK */ /* Fill direct blocks in root indirect block */ if (fill_root_direct(fh, fill_size, &state, &keep_ids)) @@ -12591,9 +12523,9 @@ error: } /* test_man_frag_2nd_direct() */ /*------------------------------------------------------------------------- - * Function: test_man_frag_3rd_direct + * Function: test_man_frag_3rd_direct * - * Purpose: Test filling all direct blocks in root indirect block and + * Purpose: Test filling all direct blocks in root indirect block and * all 2nd level indirect blocks, then * inserting small object to fit into each direct block * in 3rd level indirect block, but not to share a block with @@ -12602,11 +12534,11 @@ error: * * Then, go back and remove all objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 25, 2006 * *------------------------------------------------------------------------- @@ -12625,10 +12557,11 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = + unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "fill root direct blocks and 2nd level indirect blocks, then fragment 3rd level indirect block's " - "direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u, v; /* Local index variables */ + "direct blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -12708,21 +12641,18 @@ error: H5E_END_TRY; return (1); } /* test_man_frag_3rd_direct() */ -#endif /* QAK */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_huge_insert_one + * Function: test_huge_insert_one * - * Purpose: Test inserting one huge object in the heap + * Purpose: Test inserting one huge object in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 7, 2006 * *------------------------------------------------------------------------- @@ -12744,7 +12674,8 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = "insert one huge object, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert one huge object, then remove %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12791,7 +12722,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -12830,9 +12761,6 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -12865,16 +12793,16 @@ error: } /* test_huge_insert_one() */ /*------------------------------------------------------------------------- - * Function: test_huge_insert_two + * Function: test_huge_insert_two * - * Purpose: Test inserting two huge objects in the heap + * Purpose: Test inserting two huge objects in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 11, 2006 * *------------------------------------------------------------------------- @@ -12897,7 +12825,8 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = "insert two huge objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert two huge objects, then remove %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12946,7 +12875,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object too large for managed heap blocks */ @@ -12976,7 +12905,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -13060,9 +12989,6 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -13097,16 +13023,16 @@ error: } /* test_huge_insert_two() */ /*------------------------------------------------------------------------- - * Function: test_huge_insert_three + * Function: test_huge_insert_three * - * Purpose: Test inserting three huge objects in the heap + * Purpose: Test inserting three huge objects in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 11, 2006 * *------------------------------------------------------------------------- @@ -13130,7 +13056,8 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = "insert three huge objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert three huge objects, then remove %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -13181,7 +13108,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object too large for managed heap blocks */ @@ -13211,7 +13138,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert third object too large for managed heap blocks */ @@ -13241,7 +13168,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -13365,9 +13292,6 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -13404,16 +13328,16 @@ error: } /* test_huge_insert_three() */ /*------------------------------------------------------------------------- - * Function: test_huge_insert_mix + * Function: test_huge_insert_mix * - * Purpose: Test inserting a mix of 'normal' & 'huge' objects in the heap + * Purpose: Test inserting a mix of 'normal' & 'huge' objects in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 11, 2006 * *------------------------------------------------------------------------- @@ -13439,7 +13363,8 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert mix of normal & huge objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert mix of normal & huge objects, then remove %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -13494,7 +13419,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object too large for managed heap blocks */ @@ -13524,7 +13449,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert third object too large for managed heap blocks */ @@ -13554,7 +13479,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert fourth object small enough to fit into 'normal' heap blocks */ @@ -13591,7 +13516,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id4, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert fifth object small enough to fit into 'normal' heap blocks */ @@ -13629,7 +13554,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id5, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -13788,9 +13713,6 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -13831,14 +13753,14 @@ error: } /* test_huge_insert_mix() */ /*------------------------------------------------------------------------- - * Function: test_filtered_huge + * Function: test_filtered_huge * - * Purpose: Test storing 'huge' object in a heap with I/O filters + * Purpose: Test storing 'huge' object in a heap with I/O filters * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, August 15, 2006 * *------------------------------------------------------------------------- @@ -13865,8 +13787,8 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam size_t old_actual_id_len = 0; /* Old actual ID length */ hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */ hbool_t pline_init = FALSE; /* Whether the I/O pipeline has been initialized */ - const char * base_desc = - "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -13929,7 +13851,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam if (reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR -/* QAK */ #ifdef QAK /* Close the fractal heap */ if (H5HF_close(fh) < 0) @@ -13956,7 +13877,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam if (NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR #endif /* QAK */ - /* QAK */ /* Check up on heap... */ state.huge_size = obj_size; @@ -13972,7 +13892,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -14011,10 +13931,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, - (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -14046,21 +13962,18 @@ error: H5E_END_TRY; return (1); } /* test_filtered_huge() */ -#endif /* QAK */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_tiny_insert_one + * Function: test_tiny_insert_one * - * Purpose: Test inserting one tiny object in the heap + * Purpose: Test inserting one tiny object in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -14082,7 +13995,8 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = "insert one tiny object, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert one tiny object, then remove %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -14129,7 +14043,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -14168,9 +14082,6 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -14203,16 +14114,16 @@ error: } /* test_tiny_insert_one() */ /*------------------------------------------------------------------------- - * Function: test_tiny_insert_two + * Function: test_tiny_insert_two * - * Purpose: Test inserting two tiny objects in the heap + * Purpose: Test inserting two tiny objects in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -14235,7 +14146,8 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = "insert two tiny objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert two tiny objects, then remove %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -14284,7 +14196,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object small enough to encode in heap ID */ @@ -14314,7 +14226,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -14398,9 +14310,6 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -14435,17 +14344,17 @@ error: } /* test_tiny_insert_two() */ /*------------------------------------------------------------------------- - * Function: test_tiny_insert_mix + * Function: test_tiny_insert_mix * - * Purpose: Test inserting a mix of 'normal', 'huge' & 'tiny' objects in + * Purpose: Test inserting a mix of 'normal', 'huge' & 'tiny' objects in * the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -14473,8 +14382,8 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char * base_desc = - "insert mix of normal, huge & tiny objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert mix of normal, huge & tiny objects, then remove %s"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -14533,14 +14442,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on first huge object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object too large for managed heap blocks */ @@ -14570,14 +14479,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on second huge object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id2, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert third object too large for managed heap blocks */ @@ -14607,14 +14516,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on third huge object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id3, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert fourth object small enough to fit into 'normal' heap blocks */ @@ -14651,14 +14560,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id4, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on fourth ('normal') object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id4, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert fifth object small enough to fit into 'normal' heap blocks */ @@ -14696,14 +14605,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id5, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on fifth ('normal') object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id5, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert sixth object small enough to encode in heap ID */ @@ -14733,14 +14642,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id6, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on sixth ('tiny') object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id6, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert seventh object small enough to encode in heap ID */ @@ -14770,14 +14679,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id7, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on seventh ('tiny') object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id7, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -14998,9 +14907,6 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -15043,20 +14949,16 @@ error: H5E_END_TRY; return (1); } /* test_tiny_insert_mix() */ -#endif /* QAK */ -#endif /* QAK2 */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_filtered_man_root_direct + * Function: test_filtered_man_root_direct * - * Purpose: Test storing one 'managed' object in a heap with I/O filters + * Purpose: Test storing one 'managed' object in a heap with I/O filters * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -15081,8 +14983,8 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ unsigned deflate_level; /* Deflation level */ - const char * base_desc = - "insert one 'managed' object into heap with I/O filters, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert one 'managed' object into heap with I/O filters, then remove %s"; /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -15154,7 +15056,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -15196,10 +15098,6 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, - (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -15226,14 +15124,14 @@ error: } /* test_filtered_man_root_direct() */ /*------------------------------------------------------------------------- - * Function: test_filtered_man_root_indirect + * Function: test_filtered_man_root_indirect * - * Purpose: Test storing several objects in a 'managed heap with I/O filters + * Purpose: Test storing several objects in a 'managed heap with I/O filters * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, October 24, 2006 * *------------------------------------------------------------------------- @@ -15259,8 +15157,8 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ unsigned deflate_level; /* Deflation level */ - const char * base_desc = - "insert two 'managed' objects into heap with I/O filters, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert two 'managed' objects into heap with I/O filters, then remove %s"; /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -15341,7 +15239,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id1, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Read in ('normal') object #2 */ @@ -15352,7 +15250,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -15526,10 +15424,6 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, - (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -15554,23 +15448,20 @@ error: H5E_END_TRY; return (1); } /* test_filtered_man_root_indirect() */ -#endif /* QAK */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_random + * Function: test_random * - * Purpose: Test inserting random sized objects into a heap, and read + * Purpose: Test inserting random sized objects into a heap, and read * them back. * * Then, go back and remove all objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 9, 2006 * *------------------------------------------------------------------------- @@ -15642,10 +15533,10 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK - /* seed = (unsigned long)1156158635; */ - HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#if 0 +/* seed = (unsigned long)1156158635; */ +HDfprintf(stderr, "Random # seed was: %lu\n", seed); +#endif HDsrandom((unsigned)seed); /* Loop over adding objects to the heap, until the size limit is reached */ @@ -15666,10 +15557,6 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Increment the amount of objects added */ total_obj_added += obj_size; } /* end while */ -#ifdef QAK - HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids, - total_obj_added, size_limit); -#endif /* QAK */ /* Randomize the order of the IDs kept */ for (u = 0; u < keep_ids.num_ids; u++) { @@ -15728,9 +15615,6 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -15769,19 +15653,19 @@ error: } /* test_random() */ /*------------------------------------------------------------------------- - * Function: test_random_pow2 + * Function: test_random_pow2 * - * Purpose: Test inserting random sized objects with a "power of 2 + * Purpose: Test inserting random sized objects with a "power of 2 * distribution" (which favors small objects) into a heap, * and read them back. * * Then, go back and remove all objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 15, 2006 * *------------------------------------------------------------------------- @@ -15855,10 +15739,10 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK - /* seed = (unsigned long)1155181717; */ - HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#if 0 +/* seed = (unsigned long)1155181717; */ +HDfprintf(stderr, "Random # seed was: %lu\n", seed); +#endif HDsrandom((unsigned)seed); /* Loop over adding objects to the heap, until the size limit is reached */ @@ -15891,10 +15775,6 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te /* Increment the amount of objects added */ total_obj_added += obj_size; } /* end while */ -#ifdef QAK - HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids, - total_obj_added, size_limit); -#endif /* QAK */ /* Randomize the order of the IDs kept */ for (u = 0; u < keep_ids.num_ids; u++) { @@ -15953,10 +15833,6 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te /* Get the size of the file */ if ((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK - HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); - HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if (file_size != empty_size) @@ -15992,19 +15868,16 @@ error: H5E_END_TRY; return (1); } /* test_random_pow2() */ -#endif /* QAK */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_write + * Function: test_write * - * Purpose: Test inserting objects, then changing the value for them. + * Purpose: Test inserting objects, then changing the value for them. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, December 18, 2006 * *------------------------------------------------------------------------- @@ -16189,7 +16062,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Compare data read in */ - if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size)) + if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size) != 0) TEST_ERROR /* Change size of data to write */ @@ -16238,7 +16111,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Compare data read in */ - if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size)) + if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size) != 0) TEST_ERROR /* Change size of data to write */ @@ -16286,21 +16159,18 @@ error: H5E_END_TRY; return (1); } /* test_write() */ -#endif /* QAK */ - -#ifndef QAK /*------------------------------------------------------------------------- - * Function: test_bug1 + * Function: test_bug1 * - * Purpose: Test inserting several objects, then deleting one and + * Purpose: Test inserting several objects, then deleting one and * re-inserting an object, along with opening and closing * the file. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 28, 2006 * *------------------------------------------------------------------------- @@ -16461,18 +16331,17 @@ error: H5E_END_TRY; return (1); } /* test_bug1() */ -#endif /* QAK */ /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test the fractal heap code + * Purpose: Test the fractal heap code * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 24, 2006 * *------------------------------------------------------------------------- @@ -16501,7 +16370,7 @@ main(void) envval = "nomatch"; /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") != 0 && HDstrcmp(envval, "multi") != 0); /* Reset library */ h5_reset(); diff --git a/test/fillval.c b/test/fillval.c index 673b267..4215c89 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -935,7 +935,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f H5_FAILED(); HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__); HDfprintf(stdout, - " Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, " + " Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE + "}, read: %u, " "Fill value: %u\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], val_rd, fillval); @@ -952,7 +953,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f H5_FAILED(); HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__); HDfprintf(stdout, - " Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %f, %d, %f, %c" + " Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE + "}, read: %f, %d, %f, %c" "Fill value: %f, %d, %f, %c\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)fill_c.a, fill_c.x, fill_c.y, @@ -994,7 +996,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f H5_FAILED(); HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__); HDfprintf(stdout, - " Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %u, " + " Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE + ", %" PRIuHSIZE "}, read: %u, " "Fill value: %u\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], buf[u], fillval); @@ -1020,7 +1023,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f H5_FAILED(); HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__); HDfprintf(stdout, - " Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %f, %d, %f, %c" + " Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE + ", %" PRIuHSIZE "}, read: %f, %d, %f, %c" "Fill value: %f, %d, %f, %c\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], (double)buf_c[u].a, buf_c[u].x, buf_c[u].y, buf_c[u].z, (double)fill_c.a, @@ -1445,7 +1449,8 @@ test_extend_verify_integer(unsigned lineno, const hsize_t *offset, const void *_ if (*test_val != *compare_val) { HDfprintf(stdout, "%u: Value read was not expected.\n", lineno); HDfprintf(stdout, - " Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: %d, " + " Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE + "}, read: %d, " "expected: %d\n", offset[0], offset[1], offset[2], offset[3], offset[4], *test_val, *compare_val); goto error; @@ -1536,7 +1541,8 @@ test_extend_verify_cmpd_vl(unsigned lineno, const hsize_t *offset, const void *_ HDstrcmp(test_val->b, compare_val->b) != 0 || (test_val->y != compare_val->y)) { HDfprintf(stdout, "%u: Value read was not expected.\n", lineno); HDfprintf(stdout, - " Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: {%d, '%s', '%s', %d} " + " Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE + "}, read: {%d, '%s', '%s', %d} " "expected: {%d, '%s', '%s', %d}\n", offset[0], offset[1], offset[2], offset[3], offset[4], test_val->x, test_val->a, test_val->b, test_val->y, compare_val->x, compare_val->a, compare_val->b, compare_val->y); 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..d2011d4 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 @@ -73,7 +73,7 @@ mult_div_value(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_valu return 0; /* Assignment to eliminate unused parameter warning */ - cd_values = cd_values; + (void)cd_values; if (flags & H5Z_FLAG_REVERSE) { /* READ - Divide the original value by MULTIPLIER */ 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..630dcd6 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 @@ -74,7 +74,7 @@ append_to_group_name(unsigned int flags, size_t cd_nelmts, const unsigned int *c return 0; /* Assignment to eliminate unused parameter warning. */ - cd_values = cd_values; + (void)cd_values; if (flags & H5Z_FLAG_REVERSE) { /* READ - Remove the suffix from the group name */ diff --git a/test/freespace.c b/test/freespace.c index 52fd097..e888b2b 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -400,22 +400,27 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, frspace_state_t *state) FAIL_STACK_ERROR if (frspace_stats.tot_space != state->tot_space) { - HDfprintf(stdout, "frspace_stats.tot_space = %Hu, state->tot_space = %Zu\n", frspace_stats.tot_space, - state->tot_space); + HDfprintf(stdout, "frspace_stats.tot_space = %" PRIuHSIZE ", state->tot_space = %" PRIuHSIZE "\n", + frspace_stats.tot_space, state->tot_space); TEST_ERROR } /* end if */ if (frspace_stats.tot_sect_count != state->tot_sect_count) { - HDfprintf(stdout, "frspace_stats.tot_sect_count = %Hu, state->tot_sect_count = %Hu\n", + HDfprintf(stdout, + "frspace_stats.tot_sect_count = %" PRIuHSIZE ", state->tot_sect_count = %" PRIuHSIZE "\n", frspace_stats.tot_sect_count, state->tot_sect_count); TEST_ERROR } /* end if */ if (frspace_stats.serial_sect_count != state->serial_sect_count) { - HDfprintf(stdout, "frspace_stats.serial_sect_count = %Hu, state->serial_sect_count = %Hu\n", + HDfprintf(stdout, + "frspace_stats.serial_sect_count = %" PRIuHSIZE ", state->serial_sect_count = %" PRIuHSIZE + "\n", frspace_stats.serial_sect_count, state->serial_sect_count); TEST_ERROR } /* end if */ if (frspace_stats.ghost_sect_count != state->ghost_sect_count) { - HDfprintf(stdout, "frspace_stats.ghost_sect_count = %Hu, state->ghost_sect_count = %Hu\n", + HDfprintf(stdout, + "frspace_stats.ghost_sect_count = %" PRIuHSIZE ", state->ghost_sect_count = %" PRIuHSIZE + "\n", frspace_stats.ghost_sect_count, state->ghost_sect_count); TEST_ERROR } /* end if */ diff --git a/test/gen_new_array.c b/test/gen_new_array.c index 7fe4686..5811106 100644 --- a/test/gen_new_array.c +++ b/test/gen_new_array.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 09, 2000 * * Purpose: Create a two datasets, one with a compound datatypes with array diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c index 58afecb..2c18f59 100644 --- a/test/gen_new_fill.c +++ b/test/gen_new_fill.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Feb 27, 2002 * * Purpose: This program is run to generate a HDF5 data file with fill diff --git a/test/gen_new_group.c b/test/gen_new_group.c index 489f409..3557192 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Oct 24, 2005 * * Purpose: This program is run to generate an HDF5 data file with both diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c index baf4dd0..bb977ad 100644 --- a/test/gen_new_mtime.c +++ b/test/gen_new_mtime.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 3, 2003 * * Purpose: Create a dataset, which should have the newer mtime information diff --git a/test/gen_new_super.c b/test/gen_new_super.c index ec2e93b..ce2f88a 100644 --- a/test/gen_new_super.c +++ b/test/gen_new_super.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 15, 2003 * * Purpose: Create a file which will have the newer superblock format. diff --git a/test/gen_old_array.c b/test/gen_old_array.c index ad798a8..9755896 100644 --- a/test/gen_old_array.c +++ b/test/gen_old_array.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 09, 2000 * * Purpose: Create a two datasets with compound datatypes, one with no array diff --git a/test/gen_old_group.c b/test/gen_old_group.c index faa9532..1b4e0b2 100644 --- a/test/gen_old_group.c +++ b/test/gen_old_group.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Oct 24, 2005 * * Purpose: This program is run to generate an HDF5 data file with an diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c index 34eb2f5..4412078 100644 --- a/test/gen_old_layout.c +++ b/test/gen_old_layout.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 27, 2004 * * Purpose: Create two datasets (one for version 1 and one for version 2 of diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c index 90fc561..0ec3486 100644 --- a/test/gen_old_mtime.c +++ b/test/gen_old_mtime.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 3, 2003 * * Purpose: Create a dataset, which should have the older mtime information diff --git a/test/gen_plist.c b/test/gen_plist.c index 8bae408..7a67c56 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -459,7 +459,7 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil if ((ret = H5Pencode2(plist_id, NULL, &temp_size, H5P_DEFAULT)) < 0) HDassert(ret > 0); - temp_buf = HDcalloc(1, temp_size); + temp_buf = (void *)HDmalloc(temp_size); HDassert(temp_buf); if ((ret = H5Pencode2(plist_id, temp_buf, &temp_size, H5P_DEFAULT)) < 0) diff --git a/test/gen_sizes_lheap.c b/test/gen_sizes_lheap.c index a94789b..8f090e8 100644 --- a/test/gen_sizes_lheap.c +++ b/test/gen_sizes_lheap.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, July 15, 2010 * * Purpose: Creates a file with non-default sizes of lengths and addresses. diff --git a/test/gen_specmetaread.c b/test/gen_specmetaread.c index 0664390..5ec1f98 100644 --- a/test/gen_specmetaread.c +++ b/test/gen_specmetaread.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, October 8, 2009 * * Purpose: Create a file with a dataset who's raw data immediately follows diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c index 4b68647..d41625a 100644 --- a/test/gen_udlinks.c +++ b/test/gen_udlinks.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Tuesday, June 6, 2006 * * This program creates HDF5 files with user-defined links. These files diff --git a/test/hyperslab.c b/test/hyperslab.c index a867430..41528ad 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -1114,8 +1114,8 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z) /* Check computed coordinates */ for (v = 0; v < ARRAY_OFFSET_NDIMS; v++) if (coords[v] != new_coords[v]) { - HDfprintf(stderr, "coords[%u]=%Hu, new_coords[%u]=%Hu\n", (unsigned)v, coords[v], (unsigned)v, - new_coords[v]); + HDfprintf(stderr, "coords[%zu]=%" PRIuHSIZE ", new_coords[%zu]=%" PRIuHSIZE "\n", v, + coords[v], v, new_coords[v]); TEST_ERROR; } /* end if */ } /* end for */ diff --git a/test/links_env.c b/test/links_env.c index 250e786..590be20 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -69,7 +69,7 @@ external_link_env(hid_t fapl, hbool_t new_format) if ((envval = HDgetenv("HDF5_EXT_PREFIX")) == NULL) envval = "nomatch"; - if (HDstrcmp(envval, ".:tmp_links_env")) + if (HDstrcmp(envval, ".:tmp_links_env") != 0) TEST_ERROR /* Set up name for main file:"extlinks_env0" */ @@ -115,7 +115,7 @@ external_link_env(hid_t fapl, hbool_t new_format) /* Should be able to find the target file from pathnames set via HDF5_EXT_PREFIX */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp_links_env directory."); + HDputs(" Should have found the file in tmp_links_env directory."); goto error; } diff --git a/test/mf.c b/test/mf.c index c53b6f1..c753c2b 100644 --- a/test/mf.c +++ b/test/mf.c @@ -168,22 +168,27 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *state) FAIL_STACK_ERROR if (frspace_stats.tot_space != state->tot_space) { - HDfprintf(stdout, "frspace_stats.tot_space = %Hu, state->tot_space = %Zu\n", frspace_stats.tot_space, - state->tot_space); + HDfprintf(stdout, "frspace_stats.tot_space = %" PRIuHSIZE ", state->tot_space = %" PRIuHSIZE "\n", + frspace_stats.tot_space, state->tot_space); TEST_ERROR } /* end if */ if (frspace_stats.tot_sect_count != state->tot_sect_count) { - HDfprintf(stdout, "frspace_stats.tot_sect_count = %Hu, state->tot_sect_count = %Hu\n", + HDfprintf(stdout, + "frspace_stats.tot_sect_count = %" PRIuHSIZE ", state->tot_sect_count = %" PRIuHSIZE "\n", frspace_stats.tot_sect_count, state->tot_sect_count); TEST_ERROR } /* end if */ if (frspace_stats.serial_sect_count != state->serial_sect_count) { - HDfprintf(stdout, "frspace_stats.serial_sect_count = %Hu, state->serial_sect_count = %Hu\n", + HDfprintf(stdout, + "frspace_stats.serial_sect_count = %" PRIuHSIZE ", state->serial_sect_count = %" PRIuHSIZE + "\n", frspace_stats.serial_sect_count, state->serial_sect_count); TEST_ERROR } /* end if */ if (frspace_stats.ghost_sect_count != state->ghost_sect_count) { - HDfprintf(stdout, "frspace_stats.ghost_sect_count = %Hu, state->ghost_sect_count = %Hu\n", + HDfprintf(stdout, + "frspace_stats.ghost_sect_count = %" PRIuHSIZE ", state->ghost_sect_count = %" PRIuHSIZE + "\n", frspace_stats.ghost_sect_count, state->ghost_sect_count); TEST_ERROR } /* end if */ @@ -225,7 +230,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) /* Skip test when using VFDs that has different address spaces for each * type of metadata allocation. */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -373,7 +378,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) /* Skip test when using VFDs that has different address spaces for each * type of metadata allocation. */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -660,7 +665,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) /* Skip test when using VFDs that has different address spaces for each * type of metadata allocation. */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -867,7 +872,8 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TESTING("'temporary' file space allocation with old library format") /* Can't run this test with multi-file VFDs */ - if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { + if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0) { char filename[FILENAME_LEN]; /* Filename to use */ H5F_t * f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ @@ -2011,7 +2017,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) TESTING("A free-space section absorbs an aggregator: test 1"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2187,7 +2193,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 1"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2338,7 +2344,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 2"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2496,7 +2502,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator: test 3"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2664,7 +2670,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 4"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2813,7 +2819,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 5"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2951,7 +2957,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 6"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3125,7 +3131,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 7"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3296,7 +3302,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_try_extend() of meta/sdata aggregator: test 1"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3594,7 +3600,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3848,8 +3854,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -4292,8 +4298,8 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { if ((file_size = h5_get_file_size(filename, new_fapl)) < 0) TEST_ERROR @@ -4498,8 +4504,8 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -4760,8 +4766,8 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -5105,8 +5111,8 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -5418,8 +5424,8 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -5636,8 +5642,8 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -5906,8 +5912,8 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -6176,7 +6182,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - free(memb_name[mt]); + HDfree(memb_name[mt]); } /* end else */ /* Close memb_fapl */ @@ -6923,7 +6929,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) else TESTING("File's free-space is persistent with old library format") - if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")) { + if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0) { /* File creation property list template */ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) @@ -7100,7 +7106,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TESTING("File's free-space is going away with old library format") /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { @@ -7291,7 +7297,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for TESTING("File space strategy/persisting/threshold with old library format") /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -7461,7 +7467,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format TESTING("File space merge/shrink for section size < threshold with old library format") /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -7755,7 +7761,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t is_multi_or_split) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - free(memb_name[mt]); + HDfree(memb_name[mt]); return 0; @@ -8018,7 +8024,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) TESTING("Paged aggregation for file space: H5MF_try_shrink()"); /* Current VFD that does not support continuous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { @@ -8147,8 +8153,8 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) TESTING("Paged aggregation for file space: H5MF_try_extend() a small block"); /* Current VFD that does not support continuous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0); if (contig_addr_vfd) { @@ -8326,7 +8332,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) TESTING("Paged aggregation for file space: H5MF_try_extend() a large block"); /* Current VFD that does not support continuous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { @@ -8490,7 +8496,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) TESTING("Paged aggregation for file space: large allocations and de-allocations"); /* Current VFD that does not support continuous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { @@ -8906,7 +8912,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - free(memb_name[mt]); + HDfree(memb_name[mt]); /* Close memb_fapl */ if (H5Pclose(memb_fapl) < 0) diff --git a/test/mount.c b/test/mount.c index d59f458..c5ac9b3 100644 --- a/test/mount.c +++ b/test/mount.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, October 7, 1998 * * Purpose: Tests file mounting. @@ -1583,7 +1583,7 @@ test_mount_after_close(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidABMX, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/A/B/M/X")) + if (HDstrcmp(objname, "/A/B/M/X") != 0) TEST_ERROR /* Close object in mounted file */ @@ -1598,7 +1598,7 @@ test_mount_after_close(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidABC, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/A/B/C")) + if (HDstrcmp(objname, "/A/B/C") != 0) TEST_ERROR /* Close object in mounted file */ @@ -1613,7 +1613,7 @@ test_mount_after_close(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidABT, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/A/B/T")) + if (HDstrcmp(objname, "/A/B/T") != 0) TEST_ERROR /* Close object in original file */ @@ -1628,7 +1628,7 @@ test_mount_after_close(hid_t fapl) *objname = '\0'; if (H5Iget_name(didABMXYD, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/A/B/M/X/Y/D")) + if (HDstrcmp(objname, "/A/B/M/X/Y/D") != 0) TEST_ERROR /* Close object in mounted file */ @@ -1801,7 +1801,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidAMXX, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/M/X/X")) + if (HDstrcmp(objname, "/A/M/X/X") != 0) TEST_ERROR /* Open group in mounted file #2 */ @@ -1821,7 +1821,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/M/X/M/Y")) + if (HDstrcmp(objname, "/A/M/X/M/Y") != 0) TEST_ERROR /* Unmount second file */ @@ -1832,7 +1832,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/X/M/Y")) + if (HDstrcmp(objname, "/X/M/Y") != 0) TEST_ERROR /* Rename object in file #3 that is "disconnected" from name hiearchy */ @@ -1852,7 +1852,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/X/M/Z")) + if (HDstrcmp(objname, "/X/M/Z") != 0) TEST_ERROR /* Mount fourth file */ @@ -1868,7 +1868,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidBMZ, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/B/M/Z")) + if (HDstrcmp(objname, "/B/M/Z") != 0) TEST_ERROR /* Unmount third file */ @@ -3140,7 +3140,7 @@ test_mult_mount(hid_t fapl) *name = '\0'; if (H5Iget_name(gidAMT, name, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(name, "/A/M/T")) + if (HDstrcmp(name, "/A/M/T") != 0) TEST_ERROR /* Create object in file #3 */ @@ -3158,7 +3158,7 @@ test_mult_mount(hid_t fapl) *name = '\0'; if (H5Iget_name(gidBS, name, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(name, "/B/S")) + if (HDstrcmp(name, "/B/S") != 0) TEST_ERROR /* Re-open object created in file #3 through file #1 mount path */ @@ -3339,7 +3339,7 @@ test_nested_survive(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidAM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/A/M")) + if (name_len == 0 || HDstrcmp(name, "/A/M") != 0) TEST_ERROR /* Unmount file #2 from file #1 */ @@ -3350,7 +3350,7 @@ test_nested_survive(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidAM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len != 0 || HDstrcmp(name, "")) + if (name_len != 0 || HDstrcmp(name, "") != 0) TEST_ERROR /* Open object in file #3 through file #1 mount path (should fail) */ @@ -3370,7 +3370,7 @@ test_nested_survive(hid_t fapl) *name = '\0'; if (H5Iget_name(gidMS, name, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(name, "/M/S")) + if (HDstrcmp(name, "/M/S") != 0) TEST_ERROR /* Close group in file #3 */ @@ -3389,7 +3389,7 @@ test_nested_survive(hid_t fapl) *name = '\0'; if (H5Iget_name(gidAMS, name, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(name, "/A/M/S")) + if (HDstrcmp(name, "/A/M/S") != 0) TEST_ERROR /* Close group in file #3 */ @@ -3538,7 +3538,7 @@ test_close_parent(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/A/M")) + if (name_len == 0 || HDstrcmp(name, "/A/M") != 0) TEST_ERROR /* Unmount file #2 from file #1, closing file #1 */ @@ -3549,7 +3549,7 @@ test_close_parent(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/M")) + if (name_len == 0 || HDstrcmp(name, "/M") != 0) TEST_ERROR /* Just file #2's underlying shared file should be open still */ @@ -3816,7 +3816,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/A/E/M")) + if (name_len == 0 || HDstrcmp(name, "/A/E/M") != 0) TEST_ERROR /* Open object in file #7 */ @@ -3827,7 +3827,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/B/I/Q")) + if (name_len == 0 || HDstrcmp(name, "/B/I/Q") != 0) TEST_ERROR /* Close file #1 */ @@ -3887,7 +3887,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidK, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/D/K")) + if (name_len == 0 || HDstrcmp(name, "/D/K") != 0) TEST_ERROR if (H5Gclose(gidK) < 0) @@ -3910,7 +3910,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidO, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/B/H/O")) + if (name_len == 0 || HDstrcmp(name, "/B/H/O") != 0) TEST_ERROR if (H5Gclose(gidO) < 0) @@ -3920,14 +3920,14 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/E/M")) + if (name_len == 0 || HDstrcmp(name, "/E/M") != 0) TEST_ERROR /* Check the name of "Q" is still defined */ *name = '\0'; if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/B/I/Q")) + if (name_len == 0 || HDstrcmp(name, "/B/I/Q") != 0) TEST_ERROR /* Check that all seven underlying files are still opened */ @@ -3952,7 +3952,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/I/Q")) + if (name_len == 0 || HDstrcmp(name, "/I/Q") != 0) TEST_ERROR /* Open object in file #6 from file #7 */ @@ -3963,7 +3963,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidO, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/H/O")) + if (name_len == 0 || HDstrcmp(name, "/H/O") != 0) TEST_ERROR if (H5Gclose(gidO) < 0) @@ -4132,7 +4132,7 @@ test_symlink(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidL, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/L")) + if (name_len == 0 || HDstrcmp(name, "/L") != 0) TEST_ERROR /* Close file #1 */ diff --git a/test/mtime.c b/test/mtime.c index 7172dea..78f9065 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 30, 1998 * * Purpose: Determines if the modification time message is working @@ -147,7 +147,7 @@ main(void) H5_FAILED(); /* If this fails, examine H5Omtime.c. Modification time is very * system dependent (e.g., on Windows DST must be hardcoded). */ - puts(" Old modification time incorrect"); + HDputs(" Old modification time incorrect"); goto error; } if (H5Fclose(file) < 0) diff --git a/test/ntypes.c b/test/ntypes.c index 541670b..13cc72a 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -12,10 +12,10 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * October 14, 2001 * - * Purpose: Tests the H5Tget_native_type function. + * Purpose: Tests the H5Tget_native_type function. */ #include "h5test.h" @@ -57,16 +57,16 @@ int ipoints3[DIM0][DIM1][5], icheck3[DIM0][DIM1][5]; #define BITFIELD_ENUMB 8 /*------------------------------------------------------------------------- - * Function: test_atomic_dtype + * Function: test_atomic_dtype * - * Purpose: Test H5Tget_native_type for atomic datatype + * Purpose: Test H5Tget_native_type for atomic datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -291,16 +291,16 @@ error: } /*------------------------------------------------------------------------- - * Function: test_compound_dtype2 + * Function: test_compound_dtype2 * - * Purpose: Test H5Tget_native_type for compound datatype + * Purpose: Test H5Tget_native_type for compound datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -621,16 +621,16 @@ error: } /*------------------------------------------------------------------------- - * Function: test_compound_dtype + * Function: test_compound_dtype * - * Purpose: Test H5Tget_native_type for compound datatype + * Purpose: Test H5Tget_native_type for compound datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -834,16 +834,16 @@ error: } /*------------------------------------------------------------------------- - * Function: test_compound_dtype3 + * Function: test_compound_dtype3 * - * Purpose: Test H5Tget_native_type for compound datatype + * Purpose: Test H5Tget_native_type for compound datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -1075,16 +1075,16 @@ error: } /*------------------------------------------------------------------------- - * Function: test_compound_opaque + * Function: test_compound_opaque * - * Purpose: Test H5Tget_native_type for compound datatype with opaque field + * Purpose: Test H5Tget_native_type for compound datatype with opaque field * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Quincey Koziol - * January 31, 2004 + * Programmer: Quincey Koziol + * January 31, 2004 * * Modifications: * @@ -1302,16 +1302,16 @@ error: } /*------------------------------------------------------------------------- - * Function: test_enum_dtype + * Function: test_enum_dtype * - * Purpose: Test H5Tget_native_type for enumerate datatype + * Purpose: Test H5Tget_native_type for enumerate datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -1446,16 +1446,16 @@ error: } /*------------------------------------------------------------------------- - * Function: test_array_dtype + * Function: test_array_dtype * - * Purpose: Test H5Tget_native_type for array datatype + * Purpose: Test H5Tget_native_type for array datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -1634,16 +1634,16 @@ error: } /*------------------------------------------------------------------------- - * Function: test_array_dtype2 + * Function: test_array_dtype2 * - * Purpose: Test H5Tget_native_type for array datatype + * Purpose: Test H5Tget_native_type for array datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -1769,16 +1769,16 @@ error: } /*------------------------------------------------------------------------- - * Function: test_vl_dtype + * Function: test_vl_dtype * - * Purpose: Test H5Tget_native_type for variable length datatype + * Purpose: Test H5Tget_native_type for variable length datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -1975,16 +1975,16 @@ error: } /* end test_vl_type() */ /*------------------------------------------------------------------------- - * Function: test_vlstr_dtype + * Function: test_vlstr_dtype * - * Purpose: Test H5Tget_native_type for variable length string datatype + * Purpose: Test H5Tget_native_type for variable length string datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -1993,21 +1993,17 @@ error: static herr_t test_vlstr_dtype(hid_t file) { + /* Information to write */ const char *wdata[SPACE1_DIM1] = { - "Four score and seven years ago our forefathers brought forth on this continent a new " - "nation,", + "Four score and seven years ago our forefathers brought forth on this continent a new nation,", "conceived in liberty and dedicated to the proposition that all men are created equal.", "Now we are engaged in a great civil war,", - "testing whether that nation or any nation so conceived and so dedicated can long " - "endure."}; /* Information - to - write - */ + "testing whether that nation or any nation so conceived and so dedicated can long endure."}; char * rdata[SPACE1_DIM1]; /* Information read in */ hbool_t rdata_alloc = FALSE; /* Whether the read data is allocated */ - hid_t dataset = -1; /* Dataset ID */ - hid_t sid1 = -1; /* Dataspace ID */ - hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */ + hid_t dataset = -1; /* Dataset ID */ + hid_t sid1 = -1; /* Dataspace ID */ + hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; unsigned i; /* counting variable */ @@ -2119,16 +2115,16 @@ error: } /* end test_vlstr_dtype() */ /*------------------------------------------------------------------------- - * Function: test_str_dtype + * Function: test_str_dtype * - * Purpose: Test H5Tget_native_type for fixed-length string datatype + * Purpose: Test H5Tget_native_type for fixed-length string datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -2139,9 +2135,9 @@ test_str_dtype(hid_t file) { const char wdata[SPACE1_DIM1][4] = {"one", "two", "3rd", "4th"}; /* Information to write */ char rdata[SPACE1_DIM1][4]; /* Information read in */ - hid_t dataset = -1; /* Dataset ID */ - hid_t sid1 = -1; /* Dataspace ID */ - hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */ + hid_t dataset = -1; /* Dataset ID */ + hid_t sid1 = -1; /* Dataspace ID */ + hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; unsigned i; /* counting variable */ @@ -2241,16 +2237,16 @@ error: } /* end test_str_dtype() */ /*------------------------------------------------------------------------- - * Function: test_refer_dtype + * Function: test_refer_dtype * - * Purpose: Test H5Tget_native_type for reference datatype + * Purpose: Test H5Tget_native_type for reference datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -2266,10 +2262,10 @@ test_refer_dtype(hid_t file) float c; } s1_t; - hid_t dataset = -1; /* Dataset ID */ + hid_t dataset = -1; /* Dataset ID */ hid_t group = -1; /* Group ID */ - hid_t sid1 = -1; /* Dataspace ID */ - hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */ + hid_t sid1 = -1; /* Dataspace ID */ + hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */ hsize_t dims1[] = {1}; H5O_type_t obj_type; /* Object type */ hobj_ref_t *wbuf = NULL, /* buffer to write to disk */ @@ -2414,16 +2410,16 @@ error: } /* test_refer_dtype() */ /*------------------------------------------------------------------------- - * Function: test_refer_dtype2 + * Function: test_refer_dtype2 * - * Purpose: Test H5Tget_native_type for reference + * Purpose: Test H5Tget_native_type for reference * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -2432,10 +2428,10 @@ error: static herr_t test_refer_dtype2(hid_t file) { - hid_t dset1 = -1, /* Dataset ID */ + hid_t dset1 = -1, /* Dataset ID */ dset2 = -1; /* Dereferenced dataset ID */ - hid_t sid1 = -1, /* Dataspace ID #1 */ - sid2 = -1; /* Dataspace ID #2 */ + hid_t sid1 = -1, /* Dataspace ID #1 */ + sid2 = -1; /* Dataspace ID #2 */ hid_t dtype = -1, native_type = -1; hsize_t dims1[] = {1}, dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ @@ -2628,16 +2624,16 @@ error: } /* test_refer_dtype2() */ /*------------------------------------------------------------------------- - * Function: test_opaque_dtype + * Function: test_opaque_dtype * - * Purpose: Test H5Tget_native_type for opaque datatype + * Purpose: Test H5Tget_native_type for opaque datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -2727,16 +2723,16 @@ error: } /* test_opaque_dtype */ /*------------------------------------------------------------------------- - * Function: test_bitfield_dtype + * Function: test_bitfield_dtype * - * Purpose: Test H5Tget_native_type for bitfield datatype + * Purpose: Test H5Tget_native_type for bitfield datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * Raymond Lu @@ -2894,7 +2890,7 @@ error: * Return: Success: 0 * Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * September 3, 2004 * * Modifications: @@ -3102,12 +3098,12 @@ error: } /* end test_ninteger() */ /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test H5Tget_native_type for different datatype + * Purpose: Test H5Tget_native_type for different datatype * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * diff --git a/test/pool.c b/test/pool.c index b6e3765..9ce1846 100644 --- a/test/pool.c +++ b/test/pool.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, May 3, 2005 */ #include "h5test.h" @@ -660,10 +660,10 @@ test_allocate_random(void) /* Initialize random number seed */ curr_time = HDtime(NULL); -#ifdef QAK - curr_time = 1115412944; - HDfprintf(stderr, "curr_time=%lu\n", (unsigned long)curr_time); -#endif /* QAK */ +#if 0 +curr_time=1115412944; +HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); +#endif HDsrandom((unsigned)curr_time); /* Create a memory pool */ @@ -784,11 +784,11 @@ main(void) if (nerrors) goto error; - puts("All memory pool tests passed."); + HDputs("All memory pool tests passed."); return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); return 1; } diff --git a/test/reserved.c b/test/reserved.c index 1ea73a6..6e41a16 100644 --- a/test/reserved.c +++ b/test/reserved.c @@ -126,7 +126,7 @@ rsrv_heap(void) /* If we can read a dataset from the file, the file has been flushed to disk * (if the heap or object headers weren't flushed, the file would be empty). */ - if (dataset_id == H5I_BADID) + if (dataset_id == H5I_INVALID_HID) TEST_ERROR; if (H5Dclose(dataset_id) < 0) @@ -268,7 +268,7 @@ rsrv_ohdr(void) /* If we can read the dataset from the file, the file has been flushed to disk * (if the heap or object headers weren't flushed, the file would be empty). */ - if (dataset_id == H5I_BADID) + if (dataset_id == H5I_INVALID_HID) TEST_ERROR; if (H5Dclose(dataset_id) < 0) @@ -432,7 +432,7 @@ rsrv_vlen(void) /* If we can read the dataset from the file, the file has been flushed to disk * (if the heap or object headers weren't flushed, the file would be empty). */ - if (dataset_id == H5I_BADID) + if (dataset_id == H5I_INVALID_HID) TEST_ERROR; if (H5Dclose(dataset_id) < 0) diff --git a/test/ros3.c b/test/ros3.c index 9eb8768..54518f4 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -20,7 +20,7 @@ * * Demonstrates basic use cases and fapl/dxpl interaction. * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2017-10-11 */ @@ -193,15 +193,21 @@ * *---------------------------------------------------------------------------- */ +static inline void +jserr_long(long expected, long actual, const char *reason) +{ + if (reason != NULL) { + HDprintf("%s\n", reason); + } + else { + HDprintf(" ! Expected %ld\n ! Actual %ld\n", expected, actual); + } +} + #define JSERR_LONG(expected, actual, reason) \ { \ JSFAILED_AT() \ - if (reason != NULL) { \ - HDprintf("%s\n", (reason)); \ - } \ - else { \ - HDprintf(" ! Expected %ld\n ! Actual %ld\n", (long)(expected), (long)(actual)); \ - } \ + jserr_long((long)(expected), (long)(actual), (reason)); \ } /*---------------------------------------------------------------------------- @@ -232,15 +238,21 @@ * *---------------------------------------------------------------------------- */ +static inline void +jserr_str(const char *expected, const char *actual, const char *reason) +{ + if (reason != NULL) { + HDprintf("%s\n", reason); + } + else { + HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", expected, actual); + } +} + #define JSERR_STR(expected, actual, reason) \ { \ JSFAILED_AT() \ - if ((reason) != NULL) { \ - HDprintf("%s\n", (reason)); \ - } \ - else { \ - HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", (expected), (actual)); \ - } \ + jserr_str((expected), (actual), (reason)); \ } #ifdef JSVERIFY_EXP_ACT @@ -306,7 +318,7 @@ *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(expected, actual, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -351,7 +363,7 @@ *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(actual, expected, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -548,8 +560,8 @@ test_fapl_config_validation(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -829,8 +841,8 @@ test_vfd_open(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -972,15 +984,15 @@ test_eof_eoa(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1083,15 +1095,15 @@ test_H5FDread_without_eoa_set_fails(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1257,15 +1269,15 @@ test_read(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1401,8 +1413,8 @@ test_noops_and_autofails(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1438,15 +1450,6 @@ test_noops_and_autofails(void) H5E_BEGIN_TRY{ JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, TRUE), "truncate must fail (closing)")} H5E_END_TRY; - /* no-op calls to `lock()` and `unlock()` - */ - JSVERIFY(SUCCEED, H5FDlock(file, TRUE), "lock always succeeds; has no effect") - JSVERIFY(SUCCEED, H5FDlock(file, FALSE), NULL) - JSVERIFY(SUCCEED, H5FDunlock(file), NULL) - /* Lock/unlock with null file or similar error crashes tests. - * HDassert in calling heirarchy, `H5FD[un]lock()` and `H5FD_[un]lock()` - */ - /************ * TEARDOWN * ************/ @@ -1530,15 +1533,15 @@ test_cmp(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1654,15 +1657,15 @@ test_H5F_integration(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1709,7 +1712,7 @@ error: * CLEANUP * ***********/ HDprintf("\nerror!"); - fflush(stdout); + HDfflush(stdout); if (fapl_id >= 0) { H5E_BEGIN_TRY diff --git a/test/s3comms.c b/test/s3comms.c index 6ddb8a3..6202af3 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -15,7 +15,7 @@ * * Purpose: Unit tests for the S3 Communications (s3comms) module. * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2017-10-11 */ @@ -181,15 +181,21 @@ * *---------------------------------------------------------------------------- */ +static inline void +jserr_long(long expected, long actual, const char *reason) +{ + if (reason != NULL) { + HDprintf("%s\n", reason); + } + else { + HDprintf(" ! Expected %ld\n ! Actual %ld\n", expected, actual); + } +} + #define JSERR_LONG(expected, actual, reason) \ { \ JSFAILED_AT() \ - if (reason != NULL) { \ - HDprintf("%s\n", (reason)); \ - } \ - else { \ - HDprintf(" ! Expected %ld\n ! Actual %ld\n", (long)(expected), (long)(actual)); \ - } \ + jserr_long((long)(expected), (long)(actual), reason); \ } /*---------------------------------------------------------------------------- @@ -220,15 +226,21 @@ * *---------------------------------------------------------------------------- */ +static inline void +jserr_str(const char *expected, const char *actual, const char *reason) +{ + if (reason != NULL) { + HDprintf("%s\n", reason); + } + else { + HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", expected, actual); + } +} + #define JSERR_STR(expected, actual, reason) \ { \ JSFAILED_AT() \ - if ((reason) != NULL) { \ - HDprintf("%s\n", (reason)); \ - } \ - else { \ - HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", (expected), (actual)); \ - } \ + jserr_str((expected), (actual), (reason)); \ } #ifdef JSVERIFY_EXP_ACT @@ -299,7 +311,7 @@ *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(expected, actual, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -347,7 +359,7 @@ *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(actual, expected, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -1269,10 +1281,10 @@ test_HMAC_SHA256(void) cases[i].msg); if (cases[i].ret == SUCCEED) { #ifdef VERBOSE - if (0 != strncmp(cases[i].exp, dest, HDstrlen(cases[i].exp))) { + if (0 != HDstrncmp(cases[i].exp, dest, HDstrlen(cases[i].exp))) { /* print out how wrong things are, and then fail */ - dest = (char *)realloc(dest, cases[i].dest_size + 1); + dest = (char *)HDrealloc(dest, cases[i].dest_size + 1); HDassert(dest != NULL); dest[cases[i].dest_size] = 0; HDfprintf(stdout, "ERROR:\n!!! \"%s\"\n != \"%s\"\n", cases[i].exp, dest); @@ -1281,17 +1293,17 @@ test_HMAC_SHA256(void) #else /* VERBOSE not defined */ /* simple pass/fail test */ - JSVERIFY(0, strncmp(cases[i].exp, dest, HDstrlen(cases[i].exp)), NULL); + JSVERIFY(0, HDstrncmp(cases[i].exp, dest, HDstrlen(cases[i].exp)), NULL); #endif /* VERBOSE */ } - free(dest); + HDfree(dest); } PASSED(); return 0; error: - free(dest); + HDfree(dest); return -1; } /* end test_HMAC_SHA256() */ @@ -1357,9 +1369,9 @@ test_nlowercase(void) JSVERIFY(SUCCEED, H5FD_s3comms_nlowercase(dest, cases[i].in, cases[i].len), cases[i].in) if (cases[i].len > 0) { - JSVERIFY(0, strncmp(dest, cases[i].exp, cases[i].len), NULL) + JSVERIFY(0, HDstrncmp(dest, cases[i].exp, cases[i].len), NULL) } - free(dest); + HDfree(dest); } /* end for each testcase */ JSVERIFY(FAIL, H5FD_s3comms_nlowercase(NULL, cases[0].in, cases[0].len), "null distination should fail") @@ -1368,7 +1380,7 @@ test_nlowercase(void) return 0; error: - free(dest); + HDfree(dest); return -1; } /* end test_nlowercase() */ @@ -1729,7 +1741,7 @@ test_percent_encode_char(void) JSVERIFY(SUCCEED, H5FD_s3comms_percent_encode_char(dest, (const unsigned char)cases[i].c, &dest_len), NULL) JSVERIFY(cases[i].exp_len, dest_len, NULL) - JSVERIFY(0, strncmp(dest, cases[i].exp, dest_len), NULL) + JSVERIFY(0, HDstrncmp(dest, cases[i].exp, dest_len), NULL) JSVERIFY_STR(cases[i].exp, dest, NULL) } @@ -1768,8 +1780,8 @@ test_s3r_get_filesize(void) */ if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1828,14 +1840,14 @@ test_s3r_open(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1861,7 +1873,7 @@ test_s3r_open(void) FAIL_IF(purl->port == NULL); FAIL_IF(5 < HDsnprintf(purl->port, 5, "9000")) } - else if (strcmp(purl->port, "9000") != 0) { + else if (HDstrcmp(purl->port, "9000") != 0) { FAIL_IF(5 < HDsnprintf(purl->port, 5, "9000")) } else { @@ -2032,8 +2044,8 @@ test_s3r_read(void) */ if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -2093,7 +2105,7 @@ test_s3r_read(void) JSVERIFY(SUCCEED, H5FD_s3comms_s3r_read(handle, (haddr_t)6370, (size_t)0, buffer), NULL) JSVERIFY( 0, - strncmp( + HDstrncmp( buffer, "And my soul from out that shadow that lies floating on the floor\nShall be lifted—nevermore!\n", 94), @@ -2110,7 +2122,7 @@ test_s3r_read(void) H5FD_s3comms_s3r_read(handle, (haddr_t)6400, (size_t)100, /* 6400+100 > 6464 */ buffer), NULL) - JSVERIFY(0, strcmp("", buffer), NULL) + JSVERIFY(0, HDstrcmp("", buffer), NULL) /************************ * read starts past eof * @@ -2120,14 +2132,14 @@ test_s3r_read(void) H5FD_s3comms_s3r_read(handle, (haddr_t)1200699, /* 1200699 > 6464 */ (size_t)100, buffer), NULL) - JSVERIFY(0, strcmp("", buffer), NULL) + JSVERIFY(0, HDstrcmp("", buffer), NULL) /********************** * read starts on eof * **********************/ JSVERIFY(FAIL, H5FD_s3comms_s3r_read(handle, (haddr_t)6464, (size_t)0, buffer), NULL) - JSVERIFY(0, strcmp("", buffer), NULL) + JSVERIFY(0, HDstrcmp("", buffer), NULL) /************* * TEAR DOWN * @@ -2217,10 +2229,10 @@ test_signing_key(void) JSVERIFY(SUCCEED, H5FD_s3comms_signing_key(key, cases[i].secret_key, cases[i].region, cases[i].when), NULL) - JSVERIFY(0, strncmp((const char *)cases[i].exp, (const char *)key, SHA256_DIGEST_LENGTH), - cases[i].exp) + JSVERIFY(0, HDstrncmp((const char *)cases[i].exp, (const char *)key, SHA256_DIGEST_LENGTH), + (const char *)cases[i].exp) - free(key); + HDfree(key); key = NULL; } @@ -2243,7 +2255,7 @@ test_signing_key(void) JSVERIFY(FAIL, H5FD_s3comms_signing_key(key, cases[0].secret_key, cases[0].region, NULL), "time string cannot be NULL") - free(key); + HDfree(key); key = NULL; PASSED(); @@ -2251,7 +2263,7 @@ test_signing_key(void) error: if (key != NULL) { - free(key); + HDfree(key); } return -1; @@ -2399,9 +2411,9 @@ test_trim(void) JSVERIFY(SUCCEED, H5FD_s3comms_trim(dest, str, cases[i].in_len, &dest_len), NULL) JSVERIFY(cases[i].exp_len, dest_len, cases[i].in) if (dest_len > 0) { - JSVERIFY(0, strncmp(cases[i].exp, dest, dest_len), cases[i].exp) + JSVERIFY(0, HDstrncmp(cases[i].exp, dest, dest_len), cases[i].exp) } - free(str); + HDfree(str); str = NULL; } /* end for each testcase */ @@ -2412,9 +2424,9 @@ test_trim(void) HDassert(str == NULL); str = (char *)HDmalloc(sizeof(char *) * 11); HDassert(str != NULL); - memcpy(str, "some text ", 11); /* string with null terminator */ + HDmemcpy(str, "some text ", 11); /* string with null terminator */ JSVERIFY(FAIL, H5FD_s3comms_trim(NULL, str, 10, &dest_len), "destination for trim cannot be NULL"); - free(str); + HDfree(str); str = NULL; PASSED(); @@ -2422,7 +2434,7 @@ test_trim(void) error: if (str != NULL) { - free(str); + HDfree(str); } return -1; @@ -2513,9 +2525,9 @@ test_uriencode(void) H5FD_s3comms_uriencode(dest, cases[i].str, str_len, cases[i].encode_slash, &dest_written), NULL); JSVERIFY(HDstrlen(cases[i].expected), dest_written, NULL) - JSVERIFY(0, strncmp(dest, cases[i].expected, dest_written), cases[i].expected); + JSVERIFY(0, HDstrncmp(dest, cases[i].expected, dest_written), cases[i].expected); - free(dest); + HDfree(dest); dest = NULL; } /* end for each testcase */ @@ -2526,12 +2538,12 @@ test_uriencode(void) dest = (char *)HDmalloc(sizeof(char) * 15); HDassert(dest != NULL); - JSVERIFY(FAIL, H5FD_s3comms_uriencode(NULL, "word$", 5, false, &dest_written), + JSVERIFY(FAIL, H5FD_s3comms_uriencode(NULL, "word$", 5, FALSE, &dest_written), "destination cannot be NULL"); - JSVERIFY(FAIL, H5FD_s3comms_uriencode(dest, NULL, 5, false, &dest_written), + JSVERIFY(FAIL, H5FD_s3comms_uriencode(dest, NULL, 5, FALSE, &dest_written), "source string cannot be NULL"); - free(dest); + HDfree(dest); dest = NULL; PASSED(); @@ -2539,7 +2551,7 @@ test_uriencode(void) error: if (dest != NULL) { - free(dest); + HDfree(dest); } return -1; diff --git a/test/set_extent.c b/test/set_extent.c index fc22137..5a07362 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * April 12, 2002 * * Purpose: Tests the H5Dset_extent call @@ -121,7 +121,7 @@ main(void) if (env_h5_drvr == NULL) env_h5_drvr = "nomatch"; /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); /* Initialize random number seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -2086,7 +2086,6 @@ test_layouts(H5D_layout_t layout, hid_t fapl) H5E_BEGIN_TRY { - ret = H5Dset_extent(did, dims_e); } H5E_END_TRY; @@ -2136,7 +2135,6 @@ test_layouts(H5D_layout_t layout, hid_t fapl) H5E_BEGIN_TRY { - ret = H5Dset_extent(did, dims_s); } H5E_END_TRY; @@ -2638,7 +2636,7 @@ test_random_rank4_vl(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disab TEST_ERROR if (H5Treclaim(type, mspace, H5P_DEFAULT, wbuf) < 0) TEST_ERROR - free(fill_value.p); + HDfree(fill_value.p); if (H5Sclose(mspace) < 0) TEST_ERROR if (H5Pclose(my_dcpl) < 0) @@ -2694,6 +2692,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/space_overflow.c b/test/space_overflow.c index 720e9d0..f235670 100644 --- a/test/space_overflow.c +++ b/test/space_overflow.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, October 26, 1998 * * Purpose: Create a dataset with a simple data space that has the diff --git a/test/stab.c b/test/stab.c index 682ed84..798619d 100644 --- a/test/stab.c +++ b/test/stab.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 */ @@ -134,7 +134,7 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Oget_comment_by_name(g3, "././.", comment, sizeof comment, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(comment, "hello world")) { + if (HDstrcmp(comment, "hello world") != 0) { H5_FAILED(); HDputs(" Read the wrong comment string from the group."); HDprintf(" got: \"%s\"\n ans: \"hello world\"\n", comment); @@ -190,7 +190,7 @@ error: * * Failure: number of errors * - * Programmer: Robb Matzke 2002-03-28 + * Programmer: Robb Matzke 2002-03-28 * * Modifications: *------------------------------------------------------------------------- @@ -1279,7 +1279,7 @@ old_api(hid_t fapl) PASSED(); #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Shut compiler up */ - fapl = fapl; + (void)fapl; SKIPPED(); HDputs(" Deprecated API symbols not enabled"); @@ -1425,7 +1425,7 @@ main(void) env_h5_drvr = "nomatch"; /* VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); /* Reset library */ h5_reset(); diff --git a/test/tarray.c b/test/tarray.c index c8fc45b..8b518cf 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -157,8 +157,8 @@ test_array_atomic_1d(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -490,8 +490,8 @@ test_array_array_atomic(void) /* Check the array dimensions */ for (i = 0; i < ndims1; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -668,8 +668,8 @@ test_array_compound_atomic(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -889,8 +889,8 @@ test_array_compound_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -951,8 +951,9 @@ test_array_compound_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Nested array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf( + "Nested array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1092,7 +1093,6 @@ test_array_free_custom(void *_mem, void *info) HDfree(mem); } /* end if */ - return; } /* end test_array_free_custom() */ /*------------------------------------------------------------------------- @@ -1210,8 +1210,8 @@ test_array_vlen_atomic(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1440,8 +1440,8 @@ test_array_vlen_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -1472,8 +1472,8 @@ test_array_vlen_array(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -2081,8 +2081,9 @@ test_compat(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -2128,8 +2129,9 @@ test_compat(void) /* Check the array dimensions */ for (i = 0; i < ndims; i++) if (rdims1[i] != tdims1[i]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n", - (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i, + rdims1[i], i, tdims1[i]); continue; } /* end if */ @@ -2228,5 +2230,5 @@ test_array(void) void cleanup_array(void) { - remove(FILENAME); + HDremove(FILENAME); } /* end cleanup_array() */ diff --git a/test/tattr.c b/test/tattr.c index 8429477..c30b0f5 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -859,8 +859,8 @@ test_attr_compound_read(hid_t fapl) VERIFY(fields, 3, "H5Tget_nmembers"); for (i = 0; i < fields; i++) { fieldname = H5Tget_member_name(type, (unsigned)i); - if (!(HDstrcmp(fieldname, ATTR4_FIELDNAME1) || HDstrcmp(fieldname, ATTR4_FIELDNAME2) || - HDstrcmp(fieldname, ATTR4_FIELDNAME3))) + if (!(HDstrcmp(fieldname, ATTR4_FIELDNAME1) != 0 || HDstrcmp(fieldname, ATTR4_FIELDNAME2) != 0 || + HDstrcmp(fieldname, ATTR4_FIELDNAME3) != 0)) TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname); H5free_memory(fieldname); } /* end for */ @@ -907,7 +907,7 @@ test_attr_compound_read(hid_t fapl) /* Verify values read in */ for (i = 0; i < ATTR4_DIM1; i++) for (j = 0; j < ATTR4_DIM2; j++) - if (HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct))) { + if (HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct)) != 0) { HDprintf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); HDprintf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", @@ -920,7 +920,7 @@ test_attr_compound_read(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR4_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR4_NAME)) + if (HDstrcmp(attr_name, ATTR4_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR4_NAME); /* Close attribute datatype */ @@ -1279,7 +1279,7 @@ test_attr_mult_read(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR1_NAME)) + if (HDstrcmp(attr_name, ATTR1_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR1_NAME); /* Verify Name with too small of a buffer */ @@ -1287,7 +1287,7 @@ test_attr_mult_read(hid_t fapl) VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name"); HDstrcpy(temp_name, ATTR1_NAME); /* make a copy of the name */ temp_name[HDstrlen(ATTR1_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */ - if (HDstrcmp(attr_name, temp_name)) + if (HDstrcmp(attr_name, temp_name) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name); /* Close attribute */ @@ -1337,7 +1337,7 @@ test_attr_mult_read(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR2_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR2_NAME)) + if (HDstrcmp(attr_name, ATTR2_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR2_NAME); /* Verify Name with too small of a buffer */ @@ -1345,7 +1345,7 @@ test_attr_mult_read(hid_t fapl) VERIFY(name_len, HDstrlen(ATTR2_NAME), "H5Aget_name"); HDstrcpy(temp_name, ATTR2_NAME); /* make a copy of the name */ temp_name[HDstrlen(ATTR2_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */ - if (HDstrcmp(attr_name, temp_name)) + if (HDstrcmp(attr_name, temp_name) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name); /* Close attribute */ @@ -1399,7 +1399,7 @@ test_attr_mult_read(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR3_NAME)) + if (HDstrcmp(attr_name, ATTR3_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME); /* Verify Name with too small of a buffer */ @@ -1407,7 +1407,7 @@ test_attr_mult_read(hid_t fapl) VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name"); HDstrcpy(temp_name, ATTR3_NAME); /* make a copy of the name */ temp_name[HDstrlen(ATTR3_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */ - if (HDstrcmp(attr_name, temp_name)) + if (HDstrcmp(attr_name, temp_name) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name); /* Close attribute */ @@ -1436,19 +1436,19 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR switch (*count) { case 0: - if (HDstrcmp(name, ATTR1_NAME)) + if (HDstrcmp(name, ATTR1_NAME) != 0) TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR1_NAME); (*count)++; break; case 1: - if (HDstrcmp(name, ATTR2_NAME)) + if (HDstrcmp(name, ATTR2_NAME) != 0) TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR2_NAME); (*count)++; break; case 2: - if (HDstrcmp(name, ATTR3_NAME)) + if (HDstrcmp(name, ATTR3_NAME) != 0) TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR3_NAME); (*count)++; break; @@ -1590,7 +1590,7 @@ test_attr_delete(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR1_NAME)) + if (HDstrcmp(attr_name, ATTR1_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR1_NAME); /* Close attribute */ @@ -1605,7 +1605,7 @@ test_attr_delete(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR3_NAME)) + if (HDstrcmp(attr_name, ATTR3_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME); /* Close attribute */ @@ -1629,7 +1629,7 @@ test_attr_delete(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR3_NAME)) + if (HDstrcmp(attr_name, ATTR3_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME); /* Close attribute */ @@ -2123,7 +2123,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) HDsprintf(attrname, "attr %02u", u); name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, check_name); VERIFY(name_len, HDstrlen(attrname), "H5Aget_name"); - if (HDstrcmp(check_name, attrname)) + if (HDstrcmp(check_name, attrname) != 0) TestErrPrintf("attribute name different: attrname = '%s', should be '%s'\n", check_name, attrname); @@ -4206,8 +4206,8 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Shut compiler up */ - fcpl = fcpl; - fapl = fapl; + (void)fcpl; + (void)fapl; /* Output message about test being skipped */ MESSAGE(5, ("Skipping Test On Deprecated Attribute Routines\n")); @@ -5658,7 +5658,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); /* Don't test "native" order if there is no creation order index, since @@ -5684,7 +5684,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); } /* end if */ @@ -5705,7 +5705,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); /* Verify the information for first attribute, in increasing name order */ @@ -5725,7 +5725,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); /* Don't test "native" order queries on link name order, since there's not @@ -5749,7 +5749,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); /* Retrieve current # of errors */ @@ -6778,13 +6778,6 @@ attr_iterate2_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, vo char attrname[NAME_BUF_SIZE]; /* Object name */ H5A_info_t my_info; /* Local attribute info */ -#ifdef QAK - HDfprintf(stderr, "attr_name = '%s'\n", attr_name); - if (info) - HDfprintf(stderr, "info->corder = %u\n", (unsigned)info->corder); - HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr); -#endif /* QAK */ - /* Increment # of times the callback was called */ op_data->ncalled++; @@ -6813,7 +6806,7 @@ attr_iterate2_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, vo /* Verify name of link */ HDsprintf(attrname, "attr %02u", (unsigned)my_info.corder); - if (HDstrcmp(attr_name, attrname)) + if (HDstrcmp(attr_name, attrname) != 0) return (H5_ITER_ERROR); /* Check if we've visited this link before */ diff --git a/test/tchecksum.c b/test/tchecksum.c index 15667e3..f96d810 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -15,7 +15,7 @@ * * Created: tchecksum.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Test internal checksum routine(s) * diff --git a/test/tcoords.c b/test/tcoords.c index 855b383..fef8689 100644 --- a/test/tcoords.c +++ b/test/tcoords.c @@ -87,10 +87,10 @@ test_singleEnd_selElements(hid_t file, hbool_t is_chunked) } /* Construct dataset's name */ - memset(dset_name, 0, (size_t)NAME_LEN); - strcat(dset_name, SINGLE_END_DSET); + HDmemset(dset_name, 0, (size_t)NAME_LEN); + HDstrcat(dset_name, SINGLE_END_DSET); if (is_chunked) - strcat(dset_name, "_chunked"); + HDstrcat(dset_name, "_chunked"); did = H5Dcreate2(file, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT); CHECK(did, FAIL, "H5Dcreate2"); @@ -259,10 +259,10 @@ test_singleEnd_selHyperslab(hid_t file, hbool_t is_chunked) hsize_t mem3_block[4] = {1, 3, 6, 1}; /* Construct dataset's name */ - memset(dset_name, 0, NAME_LEN); - strcat(dset_name, SINGLE_END_DSET); + HDmemset(dset_name, 0, NAME_LEN); + HDstrcat(dset_name, SINGLE_END_DSET); if (is_chunked) - strcat(dset_name, "_chunked"); + HDstrcat(dset_name, "_chunked"); /* Dataspace for the dataset in file */ sid = H5Screate_simple(4, da_dims, da_dims); @@ -436,10 +436,10 @@ test_multiple_ends(hid_t file, hbool_t is_chunked) } /* Construct dataset's name */ - memset(dset_name, 0, NAME_LEN); - strcat(dset_name, MULTI_ENDS_SEL_HYPER_DSET); + HDmemset(dset_name, 0, NAME_LEN); + HDstrcat(dset_name, MULTI_ENDS_SEL_HYPER_DSET); if (is_chunked) - strcat(dset_name, "_chunked"); + HDstrcat(dset_name, "_chunked"); did = H5Dcreate2(file, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT); CHECK(did, FAIL, "H5Dcreate2"); @@ -687,5 +687,5 @@ test_coords(void) void cleanup_coords(void) { - remove(FILENAME); + HDremove(FILENAME); } diff --git a/test/testerror.sh.in b/test/testerror.sh.in index d284355..4fb2a81 100644 --- a/test/testerror.sh.in +++ b/test/testerror.sh.in @@ -64,6 +64,12 @@ TEST() { # Skip the plugin for testing missing filter. $ENVCMD $RUNSERIAL $TEST_ERR_BIN ) >$actual 2>$actual_err + + # Check for core dump + if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` + fi + # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ diff --git a/test/testexternal_env.sh.in b/test/testexternal_env.sh.in index 618c4ff..94fbb88 100644 --- a/test/testexternal_env.sh.in +++ b/test/testexternal_env.sh.in @@ -34,9 +34,9 @@ ENVCMD="env HDF5_EXTFILE_PREFIX=\${ORIGIN}" # The environment variable & valu $ENVCMD $RUNSERIAL $TEST_BIN exitcode=$? if [ $exitcode -eq 0 ]; then - echo "Test prefix for HDF5_EXTFILE_PREFIX PASSED" - else - nerrors="`expr $nerrors + 1`" - echo "***Error encountered for HDF5_EXTFILE_PREFIX test***" + echo "Test prefix for HDF5_EXTFILE_PREFIX PASSED" +else + nerrors="`expr $nerrors + 1`" + echo "***Error encountered for HDF5_EXTFILE_PREFIX test***" fi exit $nerrors diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index 06a5031..83685e8 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -82,7 +82,7 @@ fi # different, occasionally the wrong file is deleted, interrupting the flow of # the test. Running each of these tests in its own directory should eliminate # the problem. -mkdir flushrefresh_test +mkdir -p flushrefresh_test cp flushrefresh flushrefresh_test # With the --disable-shared option, flushrefresh is built in the test directory, @@ -90,7 +90,7 @@ cp flushrefresh flushrefresh_test # the test directory. test/flushrefresh should always be copied, # .libs/flushrefresh should be copied only if it exists. if [ -f .libs/flushrefresh ]; then - mkdir flushrefresh_test/.libs + mkdir -p flushrefresh_test/.libs for FILE in .libs/flushrefresh*; do case "$FILE" in *.o) continue ;; ## don't copy the .o files @@ -156,6 +156,12 @@ until [ $verification_done -eq 1 ]; do echo "all flush verification complete" > $endsignal else ./flushrefresh $param1 $param2 + + # Check for core dump + if [ $? -gt 0 ]; then + nerrors=`expr $nerrors + 1` + fi + echo "verification flush process done" > $endsignal fi @@ -195,6 +201,12 @@ if [ $timedout -eq 0 ]; then echo "all refresh verification complete" > $endsignal else ./flushrefresh $param1 + + # Check for core dump + if [ $? -gt 0 ]; then + nerrors=`expr $nerrors + 1` + fi + echo "refresh verifiction process done" > $endsignal fi diff --git a/test/testframe.c b/test/testframe.c index ff7cdc5..f805997 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 6, 2004 * * Purpose: Provides support functions for the testing framework. @@ -442,15 +442,15 @@ GetTestExpress(void) /* set it here for now. Should be done in something like h5test_init(). */ if (TestExpress == -1) { - env_val = getenv("HDF5TestExpress"); + env_val = HDgetenv("HDF5TestExpress"); if (env_val == NULL) SetTestExpress(1); - else if (strcmp(env_val, "0") == 0) + else if (HDstrcmp(env_val, "0") == 0) SetTestExpress(0); - else if (strcmp(env_val, "1") == 0) + else if (HDstrcmp(env_val, "1") == 0) SetTestExpress(1); - else if (strcmp(env_val, "2") == 0) + else if (HDstrcmp(env_val, "2") == 0) SetTestExpress(2); else SetTestExpress(3); @@ -521,7 +521,7 @@ ParseTestVerbosity(char *argv) else if (*argv == 'h') SetTestVerbosity(VERBO_HI); else - SetTestVerbosity(atoi(argv)); + SetTestVerbosity(HDatoi(argv)); } /* diff --git a/test/testlinks_env.sh.in b/test/testlinks_env.sh.in index dd83d7b..09074c3 100644 --- a/test/testlinks_env.sh.in +++ b/test/testlinks_env.sh.in @@ -34,8 +34,8 @@ echo "$ENVCMD $RUNSERIAL $TEST_BIN" $ENVCMD $RUNSERIAL $TEST_BIN exitcode=$? if [ $exitcode -eq 0 ]; then - echo "Test for HDF5_EXT_PREFIX PASSED" - else + echo "Test for HDF5_EXT_PREFIX PASSED" +else nerrors="`expr $nerrors + 1`" echo "***Error encountered for HDF5_EXT_PREFIX test***" fi diff --git a/test/testmeta.c b/test/testmeta.c index 370547b..c59c6cb 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -83,7 +83,7 @@ main(void) for (i = 0; i < NEXTARRAYS; i++) { /* Create dataset */ - sprintf(name, "/ExtArray%06d", i); + HDsprintf(name, "/ExtArray%06d", i); dataset_id = H5Dcreate2(file_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT); @@ -103,7 +103,7 @@ main(void) /* Removed print statement as it would lock system resources on Windows */ /* * HDprintf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS); - * fflush(stdout); + * HDfflush(stdout); */ floatval = (float)j; diff --git a/test/testvds_env.sh.in b/test/testvds_env.sh.in index 7ba0e42..39f13a5 100644 --- a/test/testvds_env.sh.in +++ b/test/testvds_env.sh.in @@ -35,8 +35,8 @@ UNENVCMD="unset HDF5_VDS_PREFIX" # Unset the environment variable $ENVCMD $RUNSERIAL $TEST_BIN exitcode=$? if [ $exitcode -eq 0 ]; then - echo "Test prefix for HDF5_VDS_PREFIX PASSED" - else + echo "Test prefix for HDF5_VDS_PREFIX PASSED" +else nerrors="`expr $nerrors + 1`" echo "***Error encountered for HDF5_VDS_PREFIX test***" fi diff --git a/test/tselect.c b/test/tselect.c index 73cc771..612b927 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -1533,7 +1533,7 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12)) + if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12) != 0) TestErrPrintf("hyperslab values don't match! Line=%d\n", __LINE__); /* Close memory dataspace */ @@ -1676,7 +1676,7 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 2 * SPACE8_DIM3 * SPACE8_DIM2 * SPACE8_DIM1)) + if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 2 * SPACE8_DIM3 * SPACE8_DIM2 * SPACE8_DIM1) != 0) TestErrPrintf("Error: hyperslab values don't match!\n"); /* Close memory dataspace */ @@ -2579,7 +2579,7 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) static void test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, unsigned tgt_n_cube_rank, unsigned edge_size, unsigned checker_edge_size, - unsigned sel_rank, hsize_t sel_start[]) + unsigned sel_rank, const hsize_t sel_start[]) { hbool_t first_selection = TRUE; unsigned n_cube_offset; @@ -3783,7 +3783,7 @@ test_select_hyper_copy(void) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2)) + if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2) != 0) TestErrPrintf("hyperslab values don't match! Line=%d\n", __LINE__); /* Close memory dataspace */ @@ -3996,7 +3996,7 @@ test_select_point_copy(void) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2)) + if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2) != 0) TestErrPrintf("point values don't match!\n"); /* Close memory dataspace */ @@ -5257,7 +5257,7 @@ test_select_hyper_union_stagger(void) CHECK(error, FAIL, "H5Fclose"); /* Initialize intput buffer */ - memset(data_out, 0, 7 * 7 * sizeof(int)); + HDmemset(data_out, 0, 7 * 7 * sizeof(int)); /* Open file */ file_id = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT); @@ -5381,9 +5381,9 @@ test_select_hyper_union_3d(void) /* Allocate write & read buffers */ wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3); - CHECK(wbuf, NULL, "HDmalloc"); + CHECK_PTR(wbuf, "HDmalloc"); rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE3_DIM1 * SPACE3_DIM2); - CHECK(rbuf, NULL, "HDcalloc"); + CHECK_PTR(rbuf, "HDcalloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE4_DIM1; i++) @@ -5555,7 +5555,7 @@ test_select_hyper_valid_combination(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Selection Combination Validity\n")); - assert(SPACE9_DIM2 >= POINT1_NPOINTS); + HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for single point selection */ single_pt_sid = H5Screate_simple(SPACE9_RANK, dims2D, NULL); @@ -8401,7 +8401,7 @@ test_shape_same(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Same Shape Comparisons\n")); - assert(SPACE9_DIM2 >= POINT1_NPOINTS); + HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for "all" selection */ all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); @@ -14277,18 +14277,18 @@ test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t enpoints, hssize_t enb /* Verify blocklist */ if (nblocks == (hssize_t)1) { - if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0]))) + if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); } /* end if */ else { HDassert(nblocks == (hssize_t)2); - if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0]))) { - if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0]))) + if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0) { + if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); - if (HDmemcmp(&blocklist[6], eblock1, 6 * sizeof(eblock1[0]))) + if (HDmemcmp(&blocklist[6], eblock1, 6 * sizeof(eblock1[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); } /* end if */ - else if (HDmemcmp(&blocklist[6], eblock2, 6 * sizeof(eblock2[0]))) + else if (HDmemcmp(&blocklist[6], eblock2, 6 * sizeof(eblock2[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); } /* end else */ } /* end if */ @@ -14705,7 +14705,7 @@ test_internal_consistency(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Consistency of Internal States\n")); - assert(SPACE9_DIM2 >= POINT1_NPOINTS); + HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for "all" selection */ all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); diff --git a/test/tunicode.c b/test/tunicode.c index 6483e13..52341bb 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -532,7 +532,7 @@ test_attrname(hid_t fid, const char *string) CHECK(attr_id, FAIL, "H5Acreate2"); size = H5Aget_name(attr_id, (size_t)MAX_STRING_LENGTH, read_buf); CHECK(size, FAIL, "H5Aget_name"); - ret = strcmp(read_buf, string); + ret = HDstrcmp(read_buf, string); VERIFY(ret, 0, "strcmp"); read_buf[0] = '\0'; @@ -541,7 +541,7 @@ test_attrname(hid_t fid, const char *string) CHECK(ret, FAIL, "H5Awrite"); ret = H5Aread(attr_id, dtype_id, read_buf); CHECK(ret, FAIL, "H5Aread"); - ret = strcmp(read_buf, string); + ret = HDstrcmp(read_buf, string); VERIFY(ret, 0, "strcmp"); /* Clean up */ @@ -682,7 +682,7 @@ test_enum(hid_t H5_ATTR_UNUSED fid, const char *string) VERIFY(val, E1_WHITE, "H5Tenum_valueof"); ret = H5Tenum_nameof(type_id, &val, readbuf, (size_t)MAX_STRING_LENGTH); CHECK(ret, FAIL, "H5Tenum_nameof"); - ret = strcmp(readbuf, string); + ret = HDstrcmp(readbuf, string); VERIFY(ret, 0, "strcmp"); /* Close the datatype */ @@ -709,7 +709,7 @@ test_opaque(hid_t H5_ATTR_UNUSED fid, const char *string) /* Read the tag back. */ read_buf = H5Tget_tag(type_id); - ret = strcmp(read_buf, string); + ret = HDstrcmp(read_buf, string); VERIFY(ret, 0, "H5Tget_tag"); H5free_memory(read_buf); diff --git a/test/tvlstr.c b/test/tvlstr.c index fb6a876..7e47c7b 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -110,16 +110,13 @@ test_vlstr_free_custom(void *_mem, void *info) static void test_vlstrings_basic(void) { + /* Information to write */ const char *wdata[SPACE1_DIM1] = { - "Four score and seven years ago our forefathers brought forth on this continent a new " - "nation,", + "Four score and seven years ago our forefathers brought forth on this continent a new nation,", "conceived in liberty and dedicated to the proposition that all men are created equal.", "Now we are engaged in a great civil war,", - "testing whether that nation or any nation so conceived and so dedicated can long " - "endure."}; /* Information - to - write - */ + "testing whether that nation or any nation so conceived and so dedicated can long endure."}; + char * rdata[SPACE1_DIM1]; /* Information read in */ char * wdata2; hid_t dataspace, dataset2; @@ -206,7 +203,7 @@ test_vlstrings_basic(void) for (i = 0; i < SPACE1_DIM1; i++) { if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i, - (int)strlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); + (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); continue; } /* end if */ if (HDstrcmp(wdata[i], rdata[i]) != 0) { @@ -310,7 +307,7 @@ test_vlstrings_special(void) for (i = 0; i < SPACE1_DIM1; i++) { if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i, - (int)strlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); + (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); continue; } /* end if */ if ((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) { @@ -539,7 +536,7 @@ test_compact_vlstring(void) for (i = 0; i < SPACE1_DIM1; i++) { if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i, - (int)strlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); + (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); continue; } /* end if */ if (HDstrcmp(wdata[i], rdata[i]) != 0) { @@ -662,8 +659,6 @@ test_write_vl_string_attribute(void) ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - - return; } /**************************************************************** @@ -742,8 +737,6 @@ test_read_vl_string_attribute(void) ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - - return; } /* Helper routine for test_vl_rewrite() */ @@ -780,7 +773,7 @@ read_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, char *data) ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); - if (HDstrcmp(data, data_read)) + if (HDstrcmp(data, data_read) != 0) TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read); ret = H5Treclaim(type, space, H5P_DEFAULT, &data_read); @@ -867,8 +860,6 @@ test_vl_rewrite(void) ret = H5Fclose(file2); CHECK(ret, FAIL, "H5Fclose"); - - return; } /* end test_vl_rewrite() */ /**************************************************************** diff --git a/test/tvltypes.c b/test/tvltypes.c index 514da53..50b2d7a 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1385,7 +1385,7 @@ test_vltypes_compound_vlstr(void) for (t1 = (s2 *)(wdata[i].v.p), t2 = (s2 *)(rdata[i].v.p), j = 0; j < rdata[i].v.len; j++, t1++, t2++) { - if (HDstrcmp(t1->string, t2->string)) { + if (HDstrcmp(t1->string, t2->string) != 0) { TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n", t1->string, t2->string); continue; @@ -1446,7 +1446,7 @@ test_vltypes_compound_vlstr(void) for (t1 = (s2 *)(wdata2[i].v.p), t2 = (s2 *)(rdata2[i].v.p), j = 0; j < rdata2[i].v.len; j++, t1++, t2++) { - if (HDstrcmp(t1->string, t2->string)) { + if (HDstrcmp(t1->string, t2->string) != 0) { TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n", t1->string, t2->string); continue; @@ -2508,8 +2508,8 @@ test_vltypes_fill_value(void) hid_t large_dspace_id; /* Dataspace ID for large datasets */ hid_t small_select_dspace_id; /* Dataspace ID for selection in small datasets */ hid_t large_select_dspace_id; /* Dataspace ID for selection in large datasets */ - hid_t dset_dspace_id; /* Dataspace ID for a particular dataset */ - hid_t dset_select_dspace_id; /* Dataspace ID for selection in a particular dataset */ + hid_t dset_dspace_id = -1; /* Dataspace ID for a particular dataset */ + hid_t dset_select_dspace_id = -1; /* Dataspace ID for selection in a particular dataset */ hid_t scalar_dspace_id; /* Dataspace ID for scalar dataspace */ hid_t single_dspace_id; /* Dataspace ID for single element selection */ hsize_t single_offset[] = {2}; /* Offset of single element selection */ @@ -2525,8 +2525,8 @@ test_vltypes_fill_value(void) hid_t dset_id; hsize_t small_dims[] = {SPACE4_DIM_SMALL}; hsize_t large_dims[] = {SPACE4_DIM_LARGE}; - size_t dset_elmts; /* Number of elements in a particular dataset */ - const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead", + size_t dset_elmts = 0; /* Number of elements in a particular dataset */ + const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead", 3, 4.0F, 100.0F, 1.0F, "liquid", "meter"}; const dtype1_struct wdata = {3, 4, "", NULL, "\0", "foo", "two", 6, 8.0F, 200.0F, 2.0F, "solid", "yard"}; dtype1_struct * rbuf = NULL; /* Buffer for reading data */ @@ -2691,13 +2691,13 @@ test_vltypes_fill_value(void) } break; case H5D_VIRTUAL: - assert(0 && "Invalid layout type!"); + HDassert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - assert(0 && "Unknown layout type!"); + HDassert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -2799,13 +2799,13 @@ test_vltypes_fill_value(void) break; case H5D_VIRTUAL: - assert(0 && "Invalid layout type!"); + HDassert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - assert(0 && "Unknown layout type!"); + HDassert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -2819,10 +2819,10 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ @@ -2842,10 +2842,11 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if ((i % 2) == select_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ @@ -2876,10 +2877,10 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ @@ -2899,10 +2900,11 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if ((i % 2) == select_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ @@ -2984,13 +2986,13 @@ test_vltypes_fill_value(void) break; case H5D_VIRTUAL: - assert(0 && "Invalid layout type!"); + HDassert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - assert(0 && "Unknown layout type!"); + HDassert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -3017,21 +3019,22 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if (i == single_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name || - HDstrcmp(rbuf[i].str_desc, wdata.str_desc) || - HDstrcmp(rbuf[i].str_orig, wdata.str_orig) || - HDstrcmp(rbuf[i].str_stat, wdata.str_stat) || - HDstrcmp(rbuf[i].str_form, wdata.str_form) || - HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) { + if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name || + HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 || + HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 || + HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 || + HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 || + HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ } /* end if */ else { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ @@ -3052,22 +3055,23 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if (i == single_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name || - HDstrcmp(rbuf[i].str_desc, wdata.str_desc) || - HDstrcmp(rbuf[i].str_orig, wdata.str_orig) || - HDstrcmp(rbuf[i].str_stat, wdata.str_stat) || - HDstrcmp(rbuf[i].str_form, wdata.str_form) || - HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) { + if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name || + HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 || + HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 || + HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 || + HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 || + HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ } /* end if */ else { if ((i % 2) == select_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ @@ -3103,21 +3107,22 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if (i == single_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name || - HDstrcmp(rbuf[i].str_desc, wdata.str_desc) || - HDstrcmp(rbuf[i].str_orig, wdata.str_orig) || - HDstrcmp(rbuf[i].str_stat, wdata.str_stat) || - HDstrcmp(rbuf[i].str_form, wdata.str_form) || - HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) { + if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name || + HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 || + HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 || + HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 || + HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 || + HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ } /* end if */ else { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ @@ -3138,22 +3143,23 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if (i == single_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name || - HDstrcmp(rbuf[i].str_desc, wdata.str_desc) || - HDstrcmp(rbuf[i].str_orig, wdata.str_orig) || - HDstrcmp(rbuf[i].str_stat, wdata.str_stat) || - HDstrcmp(rbuf[i].str_form, wdata.str_form) || - HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) { + if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name || + HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 || + HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 || + HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 || + HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 || + HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ } /* end if */ else { if ((i % 2) == select_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ @@ -3256,5 +3262,5 @@ test_vltypes(void) void cleanup_vltypes(void) { - remove(FILENAME); + HDremove(FILENAME); } diff --git a/test/twriteorder.c b/test/twriteorder.c index 4097c80..e792487 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -61,11 +61,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #define DATAFILE "twriteorder.dat" /* #define READERS_MAX 10 */ /* max number of readers */ @@ -141,21 +139,21 @@ parse_option(int argc, char *const argv[]) HDexit(EXIT_SUCCESS); break; case 'b': /* number of planes to write/read */ - if ((blocksize_g = atoi(optarg)) <= 0) { + if ((blocksize_g = HDatoi(optarg)) <= 0) { HDfprintf(stderr, "bad blocksize %s, must be a positive integer\n", optarg); usage(progname_g); Hgoto_error(-1); }; break; case 'n': /* number of planes to write/read */ - if ((nlinkedblock_g = atoi(optarg)) < 2) { + if ((nlinkedblock_g = HDatoi(optarg)) < 2) { HDfprintf(stderr, "bad number of linked blocks %s, must be greater than 1.\n", optarg); usage(progname_g); Hgoto_error(-1); }; break; case 'p': /* number of planes to write/read */ - if ((part_size_g = atoi(optarg)) <= 0) { + if ((part_size_g = HDatoi(optarg)) <= 0) { HDfprintf(stderr, "bad partition size %s, must be a positive integer\n", optarg); usage(progname_g); Hgoto_error(-1); @@ -404,7 +402,7 @@ main(int argc, char *argv[]) Hgoto_error(1); }; }; - mypid = getpid(); + mypid = HDgetpid(); /* ============= */ /* launch reader */ @@ -440,7 +438,7 @@ main(int argc, char *argv[]) /* If readwrite, collect exit code of child process */ /* ================================================ */ if (launch_g == UC_READWRITE) { - if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) { + if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) { HDperror("waitpid"); Hgoto_error(1); } @@ -468,7 +466,7 @@ done: return ret_value; } -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -477,4 +475,4 @@ main(void) return EXIT_SUCCESS; } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/unlink.c b/test/unlink.c index 40f7a00..73e3b25 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 25, 1998 * * Purpose: Test unlinking operations. @@ -516,7 +516,7 @@ check_new_move(hid_t fapl) /* Check soft links */ if (H5Lget_val(file, "group2/soft", linkval, sizeof(linkval), H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(linkval, "/group1/group_move")) + if (HDstrcmp(linkval, "/group1/group_move") != 0) FAIL_PUTS_ERROR(" Soft link test failed. Wrong link value") /* Cleanup */ @@ -581,7 +581,7 @@ test_filespace(hid_t fapl) size_t rdcc_nbytes; double rdcc_w0; - puts("Testing file space gets reused:"); + HDputs("Testing file space gets reused:"); /* Open file */ h5_fixname(FILENAME[4], fapl, filename, sizeof filename); diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 3699a56..107615a 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -61,11 +61,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #include "use.h" @@ -272,7 +270,7 @@ done: return (ret_value); } -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -281,4 +279,4 @@ main(void) return EXIT_SUCCESS; } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/use_append_chunk_mirror.c b/test/use_append_chunk_mirror.c index 59a7732..b19c510 100644 --- a/test/use_append_chunk_mirror.c +++ b/test/use_append_chunk_mirror.c @@ -91,11 +91,9 @@ #include "use.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #ifdef H5_HAVE_MIRROR_VFD @@ -391,7 +389,7 @@ main(void) #endif /* H5_HAVE_MIRROR_VFD */ -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -400,4 +398,4 @@ main(void) return EXIT_SUCCESS; } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c index 705e690..47c9f92 100644 --- a/test/use_append_mchunks.c +++ b/test/use_append_mchunks.c @@ -53,11 +53,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #include "use.h" @@ -165,12 +163,12 @@ main(int argc, char *argv[]) /* Fork process */ /* ============ */ if (UC_opts.launch == UC_READWRITE) { - if ((childpid = fork()) < 0) { - perror("fork"); + if ((childpid = HDfork()) < 0) { + HDperror("fork"); Hgoto_error(1); } } - mypid = getpid(); + mypid = HDgetpid(); /* ============= */ /* launch reader */ @@ -239,8 +237,8 @@ main(int argc, char *argv[]) /* If readwrite, collect exit code of child process */ /* ================================================ */ if (UC_opts.launch == UC_READWRITE) { - if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) { - perror("waitpid"); + if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) { + HDperror("waitpid"); Hgoto_error(1); } @@ -267,7 +265,7 @@ done: return (ret_value); } /* end main() */ -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -276,4 +274,4 @@ main(void) return EXIT_SUCCESS; } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/use_common.c b/test/use_common.c index b407434..0ea2c83 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -13,11 +13,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #include "use.h" @@ -68,7 +66,7 @@ parse_option(int argc, char *const argv[], options_t *opts) switch (c) { case 'h': usage(opts->progname); - exit(EXIT_SUCCESS); + HDexit(EXIT_SUCCESS); break; case 'f': /* usecase data file name */ opts->filename = HDstrdup(optarg); @@ -442,7 +440,7 @@ read_uc_file(hbool_t towait, options_t *opts) { hid_t fid; /* File ID for new HDF5 file */ hid_t dsid; /* dataset ID */ - UC_CTYPE *buffer, *bufptr; /* read data buffer */ + UC_CTYPE *buffer = NULL, *bufptr = NULL; /* read data buffer */ hid_t f_sid; /* dataset file space id */ hid_t m_sid; /* memory space id */ int rank; /* rank */ @@ -605,10 +603,12 @@ read_uc_file(hbool_t towait, options_t *opts) return -1; } + HDfree(buffer); + if (nreadererr) return -1; else return 0; } /* end read_uc_file() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c index 1f2976f..f28e574 100644 --- a/test/use_disable_mdc_flushes.c +++ b/test/use_disable_mdc_flushes.c @@ -18,11 +18,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #define H5D_FRIEND /*suppress error about including H5Dpkg */ #define H5D_TESTING @@ -539,7 +537,7 @@ done: return (ret_value); } -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -548,4 +546,4 @@ main(void) HDexit(EXIT_SUCCESS); } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/vds.c b/test/vds.c index 43d1fab..56973f8 100644 --- a/test/vds.c +++ b/test/vds.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, February 16, 2015 * * Purpose: Tests datasets with virtual layout. diff --git a/test/vds_env.c b/test/vds_env.c index ba91c69..58d90fc 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, February 16, 2015 * * Purpose: Tests datasets with virtual layout. -- cgit v0.12