summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/h5dump.c18
-rw-r--r--tools/lib/h5diff_dset.c5
-rw-r--r--tools/lib/h5tools.c11
-rw-r--r--tools/lib/h5tools_error.h2
4 files changed, 15 insertions, 21 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index a6c1f77..6e661df 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
*-------------------------------------------------------------------------
@@ -4511,16 +4513,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);
/*
@@ -6693,16 +6692,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);
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index ad9331d..2cc84ca 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -545,11 +545,6 @@ hsize_t diff_datasetid( hid_t did1,
} /* elmtno */
H5Sclose(sm_space);
- /* free */
- HDfree(sm_buf1);
- sm_buf1 = NULL;
- HDfree(sm_buf2);
- sm_buf2 = NULL;
} /* hyperslab read */
}/*can_compare*/
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 4761ab9..f510a5b 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -2070,6 +2070,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
if(sm_buf)
HDfree(sm_buf);
+ sm_buf = NULL;
}
else
H5E_THROW(SUCCEED, H5E_tools_min_id_g, "nothing to print");
@@ -2081,6 +2082,9 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
} /* hyperslab_count loop */
CATCH
+ if(sm_buf)
+ HDfree(sm_buf);
+
return ret_value;
}
@@ -3286,7 +3290,7 @@ h5tools_print_enum(h5tools_str_t *buffer, hid_t type)
char **name = NULL; /*member names */
unsigned char *value = NULL; /*value array */
unsigned char *copy = NULL; /*a pointer to value array */
- unsigned nmembs; /*number of members */
+ unsigned nmembs = 0; /*number of members */
int nchars; /*number of output characters */
hid_t super = -1; /*enum base integer type */
hid_t native = -1; /*native integer datatype */
@@ -3380,10 +3384,9 @@ h5tools_print_enum(h5tools_str_t *buffer, hid_t type)
}
CATCH
-
if(name) {
/* Release resources */
- for (i = 0; i < nmembs; i++)
+ for(i = 0; i < nmembs; i++)
if(name[i])
free(name[i]);
free(name);
@@ -3395,7 +3398,7 @@ CATCH
if(super >= 0 && H5Tclose(super) < 0)
H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not close datatype's super class");
- if (0 == nmembs)
+ if(0 == nmembs)
h5tools_str_append(buffer, "\n<empty>");
return ret_value;
diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h
index da8f03c..dc5f87b 100644
--- a/tools/lib/h5tools_error.h
+++ b/tools/lib/h5tools_error.h
@@ -71,7 +71,7 @@ extern hid_t H5E_tools_min_id_g;
/* Macro for "catching" flow of control when an error occurs. Note that the
* H5_LEAVE macro won't jump back here once it's past this point.
*/
-#define CATCH past_catch = TRUE; catch_except:;
+#define CATCH catch_except:; past_catch = TRUE;
/*
* H5_LEAVE macro, used to facilitate control flow between a