summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-02-04 16:53:55 (GMT)
committerGitHub <noreply@github.com>2022-02-04 16:53:55 (GMT)
commit36d9a165e428eb883f9fd72b6707555536292845 (patch)
tree61848a7a985725dcbb52daab3a986ff490cf909c /tools/lib
parent856de93673f2bd097b90e2803475ef4fc3d689fa (diff)
downloadhdf5-36d9a165e428eb883f9fd72b6707555536292845.zip
hdf5-36d9a165e428eb883f9fd72b6707555536292845.tar.gz
hdf5-36d9a165e428eb883f9fd72b6707555536292845.tar.bz2
Fix a few issues noted by LGTM (#1421)
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff_array.c6
-rw-r--r--tools/lib/h5diff_attr.c2
-rw-r--r--tools/lib/h5tools.c2
-rw-r--r--tools/lib/h5tools_dump.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 1b0d36f..e8cfacb 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -2063,7 +2063,7 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
opts->print_percentage = 0;
print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
- parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
+ parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
@@ -2110,7 +2110,7 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
opts->print_percentage = 0;
print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
- parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
+ parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
@@ -2157,7 +2157,7 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
opts->print_percentage = 0;
print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
- parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
+ parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 5c1777a..63b6d8f 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -292,7 +292,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out,
}
if (opts->mode_verbose_level >= 1)
- parallel_print("Attributes status: %d common, %d only in obj1, %d only in obj2\n",
+ parallel_print("Attributes status: %zu common, %zu only in obj1, %zu only in obj2\n",
table_lp->nattrs - table_lp->nattrs_only1 - table_lp->nattrs_only2,
table_lp->nattrs_only1, table_lp->nattrs_only2);
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index db8df16..da55136 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -945,7 +945,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec
* as TRUE, we should return failure now since the file couldn't be opened with
* the VFL driver/VOL connector that was set on the FAPL by the caller.
*/
- if (fid < 0 && use_specific_driver)
+ if (use_specific_driver)
H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to open file using specified FAPL");
/*
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 0fc5d2d..b8c9a19 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -2486,7 +2486,7 @@ found_string_type:
ctx->need_prefix = TRUE;
h5tools_str_reset(buffer);
- h5tools_str_append(buffer, "OPAQUE_SIZE \"%s\";", size);
+ h5tools_str_append(buffer, "OPAQUE_SIZE \"%zu\";", size);
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0,
(hsize_t)0);
}
@@ -2996,7 +2996,7 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c
ctx->need_prefix = TRUE;
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, "%s %s %d %s", OBJID, BEGIN, oid, END);
+ h5tools_str_append(&buffer, "%s %s %" PRId64 " %s", OBJID, BEGIN, oid, END);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
h5tools_str_close(&buffer);