summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-10-18 19:47:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-10-18 19:47:39 (GMT)
commite9519f5e6a437650aedf200356d1af7138f68b22 (patch)
tree6e9510fd472ad9567524b7c226cb68e4fd1bbfcb /tools/h5dump
parent0324f055660fde2ddbdd928b6b674814a9e53210 (diff)
downloadhdf5-e9519f5e6a437650aedf200356d1af7138f68b22.zip
hdf5-e9519f5e6a437650aedf200356d1af7138f68b22.tar.gz
hdf5-e9519f5e6a437650aedf200356d1af7138f68b22.tar.bz2
[svn-r22921] Description:
Review Coverity changes and bring them back to trunk. (QK & JK) r20402: Added #includes for h5tools.y or h5tools_utils.h as required to remedy implicit function declarations which caused compiler warnings and coverity issues 703-4 and 708-11. r20414: This is related to the previous checkin r20399. There were incorrect updates which caused incorrect behavior when no file was given. Also possible segfault when handling hyperslab options. Simplify the code changes. r20449: Description: Modified H5E_walk2_cb to check return value of H5I_object_verify. r20450: fixed coverity 813 Tested on: Mac OSX/64 10.8.2 (amazon) w/C++, FORTRAN, debug & threadsafe (too minor to require h5committest)
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/h5dump.c5
-rw-r--r--tools/h5dump/h5dump_xml.c3
-rw-r--r--tools/h5dump/h5dump_xml.h8
3 files changed, 5 insertions, 11 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 85d3bc8..34b8bc4 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -997,7 +997,7 @@ parse_command_line(int argc, const char *argv[])
/* this will be plenty big enough to hold the info */
if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) {
- goto error;
+ goto error;
}
/* parse command line options */
@@ -1054,7 +1054,7 @@ parse_start:
break;
case 'w':
h5tools_nCols = HDatoi(opt_arg);
- if (h5tools_nCols==0) {
+ if (h5tools_nCols <= 0) {
h5tools_nCols = 65535;
}
last_was_dset = FALSE;
@@ -1356,6 +1356,7 @@ error:
return hand;
}
+
/*-------------------------------------------------------------------------
* Function: main
diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c
index 1a29659..28264e7 100644
--- a/tools/h5dump/h5dump_xml.c
+++ b/tools/h5dump/h5dump_xml.c
@@ -3761,7 +3761,8 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
/* Print information about storage layout */
if (H5D_CHUNKED == H5Pget_layout(dcpl)) {
maxdims = H5Sget_simple_extent_ndims(space);
- chsize = (hsize_t *) HDmalloc(maxdims * sizeof(hsize_t));
+ HDassert(maxdims >= 0);
+ chsize = (hsize_t *)HDmalloc((size_t)maxdims * sizeof(hsize_t));
ctx.indent_level++;
dump_indent += COL;
diff --git a/tools/h5dump/h5dump_xml.h b/tools/h5dump/h5dump_xml.h
index 28485f8..258fd38 100644
--- a/tools/h5dump/h5dump_xml.h
+++ b/tools/h5dump/h5dump_xml.h
@@ -102,14 +102,6 @@ static h5tool_format_t xml_dataformat = {
extern "C" {
#endif
-/* internal functions used by XML option */
-static void xml_print_datatype(hid_t, unsigned);
-static void xml_print_enum(hid_t);
-static int xml_print_refs(hid_t, int);
-static int xml_print_strs(hid_t, int);
-static char *xml_escape_the_string(const char *, int);
-static char *xml_escape_the_name(const char *);
-
/* The dump functions of the dump_function_table */
/* XML format: same interface, alternative output */