From 236297c00d630b391b2ee3b98e67b0b83d642a12 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Fri, 8 Apr 2022 06:22:07 -0700 Subject: 1.12: Last round of normalizations for 1.12.2 (#1621) --- bin/README | 2 - src/H5.c | 35 +++++---- src/H5A.c | 46 +++++------ src/H5Dchunk.c | 34 ++++++--- src/H5Dcompact.c | 25 ++++-- src/H5Dint.c | 6 +- src/H5M.c | 4 +- src/H5VMprivate.h | 4 +- src/H5system.c | 4 +- src/H5timer.c | 15 +++- test/AtomicWriterReader.txt | 2 +- test/cork.c | 32 ++++---- test/dangle.c | 16 +++- test/direct_chunk.c | 2 +- test/fheap.c | 147 +++++++++++++++--------------------- test/titerate.c | 10 +-- test/tselect.c | 33 +++++--- tools/lib/h5tools.c | 2 +- tools/lib/h5tools_utils.c | 2 +- tools/test/perform/chunk.c | 2 - tools/test/perform/overhead.c | 6 -- tools/test/perform/pio_standalone.c | 2 +- tools/test/perform/pio_standalone.h | 5 -- tools/test/perform/sio_standalone.c | 2 +- tools/test/perform/sio_standalone.h | 5 -- tools/test/perform/zip_perf.c | 6 +- 26 files changed, 231 insertions(+), 218 deletions(-) delete mode 100644 bin/README diff --git a/bin/README b/bin/README deleted file mode 100644 index 1c77043..0000000 --- a/bin/README +++ /dev/null @@ -1,2 +0,0 @@ -The daily tests run copies of some of the scripts in this directory from another repository, notably snapshot and runtest. The copies in this directory should work, but are not used in daily tests, though they should be tested occasionally. - diff --git a/src/H5.c b/src/H5.c index 23a02d0..df30ded 100644 --- a/src/H5.c +++ b/src/H5.c @@ -597,12 +597,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5get_free_list_sizes(size_t *reg_size, size_t *arr_size, size_t *blk_size, size_t *fac_size) +H5get_free_list_sizes(size_t *reg_size /*out*/, size_t *arr_size /*out*/, size_t *blk_size /*out*/, + size_t *fac_size /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "*z*z*z*z", reg_size, arr_size, blk_size, fac_size); + H5TRACE4("e", "xxxx", reg_size, arr_size, blk_size, fac_size); /* Call the free list function to actually get the sizes */ if (H5FL_get_free_list_sizes(reg_size, arr_size, blk_size, fac_size) < 0) @@ -637,12 +638,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5get_alloc_stats(H5_alloc_stats_t *stats) +H5get_alloc_stats(H5_alloc_stats_t *stats /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*x", stats); + H5TRACE1("e", "x", stats); /* Call the internal allocation stat routine to get the values */ if (H5MM_get_alloc_stats(stats) < 0) @@ -797,12 +798,12 @@ H5__mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void *------------------------------------------------------------------------- */ herr_t -H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum) +H5get_libversion(unsigned *majnum /*out*/, unsigned *minnum /*out*/, unsigned *relnum /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*Iu*Iu*Iu", majnum, minnum, relnum); + H5TRACE3("e", "xxx", majnum, minnum, relnum); /* Set the version information */ if (majnum) @@ -920,6 +921,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) } /* end if (H5_VERS_MAJOR != majnum || H5_VERS_MINOR != minnum) */ /* H5_VERS_RELEASE should be compatible, we will only add checks for exceptions */ + /* Library develop release versions are incompatible by design */ if (H5_VERS_RELEASE != relnum) { for (unsigned i = 0; i < VERS_RELEASE_EXCEPTIONS_SIZE; i++) { /* Check for incompatible headers or incompatible library */ @@ -1024,7 +1026,7 @@ done: /*------------------------------------------------------------------------- * Function: H5close * - * Purpose: Terminate the library and release all resources. + * Purpose: Terminate the library and release all resources. * * Return: Non-negative on success/Negative on failure * @@ -1158,21 +1160,24 @@ H5free_memory(void *mem) *------------------------------------------------------------------------- */ herr_t -H5is_library_threadsafe(hbool_t *is_ts) +H5is_library_threadsafe(hbool_t *is_ts /*out*/) { - FUNC_ENTER_API_NOINIT - H5TRACE1("e", "*b", is_ts); + herr_t ret_value = SUCCEED; /* Return value */ - HDassert(is_ts); + FUNC_ENTER_API_NOINIT + H5TRACE1("e", "x", is_ts); - /* At this time, it is impossible for this to fail. */ + if (is_ts) { #ifdef H5_HAVE_THREADSAFE - *is_ts = TRUE; + *is_ts = TRUE; #else /* H5_HAVE_THREADSAFE */ - *is_ts = FALSE; + *is_ts = FALSE; #endif /* H5_HAVE_THREADSAFE */ + } + else + ret_value = FAIL; - FUNC_LEAVE_API_NOINIT(SUCCEED) + FUNC_LEAVE_API_NOINIT(ret_value) } /* end H5is_library_threadsafe() */ #if defined(H5_HAVE_THREADSAFE) && defined(H5_BUILT_AS_DYNAMIC_LIB) && defined(H5_HAVE_WIN32_API) && \ diff --git a/src/H5A.c b/src/H5A.c index 736d3cb..c1c0043 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -642,8 +642,8 @@ done: herr_t H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) { - H5VL_object_t *vol_obj; /* Attribute object for ID */ - herr_t ret_value; /* Return value */ + H5VL_object_t *vol_obj; /* Attribute object for ID */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii*x", attr_id, dtype_id, buf); @@ -685,13 +685,13 @@ done: This function reads a complete attribute from disk. --------------------------------------------------------------------------*/ herr_t -H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) +H5Aread(hid_t attr_id, hid_t dtype_id, void *buf /*out*/) { - H5VL_object_t *vol_obj; /* Attribute object for ID */ - herr_t ret_value; /* Return value */ + H5VL_object_t *vol_obj; /* Attribute object for ID */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ii*x", attr_id, dtype_id, buf); + H5TRACE3("e", "iix", attr_id, dtype_id, buf); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -849,14 +849,14 @@ done: properly terminate the string. --------------------------------------------------------------------------*/ ssize_t -H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) +H5Aget_name(hid_t attr_id, size_t buf_size, char *buf /*out*/) { H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */ H5VL_loc_params_t loc_params; ssize_t ret_value = -1; FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "iz*s", attr_id, buf_size, buf); + H5TRACE3("Zs", "izx", attr_id, buf_size, buf); /* check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -995,14 +995,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Aget_info(hid_t attr_id, H5A_info_t *ainfo) +H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/) { H5VL_object_t * vol_obj; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", attr_id, ainfo); + H5TRACE2("e", "ix", attr_id, ainfo); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -1036,7 +1036,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_info_t *ainfo, +H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_info_t *ainfo /*out*/, hid_t lapl_id) { H5VL_object_t * vol_obj; @@ -1044,7 +1044,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*s*xi", loc_id, obj_name, attr_name, ainfo, lapl_id); + H5TRACE5("e", "i*s*sxi", loc_id, obj_name, attr_name, ainfo, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1094,14 +1094,14 @@ done: */ herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - H5A_info_t *ainfo, hid_t lapl_id) + H5A_info_t *ainfo /*out*/, hid_t lapl_id) { H5VL_object_t * vol_obj; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIoh*xi", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id); + H5TRACE7("e", "i*sIiIohxi", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1300,17 +1300,17 @@ done: attribute. --------------------------------------------------------------------------*/ herr_t -H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, - void *op_data) +H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx /*in_out */, + H5A_operator2_t op, void *op_data) { - H5VL_object_t * vol_obj = NULL; /* object of loc_id */ + H5VL_object_t * vol_obj = NULL; /* Object for loc_id */ H5VL_loc_params_t loc_params; herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIiIo*hx*x", loc_id, idx_type, order, idx, op, op_data); - /* check arguments */ + /* Check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) @@ -1318,10 +1318,11 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *i if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + /* Set the location access parameters */ loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(loc_id); - /* get the loc object */ + /* Get the loc object */ if (NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") @@ -1379,7 +1380,7 @@ done: --------------------------------------------------------------------------*/ herr_t H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, - hsize_t *idx, H5A_operator2_t op, void *op_data, hid_t lapl_id) + hsize_t *idx /*in_out */, H5A_operator2_t op, void *op_data, hid_t lapl_id) { H5VL_object_t * vol_obj = NULL; /* Object location */ H5VL_loc_params_t loc_params; @@ -1402,6 +1403,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set the location access parameters */ loc_params.type = H5VL_OBJECT_BY_NAME; loc_params.obj_type = H5I_get_type(loc_id); loc_params.loc_data.loc_by_name.name = obj_name; @@ -1511,7 +1513,7 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") - /* Fill in location struct fields */ + /* Set the location access parameters */ loc_params.type = H5VL_OBJECT_BY_NAME; loc_params.loc_data.loc_by_name.name = obj_name; loc_params.loc_data.loc_by_name.lapl_id = lapl_id; @@ -1683,7 +1685,7 @@ done: * Purpose: Checks if an attribute with a given name exists on an object. * * Return: Success: TRUE/FALSE - * Failure: Negative + * Failure: Negative * * Programmer: Quincey Koziol * Thursday, November 1, 2007 diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index f0fc3a4..e6bf26c 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -107,9 +107,9 @@ /*#define H5D_CHUNK_DEBUG */ /* Flags for the "edge_chunk_state" field below */ -#define H5D_RDCC_DISABLE_FILTERS 0x01u /* Disable filters on this chunk */ +#define H5D_RDCC_DISABLE_FILTERS 0x01U /* Disable filters on this chunk */ #define H5D_RDCC_NEWLY_DISABLED_FILTERS \ - 0x02u /* Filters have been disabled since \ + 0x02U /* Filters have been disabled since \ * the last flush */ /******************/ @@ -322,13 +322,24 @@ static int H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_uda /*********************/ /* Chunked storage layout I/O ops */ -const H5D_layout_ops_t H5D_LOPS_CHUNK[1] = { - {H5D__chunk_construct, H5D__chunk_init, H5D__chunk_is_space_alloc, H5D__chunk_is_data_cached, - H5D__chunk_io_init, H5D__chunk_read, H5D__chunk_write, +const H5D_layout_ops_t H5D_LOPS_CHUNK[1] = {{ + H5D__chunk_construct, /* construct */ + H5D__chunk_init, /* init */ + H5D__chunk_is_space_alloc, /* is_space_alloc */ + H5D__chunk_is_data_cached, /* is_data_cached */ + H5D__chunk_io_init, /* io_init */ + H5D__chunk_read, /* ser_read */ + H5D__chunk_write, /* ser_write */ #ifdef H5_HAVE_PARALLEL - H5D__chunk_collective_read, H5D__chunk_collective_write, -#endif /* H5_HAVE_PARALLEL */ - NULL, NULL, H5D__chunk_flush, H5D__chunk_io_term, H5D__chunk_dest}}; + H5D__chunk_collective_read, /* par_read */ + H5D__chunk_collective_write, /* par_write */ +#endif + NULL, /* readvv */ + NULL, /* writevv */ + H5D__chunk_flush, /* flush */ + H5D__chunk_io_term, /* io_term */ + H5D__chunk_dest /* dest */ +}}; /*******************/ /* Local Variables */ @@ -595,8 +606,6 @@ H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage HDassert(offset); HDassert(storage_size); - *storage_size = 0; - /* Allocate dataspace and initialize it if it hasn't been. */ if (!(*layout->ops->is_space_alloc)(&layout->storage)) HGOTO_DONE(SUCCEED) @@ -3603,7 +3612,7 @@ H5D__chunk_cache_prune(const H5D_t *dset, size_t size) * traversing the list when pointer pN reaches wN percent of the original * list. In other words, preemption method N gets to consider entries in * approximate least recently used order w0 percent before method N+1 - * where 100% means that method N will run to completion before method N+1 + * where 100% means the method N will run to completion before method N+1 * begins. The pointers participating in the list traversal are each * given a chance at preemption before any of the pointers are advanced. */ @@ -6136,6 +6145,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) if (udata->chunk_in_cache) { HDassert(H5F_addr_defined(chunk_rec->chunk_addr)); + HDassert(ent); HDassert(H5F_addr_defined(ent->chunk_block.offset)); H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t); @@ -6417,7 +6427,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk if (NULL == (buf_space = H5S_create_simple((unsigned)1, &buf_dim, NULL))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") - /* Atomize */ + /* Register */ if ((sid_buf = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { (void)H5S_close(buf_space); HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 8a2c770..b786936 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -71,13 +71,24 @@ static herr_t H5D__compact_dest(H5D_t *dset); /*********************/ /* Compact storage layout I/O ops */ -const H5D_layout_ops_t H5D_LOPS_COMPACT[1] = { - {H5D__compact_construct, NULL, H5D__compact_is_space_alloc, NULL, H5D__compact_io_init, H5D__contig_read, - H5D__contig_write, +const H5D_layout_ops_t H5D_LOPS_COMPACT[1] = {{ + H5D__compact_construct, /* construct */ + NULL, /* init */ + H5D__compact_is_space_alloc, /* is_space_alloc */ + NULL, /* is_data_cached */ + H5D__compact_io_init, /* io_init */ + H5D__contig_read, /* ser_read */ + H5D__contig_write, /* ser_write */ #ifdef H5_HAVE_PARALLEL - NULL, NULL, -#endif /* H5_HAVE_PARALLEL */ - H5D__compact_readvv, H5D__compact_writevv, H5D__compact_flush, NULL, H5D__compact_dest}}; + NULL, /* par_read */ + NULL, /* par_write */ +#endif + H5D__compact_readvv, /* readvv */ + H5D__compact_writevv, /* writevv */ + H5D__compact_flush, /* flush */ + NULL, /* io_term */ + H5D__compact_dest /* dest */ +}}; /*******************/ /* Local Variables */ @@ -493,7 +504,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds if (NULL == (buf_space = H5S_create_simple((unsigned)1, &buf_dim, NULL))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") - /* Atomize */ + /* Register */ if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { H5S_close(buf_space); HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") diff --git a/src/H5Dint.c b/src/H5Dint.c index 6d3371d..53b691e 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -192,7 +192,7 @@ H5D__init_package(void) FUNC_ENTER_PACKAGE - /* Initialize the atom group for the dataset IDs */ + /* Initialize the ID group for the dataset IDs */ if (H5I_register_type(H5I_DATASET_CLS) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize interface") @@ -3854,7 +3854,7 @@ H5D__get_space(const H5D_t *dset) if (NULL == (space = H5S_copy(dset->shared->space, FALSE, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace") - /* Create an atom */ + /* Create an ID */ if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace") @@ -3901,7 +3901,7 @@ H5D__get_type(const H5D_t *dset) if (H5T_lock(dt, FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to lock transient datatype") - /* Create an atom */ + /* Create an ID */ if (H5T_is_named(dt)) { /* If this is a committed datatype, we need to recreate the * two-level IDs, where the VOL object is a copy of the diff --git a/src/H5M.c b/src/H5M.c index e810e6d..cbb0dc3 100644 --- a/src/H5M.c +++ b/src/H5M.c @@ -353,7 +353,7 @@ H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id H5P_LINK_CREATE_DEFAULT, key_type_id, val_type_id, mcpl_id, mapl_id, &map) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTINIT, H5I_INVALID_HID, "unable to create map") - /* Get an atom for the map */ + /* Get an ID for the map */ if ((ret_value = H5VL_register(H5I_MAP, map, vol_obj->connector, TRUE)) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register map") @@ -415,7 +415,7 @@ H5Mopen(hid_t loc_id, const char *name, hid_t mapl_id) mapl_id, &map) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open map") - /* Register an atom for the map */ + /* Register an ID for the map */ if ((ret_value = H5VL_register(H5I_MAP, map, vol_obj->connector, TRUE)) < 0) HGOTO_ERROR(H5E_MAP, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register map atom") diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 0d3bd0f..e773bae 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -393,8 +393,8 @@ static const unsigned char LogTable256[] = { static inline unsigned H5_ATTR_UNUSED H5VM_log2_gen(uint64_t n) { - unsigned r; /* r will be log2(n) */ - register unsigned int t, tt, ttt; /* temporaries */ + unsigned r; /* r will be log2(n) */ + unsigned int t, tt, ttt; /* temporaries */ if ((ttt = (unsigned)(n >> 32))) if ((tt = (unsigned)(n >> 48))) diff --git a/src/H5system.c b/src/H5system.c index 8c1fe15..7d15ee4 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -987,7 +987,7 @@ H5_nanosleep(uint64_t nanosec) #else - const uint64_t nanosec_per_sec = 1000 * 1000 * 1000; + const uint64_t nanosec_per_sec = 1000 * 1000L * 1000; struct timespec sleeptime; /* Struct to hold time to sleep */ /* Set up time to sleep @@ -1158,7 +1158,7 @@ H5_get_option(int argc, const char *const *argv, const char *opts, const struct HDfree(arg); } else { - register char *cp; /* pointer into current token */ + char *cp; /* pointer into current token */ /* short command line option */ optchar = argv[H5_optind][sp]; diff --git a/src/H5timer.c b/src/H5timer.c index b2cc5f0..b5dba97 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -193,17 +193,26 @@ H5_now_usec(void) struct timespec ts; HDclock_gettime(CLOCK_MONOTONIC, &ts); - now = (uint64_t)(ts.tv_sec * (1000 * 1000)) + (uint64_t)(ts.tv_nsec / 1000); + + /* Cast all values in this expression to uint64_t to ensure that all intermediate + * calculations are done in 64 bit, to prevent overflow */ + now = ((uint64_t)ts.tv_sec * ((uint64_t)1000 * (uint64_t)1000)) + + ((uint64_t)ts.tv_nsec / (uint64_t)1000); } #elif defined(H5_HAVE_GETTIMEOFDAY) { struct timeval now_tv; HDgettimeofday(&now_tv, NULL); - now = (uint64_t)(now_tv.tv_sec * (1000 * 1000)) + (uint64_t)now_tv.tv_usec; + + /* Cast all values in this expression to uint64_t to ensure that all intermediate + * calculations are done in 64 bit, to prevent overflow */ + now = ((uint64_t)now_tv.tv_sec * ((uint64_t)1000 * (uint64_t)1000)) + (uint64_t)now_tv.tv_usec; } #else /* H5_HAVE_GETTIMEOFDAY */ - now = (uint64_t)(HDtime(NULL) * (1000 * 1000)); + /* Cast all values in this expression to uint64_t to ensure that all intermediate calculations + * are done in 64 bit, to prevent overflow */ + now = ((uint64_t)HDtime(NULL) * ((uint64_t)1000 * (uint64_t)1000)); #endif /* H5_HAVE_GETTIMEOFDAY */ return (now); diff --git a/test/AtomicWriterReader.txt b/test/AtomicWriterReader.txt index dc0a3bd..064ba39 100644 --- a/test/AtomicWriterReader.txt +++ b/test/AtomicWriterReader.txt @@ -11,7 +11,7 @@ atomic_reader.c: is the "read" part of the test. Building the Tests ------------------ -The two test parts are automically built during configure and make process. +The two test parts are automatically built during configure and make process. But to build them individually, you can do in test/ directory: $ gcc atomic_writer $ gcc atomic_reader diff --git a/test/cork.c b/test/cork.c index a256482..9f927d8 100644 --- a/test/cork.c +++ b/test/cork.c @@ -1205,20 +1205,20 @@ static unsigned verify_multiple_cork(hbool_t swmr) { /* Variable Declarations */ - hid_t fid1 = -1, fid2 = -1; /* File ID */ - hid_t fapl = -1; /* File access property list */ - hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ - hid_t gid1 = -1, gid2 = -1; /* Group IDs */ - hid_t did1 = -1, did2 = -1; /* Dataset ID */ - hid_t aidg1 = -1, aidg2 = -1; /* Attribute ID */ - hid_t aidd1 = -1, aidd2 = -1; /* Attribute ID */ - hid_t aidt1 = -1, aidt2 = -1; /* Attribute ID */ - hid_t sid = -1; /* Dataspace ID */ - H5O_info2_t oinfo1, oinfo2, oinfo3; /* Object metadata information */ - hsize_t dim[1] = {5}; /* Dimension sizes */ - unsigned flags; /* File access flags */ - hbool_t corked; /* Cork status */ - herr_t ret; /* Return value */ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File ID */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */ + hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset ID */ + hid_t aidg1 = H5I_INVALID_HID, aidg2 = H5I_INVALID_HID; /* Attribute ID */ + hid_t aidd1 = H5I_INVALID_HID, aidd2 = H5I_INVALID_HID; /* Attribute ID */ + hid_t aidt1 = H5I_INVALID_HID, aidt2 = H5I_INVALID_HID; /* Attribute ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + H5O_info2_t oinfo1, oinfo2, oinfo3; /* Object metadata information */ + hsize_t dim[1] = {5}; /* Dimension sizes */ + unsigned flags; /* File access flags */ + hbool_t corked; /* Cork status */ + herr_t ret; /* Return value */ /* Testing Macro */ if (swmr) { @@ -1881,8 +1881,8 @@ error: static unsigned test_dset_cork(hbool_t swmr, hbool_t new_format) { - hid_t fid = H5I_INVALID_HID; /* File ID */ - hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fapl; /* File access property list */ hid_t gid = H5I_INVALID_HID; /* Group ID */ hid_t did1 = H5I_INVALID_HID, did2 = H5I_INVALID_HID; /* Dataset IDs */ hid_t tid1 = H5I_INVALID_HID, tid2 = H5I_INVALID_HID; /* Datatype IDs */ diff --git a/test/dangle.c b/test/dangle.c index d41507b..5f7a84f 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -660,7 +660,21 @@ error: int main(void) { - int nerrors = 0; + const char *env_h5_drvr; /* File Driver value from environment */ + int nerrors = 0; + + /* Get the VFD to use */ + env_h5_drvr = HDgetenv("HDF5_DRIVER"); + if (env_h5_drvr == NULL) + env_h5_drvr = "nomatch"; + + /* Don't run this test with the multi/split VFD. A bug in library shutdown + * ordering causes problems with the multi VFD when IDs are left dangling. + */ + if (!HDstrcmp(env_h5_drvr, "multi") || !HDstrcmp(env_h5_drvr, "split")) { + HDputs(" -- SKIPPED for incompatible VFD --"); + return 0; + } /* Run tests w/weak file close */ HDputs("Testing dangling objects with weak file close:"); diff --git a/test/direct_chunk.c b/test/direct_chunk.c index d4a1e7a..ac4ef8d 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -2053,7 +2053,7 @@ test_read_unallocated_chunk(hid_t file) /* Check that the chunk storage size call does not succeed. */ if (status != -1) TEST_ERROR - if (direct_chunk_nbytes != 0) + if (direct_chunk_nbytes != ULONG_MAX) TEST_ERROR } } diff --git a/test/fheap.c b/test/fheap.c index 5ca45fc..f2c9b35 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -466,40 +466,24 @@ error: return (1); } /* add_obj() */ -/*------------------------------------------------------------------------- - * Function: get_del_string - * - * Purpose: Return string describing the kind of deletion to perform - * - * Return: Success: 0 - * - * Failure: 1 - * - * Programmer: Quincey Koziol - * Monday, June 6, 2006 - * - *------------------------------------------------------------------------- - */ -static char * +/* Return a string describing the kind of deletion to perform. */ +static const char * get_del_string(const fheap_test_param_t *tparam) { - char *str; - /* Remove half of total objects from heap */ if (tparam->del_dir == FHEAP_DEL_FORWARD) if (tparam->drain_half == FHEAP_DEL_DRAIN_ALL) - str = H5MM_strdup("(all - forward)"); + return "(all - forward)"; else - str = H5MM_strdup("(half, refill, all - forward)"); + return "(half, refill, all - forward)"; else if (tparam->del_dir == FHEAP_DEL_REVERSE) if (tparam->drain_half == FHEAP_DEL_DRAIN_ALL) - str = H5MM_strdup("(all - reverse)"); + return "(all - reverse)"; else - str = H5MM_strdup("(half, refill, all - reverse)"); + return "(half, refill, all - reverse)"; else - str = H5MM_strdup("(all - deleting heap)"); + return "(all - deleting heap)"; - return (str); } /* get_del_string() */ /*------------------------------------------------------------------------- @@ -547,29 +531,20 @@ get_fill_size(const fheap_test_param_t *tparam) * *------------------------------------------------------------------------- */ -/* Disable warning for "format not a string literal" here -QAK */ -/* - * This pragma only needs to surround the snprintf() calls with - * test_desc in the code below, but early (4.4.7, at least) gcc only - * allows diagnostic pragmas to be toggled outside of functions. - */ -H5_GCC_DIAG_OFF("format-nonliteral") static int begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t *keep_ids, size_t *fill_size) { - char *del_str = NULL; /* Deletion order description */ - char *test_desc = NULL; /* Test description */ + char * test_desc; /* Test description */ + const char *del_str = get_del_string(tparam); /* * Test filling & removing all (small) objects from root direct block of absolute heap */ - del_str = get_del_string(tparam); - HDassert(del_str); - size_t test_desc_len = HDstrlen(del_str) + HDstrlen(base_desc); - test_desc = (char *)H5MM_malloc(test_desc_len); - HDsnprintf(test_desc, test_desc_len, base_desc, del_str); + size_t test_desc_len = strlen(base_desc) + sizeof(" ") + strlen(del_str); + test_desc = H5MM_malloc(test_desc_len); + (void)HDsnprintf(test_desc, test_desc_len, "%s %s", base_desc, del_str); + TESTING(test_desc); - H5MM_xfree(del_str); H5MM_xfree(test_desc); /* Initialize the heap ID structure */ @@ -582,7 +557,6 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t * /* Success */ return (0); } /* end begin_test() */ -H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- * Function: reopen_file @@ -7770,7 +7744,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ 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 = "removing all objects from root direct block of absolute heap %s"; + const char *base_desc = "removing all objects from root direct block of absolute heap"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -7843,7 +7817,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t 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 = "removing all objects from two direct blocks of absolute heap %s"; + const char *base_desc = "removing all objects from two direct blocks of absolute heap"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -7931,7 +7905,7 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t 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 = "removing all objects from first row of direct blocks of absolute heap %s"; + const char *base_desc = "removing all objects from first row of direct blocks of absolute heap"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8001,7 +7975,7 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par 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 = "removing all objects from first two rows of direct blocks of absolute heap %s"; + const char *base_desc = "removing all objects from first two rows of direct blocks of absolute heap"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8073,7 +8047,7 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa 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 = "removing all objects from first four rows of direct blocks of absolute heap %s"; + const char *base_desc = "removing all objects from first four rows of direct blocks of absolute heap"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8149,7 +8123,7 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa 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 = "removing all objects from all direct blocks of root group in absolute heap %s"; + const char *base_desc = "removing all objects from all direct blocks of root group in absolute heap"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8219,7 +8193,7 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param 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 = "removing all objects from 2nd level indirect blocks of absolute heap %s"; + const char *base_desc = "removing all objects from 2nd level indirect blocks of absolute heap"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8293,7 +8267,7 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param 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 = "removing all objects from 3rd level indirect blocks of absolute heap %s"; + const char *base_desc = "removing all objects from 3rd level indirect blocks of absolute heap"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8374,8 +8348,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ - const char *base_desc = - "inserting object that is too large for starting block, then remove all objects %s"; + const char *base_desc = "inserting object that is too large for starting block, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -8454,7 +8427,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ const char *base_desc = - "skipping starting block, then adding object back to first block, then remove all objects %s"; + "skipping starting block, then adding object back to first block, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -8554,7 +8527,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ const char *base_desc = - "skipping starting block, then adding objects to backfill and extend, then remove all objects %s"; + "skipping starting block, then adding objects to backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8663,7 +8636,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t 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"; + "blocks, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -8762,7 +8735,7 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes 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"; + "blocks, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8908,7 +8881,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * 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"; + "skipping blocks with indirect root, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9073,7 +9046,7 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ const char *base_desc = - "filling first row, then skipping rows, then backfill and extend, then remove all objects %s"; + "filling first row, then skipping rows, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9203,7 +9176,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ 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"; + "block, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -9329,7 +9302,7 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea 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"; + "backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9458,7 +9431,7 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ 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"; + "backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9590,7 +9563,7 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ /* 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"; + "large for 2nd level indirect blocks, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9736,7 +9709,7 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 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"; + "row of direct blocks, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9899,7 +9872,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ 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"; + "backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10056,7 +10029,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t /* 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"; + "block, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10236,7 +10209,7 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t /* 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"; + "3rd level indirect block, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10368,7 +10341,7 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H 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"; + "block, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10512,7 +10485,7 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h /* 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"; + "level indirect block, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10665,7 +10638,7 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( /* 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"; + "3rd level indirect block, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10823,7 +10796,7 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t 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"; + "too large for it's 2nd level indirect blocks, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10987,7 +10960,7 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s "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"; + "backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11155,7 +11128,7 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 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"; + "indirect block, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11319,7 +11292,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo "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"; + "backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11503,7 +11476,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ "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"; + "backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11722,7 +11695,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star "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"; + "block's 3rd level indirect block, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11923,7 +11896,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ "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"; + "block, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -12144,7 +12117,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar fheap_heap_state_t state; /* State of fractal heap */ unsigned u; /* Local index variables */ /* Test description */ - const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects %s"; + const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12276,7 +12249,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar fheap_heap_state_t state; /* State of fractal heap */ unsigned u, v; /* Local index variables */ /* Test description */ - const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects %s"; + const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12450,7 +12423,7 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * 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"; + "blocks, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -12562,7 +12535,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * /* 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"; + "direct blocks, then backfill and extend, then remove all objects"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -12676,7 +12649,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ - const char *base_desc = "insert one huge object, then remove %s"; + const char *base_desc = "insert one huge object, then remove"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12827,7 +12800,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ - const char *base_desc = "insert two huge objects, then remove %s"; + const char *base_desc = "insert two huge objects, then remove"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -13058,7 +13031,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ - const char *base_desc = "insert three huge objects, then remove %s"; + const char *base_desc = "insert three huge objects, then remove"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -13365,7 +13338,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ - const char *base_desc = "insert mix of normal & huge objects, then remove %s"; + const char *base_desc = "insert mix of normal & huge objects, then remove"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -13789,7 +13762,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam hbool_t huge_ids_direct; /* Are 'huge' objects directly accessed? */ hbool_t pline_init = FALSE; /* Whether the I/O pipeline has been initialized */ /* Test description */ - const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; + const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove"; /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -13997,7 +13970,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ - const char *base_desc = "insert one tiny object, then remove %s"; + const char *base_desc = "insert one tiny object, then remove"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -14148,7 +14121,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ - const char *base_desc = "insert two tiny objects, then remove %s"; + const char *base_desc = "insert two tiny objects, then remove"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -14384,7 +14357,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ /* Test description */ - const char *base_desc = "insert mix of normal, huge & tiny objects, then remove %s"; + const char *base_desc = "insert mix of normal, huge & tiny objects, then remove"; /* Perform common test initialization operations */ if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -14985,7 +14958,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para fheap_heap_state_t state; /* State of fractal heap */ unsigned deflate_level; /* Deflation level */ /* Test description */ - const char *base_desc = "insert one 'managed' object into heap with I/O filters, then remove %s"; + const char *base_desc = "insert one 'managed' object into heap with I/O filters, then remove"; /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -15159,7 +15132,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa fheap_heap_state_t state; /* State of fractal heap */ unsigned deflate_level; /* Deflation level */ /* Test description */ - const char *base_desc = "insert two 'managed' objects into heap with I/O filters, then remove %s"; + const char *base_desc = "insert two 'managed' objects into heap with I/O filters, then remove"; /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); diff --git a/test/titerate.c b/test/titerate.c index b6cdd9e3..10ed039 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -53,8 +53,8 @@ typedef struct { #define CORRUPTED_ATNAMELEN_FILE "memleak_H5O_dtype_decode_helper_H5Odtype.h5" #define DSET_NAME "image" typedef struct searched_err_t { - char message[256]; - bool found; + char message[256]; + hbool_t found; } searched_err_t; /* Call back function for test_corrupted_attnamelen */ @@ -987,7 +987,7 @@ find_err_msg_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *_ /* If the searched error message is found, stop the iteration */ if (err_desc->desc != NULL && HDstrcmp(err_desc->desc, searched_err->message) == 0) { - searched_err->found = true; + searched_err->found = TRUE; status = H5_ITER_STOP; } @@ -1033,14 +1033,14 @@ test_corrupted_attnamelen(void) if (err_status == -1) { /* Initialize client data */ HDstrcpy(err_caught.message, err_message); - err_caught.found = false; + err_caught.found = FALSE; /* Look for the correct error message */ ret = H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, find_err_msg_cb, &err_caught); CHECK(ret, FAIL, "H5Ewalk2"); /* Fail if the indicated message is not found */ - CHECK(err_caught.found, false, "test_corrupted_attnamelen: Expected error not found"); + CHECK(err_caught.found, FALSE, "test_corrupted_attnamelen: Expected error not found"); } /* Close the dataset and file */ diff --git a/test/tselect.c b/test/tselect.c index 7d32407..a489d45 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -15995,18 +15995,24 @@ test_h5s_set_extent_none(void) void test_select(void) { - hid_t plist_id; /* Property list for reading random hyperslabs */ - hid_t fapl; /* Property list accessing the file */ - int mdc_nelmts; /* Metadata number of elements */ - size_t rdcc_nelmts; /* Raw data number of elements */ - size_t rdcc_nbytes; /* Raw data number of bytes */ - double rdcc_w0; /* Raw data write percentage */ - hssize_t offset[SPACE7_RANK] = {1, 1}; /* Offset for testing selection offsets */ - herr_t ret; /* Generic return value */ + hid_t plist_id; /* Property list for reading random hyperslabs */ + hid_t fapl; /* Property list accessing the file */ + int mdc_nelmts; /* Metadata number of elements */ + size_t rdcc_nelmts; /* Raw data number of elements */ + size_t rdcc_nbytes; /* Raw data number of bytes */ + double rdcc_w0; /* Raw data write percentage */ + hssize_t offset[SPACE7_RANK] = {1, 1}; /* Offset for testing selection offsets */ + const char *env_h5_drvr; /* File Driver value from environment */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Selections\n")); + /* Get the VFD to use */ + env_h5_drvr = HDgetenv("HDF5_DRIVER"); + if (env_h5_drvr == NULL) + env_h5_drvr = "nomatch"; + /* Create a dataset transfer property list */ plist_id = H5Pcreate(H5P_DATASET_XFER); CHECK(plist_id, FAIL, "H5Pcreate"); @@ -16069,10 +16075,13 @@ test_select(void) test_select_hyper_union_3d(); /* Test hyperslab union code for 3-D dataset */ test_select_hyper_valid_combination(); /* Test different input combinations */ - test_select_hyper_and_2d(); /* Test hyperslab intersection (AND) code for 2-D dataset */ - test_select_hyper_xor_2d(); /* Test hyperslab XOR code for 2-D dataset */ - test_select_hyper_notb_2d(); /* Test hyperslab NOTB code for 2-D dataset */ - test_select_hyper_nota_2d(); /* Test hyperslab NOTA code for 2-D dataset */ + /* The following tests are currently broken with the Direct VFD */ + if (HDstrcmp(env_h5_drvr, "direct") != 0) { + test_select_hyper_and_2d(); /* Test hyperslab intersection (AND) code for 2-D dataset */ + test_select_hyper_xor_2d(); /* Test hyperslab XOR code for 2-D dataset */ + test_select_hyper_notb_2d(); /* Test hyperslab NOTB code for 2-D dataset */ + test_select_hyper_nota_2d(); /* Test hyperslab NOTA code for 2-D dataset */ + } /* test the random hyperslab I/O with the default property list for reading */ test_select_hyper_union_random_5d(H5P_DEFAULT); /* Test hyperslab union code for random 5-D hyperslabs */ diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 3c447a7..6d80082 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1005,7 +1005,7 @@ done: H5_ATTR_PURE static size_t h5tools_count_ncols(const char *s) { - register size_t i; + size_t i; for (i = 0; *s; s++) if (*s >= ' ') diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 444bab7..84d99ca 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -255,7 +255,7 @@ get_option(int argc, const char *const *argv, const char *opts, const struct lon HDfree(arg); } else { - register char *cp; /* pointer into current token */ + char *cp; /* pointer into current token */ /* short command line option */ optchar = argv[opt_ind][sp]; diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index 1b6793a..1b08e95 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -24,12 +24,10 @@ #undef NDEBUG #include "hdf5.h" -#ifdef H5_STDC_HEADERS #include #include #include #include -#endif /* Solaris Studio defines attribute, but for the attributes we need */ #if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus || defined(__SUNPRO_C) diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 2687ce9..64192ba 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -23,17 +23,11 @@ #include "hdf5.h" #include "H5private.h" -#ifdef H5_STDC_HEADERS #include #include #include #include #include -#endif - -#ifdef H5_HAVE_IO_H -#include -#endif #ifdef H5_HAVE_UNISTD_H #include diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c index b4680a4..4fab8c4 100644 --- a/tools/test/perform/pio_standalone.c +++ b/tools/test/perform/pio_standalone.c @@ -97,7 +97,7 @@ get_option(int argc, const char *const *argv, const char *opts, const struct lon sp = 1; } else { - register char *cp; /* pointer into current token */ + char *cp; /* pointer into current token */ /* short command line option */ opt_opt = argv[opt_ind][sp]; diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index 1b83e21..5e56c92 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -21,10 +21,6 @@ #include "H5public.h" /* Include Public Definitions */ -/* - * Include ANSI-C header files. - */ -#ifdef H5_STDC_HEADERS #include #include #include @@ -37,7 +33,6 @@ #include #include #include -#endif /* * Redefine all the POSIX functions. We should never see a POSIX diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c index 21a2fb5..65a655e 100644 --- a/tools/test/perform/sio_standalone.c +++ b/tools/test/perform/sio_standalone.c @@ -97,7 +97,7 @@ get_option(int argc, const char *const *argv, const char *opts, const struct lon sp = 1; } else { - register char *cp; /* pointer into current token */ + char *cp; /* pointer into current token */ /* short command line option */ opt_opt = argv[opt_ind][sp]; diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index cadc00d..02bd647 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -21,10 +21,6 @@ #include "H5public.h" /* Include Public Definitions */ -/* - * Include ANSI-C header files. - */ -#ifdef H5_STDC_HEADERS #include #include #include @@ -37,7 +33,6 @@ #include #include #include -#endif /* maximum of two, three, or four values */ #undef MAX diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index 040e774..6a8dac8 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -336,8 +336,8 @@ parse_size_directive(const char *size) static void fill_with_random_data(Bytef *src, uLongf src_len) { - register unsigned u; - h5_stat_t stat_buf; + unsigned u; + h5_stat_t stat_buf; if (HDstat("/dev/urandom", &stat_buf) == 0) { uLongf len = src_len; @@ -386,7 +386,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long Bytef * src; for (src_len = min_buf_size; src_len <= max_buf_size; src_len <<= 1) { - register unsigned long i, iters; + unsigned long i, iters; iters = file_size / src_len; src = (Bytef *)HDcalloc(1, sizeof(Bytef) * src_len); -- cgit v0.12