summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h5import/h5import.c9
-rw-r--r--tools/h5ls/h5ls.c9
-rw-r--r--tools/lib/h5diff_dset.c6
3 files changed, 8 insertions, 16 deletions
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 74c67b9..96fb6f9 100644
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -874,12 +874,9 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id)
*-------------------------------------------------------------------------
*/
- while (!HDfeof(strm)) {
- c = HDfgetc(strm);
-
+ while(EOF != (c = HDfgetc(strm)))
if (c == 10) /* eol */
nlines++;
- }
if (!nlines)
return 0;
@@ -940,9 +937,7 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id)
line = 0;
- while (!HDfeof(strm)) {
- c = HDfgetc(strm);
-
+ while(EOF != (c = HDfgetc(strm))) {
str[i] = (char)c;
i++;
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 33fc17a..2030221 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -816,8 +816,6 @@ print_float_type(h5tools_str_t *buffer, hid_t type, int ind)
* Programmer: Robb Matzke
* Thursday, November 5, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static hbool_t
@@ -832,8 +830,7 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
if(H5T_COMPOUND != H5Tget_class(type))
return FALSE;
- nmembs = H5Tget_nmembers(type);
- if(nmembs <= 0)
+ if((nmembs = H5Tget_nmembers(type)) < 0)
return FALSE;
h5tools_str_append(buffer, "struct {");
@@ -855,6 +852,7 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
size = H5Tget_size(type);
h5tools_str_append(buffer, "\n%*s} %lu byte%s",
ind, "", (unsigned long)size, 1==size?"":"s");
+
return TRUE;
}
@@ -883,8 +881,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
if(H5T_ENUM != H5Tget_class(type))
return FALSE;
- nmembs = H5Tget_nmembers(type);
- if(nmembs < 0)
+ if((nmembs = H5Tget_nmembers(type)) < 0)
return FALSE;
super = H5Tget_super(type);
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index f6e6329..d7c5639 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -441,13 +441,13 @@ hsize_t diff_datasetid( hid_t did1,
HDassert(sm_nbytes > 0);
} /* end for */
- /* malloc return code should be verified.
+ /* malloc return code should be verified.
* If fail, need to handle the error.
* This else branch should be recoded as a separate function.
* Note that there are many "goto error" within this branch
* that fails to address freeing other objects created here.
- * E.g., sm_space.
- */
+ * E.g., sm_space.
+ */
sm_buf1 = HDmalloc((size_t)sm_nbytes);
HDassert(sm_buf1);
sm_buf2 = HDmalloc((size_t)sm_nbytes);