summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-10-16 14:19:41 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-10-16 14:19:41 (GMT)
commit448217e7e3f15ed6aee5595a6f8bbe7db0abcb56 (patch)
tree26a96f999946948524a1b93e2e8cffef54b7337b
parentd5c073d406f8d1e1ac3bcb05883bea406c8e9378 (diff)
downloadhdf5-448217e7e3f15ed6aee5595a6f8bbe7db0abcb56.zip
hdf5-448217e7e3f15ed6aee5595a6f8bbe7db0abcb56.tar.gz
hdf5-448217e7e3f15ed6aee5595a6f8bbe7db0abcb56.tar.bz2
HDFFV-10297 Fix compiler compaliants
-rw-r--r--tools/lib/h5diff.c12
-rw-r--r--tools/lib/h5tools_dump.c3
2 files changed, 9 insertions, 6 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 285ec60..a584bf2 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -1061,11 +1061,13 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
/* make full path for obj1 */
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
- if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0)
+ if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) {
HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed");
+ }
#else /* H5_HAVE_ASPRINTF */
- if((obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL)
+ if((obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) {
HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed");
+ }
else {
HDstrcpy(obj1_fullpath, grp1_path);
HDstrcat(obj1_fullpath, table->objs[i].name);
@@ -1075,11 +1077,13 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
/* make full path for obj2 */
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
- if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0)
+ if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) {
HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed");
+ }
#else /* H5_HAVE_ASPRINTF */
- if((obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL)
+ if((obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) {
HERROR(FAIL, H5E_tools_min_id_g, "name buffer allocation failed");
+ }
else {
HDstrcpy(obj2_fullpath, grp2_path);
HDstrcat(obj2_fullpath, table->objs[i].name);
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 7c88151..f987296 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -642,8 +642,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]);
HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
- if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL)
- {
+ if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) {
HERROR(H5E_tools_g, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
HGOTO_DONE(dimension_break);
}