summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/H5srcdir.c61
-rw-r--r--test/H5srcdir.h39
-rw-r--r--test/H5srcdir_str.h.in2
-rw-r--r--test/Makefile.am8
-rw-r--r--test/cache.c2
-rw-r--r--test/cache_common.c2
-rw-r--r--test/cache_tagging.c2
-rw-r--r--test/del_many_dense_attrs.c2
-rw-r--r--test/dsets.c9
-rw-r--r--test/dt_arith.c34
-rw-r--r--test/fillval.c5
-rw-r--r--test/null_vol_connector.c6
-rw-r--r--test/objcopy_ref.c8
-rw-r--r--test/swmr_sparse_reader.c4
-rw-r--r--test/tid.c25
-rw-r--r--test/trefer.c271
-rw-r--r--test/trefer_deprec.c2
-rw-r--r--test/tvlstr.c4
-rw-r--r--test/vds_swmr.h24
-rw-r--r--test/vds_swmr_common.c36
21 files changed, 311 insertions, 237 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c7a945e..d3f8ed8 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -16,9 +16,11 @@ set (TEST_LIB_SOURCES
${HDF5_TEST_SOURCE_DIR}/cache_common.c
${HDF5_TEST_SOURCE_DIR}/external_common.c
${HDF5_TEST_SOURCE_DIR}/swmr_common.c
+ ${HDF5_TEST_SOURCE_DIR}/vds_swmr_common.c
)
set (TEST_LIB_HEADERS
+ ${HDF5_TEST_SOURCE_DIR}/H5srcdir.h
${HDF5_TEST_SOURCE_DIR}/h5test.h
${HDF5_TEST_SOURCE_DIR}/cache_common.h
${HDF5_TEST_SOURCE_DIR}/external_common.h
diff --git a/test/H5srcdir.c b/test/H5srcdir.c
new file mode 100644
index 0000000..8268d2c
--- /dev/null
+++ b/test/H5srcdir.c
@@ -0,0 +1,61 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#include "H5private.h"
+#include "H5srcdir.h"
+
+/* Buffer to construct path in and return pointer to */
+char srcdir_path[1024] = "";
+
+/* Buffer to construct file in and return pointer to */
+char srcdir_testpath[1024] = "";
+
+/* Just return the srcdir path */
+const char *
+H5_get_srcdir(void)
+{
+ const char *srcdir = HDgetenv("srcdir");
+
+ /* Check for using the srcdir from configure time */
+ if(NULL == srcdir)
+ srcdir = config_srcdir;
+
+ /* Build path to all test files */
+ if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) {
+ HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir);
+ return(srcdir_path);
+ } /* end if */
+ else
+ return(NULL);
+} /* end H5_get_srcdir() */
+
+/* Append the test file name to the srcdir path and return the whole string */
+const char *
+H5_get_srcdir_filename(const char *filename)
+{
+ const char *srcdir = H5_get_srcdir();
+
+ /* Check for error */
+ if(NULL == srcdir)
+ return(NULL);
+ else {
+ /* Build path to test file */
+ if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) {
+ HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename);
+ return(srcdir_testpath);
+ } /* end if */
+ else
+ return(NULL);
+ } /* end else */
+} /* end H5_get_srcdir_filename() */
+
diff --git a/test/H5srcdir.h b/test/H5srcdir.h
index 32fe8c9..d0a4bf7 100644
--- a/test/H5srcdir.h
+++ b/test/H5srcdir.h
@@ -24,47 +24,16 @@
#include "H5srcdir_str.h"
/* Buffer to construct path in and return pointer to */
-static char srcdir_path[1024] = "";
+extern char srcdir_path[1024];
/* Buffer to construct file in and return pointer to */
-static char srcdir_testpath[1024] = "";
+extern char srcdir_testpath[1024];
/* Just return the srcdir path */
-static const char *
-H5_get_srcdir(void)
-{
- const char *srcdir = HDgetenv("srcdir");
-
- /* Check for using the srcdir from configure time */
- if(NULL == srcdir)
- srcdir = config_srcdir;
-
- /* Build path to all test files */
- if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) {
- HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir);
- return(srcdir_path);
- } /* end if */
- else
- return(NULL);
-} /* end H5_get_srcdir() */
+const char *H5_get_srcdir(void);
/* Append the test file name to the srcdir path and return the whole string */
-static const char *H5_get_srcdir_filename(const char *filename)
-{
- const char *srcdir = H5_get_srcdir();
+const char *H5_get_srcdir_filename(const char *);
- /* Check for error */
- if(NULL == srcdir)
- return(NULL);
- else {
- /* Build path to test file */
- if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) {
- HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename);
- return(srcdir_testpath);
- } /* end if */
- else
- return(NULL);
- } /* end else */
-} /* end H5_get_srcdir_filename() */
#endif /* _H5SRCDIR_H */
diff --git a/test/H5srcdir_str.h.in b/test/H5srcdir_str.h.in
index bab1df3..ba30a88 100644
--- a/test/H5srcdir_str.h.in
+++ b/test/H5srcdir_str.h.in
@@ -16,5 +16,5 @@
*/
/* Set the 'srcdir' path from configure time */
-static const char *config_srcdir = "@srcdir@";
+#define config_srcdir "@srcdir@"
diff --git a/test/Makefile.am b/test/Makefile.am
index 57080aa..d66200d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -135,7 +135,7 @@ else
noinst_LTLIBRARIES=libh5test.la
endif
-libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c
+libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c H5srcdir.c
# Use libhd5test.la to compile all of the tests
LDADD=libh5test.la $(LIBHDF5)
@@ -145,6 +145,12 @@ ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \
ttsafe_acreate.c
cache_image_SOURCES=cache_image.c genall5.c
+#filter_plugin_SOURCES=filter_plugin.c H5srcdir.c
+
+vds_swmr_gen_SOURCES=vds_swmr_gen.c vds_swmr_common.c
+vds_swmr_writer_SOURCES=vds_swmr_writer.c vds_swmr_common.c
+vds_swmr_reader_SOURCES=vds_swmr_reader.c vds_swmr_common.c
+
VFD_LIST = sec2 stdio core core_paged split multi family
if DIRECT_VFD_CONDITIONAL
VFD_LIST += direct
diff --git a/test/cache.c b/test/cache.c
index 1a726fa..e59dc3e 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -16926,7 +16926,7 @@ check_move_entry_errs(unsigned paged)
{
herr_t result;
H5F_t * file_ptr = NULL;
- H5C_t * cache_ptr = NULL;
+ H5C_t * cache_ptr;
test_entry_t * entry_ptr = NULL;
test_entry_t * entry_0_0_ptr;
test_entry_t * entry_0_1_ptr;
diff --git a/test/cache_common.c b/test/cache_common.c
index 24962bc..740523e 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -5522,7 +5522,7 @@ col_major_scan_backward(H5F_t * file_ptr,
int mile_stone = 1;
int32_t type;
int32_t idx;
- int32_t local_max_index[NUMBER_OF_ENTRY_TYPES];
+ int32_t local_max_index[NUMBER_OF_ENTRY_TYPES] = {0};
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", FUNC);
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 7ce4e88..c3921ea 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -528,7 +528,7 @@ check_file_open_tags(hid_t fcpl, int type)
hid_t fid = -1; /* File Identifier */
int verbose = FALSE; /* verbose file outout */
hid_t fapl = -1; /* File access prop list */
- haddr_t root_tag; /* Root Group Tag */
+ haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */
haddr_t sbe_tag; /* Sblock Extension Tag */
/* Testing Macro */
diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c
index ada7a6f..ce85d1b 100644
--- a/test/del_many_dense_attrs.c
+++ b/test/del_many_dense_attrs.c
@@ -70,7 +70,7 @@ main(void)
hid_t fapl = -1; /* File access property lists */
hid_t gcpl = -1; /* Group creation property list */
char aname[50]; /* Name of attribute */
- char *basename="attr"; /* Name prefix for attribute */
+ const char *basename="attr";/* Name prefix for attribute */
char filename[100]; /* File name */
int i; /* Local index variable */
diff --git a/test/dsets.c b/test/dsets.c
index eaa469f..aa84833 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -7065,16 +7065,15 @@ static void
make_random_offset_and_increment(long nelts, long *offsetp, long *incp)
{
long inc;
-
- HDassert(0 < nelts);
-
- *offsetp = HDrandom() % nelts;
-
/* `maxinc` is chosen so that for any `x` in [0, nelts - 1],
* `x + maxinc` does not overflow a long.
*/
const long maxinc = MIN(nelts - 1, LONG_MAX - nelts);
+ HDassert(0 < nelts);
+
+ *offsetp = HDrandom() % nelts;
+
/* Choose a random number in [1, nelts - 1]. If its greatest divisor
* in common with `nelts` is 1, then it will "generate" the additive ring
* [0, nelts - 1], so let it be our increment. Otherwise, choose a new
diff --git a/test/dt_arith.c b/test/dt_arith.c
index 7e1adf5..8d04770 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -770,7 +770,7 @@ static int test_particular_fp_integer(void)
/* Print errors */
if(dst_c != SCHAR_MAX) {
- double x;
+ double x = 0.;
signed char y;
if(0 == fails_this_test++)
@@ -814,7 +814,7 @@ static int test_particular_fp_integer(void)
/* Print errors */
if(dst_i != fill_value) {
- float x;
+ float x = 0.;
int y;
if(0 == fails_this_test++)
@@ -2723,16 +2723,16 @@ my_isnan(dtype_t type, void *val)
char s[256];
if (FLT_FLOAT==type) {
- float x;
+ float x = 0.;
HDmemcpy(&x, val, sizeof(float));
retval = (x!=x);
} else if (FLT_DOUBLE==type) {
- double x;
+ double x = 0.;
HDmemcpy(&x, val, sizeof(double));
retval = (x!=x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
} else if (FLT_LDOUBLE==type) {
- long double x;
+ long double x = 0.;
HDmemcpy(&x, val, sizeof(long double));
retval = (x!=x);
#endif
@@ -2746,18 +2746,18 @@ my_isnan(dtype_t type, void *val)
*/
if (!retval) {
if (FLT_FLOAT==type) {
- float x;
+ float x = 0.;
HDmemcpy(&x, val, sizeof(float));
HDsnprintf(s, sizeof(s), "%g", (double)x);
} else if (FLT_DOUBLE==type) {
- double x;
+ double x = 0.;
HDmemcpy(&x, val, sizeof(double));
HDsnprintf(s, sizeof(s), "%g", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
} else if (FLT_LDOUBLE==type) {
- long double x;
+ long double x = 0.;
HDmemcpy(&x, val, sizeof(long double));
HDsnprintf(s, sizeof(s), "%Lg", x);
@@ -3197,7 +3197,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
int check_expo[2];
if (FLT_FLOAT==dst_type) {
- float x;
+ float x = 0.;
HDmemcpy(&x, &buf[j*dst_size], sizeof(float));
if (underflow &&
HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN)
@@ -3208,7 +3208,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
check_mant[0] = HDfrexpf(x, check_expo+0);
check_mant[1] = HDfrexpf(hw_f, check_expo+1);
} else if (FLT_DOUBLE==dst_type) {
- double x;
+ double x = 0.;
HDmemcpy(&x, &buf[j*dst_size], sizeof(double));
if (underflow &&
HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN)
@@ -3220,7 +3220,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
check_mant[1] = HDfrexp(hw_d, check_expo+1);
#if H5_SIZEOF_LONG_DOUBLE !=0 && (H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE)
} else {
- long double x;
+ long double x = 0.;
HDmemcpy(&x, &buf[j*dst_size], sizeof(long double));
/* dst is largest float, no need to check underflow. */
check_mant[0] = (double)HDfrexpl(x, check_expo+0);
@@ -3265,16 +3265,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size,k,sendian)]);
HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), "");
if (FLT_FLOAT==src_type) {
- float x;
+ float x = 0.;
HDmemcpy(&x, &saved[j*src_size], sizeof(float));
HDprintf(" %29.20e\n", (double)x);
} else if (FLT_DOUBLE==src_type) {
- double x;
+ double x = 0.;
HDmemcpy(&x, &saved[j*src_size], sizeof(double));
HDprintf(" %29.20e\n", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
} else {
- long double x;
+ long double x = 0.;
HDmemcpy(&x, &saved[j*src_size], sizeof(long double));
HDfprintf(stdout," %29.20Le\n", x);
#endif
@@ -3285,16 +3285,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k,dendian)]);
HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), "");
if (FLT_FLOAT==dst_type) {
- float x;
+ float x = 0.;
HDmemcpy(&x, &buf[j*dst_size], sizeof(float));
HDprintf(" %29.20e\n", (double)x);
} else if (FLT_DOUBLE==dst_type) {
- double x;
+ double x = 0.;
HDmemcpy(&x, &buf[j*dst_size], sizeof(double));
HDprintf(" %29.20e\n", x);
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
} else {
- long double x;
+ long double x = 0.;
HDmemcpy(&x, &buf[j*dst_size], sizeof(long double));
HDfprintf(stdout," %29.20Le\n", x);
#endif
diff --git a/test/fillval.c b/test/fillval.c
index 47cd53a..dd0ca7f 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -762,6 +762,11 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
comp_datatype *buf_c=NULL;
H5D_space_status_t allocation;
+ fill_c.a = 0;
+ fill_c.x = 0;
+ fill_c.y = 0;
+ fill_c.z = 0;
+
if(datatype == H5T_INTEGER) {
fillval = *(int*)_fillval;
}
diff --git a/test/null_vol_connector.c b/test/null_vol_connector.c
index 5ed8545..64f62c4 100644
--- a/test/null_vol_connector.c
+++ b/test/null_vol_connector.c
@@ -116,6 +116,12 @@ static const H5VL_class_t null_vol_g = {
NULL, /* optional */
NULL /* free */
},
+ { /* blob_cls */
+ NULL, /* put */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
NULL /* optional */
};
diff --git a/test/objcopy_ref.c b/test/objcopy_ref.c
index 721a7c6..fdb3179 100644
--- a/test/objcopy_ref.c
+++ b/test/objcopy_ref.c
@@ -1587,7 +1587,6 @@ main(void)
unsigned max_compact, min_dense;
int configuration; /* Configuration of tests. */
int ExpressMode;
- hbool_t same_file; /* Whether to run tests that only use one file */
/* Setup */
h5_reset();
@@ -1620,11 +1619,6 @@ main(void)
hid_t fcpl_src;
hid_t fcpl_dst;
- /* Start with same_file == TRUE. Use source file settings for these
- * tests. Don't run with a non-default destination file setting, as
- * destination settings have no effect. */
- same_file = TRUE;
-
/* No need to test dense attributes with old format */
if(!(configuration & CONFIG_SRC_NEW_FORMAT) && (configuration & CONFIG_DENSE))
continue;
@@ -1646,7 +1640,6 @@ main(void)
if(configuration & CONFIG_SHARE_DST) {
HDputs("Testing with shared dst messages:");
fcpl_dst = fcpl_shared;
- same_file = FALSE;
}
else {
HDputs("Testing without shared dst messages:");
@@ -1678,7 +1671,6 @@ main(void)
if(configuration & CONFIG_DST_NEW_FORMAT) {
HDputs("Testing with latest format for destination file:");
dst_fapl = fapl2;
- same_file = FALSE;
} /* end if */
else {
HDputs("Testing with oldest file format for destination file:");
diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c
index 6adc6c5..a969b16 100644
--- a/test/swmr_sparse_reader.c
+++ b/test/swmr_sparse_reader.c
@@ -115,7 +115,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
/* Emit informational message */
if(verbose)
- HDfprintf(stderr, "Symbol = '%s', location = %lld\n", symbol->name, (long long)start);
+ HDfprintf(stderr, "Symbol = '%s', location = %ju,%ju\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1]);
/* Read record from dataset */
record->rec_id = (uint64_t)ULLONG_MAX;
@@ -126,7 +126,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
if(record->rec_id != start[1]) {
HDfprintf(stderr, "*** ERROR ***\n");
HDfprintf(stderr, "Incorrect record value!\n");
- HDfprintf(stderr, "Symbol = '%s', location = %lld, record->rec_id = %llu\n", symbol->name, (long long)start, (unsigned long long)record->rec_id);
+ HDfprintf(stderr, "Symbol = '%s', location = %ju,%ju, record->rec_id = %" PRIu64 "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1], record->rec_id);
return -1;
} /* end if */
diff --git a/test/tid.c b/test/tid.c
index d0ae3e4..7a839d2 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -19,6 +19,13 @@
#define H5I_FRIEND /*suppress error about including H5Ipkg */
#include "H5Ipkg.h"
+static herr_t
+free_wrapper(void *p)
+{
+ HDfree(p);
+ return SUCCEED;
+}
+
/* Test basic functionality of registering and deleting types and IDs */
static int basic_id_test(void)
{
@@ -69,7 +76,7 @@ static int basic_id_test(void)
goto out;
/* Register a type */
- myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free );
+ myType = H5Iregister_type((size_t)64, 0, free_wrapper);
CHECK(myType, H5I_BADID, "H5Iregister_type");
if(myType == H5I_BADID)
@@ -163,7 +170,7 @@ static int basic_id_test(void)
H5E_END_TRY
/* Register another type and another object in that type */
- myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free );
+ myType = H5Iregister_type((size_t)64, 0, free_wrapper);
CHECK(myType, H5I_BADID, "H5Iregister_type");
if(myType == H5I_BADID)
@@ -238,7 +245,7 @@ out:
/* A dummy search function for the next test */
-static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; }
+static int test_search_func(void H5_ATTR_UNUSED * ptr1, hid_t H5_ATTR_UNUSED id, void H5_ATTR_UNUSED * ptr2) { return 0; }
/* Ensure that public functions cannot access "predefined" ID types */
static int id_predefined_test(void )
@@ -264,7 +271,7 @@ static int id_predefined_test(void )
goto out;
H5E_BEGIN_TRY
- testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj);
+ testPtr = H5Isearch(H5I_GENPROP_LST, test_search_func, testObj);
H5E_END_TRY
CHECK_PTR_NULL(testPtr, "H5Isearch");
@@ -492,7 +499,7 @@ static int test_id_type_list(void)
H5I_type_t testType;
int i; /* Just a counter variable */
- startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+ startType = H5Iregister_type((size_t)8, 0, free_wrapper);
CHECK(startType, H5I_BADID, "H5Iregister_type");
if(startType == H5I_BADID)
goto out;
@@ -507,7 +514,7 @@ static int test_id_type_list(void)
/* Create types up to H5I_MAX_NUM_TYPES */
for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++)
{
- currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+ currentType = H5Iregister_type((size_t)8, 0, free_wrapper);
CHECK(currentType, H5I_BADID, "H5Iregister_type");
if(currentType == H5I_BADID)
goto out;
@@ -516,7 +523,7 @@ static int test_id_type_list(void)
/* Wrap around to low type ID numbers */
for(i = H5I_NTYPES; i < startType; i++)
{
- currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+ currentType = H5Iregister_type((size_t)8, 0, free_wrapper);
CHECK(currentType, H5I_BADID, "H5Iregister_type");
if(currentType == H5I_BADID)
goto out;
@@ -524,7 +531,7 @@ static int test_id_type_list(void)
/* There should be no room at the inn for a new ID type*/
H5E_BEGIN_TRY
- testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+ testType = H5Iregister_type((size_t)8, 0, free_wrapper);
H5E_END_TRY
VERIFY(testType, H5I_BADID, "H5Iregister_type");
@@ -533,7 +540,7 @@ static int test_id_type_list(void)
/* Now delete a type and try to insert again */
H5Idestroy_type(H5I_NTYPES);
- testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
+ testType = H5Iregister_type((size_t)8, 0, free_wrapper);
VERIFY(testType, H5I_NTYPES, "H5Iregister_type");
if(testType != H5I_NTYPES)
diff --git a/test/trefer.c b/test/trefer.c
index 7d87ea9..4ffc2dc 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -89,9 +89,9 @@ test_reference_params(void)
H5R_ref_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf; /* temp. buffer read from disk */
+ unsigned *obuf;
H5R_type_t type; /* Reference type */
- unsigned *tu32; /* Temporary pointer to uint32 data */
- int i; /* Counters */
+ unsigned int i; /* Counters */
const char *write_comment = "Foo!"; /* Comments for group */
hid_t ret_id; /* Generic hid_t return value */
ssize_t name_size; /* Size of reference name */
@@ -101,12 +101,13 @@ test_reference_params(void)
MESSAGE(5, ("Testing Reference Parameters\n"));
/* Allocate write & read buffers */
- wbuf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
- rbuf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
- tbuf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
+ wbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)i * 3;
+ for(i = 0; i < SPACE1_DIM1; i++)
+ obuf[i] = i * 3;
/* Create file */
fid1 = H5Fcreate(FILE_REF_PARAM, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -137,7 +138,7 @@ test_reference_params(void)
CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Write selection to disk */
- ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -153,7 +154,7 @@ test_reference_params(void)
CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
/* Write attribute to disk */
- ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, obuf);
CHECK(ret, FAIL, "H5Awrite");
/* Close attribute */
@@ -233,19 +234,19 @@ test_reference_params(void)
VERIFY(type, H5R_BADTYPE, "H5Rget_type ref");
/* Test parameters to H5Requal */
- ret = H5Requal(NULL, (const H5R_ref_t *)&rbuf[0]);
+ ret = H5Requal(NULL, &rbuf[0]);
VERIFY(ret, FAIL, "H5Requal ref1");
- ret = H5Requal((const H5R_ref_t *)&rbuf[0], NULL);
+ ret = H5Requal(&rbuf[0], NULL);
VERIFY(ret, FAIL, "H5Requal ref2");
/* Test parameters to H5Rcopy */
ret = H5Rcopy(NULL, &wbuf[0]);
VERIFY(ret, FAIL, "H5Rcopy src_ref");
- ret = H5Rcopy((const H5R_ref_t *)&rbuf[0], NULL);
+ ret = H5Rcopy(&rbuf[0], NULL);
VERIFY(ret, FAIL, "H5Rcopy dest_ref");
/* Test parameters to H5Ropen_object */
- dset2 = H5Ropen_object((const H5R_ref_t *)&rbuf[0], H5I_INVALID_HID, H5I_INVALID_HID);
+ dset2 = H5Ropen_object(&rbuf[0], H5I_INVALID_HID, H5I_INVALID_HID);
VERIFY(dset2, FAIL, "H5Ropen_object oapl_id");
dset2 = H5Ropen_object(NULL, H5P_DEFAULT, dapl_id);
VERIFY(dset2, FAIL, "H5Ropen_object ref");
@@ -298,6 +299,7 @@ test_reference_params(void)
HDfree(wbuf);
HDfree(rbuf);
HDfree(tbuf);
+ HDfree(obuf);
} /* test_reference_params() */
/****************************************************************
@@ -318,10 +320,9 @@ test_reference_obj(void)
hsize_t dims1[] = {SPACE1_DIM1};
hid_t dapl_id; /* Dataset access property list */
H5R_ref_t *wbuf, /* buffer to write to disk */
- *rbuf, /* buffer read from disk */
- *tbuf; /* temp. buffer read from disk */
- unsigned *tu32; /* Temporary pointer to uint32 data */
- int i, j; /* Counters */
+ *rbuf; /* buffer read from disk */
+ unsigned *ibuf, *obuf;
+ unsigned i, j; /* Counters */
H5O_type_t obj_type; /* Object type */
herr_t ret; /* Generic return value */
@@ -329,12 +330,13 @@ test_reference_obj(void)
MESSAGE(5, ("Testing Object Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
- rbuf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
- tbuf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
+ wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)i * 3;
+ for (i = 0; i < SPACE1_DIM1; i++)
+ obuf[i] = i * 3;
/* Create file */
fid1 = H5Fcreate(FILE_REF_OBJ, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -357,7 +359,7 @@ test_reference_obj(void)
CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Write selection to disk */
- ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -405,28 +407,28 @@ test_reference_obj(void)
/* Create reference to dataset */
ret = H5Rcreate_object(fid1, "/Group1/Dataset1", &wbuf[0]);
CHECK(ret, FAIL, "H5Rcreate_object");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&wbuf[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Create reference to dataset */
ret = H5Rcreate_object(fid1, "/Group1/Dataset2", &wbuf[1]);
CHECK(ret, FAIL, "H5Rcreate_object");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&wbuf[1], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&wbuf[1], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Create reference to group */
ret = H5Rcreate_object(fid1, "/Group1", &wbuf[2]);
CHECK(ret, FAIL, "H5Rcreate_object");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&wbuf[2], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&wbuf[2], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3");
/* Create reference to named datatype */
ret = H5Rcreate_object(fid1, "/Group1/Datatype1", &wbuf[3]);
CHECK(ret, FAIL, "H5Rcreate_object");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&wbuf[3], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&wbuf[3], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3");
@@ -459,7 +461,7 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Dread");
/* Open dataset object */
- dset2 = H5Ropen_object((const H5R_ref_t *)&rbuf[0], H5P_DEFAULT, dapl_id);
+ dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
/* Check information in referenced dataset */
@@ -470,18 +472,18 @@ test_reference_obj(void)
VERIFY(ret, SPACE1_DIM1, "H5Sget_simple_extent_npoints");
/* Read from disk */
- ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tbuf);
+ ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf);
CHECK(ret, FAIL, "H5Dread");
- for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
- VERIFY(*tu32, (uint32_t)(i*3), "Data");
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(ibuf[i], i * 3, "Data");
/* Close dereferenced Dataset */
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
/* Open group object. GAPL isn't supported yet. But it's harmless to pass in */
- group = H5Ropen_object((const H5R_ref_t *)&rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
+ group = H5Ropen_object(&rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
CHECK(group, H5I_INVALID_HID, "H5Ropen_object");
/* Close group */
@@ -489,7 +491,7 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Gclose");
/* Open datatype object. TAPL isn't supported yet. But it's harmless to pass in */
- tid1 = H5Ropen_object((const H5R_ref_t *)&rbuf[3], H5P_DEFAULT, H5P_DEFAULT);
+ tid1 = H5Ropen_object(&rbuf[3], H5P_DEFAULT, H5P_DEFAULT);
CHECK(tid1, H5I_INVALID_HID, "H5Ropen_object");
/* Verify correct datatype */
@@ -530,7 +532,8 @@ test_reference_obj(void)
/* Free memory buffers */
HDfree(wbuf);
HDfree(rbuf);
- HDfree(tbuf);
+ HDfree(ibuf);
+ HDfree(obuf);
} /* test_reference_obj() */
/****************************************************************
@@ -565,7 +568,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
hsize_t high[SPACE2_RANK]; /* Selection bounds */
H5R_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
- H5R_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */
+ H5R_ref_t nvrbuf[3]={{{0}},{{101}},{{255}}}; /* buffer with non-valid refs */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
*drbuf; /* Buffer for reading numeric data from disk */
uint8_t *tu8; /* Temporary pointer to uint8 data */
@@ -583,8 +586,8 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
MESSAGE(5, ("Testing Dataset Region Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
- rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
@@ -647,7 +650,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
/* Store first dataset region */
ret = H5Rcreate_region(fid1, "/Dataset2", sid2, &wbuf[0]);
CHECK(ret, FAIL, "H5Rcreate_region");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&wbuf[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
@@ -691,7 +694,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
ret = H5Rcreate_region(fid1, "/Dataset2", sid2, &wbuf[2]);
CHECK(ret, FAIL, "H5Rcreate_region");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&wbuf[2], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&wbuf[2], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
@@ -764,7 +767,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
* Dereference an undefined reference (should fail)
*/
H5E_BEGIN_TRY {
- dset2 = H5Ropen_object((const H5R_ref_t *)&rdata_NA[0], H5P_DEFAULT, H5P_DEFAULT);
+ dset2 = H5Ropen_object(&rdata_NA[0], H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object");
@@ -798,11 +801,11 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
CHECK(ret, FAIL, "H5Dread");
/* Try to open objects */
- dset2 = H5Ropen_object((const H5R_ref_t *)&rbuf[0], H5P_DEFAULT, dapl_id);
+ dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
/* Check what H5Rget_obj_type3 function returns */
- ret = H5Rget_obj_type3((const H5R_ref_t *)&rbuf[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&rbuf[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
@@ -821,7 +824,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(*tu8, (uint8_t)(i * 3), "Data");
/* Get the hyperslab selection */
- sid2 = H5Ropen_region((const H5R_ref_t *)&rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
+ sid2 = H5Ropen_region(&rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
CHECK(sid2, H5I_INVALID_HID, "H5Ropen_region");
/* Verify correct hyperslab selected */
@@ -849,7 +852,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
CHECK(ret, FAIL, "H5Sclose");
/* Get the element selection */
- sid2 = H5Ropen_region((const H5R_ref_t *)&rbuf[1], H5P_DEFAULT, H5P_DEFAULT);
+ sid2 = H5Ropen_region(&rbuf[1], H5P_DEFAULT, H5P_DEFAULT);
CHECK(sid2, H5I_INVALID_HID, "H5Ropen_region");
/* Verify correct elements selected */
@@ -893,7 +896,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
CHECK(ret, FAIL, "H5Sclose");
/* Get the unlimited selection */
- sid2 = H5Ropen_region((const H5R_ref_t *)&rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
+ sid2 = H5Ropen_region(&rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
CHECK(sid2, H5I_INVALID_HID, "H5Ropen_region");
/* Verify correct hyperslab selected */
@@ -928,7 +931,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
/* Attempting to retrieve type of object using non-valid refs */
for(j = 0; j < 3; j++) {
H5E_BEGIN_TRY {
- ret = H5Rget_obj_type3((const H5R_ref_t *)&nvrbuf[j], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&nvrbuf[j], H5P_DEFAULT, &obj_type);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Rget_obj_type3");
} /* end for */
@@ -1006,8 +1009,8 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
- rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
+ wbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
+ rbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
@@ -1070,7 +1073,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
/* Store first dataset region */
ret = H5Rcreate_region(fid1, "/Dataset2", sid3, &wbuf[0]);
CHECK(ret, FAIL, "H5Rcreate_region");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&wbuf[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
@@ -1128,11 +1131,11 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
CHECK(ret, FAIL, "H5Dread");
/* Try to open objects */
- dset3 = H5Ropen_object((const H5R_ref_t *)&rbuf[0], H5P_DEFAULT, dapl_id);
+ dset3 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
CHECK(dset3, H5I_INVALID_HID, "H5Ropen_object");
/* Check what H5Rget_obj_type3 function returns */
- ret = H5Rget_obj_type3((const H5R_ref_t *)&rbuf[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&rbuf[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
@@ -1151,7 +1154,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(*tu8, (uint8_t)(i * 3), "Data");
/* Get the hyperslab selection */
- sid3 = H5Ropen_region((const H5R_ref_t *)&rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
+ sid3 = H5Ropen_region(&rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
CHECK(sid3, H5I_INVALID_HID, "H5Ropen_region");
/* Verify correct hyperslab selected */
@@ -1203,7 +1206,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
CHECK(ret, FAIL, "H5Sclose");
/* Get the element selection */
- sid3 = H5Ropen_region((const H5R_ref_t *)&rbuf[1], H5P_DEFAULT, H5P_DEFAULT);
+ sid3 = H5Ropen_region(&rbuf[1], H5P_DEFAULT, H5P_DEFAULT);
CHECK(sid3, H5I_INVALID_HID, "H5Ropen_region");
/* Verify correct elements selected */
@@ -1313,7 +1316,7 @@ test_reference_obj_deleted(void)
/* Create reference to dataset */
ret = H5Rcreate_object(fid1, "/Dataset1", &oref);
CHECK(ret, FAIL, "H5Rcreate_object");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&oref, H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&oref, H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
@@ -1354,7 +1357,7 @@ test_reference_obj_deleted(void)
CHECK(ret, FAIL, "H5Dread");
/* Open deleted dataset object */
- dset2 = H5Ropen_object((const H5R_ref_t *)&oref, H5P_DEFAULT, H5P_DEFAULT);
+ dset2 = H5Ropen_object(&oref, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object");
/* Close Dataset */
@@ -1501,7 +1504,7 @@ test_reference_group(void)
CHECK(ret, FAIL, "H5Dread");
/* Dereference to get the group */
- gid = H5Ropen_object((const H5R_ref_t *)&rref, H5P_DEFAULT, H5P_DEFAULT);
+ gid = H5Ropen_object(&rref, H5P_DEFAULT, H5P_DEFAULT);
CHECK(gid, H5I_INVALID_HID, "H5Ropen_object");
/* Iterate through objects in dereferenced group */
@@ -1562,8 +1565,7 @@ test_reference_attr(void)
H5R_ref_t ref_wbuf[SPACE1_DIM1], /* Buffer to write to disk */
ref_rbuf[SPACE1_DIM1]; /* Buffer read from disk */
unsigned wbuf[SPACE1_DIM1], rbuf[SPACE1_DIM1];
- unsigned *tu32; /* Temporary pointer to uint32 data */
- int i; /* Local index variables */
+ unsigned i; /* Local index variables */
H5O_type_t obj_type; /* Object type */
herr_t ret; /* Generic return value */
@@ -1590,8 +1592,8 @@ test_reference_attr(void)
attr = H5Acreate2(group, "Attr2", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)((i * 3) + 1);
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = (i * 3) + 1;
/* Write attribute to disk */
ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
@@ -1609,8 +1611,8 @@ test_reference_attr(void)
attr = H5Acreate2(dataset, "Attr1", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)(i * 3);
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = i * 3;
/* Write attribute to disk */
ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
@@ -1654,8 +1656,8 @@ test_reference_attr(void)
attr = H5Acreate2(tid, "Attr3", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)((i * 3) + 2);
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = (i * 3) + 2;
/* Write attribute to disk */
ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
@@ -1680,28 +1682,28 @@ test_reference_attr(void)
/* Create reference to dataset1 attribute */
ret = H5Rcreate_attr(fid, "/Group1/Dataset1", "Attr1", &ref_wbuf[0]);
CHECK(ret, FAIL, "H5Rcreate_attr");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&ref_wbuf[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&ref_wbuf[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Create reference to dataset2 attribute */
ret = H5Rcreate_attr(fid, "/Group1/Dataset2", "Attr1", &ref_wbuf[1]);
CHECK(ret, FAIL, "H5Rcreate_attr");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&ref_wbuf[1], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&ref_wbuf[1], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Create reference to group attribute */
ret = H5Rcreate_attr(fid, "/Group1", "Attr2", &ref_wbuf[2]);
CHECK(ret, FAIL, "H5Rcreate_attr");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&ref_wbuf[2], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&ref_wbuf[2], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3");
/* Create reference to named datatype attribute */
ret = H5Rcreate_attr(fid, "/Group1/Datatype1", "Attr3", &ref_wbuf[3]);
CHECK(ret, FAIL, "H5Rcreate_attr");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&ref_wbuf[3], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&ref_wbuf[3], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3");
@@ -1734,7 +1736,7 @@ test_reference_attr(void)
CHECK(ret, FAIL, "H5Dread");
/* Open attribute on dataset object */
- attr = H5Ropen_attr((const H5R_ref_t *)&ref_rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
+ attr = H5Ropen_attr(&ref_rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
/* Check information in referenced dataset */
@@ -1748,38 +1750,38 @@ test_reference_attr(void)
ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
CHECK(ret, FAIL, "H5Aread");
- for(tu32 = (unsigned *)rbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
- VERIFY(*tu32, (uint32_t)(i * 3), "Data");
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], i * 3, "Data");
/* Close dereferenced Dataset */
ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
/* Open attribute on group object */
- attr = H5Ropen_attr((const H5R_ref_t *)&ref_rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
+ attr = H5Ropen_attr(&ref_rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
/* Read from disk */
ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
CHECK(ret, FAIL, "H5Aread");
- for(tu32 = (unsigned *)rbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
- VERIFY(*tu32, (uint32_t)((i * 3) + 1), "Data");
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], (i * 3) + 1, "Data");
/* Close attribute */
ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
/* Open attribute on named datatype object */
- attr = H5Ropen_attr((const H5R_ref_t *)&ref_rbuf[3], H5P_DEFAULT, H5P_DEFAULT);
+ attr = H5Ropen_attr(&ref_rbuf[3], H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
/* Read from disk */
ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
CHECK(ret, FAIL, "H5Aread");
- for(tu32 = (unsigned *)rbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
- VERIFY(*tu32, (uint32_t)((i * 3) + 2), "Data");
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], (i * 3) + 2, "Data");
/* Close attribute */
ret = H5Aclose(attr);
@@ -1826,8 +1828,7 @@ test_reference_external(void)
H5R_ref_t ref_wbuf[SPACE1_DIM1], /* Buffer to write to disk */
ref_rbuf[SPACE1_DIM1]; /* Buffer read from disk */
unsigned wbuf[SPACE1_DIM1], rbuf[SPACE1_DIM1];
- unsigned *tu32; /* Temporary pointer to uint32 data */
- int i; /* Local index variables */
+ unsigned i; /* Local index variables */
H5O_type_t obj_type; /* Object type */
herr_t ret; /* Generic return value */
@@ -1854,8 +1855,8 @@ test_reference_external(void)
attr = H5Acreate2(group, "Attr2", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)((i * 3) + 1);
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = (i * 3) + 1;
/* Write attribute to disk */
ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
@@ -1873,8 +1874,8 @@ test_reference_external(void)
attr = H5Acreate2(dataset, "Attr1", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)(i * 3);
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = i * 3;
/* Write attribute to disk */
ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
@@ -1918,8 +1919,8 @@ test_reference_external(void)
attr = H5Acreate2(tid, "Attr3", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)((i * 3) + 2);
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = (i * 3) + 2;
/* Write attribute to disk */
ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
@@ -1940,28 +1941,28 @@ test_reference_external(void)
/* Create reference to dataset1 attribute */
ret = H5Rcreate_attr(fid1, "/Group1/Dataset1", "Attr1", &ref_wbuf[0]);
CHECK(ret, FAIL, "H5Rcreate_attr");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&ref_wbuf[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&ref_wbuf[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Create reference to dataset2 attribute */
ret = H5Rcreate_attr(fid1, "/Group1/Dataset2", "Attr1", &ref_wbuf[1]);
CHECK(ret, FAIL, "H5Rcreate_attr");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&ref_wbuf[1], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&ref_wbuf[1], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Create reference to group attribute */
ret = H5Rcreate_attr(fid1, "/Group1", "Attr2", &ref_wbuf[2]);
CHECK(ret, FAIL, "H5Rcreate_attr");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&ref_wbuf[2], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&ref_wbuf[2], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3");
/* Create reference to named datatype attribute */
ret = H5Rcreate_attr(fid1, "/Group1/Datatype1", "Attr3", &ref_wbuf[3]);
CHECK(ret, FAIL, "H5Rcreate_attr");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&ref_wbuf[3], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&ref_wbuf[3], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3");
@@ -2014,7 +2015,7 @@ test_reference_external(void)
CHECK(ret, FAIL, "H5Dread");
/* Open attribute on dataset object */
- attr = H5Ropen_attr((const H5R_ref_t *)&ref_rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
+ attr = H5Ropen_attr(&ref_rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
/* Check information in referenced dataset */
@@ -2028,38 +2029,38 @@ test_reference_external(void)
ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
CHECK(ret, FAIL, "H5Aread");
- for(tu32 = (unsigned *)rbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
- VERIFY(*tu32, (uint32_t)(i * 3), "Data");
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], i * 3, "Data");
/* Close dereferenced Dataset */
ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
/* Open attribute on group object */
- attr = H5Ropen_attr((const H5R_ref_t *)&ref_rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
+ attr = H5Ropen_attr(&ref_rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
/* Read from disk */
ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
CHECK(ret, FAIL, "H5Aread");
- for(tu32 = (unsigned *)rbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
- VERIFY(*tu32, (uint32_t)((i * 3) + 1), "Data");
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], (i * 3) + 1, "Data");
/* Close attribute */
ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
/* Open attribute on named datatype object */
- attr = H5Ropen_attr((const H5R_ref_t *)&ref_rbuf[3], H5P_DEFAULT, H5P_DEFAULT);
+ attr = H5Ropen_attr(&ref_rbuf[3], H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
/* Read from disk */
ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
CHECK(ret, FAIL, "H5Aread");
- for(tu32 = (unsigned *)rbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
- VERIFY(*tu32, (uint32_t)((i * 3) + 2), "Data");
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], (i * 3) + 2, "Data");
/* Close attribute */
ret = H5Aclose(attr);
@@ -2121,9 +2122,9 @@ test_reference_compat_conv(void)
/* Allocate write & read buffers */
wbuf_obj = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
- rbuf_obj = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf_obj = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
wbuf_reg = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), 2);
- rbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), 2);
+ rbuf_reg = HDcalloc(sizeof(H5R_ref_t), 2);
/* Create file */
fid1 = H5Fcreate(FILE_REF_COMPAT, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -2286,43 +2287,43 @@ test_reference_compat_conv(void)
CHECK(ret, FAIL, "H5Dread");
/* Verify type of objects pointed at */
- ret = H5Rget_obj_type3((const H5R_ref_t *)&rbuf_obj[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&rbuf_obj[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&rbuf_obj[1], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&rbuf_obj[1], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&rbuf_obj[2], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&rbuf_obj[2], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&rbuf_obj[3], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&rbuf_obj[3], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3");
/* Make sure the referenced objects can be opened */
- dset2 = H5Ropen_object((const H5R_ref_t *)&rbuf_obj[0], H5P_DEFAULT, H5P_DEFAULT);
+ dset2 = H5Ropen_object(&rbuf_obj[0], H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
- dset2 = H5Ropen_object((const H5R_ref_t *)&rbuf_obj[1], H5P_DEFAULT, H5P_DEFAULT);
+ dset2 = H5Ropen_object(&rbuf_obj[1], H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
- group2 = H5Ropen_object((const H5R_ref_t *)&rbuf_obj[2], H5P_DEFAULT, H5P_DEFAULT);
+ group2 = H5Ropen_object(&rbuf_obj[2], H5P_DEFAULT, H5P_DEFAULT);
CHECK(group2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Gclose(group2);
CHECK(ret, FAIL, "H5Gclose");
- tid2 = H5Ropen_object((const H5R_ref_t *)&rbuf_obj[3], H5P_DEFAULT, H5P_DEFAULT);
+ tid2 = H5Ropen_object(&rbuf_obj[3], H5P_DEFAULT, H5P_DEFAULT);
CHECK(tid2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Tclose(tid2);
@@ -2342,22 +2343,22 @@ test_reference_compat_conv(void)
CHECK(ret, FAIL, "H5Dread");
/* Verify type of objects pointed at */
- ret = H5Rget_obj_type3((const H5R_ref_t *)&rbuf_reg[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&rbuf_reg[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&rbuf_reg[1], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&rbuf_reg[1], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Make sure the referenced objects can be opened */
- dset2 = H5Ropen_object((const H5R_ref_t *)&rbuf_reg[0], H5P_DEFAULT, H5P_DEFAULT);
+ dset2 = H5Ropen_object(&rbuf_reg[0], H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
- dset2 = H5Ropen_object((const H5R_ref_t *)&rbuf_reg[1], H5P_DEFAULT, H5P_DEFAULT);
+ dset2 = H5Ropen_object(&rbuf_reg[1], H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Dclose(dset2);
@@ -2414,8 +2415,8 @@ test_reference_perf(void)
*rbuf_deprec;/* deprecated references */
hdset_reg_ref_t *wbuf_reg_deprec, /* deprecated references*/
*rbuf_reg_deprec; /* deprecated references*/
- unsigned *tu32; /* Temporary pointer to uint32 data */
- int i, j; /* Counters */
+ unsigned *ibuf, *obuf;
+ unsigned i, j; /* Counters */
H5O_type_t obj_type; /* Object type */
herr_t ret; /* Generic return value */
double t1, t2, t; /* Timers */
@@ -2424,18 +2425,20 @@ test_reference_perf(void)
MESSAGE(5, ("Testing Object Reference Performance\n"));
/* Allocate write & read buffers */
- wbuf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
- wbuf_deprec = (hobj_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)), SPACE1_DIM1);
- rbuf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
- rbuf_deprec = (hobj_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)), SPACE1_DIM1);
- tbuf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
- wbuf_reg = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
- rbuf_reg = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), SPACE1_DIM1);
- wbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(hdset_reg_ref_t)), SPACE1_DIM1);
- rbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(hdset_reg_ref_t)), SPACE1_DIM1);
-
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)i * 3;
+ wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ wbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
+ rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
+ tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
+ rbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ obuf[i] = i * 3;
/* Create file */
fid1 = H5Fcreate(FILE_REF_OBJ, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -2458,7 +2461,7 @@ test_reference_perf(void)
CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Write selection to disk */
- ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -2518,7 +2521,7 @@ test_reference_perf(void)
/* Create reference to dataset */
ret = H5Rcreate_object(fid1, "/Group1/Dataset1", &wbuf[0]);
CHECK(ret, FAIL, "H5Rcreate_object");
- ret = H5Rget_obj_type3((const H5R_ref_t *)&wbuf[0], H5P_DEFAULT, &obj_type);
+ ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type);
CHECK(ret, FAIL, "H5Rget_obj_type3");
VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
@@ -2670,7 +2673,7 @@ test_reference_perf(void)
CHECK(ret, FAIL, "H5Dread");
/* Open dataset object */
- dset2 = H5Ropen_object((const H5R_ref_t *)&rbuf[0], H5P_DEFAULT, dapl_id);
+ dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
/* Check information in referenced dataset */
@@ -2681,11 +2684,11 @@ test_reference_perf(void)
VERIFY(ret, dims1[0], "H5Sget_simple_extent_npoints");
/* Read from disk */
- ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tbuf);
+ ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf);
CHECK(ret, FAIL, "H5Dread");
- for(tu32 = (unsigned *)tbuf, i = 0; i < (int)dims1[0]; i++, tu32++)
- VERIFY(*tu32, (uint32_t)(i*3), "Data");
+ for(i = 0; i < dims1[0]; i++)
+ VERIFY(ibuf[i], i * 3, "Data");
/* Close dereferenced Dataset */
ret = H5Dclose(dset2);
@@ -2767,7 +2770,7 @@ test_reference_perf(void)
CHECK(ret, FAIL, "H5Fclose");
/* Destroy references */
- for(j = 0; j < (int)dims1[0]; j++) {
+ for(j = 0; j < dims1[0]; j++) {
ret = H5Rdestroy(&wbuf[j]);
CHECK(ret, FAIL, "H5Rdestroy");
ret = H5Rdestroy(&wbuf_reg[j]);
@@ -2788,6 +2791,8 @@ test_reference_perf(void)
HDfree(wbuf_reg_deprec);
HDfree(rbuf_reg_deprec);
HDfree(tbuf);
+ HDfree(ibuf);
+ HDfree(obuf);
} /* test_reference_perf() */
/****************************************************************
diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c
index 949f41b..1b77e9c 100644
--- a/test/trefer_deprec.c
+++ b/test/trefer_deprec.c
@@ -517,7 +517,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
hsize_t high[SPACE2_RANK]; /* Selection bounds */
hdset_reg_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
- hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */
+ hdset_reg_ref_t nvrbuf[3]={{{0}},{{101}},{{255}}}; /* buffer with non-valid refs */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
*drbuf; /* Buffer for reading numeric data from disk */
uint8_t *tu8; /* Temporary pointer to uint8 data */
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 731270c..cc01084 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -861,12 +861,12 @@ static void test_write_same_element(void)
hid_t file1, dataset1;
hid_t mspace, fspace, dtype;
hsize_t fdim[] = {SPACE1_DIM1};
- char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"};
+ const char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"};
hsize_t marray[] = {NUMP};
hsize_t coord[SPACE1_RANK][NUMP];
herr_t ret;
- char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."};
+ const char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."};
file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1, FAIL, "H5Fcreate");
diff --git a/test/vds_swmr.h b/test/vds_swmr.h
index eb2dcf4..18d6b35 100644
--- a/test/vds_swmr.h
+++ b/test/vds_swmr.h
@@ -84,31 +84,17 @@
#define N_PLANES_TO_WRITE 25
/* Planes */
-static hsize_t PLANES[N_SOURCES][RANK] = {
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH},
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH},
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH}
-};
+extern hsize_t PLANES[N_SOURCES][RANK];
/* File names for source datasets */
-static char FILE_NAMES[N_SOURCES][NAME_LEN] = {
- {"vds_swmr_src_a.h5"},
- {"vds_swmr_src_b.h5"},
- {"vds_swmr_src_c.h5"},
- {"vds_swmr_src_d.h5"},
- {"vds_swmr_src_e.h5"},
- {"vds_swmr_src_f.h5"}
-};
+extern char FILE_NAMES[N_SOURCES][NAME_LEN];
/* VDS file name */
-static char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
+extern char VDS_FILE_NAME[NAME_LEN];
/* Dataset names */
-static char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
-static char VDS_DSET_NAME[NAME_LEN] = "vds_dset";
+extern char SOURCE_DSET_PATH[NAME_LEN];
+extern char VDS_DSET_NAME[NAME_LEN];
/* Fill values */
#endif /* VDS_SWMR_H */
diff --git a/test/vds_swmr_common.c b/test/vds_swmr_common.c
new file mode 100644
index 0000000..d2b4bd6
--- /dev/null
+++ b/test/vds_swmr_common.c
@@ -0,0 +1,36 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#include "vds_swmr.h"
+
+hsize_t PLANES[N_SOURCES][RANK] = {
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH},
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH},
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH}
+};
+
+char FILE_NAMES[N_SOURCES][NAME_LEN] = {
+ {"vds_swmr_src_a.h5"},
+ {"vds_swmr_src_b.h5"},
+ {"vds_swmr_src_c.h5"},
+ {"vds_swmr_src_d.h5"},
+ {"vds_swmr_src_e.h5"},
+ {"vds_swmr_src_f.h5"}
+};
+
+char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
+char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
+char VDS_DSET_NAME[NAME_LEN] = "vds_dset";