summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-01-15 03:05:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-01-15 03:05:59 (GMT)
commit066294e32131d1d81d326d35d67b0d753e8b8b56 (patch)
treeff8ac3f4d94edceeacf167486a8a9f7adcd01d63 /tools/h5dump/h5dump.c
parent22da4232a4693e3f0a4ee2f37053f85a28e885fd (diff)
downloadhdf5-066294e32131d1d81d326d35d67b0d753e8b8b56.zip
hdf5-066294e32131d1d81d326d35d67b0d753e8b8b56.tar.gz
hdf5-066294e32131d1d81d326d35d67b0d753e8b8b56.tar.bz2
[svn-r18109] Description:
Bring r18076-18096 from hdf5_1_8_coverity branch to trunk: r18076: Correct Coverity issue #1 by removing dead code r18077: Fix coverity item 142. When an error occurred while copying a linked list in H5S_point_copy, the library would not free the partially allocated list. Added code to free the list in this case. r18078: Correct Coverity issue #2 by removing impossible to reach code. r18079: Correct #3 by removing impossible to reach code. r18080: Correct Coverity issue #4 by removing impossible to reach code. r18081: fix coverity 26 , check (dblik->parent) before calls H5HF_man_iblock_detach(). r18082: Fixed coverity issues 321 and 316. 321: freed sm_buf in error handling to remove resource leak. Also set sm_buf to NULL after other instances in which it is freed to prevent double free. 316: initialized nmembs to 0. r18083: Correct Coverity issue #6 by removing debugging knob from error reporting code. r18084: Fix coverity item 269 + others. When a error occurred in a function using the h5tools error framework, the "past_catch" variable would not be set to true because that statement was before the label that goto jumped to. This could cause a failure in the cleanup section to go back to the start of the section, freeing variables twice, etc. Moved the label infront of past_catch=TRUE. r18085: fixed coverity #27, check if (heap) before use heap->obj.... r18086: fixed coverity #28, check curr_span not null before use it at if(curr_span && (io_bytes_left==0 || curr_seq>=maxseq)) r18087: Correct Coverity issue #7 by cleaning up correctly on error r18088: Correct Coverity #8 by removing unchanged variable checking code. r18089: Correct Coverity issue #9 - remove impossible to reach code. r18090: Correct Coverity issue #11 by removing impossible to reach code. Also clean up some minor style issues. r18091: Fix coverity items 314 and 318. Changed the improper assertion of the return value of a library function to a check, and a return(void) on failure. r18092: Fix coverity item 70. Changed the improper assertion of the return value of a library function to a check, and a return(void) on failure. r18093: Correct Coverity issue #12 by removing dead code. r18094: Correct Coverity issue #16 by removing debugging code. r18095: Fixed coverity issue # 271. Removed redundant checking and freeing of sm_buf1 and sm_buf2. r18096: Correct Coverity issue #17 by refactoring test to remove dead code. Also, removed previous "coverity" statements in comments, we'll review those issues again and see if we can figure them out, now that we have more experience with Coverity. Tested on: Mac OS X/32 10.6.2 (amazon)
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 0628299..cdc9c6a 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -2707,14 +2707,12 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
H5D_fill_time_t ft;
hsize_t storage_size;
haddr_t ioffset;
- int i, next;
+ int i;
unsigned j;
storage_size = H5Dget_storage_size(obj_id);
nfilters = H5Pget_nfilters(dcpl_id);
ioffset = H5Dget_offset(obj_id);
- next = H5Pget_external_count(dcpl_id);
- HDassert(next >= 0);
HDstrcpy(f_name,"\0");
/*-------------------------------------------------------------------------
@@ -2820,6 +2818,10 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
printf("%s\n",END);
}
else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl_id)) {
+ int next;
+
+ next = H5Pget_external_count(dcpl_id);
+
/*-------------------------------------------------------------------------
* EXTERNAL_FILE
*-------------------------------------------------------------------------
@@ -4526,16 +4528,13 @@ print_enum(hid_t type)
unsigned char *value = NULL; /*value array */
unsigned char *copy = NULL; /*a pointer to value array */
unsigned nmembs; /*number of members */
- int snmembs;
int nchars; /*number of output characters */
hid_t super; /*enum base integer type */
hid_t native = -1; /*native integer datatype */
size_t dst_size; /*destination value type size */
unsigned i;
- snmembs = H5Tget_nmembers(type);
- HDassert(snmembs >= 0);
- nmembs = (unsigned)snmembs;
+ nmembs = (unsigned)H5Tget_nmembers(type);
super = H5Tget_super(type);
/*
@@ -6708,16 +6707,13 @@ xml_print_enum(hid_t type)
char **name = NULL; /*member names */
unsigned char *value = NULL; /*value array */
unsigned nmembs; /*number of members */
- int snmembs;
hid_t super; /*enum base integer type */
hid_t native = -1; /*native integer datatype */
size_t dst_size; /*destination value type size */
unsigned i; /*miscellaneous counters */
size_t j;
- snmembs = H5Tget_nmembers(type);
- HDassert(snmembs >= 0);
- nmembs = (unsigned)snmembs;
+ nmembs = (unsigned)H5Tget_nmembers(type);
super = H5Tget_super(type);
indentation(indent);