summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-07-03 04:43:45 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-07-03 04:43:45 (GMT)
commit3b594992d6b062cf350d3f03e4b5c5d27b83a245 (patch)
tree42392ac76ff26413e3aee3989d60658189e2b57b /tools
parentd0bc570c2cdc4cbbb42cc1d4dac61aba67e20892 (diff)
downloadhdf5-3b594992d6b062cf350d3f03e4b5c5d27b83a245.zip
hdf5-3b594992d6b062cf350d3f03e4b5c5d27b83a245.tar.gz
hdf5-3b594992d6b062cf350d3f03e4b5c5d27b83a245.tar.bz2
Add support for GCC9, update warnhist script, and clean up warnings.
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5diff_array.c2
-rw-r--r--tools/lib/h5diff_util.c6
-rw-r--r--tools/lib/h5trav.c2
-rw-r--r--tools/src/h5repack/h5repack_refs.c24
-rw-r--r--tools/test/misc/h5clear_gentest.c2
-rw-r--r--tools/test/perform/chunk_cache.c6
-rw-r--r--tools/test/perform/perf.c21
7 files changed, 29 insertions, 34 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index ac385c9..a9a87c9 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -831,7 +831,7 @@ static hsize_t diff_datum(
nelmts = ((hvl_t *)((void *)mem1))->len;
for (j = 0; j < nelmts; j++)
- nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index,
+ nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *)((void *)mem2))->p)) + j * size, memb_type, index,
rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members);
H5Tclose(memb_type);
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index d4fc3a2..41a40f1 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -211,7 +211,7 @@ diff_basename(const char *name)
* Purpose: Returns the type as a string
*-------------------------------------------------------------------------
*/
-H5_ATTR_PURE H5_ATTR_CONST const char*
+H5_ATTR_CONST const char*
get_type(h5trav_type_t type)
{
switch(type) {
@@ -242,7 +242,7 @@ get_type(h5trav_type_t type)
* Purpose: Returns the sign as a string
*-------------------------------------------------------------------------
*/
-H5_ATTR_PURE const char*
+H5_ATTR_CONST const char*
get_sign(H5T_sign_t sign)
{
switch(sign) {
@@ -270,7 +270,7 @@ get_sign(H5T_sign_t sign)
* Purpose: Returns the class as a string
*-------------------------------------------------------------------------
*/
-H5_ATTR_PURE const char*
+H5_ATTR_CONST const char*
get_class(H5T_class_t tclass)
{
switch(tclass) {
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 917d5f5..ecc1fae 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -184,7 +184,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo,
if(udata->is_absolute) {
size_t base_len = HDstrlen(udata->base_grp_name);
size_t add_slash = base_len ? ((udata->base_grp_name)[base_len - 1] != '/') : 1;
- size_t new_name_len = base_len + add_slash + HDstrlen(path) + 1;
+ size_t new_name_len = base_len + add_slash + HDstrlen(path) + 4;
if(NULL == (new_name = (char*)HDmalloc(new_name_len)))
return(H5_ITER_ERROR);
diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c
index a275443..610c21c 100644
--- a/tools/src/h5repack/h5repack_refs.c
+++ b/tools/src/h5repack/h5repack_refs.c
@@ -22,7 +22,7 @@
*/
static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt);
-static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options,
+static int copy_refs_attr(hid_t loc_in, hid_t loc_out,
trav_table_t *travt, hid_t fidout);
static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
hid_t fid_out, void *ref_out, trav_table_t *travt);
@@ -81,7 +81,7 @@ int do_copy_refobjs(hid_t fidin,
if((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed");
- if(copy_refs_attr(grp_in, grp_out, options, travt, fidout) < 0)
+ if(copy_refs_attr(grp_in, grp_out, travt, fidout) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed");
if(H5Gclose(grp_out) < 0)
@@ -316,7 +316,7 @@ int do_copy_refobjs(hid_t fidin,
* copy referenced objects in attributes
*-------------------------------------------------------------------------
*/
- if(copy_refs_attr(dset_in, dset_out, options, travt, fidout) < 0)
+ if(copy_refs_attr(dset_in, dset_out, travt, fidout) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed");
/*-------------------------------------------------------------------------
@@ -426,7 +426,6 @@ done:
static int copy_refs_attr(hid_t loc_in,
hid_t loc_out,
- pack_opt_t *options,
trav_table_t *travt,
hid_t fidout) /* for saving references */
{
@@ -450,7 +449,6 @@ static int copy_refs_attr(hid_t loc_in,
is_ref_comp = 0;
void *refbuf = NULL;
void *buf = NULL;
- const char *refname = NULL;
unsigned *ref_comp_index = NULL;
size_t *ref_comp_size = NULL;
int ref_comp_field_n = 0;
@@ -604,12 +602,9 @@ static int copy_refs_attr(hid_t loc_in,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
} /* end if */
- for(i = 0; i < (unsigned)nelmts; i++) {
- if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt)<0)
+ for(i = 0; i < (unsigned)nelmts; i++)
+ if(update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt) < 0)
continue;
- if(options->verbose)
- printf("object <%s> reference created to <%s>\n", name, refname);
- } /* i */
} /* H5T_STD_REF_OBJ */
/* handle region references */
else if((is_ref || is_ref_array) && (H5R_DSET_REG_REF_BUF_SIZE == msize)) {
@@ -632,12 +627,9 @@ static int copy_refs_attr(hid_t loc_in,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed");
} /* end if */
- for(i = 0; i < (unsigned)nelmts; i++) {
- if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt)<0)
+ for(i = 0; i < (unsigned)nelmts; i++)
+ if(update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt) < 0)
continue;
- if(options->verbose)
- printf("object <%s> region reference created to <%s>\n", name, refname);
- }
} /* H5T_STD_REF_DSETREG */
else if (is_ref_vlen) {
/* handle VLEN of references */
@@ -700,7 +692,7 @@ static int copy_refs_attr(hid_t loc_in,
size_t idx = (i * msize) + H5Tget_member_offset(mtype_id, ref_comp_index[j]);
hobj_ref_t ref_out;
- if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
+ if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)((void *)(((char *)buf)+idx)), fidout, &ref_out, travt)<0)
continue;
HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
} /* if */
diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c
index 88c8ea5..7f80c23 100644
--- a/tools/test/misc/h5clear_gentest.c
+++ b/tools/test/misc/h5clear_gentest.c
@@ -172,7 +172,7 @@ gen_enhance_files(hbool_t user)
int data[NUM_ELMTS]; /* Buffer for data */
int fd = -1; /* The file descriptor ID */
int64_t eoa; /* The EOA value */
- int32_t chksum; /* The chksum value */
+ uint32_t chksum; /* The chksum value */
int i = 0 , j = 0, u = 0; /* Local index variable */
/* Get a copy of the default file creation property */
diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c
index 3962edd..1d2e791 100644
--- a/tools/test/perform/chunk_cache.c
+++ b/tools/test/perform/chunk_cache.c
@@ -70,9 +70,9 @@ const H5Z_class2_t H5Z_COUNTER[1] = {{
* track of the data of chunks being read from file into memory.
*/
static size_t
-counter (unsigned flags, size_t cd_nelmts,
- const unsigned *cd_values, size_t nbytes,
- size_t *buf_size, void **buf)
+counter (unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
+ const unsigned H5_ATTR_UNUSED *cd_values, size_t nbytes,
+ size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
{
nbytes_global += nbytes;
return nbytes;
diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c
index c6e62d5..1d52471 100644
--- a/tools/test/perform/perf.c
+++ b/tools/test/perform/perf.c
@@ -22,6 +22,7 @@
#include "hdf5.h"
#include "H5private.h"
+#include "h5test.h"
#ifdef H5_HAVE_PARALLEL
@@ -77,7 +78,7 @@
hsize_t dims[RANK]; /* dataset dim sizes */
hsize_t block[RANK], stride[RANK], count[RANK];
-hssize_t start[RANK];
+hsize_t start[RANK];
hid_t fid; /* HDF5 file ID */
hid_t acc_tpl; /* File access templates */
hid_t sid; /* Dataspace ID */
@@ -240,7 +241,7 @@ int main(int argc, char **argv)
*/
for(j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
- start[0] = (j*iter_jump)+(mynod*opt_block);
+ start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
stride[0] = block[0] = opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -293,7 +294,7 @@ int main(int argc, char **argv)
/* we are going to repeat the read the same pattern the write used */
for (j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
- start[0] = (j*iter_jump)+(mynod*opt_block);
+ start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
stride[0] = block[0] = opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -320,13 +321,13 @@ int main(int argc, char **argv)
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded", !H5FATAL);
- if (ret < 0) fprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
+ if (ret < 0) HDfprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
mynod, mynod*opt_block, strerror(myerrno));
/* if the user wanted to check correctness, compare the write
* buffer to the read buffer */
if (opt_correct && memcmp(buf, buf2, opt_block)) {
- fprintf(stderr, "node %d, correctness test failed\n", mynod);
+ HDfprintf(stderr, "node %d, correctness test failed\n", mynod);
my_correct = 0;
MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN,
MPI_COMM_WORLD);
@@ -435,10 +436,12 @@ parse_args(int argc, char **argv)
* e.g., -a4096/512 allocate at 4096 bytes
* boundary if request size >= 512.
*/
- {char *p;
- opt_alignment = atoi(optarg);
- if (p=(char*)strchr(optarg, '/'))
- opt_threshold = atoi(p+1);
+ {
+ char *p;
+
+ opt_alignment = HDatoi(optarg);
+ if(NULL != (p = (char*)HDstrchr(optarg, '/')))
+ opt_threshold = HDatoi(p + 1);
}
HDfprintf(stdout,
"alignment/threshold=%Hu/%Hu\n",