summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perform/zip_perf.c2
-rw-r--r--src/H5T.c20
-rw-r--r--test/enum.c3
-rw-r--r--test/h5test.h2
4 files changed, 16 insertions, 11 deletions
diff --git a/perform/zip_perf.c b/perform/zip_perf.c
index 26b0ea4..ae84304 100644
--- a/perform/zip_perf.c
+++ b/perform/zip_perf.c
@@ -23,6 +23,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/time.h>
+#include <sys/uio.h>
+#include <unistd.h>
/* our header files */
#include "hdf5.h"
diff --git a/src/H5T.c b/src/H5T.c
index edb5aaa..12832e5 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -6912,14 +6912,16 @@ H5T_enum_nameof(H5T_t *dt, void *value, char *name/*out*/, size_t size)
assert(name || 0==size);
if (name && size>0) *name = '\0';
+ /* Sanity check */
+ if (dt->u.enumer.nmembs == 0) {
+ HRETURN_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL,
+ "datatype has no members");
+ }
+
/* Do a binary search over the values to find the correct one */
H5T_sort_value(dt, NULL);
lt = 0;
rt = dt->u.enumer.nmembs;
- if (rt == 0) {
- HRETURN_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL,
- "datatype has no members");
- }
md = -1;
while (lt<rt) {
@@ -6985,14 +6987,16 @@ H5T_enum_valueof(H5T_t *dt, const char *name, void *value/*out*/)
assert(name && *name);
assert(value);
+ /* Sanity check */
+ if (dt->u.enumer.nmembs == 0) {
+ HRETURN_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL,
+ "datatype has no members");
+ }
+
/* Do a binary search over the names to find the correct one */
H5T_sort_name(dt, NULL);
lt = 0;
rt = dt->u.enumer.nmembs;
- if (rt == 0) {
- HRETURN_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL,
- "datatype has no members");
- }
md = -1;
while (lt<rt) {
diff --git a/test/enum.c b/test/enum.c
index 7545ff0..1def5bc 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -357,11 +357,10 @@ test_tr2(hid_t file)
*-------------------------------------------------------------------------
*/
static int
-test_value_dsnt_exist()
+test_value_dsnt_exist(void)
{
hid_t datatype_id; /* identifiers */
- herr_t status;
int val;
char nam[100];
size_t size = 100;
diff --git a/test/h5test.h b/test/h5test.h
index 6cf7277..5781185 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -62,8 +62,8 @@ char *h5_fixname(const char *base_name, hid_t fapl, char *fullname,
hid_t h5_fileaccess(void);
void h5_no_hwconv(void);
void h5_reset(void);
-#ifdef H5_HAVE_PARALLEL
void h5_show_hostname(void);
+#ifdef H5_HAVE_PARALLEL
int h5_set_info_object(void);
void h5_dump_info_object(MPI_Info info);
#endif