summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-03-12 18:00:15 (GMT)
committerGitHub <noreply@github.com>2021-03-12 18:00:15 (GMT)
commita09e1ea2191ad0ea2a72f7bd519b2cc95f218328 (patch)
tree7b41ca2a3fe29309e39db5ea13d1708c2c0ca69a /tools/lib
parent579b266e65974fad1f7c30ac5c7c24405e2d326e (diff)
downloadhdf5-a09e1ea2191ad0ea2a72f7bd519b2cc95f218328.zip
hdf5-a09e1ea2191ad0ea2a72f7bd519b2cc95f218328.tar.gz
hdf5-a09e1ea2191ad0ea2a72f7bd519b2cc95f218328.tar.bz2
Hdf5 merge issue #458 to hdf5_1_12 (#463)
* Snapshot version 1.12 release 1-3. Update version to 1.12.1-4. * First cut of the H5 public API documentation. (#80) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. * Full set of current H5F documentation. (#105) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. * Migrated documentation for SWMR functions. * Catching up on MDC functions. * Integrated the H5F MDC function documentation. * Added MDC and parallel H5F functions. * Slightly updated main page. * Added doxygen/dox/H5AC_cache_config_t.dox to MANIFEST. * Doxygen - added (mostly) beginner functions (#112) * Doxygen - added (mostly) beginner functions * Removed duplicate H5Pset_szip function * Add src/H5module.h to MANIFEST. * close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Avoid aligned access for references by decoding into temporary buffer and then copying the result into the actual buffer. Update test to be more thorough with using compound datatype fields everywhere. (#206) * Modify temporary rpath for testing in java example scripts. (#230) * Fix undefined left shifting of negative numbers (#338) Undefined Bahavior Sanitizer errored here about left shifting negative numbers. * Fixes various warnings noticed on Windows (#425) * Fixes various warnings noticed on Windows - Adds a prototype for our implementation of vasprintf - Return type of H5_get_utf16_str() is now non-const - Fixes possible uninitialized return type in Wremove_utf8 - Better isolation of fork() code in accum.c:test_swmr_write_big() - Better isolation of non-zlib code in dsets.c:test_filter_delete() - Removed unused variable in trefer.c:test_reference_cmpnd_obj() * Fixes clang-format issues * Applied clang-tidy readability-non-const-parameter warning fixes auto… (#429) * Automatically applied clang-tidy readability-avoid-const-params-in-decls fixes Removes useless const declarations. * Fixed most readability-non-const-parameter warnings These changes were made automatically by clang-tidy, but I manually reverted the changes related to the H5Z_func_t signature. * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Added C++11 override keyword where appropriate (#433) Added H5_OVERRIDE macro for compatibility with both C++11 and older. * Various clang tidy warning fixes (#448) * Fixed clang-tidy bugprone-reserved-identifier warnings * Fixed clang-tidy bugprone-assert-side-effect warnings * Fixed clang-tidy bugprone-copy-constructor-init warning * Fixed clang-tidy readability-redundant-preprocessor warning For error_test.c the removed code was already dead, because it was in the else of an `#if H5_USE_16_API` block. Based on H5Location.h, I think p_get_ref_obj_type was meant to be in `#ifndef DOXYGEN_SHOULD_SKIP_THIS` and an `#endif` was missing. Similarly, in the header, getObjTypeByIdx is only in H5_NO_DEPRECATED_SYMBOLS, not DOXYGEN_SHOULD_SKIP_THIS. * Fixed clang-tidy readability-redundant-string-init warnings * Fixed some clang-tidy performance-type-promotion-in-math-fn warnings * Fixed clang-tidy performance-unnecessary-value-param warnings * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Removed checks/workarounds for pre-C++89 compatibility (#449) After 30+ years, just assume that the following exist: - extension-less includes - namespaces - std:: - static_cast - bool * Fixed all clang-tidy bugprone-suspicious-string-compare warnings (#451) * Fixed all clang-tidy bugprone-suspicious-string-compare warnings This change was generated entirely by clang-tidy itself. * Reformat code with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Remove 2 functions incorrectly merged from develop in a cherry-pick merge of PR #451. Co-authored-by: Gerd Heber <gheber@hdfgroup.org> Co-authored-by: bljhdf <58825073+bljhdf@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Quincey Koziol <quincey@koziol.cc> Co-authored-by: Sean McBride <sean@rogue-research.com> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c10
-rw-r--r--tools/lib/h5diff_attr.c2
-rw-r--r--tools/lib/h5tools.c10
-rw-r--r--tools/lib/h5tools.h7
-rw-r--r--tools/lib/h5tools_dump.c12
-rw-r--r--tools/lib/h5tools_ref.c2
-rw-r--r--tools/lib/h5tools_str.c4
-rw-r--r--tools/lib/h5tools_str.h2
-rw-r--r--tools/lib/h5trav.c4
-rw-r--r--tools/lib/h5trav.h3
10 files changed, 29 insertions, 27 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 19a19b0..57cfaf2 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -687,7 +687,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
/* if any object is specified */
if (objname1) {
/* make the given object1 fullpath, start with "/" */
- if (HDstrncmp(objname1, "/", 1)) {
+ if (HDstrncmp(objname1, "/", 1) != 0) {
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if (HDasprintf(&obj1fullname, "/%s", objname1) < 0)
@@ -706,7 +706,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
H5TOOLS_DEBUG("obj1fullname = %s", obj1fullname);
/* make the given object2 fullpath, start with "/" */
- if (HDstrncmp(objname2, "/", 1)) {
+ if (HDstrncmp(objname2, "/", 1) != 0) {
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if (HDasprintf(&obj2fullname, "/%s", objname2) < 0)
@@ -1013,7 +1013,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
parallel_print("\n");
/* if given objects is group under root */
- if (HDstrcmp(obj1fullname, "/") || HDstrcmp(obj2fullname, "/"))
+ if (HDstrcmp(obj1fullname, "/") != 0 || HDstrcmp(obj2fullname, "/") != 0)
parallel_print("group1 group2\n");
else
parallel_print("file1 file2\n");
@@ -1115,9 +1115,9 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id,
* if not root, prepare object name to be pre-appended to group path to
* make full path
*/
- if (HDstrcmp(grp1, "/"))
+ if (HDstrcmp(grp1, "/") != 0)
grp1_path = grp1;
- if (HDstrcmp(grp2, "/"))
+ if (HDstrcmp(grp2, "/") != 0)
grp2_path = grp2;
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index c5966da..5c1777a 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -104,7 +104,7 @@ table_attrs_free(table_attrs_t *table)
* Date: March 15, 2011
*------------------------------------------------------------------------*/
static void
-table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *table)
+table_attr_mark_exist(const unsigned *exist, char *name, table_attrs_t *table)
{
if (table->nattrs == table->size) {
match_attr_t *new_attrs;
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 3b78491..ab868db 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1609,7 +1609,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools
*-------------------------------------------------------------------------
*/
void
-init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx)
+init_acc_pos(unsigned ndims, const hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx)
{
int i;
unsigned j;
@@ -1642,7 +1642,7 @@ init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t
*-------------------------------------------------------------------------
*/
hsize_t
-calc_acc_pos(unsigned ndims, hsize_t elmtno, hsize_t *acc, hsize_t *pos)
+calc_acc_pos(unsigned ndims, hsize_t elmtno, const hsize_t *acc, hsize_t *pos)
{
int i;
hsize_t curr_pos = elmtno;
@@ -1913,7 +1913,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
*/
int
render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, unsigned ndims,
- hid_t type_id, hsize_t nblocks, hsize_t *ptdata)
+ hid_t type_id, hsize_t nblocks, const hsize_t *ptdata)
{
hsize_t *dims1 = NULL;
hsize_t *start = NULL;
@@ -2221,12 +2221,12 @@ h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char
H5O_info2_t oinfo1, oinfo2;
hbool_t ret_val = FALSE;
- if (name1 && HDstrcmp(name1, "."))
+ if (name1 && HDstrcmp(name1, ".") != 0)
H5Oget_info_by_name3(loc_id1, name1, &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT);
else
H5Oget_info3(loc_id1, &oinfo1, H5O_INFO_BASIC);
- if (name2 && HDstrcmp(name2, "."))
+ if (name2 && HDstrcmp(name2, ".") != 0)
H5Oget_info_by_name3(loc_id2, name2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
else
H5Oget_info3(loc_id2, &oinfo2, H5O_INFO_BASIC);
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index a972fd9..9d065f3 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -672,8 +672,9 @@ H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type);
H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid);
H5TOOLS_DLL htri_t h5tools_detect_vlen_str(hid_t tid);
H5TOOLS_DLL hbool_t h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char *name2);
-H5TOOLS_DLL void init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx);
-H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, hsize_t *acc, hsize_t *pos);
+H5TOOLS_DLL void init_acc_pos(unsigned ndims, const hsize_t *dims, hsize_t *acc, hsize_t *pos,
+ hsize_t *p_min_idx);
+H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, const hsize_t *acc, hsize_t *pos);
H5TOOLS_DLL hbool_t h5tools_is_zero(const void *_mem, size_t size);
H5TOOLS_DLL int h5tools_canreadf(const char *name, hid_t dcpl_id);
H5TOOLS_DLL int h5tools_can_encode(H5Z_filter_t filtn);
@@ -687,7 +688,7 @@ H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_
H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t nelmts);
H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container,
unsigned ndims, hid_t type_id, hsize_t nblocks,
- hsize_t *ptdata);
+ const hsize_t *ptdata);
H5TOOLS_DLL hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream,
hid_t container);
H5TOOLS_DLL int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *stream,
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 4546178..b195f92 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -1257,12 +1257,12 @@ done:
static herr_t
h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset,
hid_t p_type, hid_t f_space, hsize_t hyperslab_count,
- hsize_t * temp_start, /* start inside offset count loop */
- hsize_t * temp_count, /* count inside offset count loop */
- hsize_t * temp_block, /* block size used in loop */
- hsize_t * temp_stride, /* stride size used in loop */
- hsize_t * total_size, /* total size of dataset */
- unsigned int row_dim) /* index of row_counter dimension */
+ hsize_t * temp_start, /* start inside offset count loop */
+ hsize_t * temp_count, /* count inside offset count loop */
+ hsize_t * temp_block, /* block size used in loop */
+ hsize_t * temp_stride, /* stride size used in loop */
+ const hsize_t *total_size, /* total size of dataset */
+ unsigned int row_dim) /* index of row_counter dimension */
{
size_t i; /* counters */
size_t j; /* counters */
diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c
index 4643466..50f283d 100644
--- a/tools/lib/h5tools_ref.c
+++ b/tools/lib/h5tools_ref.c
@@ -200,7 +200,7 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token)
if ((thepath == NULL) || (HDstrlen(thepath) == 0))
return -1;
/* Allow lookups on the root group, even though it doesn't have any link info */
- if (HDstrcmp(thepath, "/")) {
+ if (HDstrcmp(thepath, "/") != 0) {
H5L_info2_t li;
/* Check for external link first, so we don't return the OID of an object in another file */
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 212b13e..6bb1928 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -142,7 +142,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...)
/* failure, such as bad format */
return NULL;
- if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) {
+ if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s") != 0))) {
/* Truncation return value as documented by C99, or zero return value with either of the
* following conditions, each of which indicates that the proper C99 return value probably
* should have been positive when the format string is
@@ -323,7 +323,7 @@ h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, h
*/
char *
h5tools_str_region_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, hsize_t elmtno,
- hsize_t *ptdata, h5tools_context_t *ctx)
+ const hsize_t *ptdata, h5tools_context_t *ctx)
{
size_t i = 0;
diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h
index c207a83..eee87c9 100644
--- a/tools/lib/h5tools_str.h
+++ b/tools/lib/h5tools_str.h
@@ -36,7 +36,7 @@ H5TOOLS_DLL char * h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t
* new functions needed to display region reference data
*/
H5TOOLS_DLL char *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno,
- hsize_t *ptdata, h5tools_context_t *ctx);
+ const hsize_t *ptdata, h5tools_context_t *ctx);
H5TOOLS_DLL void h5tools_str_dump_space_slabs(h5tools_str_t *, hid_t, const h5tool_format_t *,
h5tools_context_t *ctx);
H5TOOLS_DLL void h5tools_str_dump_space_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *);
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 042288c..d0c299f 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -357,7 +357,7 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id)
H5O_info2_t oinfo;
size_t idx = info->nused - 1;
- if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, "."))
+ if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, ".") != 0)
H5Oget_info_by_name3(loc_id, info->paths[idx].path, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
else
H5Oget_info3(loc_id, &oinfo, H5O_INFO_BASIC);
@@ -731,7 +731,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char
*-------------------------------------------------------------------------
*/
void
-trav_table_addflags(unsigned *flags, char *name, h5trav_type_t type, trav_table_t *table)
+trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_table_t *table)
{
size_t new_obj;
diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h
index c7b9db7..7a8a63d 100644
--- a/tools/lib/h5trav.h
+++ b/tools/lib/h5trav.h
@@ -187,6 +187,7 @@ H5TOOLS_DLL void trav_table_init(hid_t fid, trav_table_t **table);
H5TOOLS_DLL void trav_table_free(trav_table_t *table);
-H5TOOLS_DLL void trav_table_addflags(unsigned *flags, char *objname, h5trav_type_t type, trav_table_t *table);
+H5TOOLS_DLL void trav_table_addflags(const unsigned *flags, char *objname, h5trav_type_t type,
+ trav_table_t *table);
#endif /* H5TRAV_H */