diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-07-28 11:42:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 11:42:41 (GMT) |
commit | f563c2b926445f7a975553bc7742a38f42d3b6f4 (patch) | |
tree | fd21684ce4e86bd32d945ba1bd3d8065dbcf194f /tools/test/h5repack | |
parent | fe4b1c572841fff38a6b9422ea63d345ccfa96bf (diff) | |
download | hdf5-f563c2b926445f7a975553bc7742a38f42d3b6f4.zip hdf5-f563c2b926445f7a975553bc7742a38f42d3b6f4.tar.gz hdf5-f563c2b926445f7a975553bc7742a38f42d3b6f4.tar.bz2 |
Sync tools with develop (#3301)
Diffstat (limited to 'tools/test/h5repack')
-rw-r--r-- | tools/test/h5repack/dynlib_rpk.c | 2 | ||||
-rw-r--r-- | tools/test/h5repack/h5repacktst.c | 96 |
2 files changed, 55 insertions, 43 deletions
diff --git a/tools/test/h5repack/dynlib_rpk.c b/tools/test/h5repack/dynlib_rpk.c index 739dbe0..0fc3c42 100644 --- a/tools/test/h5repack/dynlib_rpk.c +++ b/tools/test/h5repack/dynlib_rpk.c @@ -23,7 +23,7 @@ static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, const uns size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIB1[1] = {{ +static const H5Z_class2_t H5Z_DYNLIB1[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_DYNLIB1, /* Filter id number */ 1, 1, /* Encoding and decoding enabled */ diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 5cd6fe3..00a7ae2 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -17,10 +17,10 @@ #include "h5tools_utils.h" #define GOERROR \ - { \ + do { \ H5_FAILED(); \ goto error; \ - } + } while (0) /* fill value test */ #define FNAME0 "h5repack_fill.h5" @@ -82,7 +82,7 @@ /* Files for testing file space paging */ #define FSPACE_OUT "h5repack_fspace_OUT.h5" /* The output file */ #define NELMTS(X) (sizeof(X) / sizeof(X[0])) /* # of elements */ -const char *H5REPACK_FSPACE_FNAMES[] = { +static const char *H5REPACK_FSPACE_FNAMES[] = { "h5repack_latest.h5", /* 0 */ "h5repack_default.h5", /* 1 */ "h5repack_page_persist.h5", /* 2 */ @@ -101,7 +101,7 @@ const char *H5REPACK_FSPACE_FNAMES[] = { /* obj and region references in attr of compound and vlen type */ #define FNAME_ATTR_REF "h5repack_attr_refs.h5" -const char *H5REPACK_FILENAMES[] = {"h5repack_big_out", NULL}; +static const char *H5REPACK_FILENAMES[] = {"h5repack_big_out", NULL}; #define H5REPACK_EXTFILE "h5repack_ext.bin" @@ -2303,7 +2303,7 @@ out: H5Tclose(tid); H5Pclose(gcplid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2373,7 +2373,7 @@ out: H5Gclose(rid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2441,7 +2441,7 @@ out: H5Gclose(g2id); H5Gclose(g3id); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -2515,7 +2515,7 @@ error: H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2600,7 +2600,7 @@ error: H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2670,7 +2670,7 @@ error: H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2743,7 +2743,7 @@ error: H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2851,7 +2851,7 @@ error: H5Sclose(sid); H5Dclose(dsid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -2953,7 +2953,7 @@ error: H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -3137,7 +3137,7 @@ error: H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -3235,7 +3235,7 @@ out: H5Dclose(did); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -3331,7 +3331,7 @@ error: H5Pclose(dcpl); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY free(buf); @@ -3404,7 +3404,7 @@ error: H5Sclose(s_sid); } - H5E_END_TRY; + H5E_END_TRY free(s_buf); @@ -3547,7 +3547,7 @@ error: H5Pclose(dcpl2); H5Pclose(dcpl3); } - H5E_END_TRY; + H5E_END_TRY free(buf1); free(buf2); @@ -3604,7 +3604,7 @@ out: H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -3686,7 +3686,7 @@ out: H5Sclose(m_sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -3740,7 +3740,7 @@ out: H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -3800,7 +3800,7 @@ out: H5Pclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (fd >= 0) HDclose(fd); @@ -3870,7 +3870,7 @@ out: H5Pclose(fcpl); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY if (fd >= 0) HDclose(fd); @@ -4095,9 +4095,11 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (write_dset(loc_id, 1, dims, "enum", tid, buf45) < 0) goto out; @@ -4319,9 +4321,11 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (write_dset(loc_id, 2, dims2, "enum2D", tid, 0) < 0) goto out; @@ -4527,9 +4531,11 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (write_dset(loc_id, 3, dims3, "enum3D", tid, 0) < 0) goto out; @@ -4636,7 +4642,7 @@ out: H5Dclose(did); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -4745,7 +4751,7 @@ out: H5Dclose(did1); H5Dclose(did2); } - H5E_END_TRY; + H5E_END_TRY return retval; } @@ -4982,9 +4988,11 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da */ if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (make_attr(loc_id, 1, dims, "enum", tid, buf45) < 0) goto out; @@ -5285,9 +5293,11 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (make_attr(loc_id, 2, dims2, "enum2D", tid, buf452) < 0) goto out; @@ -5729,9 +5739,11 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da if ((tid = H5Tcreate(H5T_ENUM, sizeof(e_t))) < 0) goto out; - if (H5Tenum_insert(tid, "RED", (val = 0, &val)) < 0) + val = 0; + if (H5Tenum_insert(tid, "RED", &val) < 0) goto out; - if (H5Tenum_insert(tid, "GREEN", (val = 1, &val)) < 0) + val = 1; + if (H5Tenum_insert(tid, "GREEN", &val) < 0) goto out; if (make_attr(loc_id, 3, dims3, "enum3D", tid, buf453) < 0) goto out; @@ -5880,7 +5892,7 @@ out: H5Sclose(sid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -5929,7 +5941,7 @@ out: { H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -5987,7 +5999,7 @@ out: H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -6024,7 +6036,7 @@ out: H5Aclose(aid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -6150,7 +6162,7 @@ out: H5Dclose(did); H5Gclose(gid); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end make_named_dtype() */ |