summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/cmake/ConfigureChecks.cmake7
-rw-r--r--fortran/src/H5Af.c4
-rw-r--r--fortran/src/H5Ff.c2
-rw-r--r--fortran/src/H5Lf.c2
-rw-r--r--fortran/src/H5Pf.c125
-rw-r--r--fortran/src/H5Rf.c215
-rw-r--r--fortran/src/H5Sf.c4
-rw-r--r--fortran/src/H5Tf.c27
-rw-r--r--fortran/src/H5_f.c41
-rw-r--r--fortran/src/H5f90kit.c6
-rw-r--r--fortran/src/H5f90proto.h22
-rwxr-xr-xhl/fortran/src/H5TBfc.c218
-rw-r--r--hl/test/test_packet.c9
-rw-r--r--src/H5AC.c4
-rw-r--r--src/H5B.c9
-rw-r--r--src/H5C.c25
-rw-r--r--src/H5Dcontig.c10
-rw-r--r--src/H5Tbit.c34
-rw-r--r--test/CMakeLists.txt8
-rw-r--r--test/fheap.c376
-rw-r--r--test/ohdr.c6
-rw-r--r--testpar/t_mdset.c12
-rw-r--r--tools/lib/h5tools.c68
23 files changed, 587 insertions, 647 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index cad3870..fc479d7 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -202,17 +202,16 @@ ENDIF (CYGWIN)
# Check for the math library "m"
#-----------------------------------------------------------------------------
IF (NOT WINDOWS)
- CHECK_LIBRARY_EXISTS_CONCAT ("m" printf H5_HAVE_LIBM)
+ CHECK_LIBRARY_EXISTS_CONCAT ("m" random H5_HAVE_LIBM)
ENDIF (NOT WINDOWS)
-CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" printf H5_HAVE_LIBWS2_32)
-CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" printf H5_HAVE_LIBWSOCK32)
+CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32)
+CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32)
#CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL)
CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname H5_HAVE_LIBUCB)
CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect H5_HAVE_LIBSOCKET)
CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL)
-
IF (NOT NOT_NEED_LIBNSL)
CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname H5_HAVE_LIBNSL)
ENDIF (NOT NOT_NEED_LIBNSL)
diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c
index 939fd81..8e6158e 100644
--- a/fortran/src/H5Af.c
+++ b/fortran/src/H5Af.c
@@ -974,16 +974,16 @@ nh5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf)
int_f ret_value=0; /* Return value */
c_bufsize = (size_t)*bufsize+1;
+
/*
* Allocate buffer to hold name of an attribute
*/
- if ((c_buf = HDmalloc(c_bufsize)) == NULL)
+ if(NULL == (c_buf = (char *)HDmalloc(c_bufsize)))
HGOTO_DONE(FAIL);
/*
* Call H5Aget_name function
*/
-
if ((ret_value = (int_f)H5Aget_name((hid_t)*attr_id, c_bufsize, c_buf)) < 0)
HGOTO_DONE(FAIL);
diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c
index 9640444..1570bb3 100644
--- a/fortran/src/H5Ff.c
+++ b/fortran/src/H5Ff.c
@@ -520,7 +520,7 @@ nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen)
/*
* Allocate buffer to hold name of an attribute
*/
- if ((c_buf = HDmalloc((size_t)*buflen +1)) == NULL)
+ if(NULL == (c_buf = (char *)HDmalloc((size_t)*buflen + 1)))
HGOTO_DONE(FAIL);
/*
diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c
index 4d3e31c..59f4535 100644
--- a/fortran/src/H5Lf.c
+++ b/fortran/src/H5Lf.c
@@ -606,7 +606,7 @@ nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
/*
* Allocate buffer to hold name of an attribute
*/
- if ((c_name = HDmalloc(c_size)) == NULL)
+ if(NULL == (c_name = (char *)HDmalloc(c_size)))
HGOTO_DONE(FAIL)
if((*size = (size_t)H5Lget_name_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field,
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c
index 96b771d..29ba593 100644
--- a/fortran/src/H5Pf.c
+++ b/fortran/src/H5Pf.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
@@ -22,7 +21,7 @@
/*----------------------------------------------------------------------------
* Name: h5pcreate_c
* Purpose: Call H5Pcreate to create a property list
- * Inputs: class - property list class identifier
+ * Inputs: cls - property list class identifier
* Outputs: prp_id - identifier of the created property list
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -31,12 +30,12 @@
*---------------------------------------------------------------------------*/
int_f
-nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id )
+nh5pcreate_c ( hid_t_f *cls, hid_t_f *prp_id )
{
hid_t c_prp_id;
int_f ret_value = 0;
- c_prp_id = H5Pcreate((hid_t)*class);
+ c_prp_id = H5Pcreate((hid_t)*cls);
if(c_prp_id < 0)
HGOTO_DONE(FAIL)
@@ -264,7 +263,7 @@ nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims )
herr_t status;
int i;
- c_dims = malloc(sizeof(hsize_t) * (*rank ));
+ c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * (*rank ));
if (!c_dims) return ret_value;
/*
@@ -309,7 +308,7 @@ nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims )
int c_max_rank;
int i;
- c_dims = malloc(sizeof(hsize_t) * (*max_rank ));
+ c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * (*max_rank ));
if (!c_dims) return ret_value;
c_prp_id = (hid_t)*prp_id;
@@ -1311,8 +1310,8 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h
c_meta_ext_size = (size_t) *meta_ext_size;
c_raw_ext_size = (size_t) *raw_ext_size;
- c_meta_ext = (char*)malloc(sizeof(char)*c_meta_ext_size);
- c_raw_ext = (char*)malloc(sizeof(char)*c_raw_ext_size);
+ c_meta_ext = (char *)HDmalloc(sizeof(char) * c_meta_ext_size);
+ c_raw_ext = (char *)HDmalloc(sizeof(char) * c_raw_ext_size);
if(c_meta_ext == NULL || c_raw_ext == NULL) return ret_value;
/*
@@ -1481,7 +1480,7 @@ nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nel
c_filter = (H5Z_filter_t)*filter;
c_flags = (unsigned)*flags;
c_cd_nelmts = (size_t)*cd_nelmts;
- c_cd_values = (unsigned int*)malloc(sizeof(unsigned int)*((int)c_cd_nelmts));
+ c_cd_values = (unsigned int*)HDmalloc(sizeof(unsigned int) * ((int)c_cd_nelmts));
if (!c_cd_values) return ret_value;
for (i = 0; i < c_cd_nelmts; i++)
c_cd_values[i] = (unsigned int)cd_values[i];
@@ -1566,10 +1565,10 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f*
c_cd_nelmts = (size_t)*cd_nelmts;
- if(NULL == (c_name = (char *)malloc((size_t)*namelen + 1)))
+ if(NULL == (c_name = (char *)HDmalloc((size_t)*namelen + 1)))
goto DONE;
- if(NULL == (c_cd_values = (unsigned int *)malloc(sizeof(unsigned int) * c_cd_nelmts)))
+ if(NULL == (c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * c_cd_nelmts)))
goto DONE;
/*
@@ -1702,7 +1701,7 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name,
/*
* Allocate memory to store the name of the external file.
*/
- if(c_namelen) c_name = (char*) HDmalloc(c_namelen + 1);
+ if(c_namelen) c_name = (char*)HDmalloc(c_namelen + 1);
if (c_name == NULL) return ret_value;
/*
@@ -2232,14 +2231,14 @@ nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size)
* Inputs: parent - property list class identifier
* name - name of the new class
* name_len - lenght of the "name" buffer
- * Outputs: class - new class identifier
+ * Outputs: cls - new class identifier
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* October 11, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class)
+nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *cls)
{
int ret_value = -1;
hid_t c_parent;
@@ -2255,7 +2254,7 @@ nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class)
*/
c_class = H5Pcreate_class(c_parent, c_name, NULL, NULL,NULL,NULL,NULL,NULL);
if (c_class < 0) goto DONE;
- *class = (hid_t_f)c_class;
+ *cls = (hid_t_f)c_class;
ret_value = 0;
DONE:
@@ -2266,7 +2265,7 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5pregisterc_c
* Purpose: Call h5pregister_c to registers a permanent property
- * Inputs: class - property list class identifier
+ * Inputs: cls - property list class identifier
* name - name of the new property
* name_len - length of the "name" buffer
* size - property size
@@ -2277,21 +2276,21 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f UNUSED *value_len)
+nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f UNUSED *value_len)
{
int ret_value = -1;
/*
* Call h5pregister_c function
*/
- ret_value = nh5pregister_c(class, name, name_len, size, _fcdtocp(value));
+ ret_value = nh5pregister_c(cls, name, name_len, size, _fcdtocp(value));
return ret_value;
}
/*----------------------------------------------------------------------------
* Name: h5pregister_c
* Purpose: Call H5Pregister2 to registers a permanent property
- * Inputs: class - property list class identifier
+ * Inputs: cls - property list class identifier
* name - name of the new property
* name_len - length of the "name" buffer
* size - property size
@@ -2302,7 +2301,7 @@ nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5pregister_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void UNUSED *value)
+nh5pregister_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void UNUSED *value)
{
char* c_name = NULL;
int_f ret_value = -1;
@@ -2313,7 +2312,7 @@ nh5pregister_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void
/*
* Call H5Pregister2 function.
*/
- if(H5Pregister2((hid_t)*class, c_name, (size_t)*size, value, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
+ if(H5Pregister2((hid_t)*cls, c_name, (size_t)*size, value, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
goto DONE;
ret_value = 0;
@@ -2324,30 +2323,30 @@ DONE:
}
int_f
-nh5pregister_integer_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void *value)
+nh5pregister_integer_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void *value)
{
/*
* Call h5pregister_c function
*/
- return nh5pregister_c(class, name, name_len, size, value);
+ return nh5pregister_c(cls, name, name_len, size, value);
}
int_f
-nh5pregister_real_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void *value)
+nh5pregister_real_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void *value)
{
/*
* Call h5pregister_c function
*/
- return nh5pregister_c(class, name, name_len, size, value);
+ return nh5pregister_c(cls, name, name_len, size, value);
}
int_f
-nh5pregister_double_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void *value)
+nh5pregister_double_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void *value)
{
/*
* Call h5pregister_c function
*/
- return nh5pregister_c(class, name, name_len, size, value);
+ return nh5pregister_c(cls, name, name_len, size, value);
}
/*----------------------------------------------------------------------------
@@ -2450,7 +2449,7 @@ nh5pinsert_double_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size,
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5pexist_c(hid_t_f *class, _fcd name, int_f *name_len)
+nh5pexist_c(hid_t_f *cls, _fcd name, int_f *name_len)
{
int_f ret_value = -1;
hid_t c_class;
@@ -2460,7 +2459,7 @@ nh5pexist_c(hid_t_f *class, _fcd name, int_f *name_len)
c_name = (char *)HD5f2cstring(name, (size_t)*name_len);
if (c_name == NULL) goto DONE;
- c_class = (hid_t)*class;
+ c_class = (hid_t)*cls;
/*
* Call H5Pexist function.
*/
@@ -2476,21 +2475,21 @@ DONE:
* Purpose: Call H5Pisa_class to querie whether a property is a
* member of a class
* Inputs: plist - property list identifier
- * class - property class identifier
+ * cls - property class identifier
* Returns: nonnegative on success, -1 on failure
* Programmer: Elena Pourmal
* October 11, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5pisa_class_c(hid_t_f *plist, hid_t_f *class)
+nh5pisa_class_c(hid_t_f *plist, hid_t_f *cls)
{
int_f ret_value = -1;
hid_t c_class;
hid_t c_plist;
htri_t status;
- c_class = (hid_t)*class;
+ c_class = (hid_t)*cls;
c_plist = (hid_t)*plist;
/*
@@ -2663,7 +2662,7 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5punregister_c
* Purpose: Call H5Punregister to remove a property from a property class
- * Inputs: class - identifier of property class
+ * Inputs: cls - identifier of property class
* name - name of the property to unregister
* name_len - length of the "name" buffer
* Returns: 0 on success, -1 on failure
@@ -2672,7 +2671,7 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len)
+nh5punregister_c(hid_t_f *cls, _fcd name, int_f *name_len)
{
int_f ret_value = -1;
hid_t c_class;
@@ -2681,7 +2680,7 @@ nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len)
c_name = (char *)HD5f2cstring(name, (size_t)*name_len);
if (c_name == NULL) goto DONE;
- c_class = (hid_t)*class;
+ c_class = (hid_t)*cls;
/*
* Call H5Punregister function.
*/
@@ -2695,19 +2694,19 @@ DONE:
/*----------------------------------------------------------------------------
* Name: h5pclose_class_c
* Purpose: Call H5Pclose_class to close property class
- * Inputs: class - identifier of property class to close
+ * Inputs: cls - identifier of property class to close
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* October 11, 2002
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5pclose_class_c(hid_t_f *class)
+nh5pclose_class_c(hid_t_f *cls)
{
int_f ret_value = -1;
hid_t c_class;
- c_class = (hid_t)*class;
+ c_class = (hid_t)*cls;
/*
* Call H5Pclose_class function.
*/
@@ -2718,7 +2717,7 @@ nh5pclose_class_c(hid_t_f *class)
/*----------------------------------------------------------------------------
* Name: h5pget_class_name_c
* Purpose: Call H5Pget_class_name to get property class name
- * Inputs: class - identifier of property class
+ * Inputs: cls - identifier of property class
* name - ibuffer to retrieve name in
* name_len - length of the "name" buffer
* Returns: 0 on success, -1 on failure
@@ -2727,22 +2726,24 @@ nh5pclose_class_c(hid_t_f *class)
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5pget_class_name_c(hid_t_f *class, _fcd name, int_f *name_len)
+nh5pget_class_name_c(hid_t_f *cls, _fcd name, int_f *name_len)
{
int_f ret_value = -1;
char *c_name = NULL; /* Buffer to hold C string */
size_t c_size;
c_size = (size_t)*name_len + 1;
+
/*
* Allocate buffer to hold name
*/
- if ((c_name = HDmalloc(c_size)) == NULL)
+ if(NULL == (c_name = (char *)HDmalloc(c_size)))
goto DONE;
+
/*
* Call H5Pget_class_name function.
*/
- c_name = H5Pget_class_name((hid_t)*class);
+ c_name = H5Pget_class_name((hid_t)*cls);
if(c_name == NULL) goto DONE;
HD5packFstring(c_name, _fcdtocp(name), (size_t)*name_len);
@@ -2752,6 +2753,7 @@ DONE:
HDfree(c_name);
return ret_value;
}
+
/*----------------------------------------------------------------------------
* Name: h5pset_c
* Purpose: Call h5setc_c to set property with the character string value
@@ -3092,14 +3094,11 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
if (tmp ==NULL) return ret_value;
tmp_p = tmp;
for (i=0; i < H5FD_MEM_NTYPES; i++) {
- c_memb_name[i] = malloc((size_t)len[i] + 1);
- memcpy(c_memb_name[i], tmp_p, (size_t)len[i]);
+ c_memb_name[i] = (char *)HDmalloc((size_t)len[i] + 1);
+ HDmemcpy(c_memb_name[i], tmp_p, (size_t)len[i]);
tmp_pp = c_memb_name[i];
tmp_pp[len[i]] = '\0';
tmp_p = tmp_p + c_lenmax;
-/* printf(" %d \n", len[i]);
- printf("name %s \n", c_memb_name[i]);
-*/
}
/*
* Take care of othe arguments
@@ -3108,25 +3107,22 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
c_prp_id = (hid_t)*prp_id;
for (i=0; i < H5FD_MEM_NTYPES; i++) {
c_memb_map[i] = (H5FD_mem_t)memb_map[i];
- /*printf("map %d \n", c_memb_map[i]); */
c_memb_fapl[i] = (hid_t)memb_fapl[i];
- /*printf("fapl %d \n", c_memb_fapl[i]); */
if(memb_addr[i] < 0) c_memb_addr[i] = HADDR_UNDEF;
- /* else c_memb_addr[i] = (haddr_t)(((float)memb_addr[i])*(HADDR_MAX));*/
else c_memb_addr[i] = (haddr_t)(((float)memb_addr[i])*(tmp_max_addr));
- /*printf("address %Ld \n", c_memb_addr[i]); */
}
/*
* Call H5Pset_fapl_multi function
*/
- status = H5Pset_fapl_multi(c_prp_id, c_memb_map, c_memb_fapl, c_memb_name, c_memb_addr, relax);
+ status = H5Pset_fapl_multi(c_prp_id, c_memb_map, c_memb_fapl, (const char * const *)c_memb_name, c_memb_addr, relax);
if ( status < 0 ) goto DONE;
ret_value = 0;
DONE:
- free(tmp);
- for (i=0; i < H5FD_MEM_NTYPES; i++) free(c_memb_name[i]);
+ HDfree(tmp);
+ for (i=0; i < H5FD_MEM_NTYPES; i++)
+ HDfree(c_memb_name[i]);
return ret_value;
}
@@ -3203,9 +3199,9 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
/*
* Take care of names array
*/
- tmp = (char *)malloc(c_lenmax*H5FD_MEM_NTYPES + 1);
+ tmp = (char *)HDmalloc(c_lenmax*H5FD_MEM_NTYPES + 1);
tmp_p = tmp;
- memset(tmp,' ', c_lenmax*H5FD_MEM_NTYPES);
+ HDmemset(tmp,' ', c_lenmax*H5FD_MEM_NTYPES);
tmp[c_lenmax*H5FD_MEM_NTYPES] = '\0';
for (i=0; i < H5FD_MEM_NTYPES; i++) {
memcpy(tmp_p, c_memb_name[i], strlen(c_memb_name[i]));
@@ -3228,8 +3224,9 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (size_t)(c_lenmax*H5FD_MEM_NTYPES));
*flag = (int_f)relax;
*maxlen_out = (int_f)length;
ret_value = 0;
- free(tmp);
- for (i=0; i < H5FD_MEM_NTYPES; i++) free(c_memb_name[i]);
+ HDfree(tmp);
+ for (i=0; i < H5FD_MEM_NTYPES; i++)
+ HDfree(c_memb_name[i]);
return ret_value;
}
@@ -3326,10 +3323,10 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f
unsigned i;
int_f ret_value = -1;
- if(NULL == (c_name = (char *)malloc((size_t)*namelen + 1)))
+ if(NULL == (c_name = (char *)HDmalloc((size_t)*namelen + 1)))
goto DONE;
- if(NULL == (c_cd_values = (unsigned int *)malloc(sizeof(unsigned int) * ((int)c_cd_nelmts_in))))
+ if(NULL == (c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * ((int)c_cd_nelmts_in))))
goto DONE;
/*
@@ -3385,7 +3382,7 @@ nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_
c_filter = (H5Z_filter_t)*filter;
c_flags = (unsigned)*flags;
c_cd_nelmts = (size_t)*cd_nelmts;
- c_cd_values = (unsigned int*)malloc(sizeof(unsigned int)*((int)c_cd_nelmts));
+ c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * ((int)c_cd_nelmts));
if (!c_cd_values) return ret_value;
for (i = 0; i < c_cd_nelmts; i++)
c_cd_values[i] = (unsigned int)cd_values[i];
@@ -3977,7 +3974,7 @@ nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_l
* Allocate memory to store the expression.
*/
if(c_expression_len) {
- c_expression = (char*)HDmalloc(c_expression_len);
+ c_expression = (char *)HDmalloc(c_expression_len);
if(NULL == c_expression)
HGOTO_DONE(FAIL)
} /* end if */
@@ -4223,7 +4220,7 @@ nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_den
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5pset_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size )
+nh5pset_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_t_f UNUSED *block_size, size_t_f UNUSED *cbuf_size)
{
int ret_value = -1;
#ifdef H5_HAVE_DIRECT
@@ -4257,7 +4254,7 @@ nh5pset_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_siz
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5pget_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size )
+nh5pget_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_t_f UNUSED *block_size, size_t_f UNUSED *cbuf_size)
{
int ret_value = -1;
#ifdef H5_HAVE_DIRECT
diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c
index ba5d273..51a775f 100644
--- a/fortran/src/H5Rf.c
+++ b/fortran/src/H5Rf.c
@@ -16,6 +16,7 @@
/* This files contains C stubs for H5R Fortran APIs */
#include "H5f90.h"
+#include "H5Eprivate.h"
/*----------------------------------------------------------------------------
* Name: h5rcreate_object_c
@@ -27,39 +28,34 @@
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen)
+nh5rcreate_object_c(haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen)
{
- int ret_value = -1;
- hid_t c_loc_id;
- int ret_value_c;
- char *c_name;
- size_t c_namelen;
+ char *c_name = NULL;
hobj_ref_t ref_c;
+ int_f ret_value = 0;
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
- if (c_name == NULL) return ret_value;
+ if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
+ HGOTO_DONE(FAIL)
/*
* Call H5Rcreate function.
*/
- c_loc_id = *loc_id;
- ret_value_c = H5Rcreate(&ref_c, c_loc_id, c_name, H5R_OBJECT, -1);
+ if(H5Rcreate(&ref_c, *loc_id, c_name, H5R_OBJECT, -1) < 0)
+ HGOTO_DONE(FAIL)
- HDfree(c_name);
- if (ret_value_c >= 0) {
- *ref=(haddr_t_f)ref_c;
- ret_value = 0;
- }
+ /* Copy the reference created */
+ *ref = (haddr_t_f)ref_c;
+done:
+ if(c_name)
+ HDfree(c_name);
return ret_value;
-}
+} /* nh5rcreate_object_c() */
/*----------------------------------------------------------------------------
* Name: h5rcreate_region_c
@@ -73,40 +69,34 @@ nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen)
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id)
+nh5rcreate_region_c(int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id)
{
- int ret_value = -1;
- hid_t c_loc_id;
- hid_t c_space_id;
- int ret_value_c;
- char *c_name;
- size_t c_namelen;
+ char *c_name = NULL;
hdset_reg_ref_t ref_c;
+ int_f ret_value = 0;
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
- if (c_name == NULL) return ret_value;
+ if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
+ HGOTO_DONE(FAIL)
/*
* Call H5Rcreate function.
*/
- c_loc_id = *loc_id;
- c_space_id = *space_id;
- ret_value_c = H5Rcreate(&ref_c, c_loc_id, c_name, H5R_DATASET_REGION, c_space_id);
-
- HDfree(c_name);
- if (ret_value_c >= 0) {
- HDmemcpy (ref, &ref_c, H5R_DSET_REG_REF_BUF_SIZE);
- ret_value = 0;
- }
+ if(H5Rcreate(&ref_c, (hid_t)*loc_id, c_name, H5R_DATASET_REGION, (hid_t)*space_id) < 0)
+ HGOTO_DONE(FAIL)
+
+ /* Copy the reference created */
+ HDmemcpy(ref, &ref_c, H5R_DSET_REG_REF_BUF_SIZE);
+
+done:
+ if(c_name)
+ HDfree(c_name);
return ret_value;
-}
+} /* end nh5rcreate_region_c() */
/*----------------------------------------------------------------------------
* Name: h5rdereference_region_c
@@ -117,29 +107,29 @@ nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id)
+nh5rdereference_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id)
{
- int ret_value = -1;
- hid_t c_dset_id;
hdset_reg_ref_t ref_c;
hid_t c_obj_id;
+ int_f ret_value = 0;
- HDmemcpy (&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE);
+ /* Copy the reference to dereference */
+ HDmemcpy(&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE);
/*
* Call H5Rdereference function.
*/
- c_dset_id = *dset_id;
- c_obj_id = H5Rdereference(c_dset_id, H5R_DATASET_REGION, &ref_c);
- if(c_obj_id < 0) return ret_value;
+ if((c_obj_id = H5Rdereference((hid_t)*dset_id, H5R_DATASET_REGION, &ref_c)) < 0)
+ HGOTO_DONE(FAIL)
+
+ /* Copy the object's ID */
*obj_id = (hid_t_f)c_obj_id;
- ret_value = 0;
- return ret_value;
-}
+done:
+ return ret_value;
+} /* end nh5rdereference_region_c() */
/*----------------------------------------------------------------------------
* Name: h5rdereference_object_c
@@ -150,28 +140,26 @@ nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id)
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5rdereference_object_c (hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id)
+nh5rdereference_object_c(hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id)
{
- int ret_value = -1;
- hid_t c_dset_id;
hid_t c_obj_id;
- hobj_ref_t ref_c;
-
- ref_c=*ref;
+ hobj_ref_t ref_c = (hobj_ref_t)*ref;
+ int_f ret_value = 0;
/*
* Call H5Rdereference function.
*/
- c_dset_id = *dset_id;
- c_obj_id = H5Rdereference(c_dset_id, H5R_OBJECT, &ref_c);
- if(c_obj_id < 0) return ret_value;
+ if((c_obj_id = H5Rdereference((hid_t)*dset_id, H5R_OBJECT, &ref_c)) < 0)
+ HGOTO_DONE(FAIL)
+
+ /* Copy the object's ID */
*obj_id = (hid_t_f)c_obj_id;
- ret_value = 0;
+
+done:
return ret_value;
-}
+} /* end nh5rdereference_object_c() */
/*----------------------------------------------------------------------------
* Name: h5rget_region_region_object_c
@@ -182,28 +170,29 @@ nh5rdereference_object_c (hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id)
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id)
+nh5rget_region_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *space_id)
{
- int ret_value = -1;
- hid_t c_dset_id;
hid_t c_space_id;
hdset_reg_ref_t ref_c;
+ int_f ret_value = 0;
- HDmemcpy (&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE);
+ /* Copy the reference to dereference */
+ HDmemcpy(&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE);
/*
* Call H5Rget_region function.
*/
- c_dset_id = *dset_id;
- c_space_id = H5Rget_region(c_dset_id, H5R_DATASET_REGION, &ref_c);
- if(c_space_id < 0) return ret_value;
+ if((c_space_id = H5Rget_region((hid_t)*dset_id, H5R_DATASET_REGION, &ref_c)) < 0)
+ HGOTO_DONE(FAIL)
+
+ /* Copy the dataspace ID */
*space_id = (hid_t_f)c_space_id;
- ret_value = 0;
+
+done:
return ret_value;
-}
+} /* end nh5rget_region_region_c() */
/*----------------------------------------------------------------------------
* Name: h5rget_object_type_obj_c
@@ -215,29 +204,26 @@ nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id)
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, December 1, 1999
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5rget_object_type_obj_c (hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type)
+nh5rget_object_type_obj_c(hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type)
{
H5O_type_t c_obj_type;
- hobj_ref_t ref_c;
- int_f ret_value = -1;
-
- ref_c = *ref;
+ hobj_ref_t ref_c = (hobj_ref_t)*ref;
+ int_f ret_value = 0;
/*
* Call H5Rget_object_type function.
*/
if(H5Rget_obj_type2((hid_t)*dset_id, H5R_OBJECT, &ref_c, &c_obj_type) < 0)
- return ret_value;
+ HGOTO_DONE(FAIL)
+ /* Copy the object type */
*obj_type = (int_f)c_obj_type;
- ret_value = 0;
-
+done:
return ret_value;
-}
+} /* end nh5rget_object_type_obj_c() */
/*----------------------------------------------------------------------------
* Name: h5rget_name_object_c
@@ -252,42 +238,40 @@ nh5rget_object_type_obj_c (hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type)
* Returns: 0 on success, -1 on failure
* Programmer: M.S. Breitenfeld
* March 31, 2008
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5rget_name_object_c (hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default)
+nh5rget_name_object_c(hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default)
{
- hobj_ref_t ref_c;
- int_f ret_value = -1;
+ hobj_ref_t ref_c = (hobj_ref_t)*ref;
ssize_t c_size;
- size_t c_bufsize;
- char *c_buf= NULL; /* Buffer to hold C string */
+ size_t c_bufsize = (size_t)*name_len + 1;
+ char *c_buf = NULL; /* Buffer to hold C string */
+ int_f ret_value = 0;
- ref_c = *ref;
- c_bufsize = (size_t)*name_len+1;
/*
* Allocate buffer to hold name of an attribute
*/
- if ((c_buf = HDmalloc(c_bufsize)) == NULL)
- return ret_value;
-
+ if(NULL == (c_buf = (char *)HDmalloc(c_bufsize)))
+ HGOTO_DONE(FAIL)
+
/*
* Call H5Rget_name function.
*/
- if((c_size=H5Rget_name((hid_t)*loc_id, H5R_OBJECT, &ref_c, c_buf, c_bufsize)) < 0)
- return ret_value;
+ if((c_size = H5Rget_name((hid_t)*loc_id, H5R_OBJECT, &ref_c, c_buf, c_bufsize)) < 0)
+ HGOTO_DONE(FAIL)
+
/*
* Convert C name to FORTRAN and place it in the given buffer
*/
HD5packFstring(c_buf, _fcdtocp(name), c_bufsize-1);
-
*size_default = (size_t_f)c_size;
- ret_value = 0;
- if(c_buf) HDfree(c_buf);
+done:
+ if(c_buf)
+ HDfree(c_buf);
return ret_value;
-}
+} /* end nh5rget_name_object_c() */
/*----------------------------------------------------------------------------
* Name: h5rget_name_region_c
@@ -302,39 +286,40 @@ nh5rget_name_object_c (hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *nam
* Returns: 0 on success, -1 on failure
* Programmer: M.S. Breitenfeld
* March 31, 2008
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5rget_name_region_c (hid_t_f *loc_id, int_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default)
+nh5rget_name_region_c(hid_t_f *loc_id, int_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default)
{
hdset_reg_ref_t ref_c;
- int_f ret_value = -1;
ssize_t c_size;
- size_t c_bufsize;
- char *c_buf= NULL; /* Buffer to hold C string */
+ size_t c_bufsize = (size_t)*name_len + 1;
+ char *c_buf = NULL; /* Buffer to hold C string */
+ int_f ret_value = 0;
- HDmemcpy (&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE);
+ /* Copy the reference to query */
+ HDmemcpy(&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE);
- c_bufsize = (size_t)*name_len+1;
/*
* Allocate buffer to hold name of an attribute
*/
- if ((c_buf = HDmalloc(c_bufsize)) == NULL)
- return ret_value;
+ if(NULL == (c_buf = (char *)HDmalloc(c_bufsize)))
+ HGOTO_DONE(FAIL)
/*
* Call H5Rget_name function.
*/
- if((c_size=H5Rget_name((hid_t)*loc_id, H5R_DATASET_REGION, &ref_c, c_buf, c_bufsize)) < 0)
- return ret_value;
+ if((c_size = H5Rget_name((hid_t)*loc_id, H5R_DATASET_REGION, &ref_c, c_buf, c_bufsize)) < 0)
+ HGOTO_DONE(FAIL)
+
/*
* Convert C name to FORTRAN and place it in the given buffer
*/
- HD5packFstring(c_buf, _fcdtocp(name), c_bufsize-1);
-
+ HD5packFstring(c_buf, _fcdtocp(name), c_bufsize - 1);
*size_default = (size_t_f)c_size;
- ret_value = 0;
- if(c_buf) HDfree(c_buf);
+done:
+ if(c_buf)
+ HDfree(c_buf);
return ret_value;
-}
+} /* end nh5rget_name_region_c() */
+
diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c
index dea3ff0..e161618 100644
--- a/fortran/src/H5Sf.c
+++ b/fortran/src/H5Sf.c
@@ -989,7 +989,7 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi
c_space_id = *space_id;
rank = H5Sget_simple_extent_ndims(c_space_id);
- c_coord = malloc(sizeof(hsize_t)*rank*(*nelements));
+ c_coord = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank*(*nelements));
if(!c_coord) return ret_value;
for (i=0; i< *nelements; i++) {
for (j = 0; j < rank; j++) {
@@ -1080,7 +1080,7 @@ nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc )
/*
* Allocate buffer
*/
- if ((c_buf = HDmalloc(c_size)) == NULL)
+ if(NULL == (c_buf = (unsigned char *)HDmalloc(c_size)))
return ret_value;
/*
* Call H5Sencode function.
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c
index 13fea93..37cfca0 100644
--- a/fortran/src/H5Tf.c
+++ b/fortran/src/H5Tf.c
@@ -990,7 +990,7 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n
char *c_name;
c_type_id = *type_id;
- c_index = *idx;
+ c_index = (unsigned)*idx;
c_name = H5Tget_member_name(c_type_id, c_index);
if (c_name == NULL ) return ret_value;
@@ -1199,7 +1199,7 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype)
/*----------------------------------------------------------------------------
* Name: h5tcreate_c
* Purpose: Call H5Tcreate to create a datatype
- * Inputs: class - class type
+ * Inputs: cls - class type
* size - size of the class memeber
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -1208,14 +1208,14 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype)
*---------------------------------------------------------------------------*/
int_f
-nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id)
+nh5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id)
{
int ret_value = -1;
H5T_class_t c_class;
size_t c_size;
c_size =(size_t) *size;
- c_class = (H5T_class_t) *class;
+ c_class = (H5T_class_t) *cls;
*type_id = (hid_t_f)H5Tcreate(c_class, c_size);
if(*type_id < 0) return ret_value;
@@ -1419,7 +1419,7 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
int_f c_value;
c_value = *value;
c_namelen = ((size_t)*namelen) +1;
- c_name = (char *)malloc(sizeof(char)*c_namelen);
+ c_name = (char *)HDmalloc(sizeof(char)*c_namelen);
c_type_id = (hid_t)*type_id;
error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen);
HD5packFstring(c_name, _fcdtocp(name), strlen(c_name));
@@ -1617,7 +1617,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag )
* datatype member
* Inputs: type_id - identifier of the dataspace
* member_no - member's index
- * Outputs: class - member's class
+ * Outputs: cls - member's class
* and negative on failure.
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -1626,7 +1626,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag )
*---------------------------------------------------------------------------*/
int_f
-nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class )
+nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls )
{
int ret_value = 0;
hid_t c_type_id;
@@ -1638,7 +1638,7 @@ nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class )
c_class = H5Tget_member_class(c_type_id, c_member_no);
if ( c_class == H5T_NO_CLASS ) ret_value = -1;
- *class = (int_f)c_class;
+ *cls = (int_f)c_class;
return ret_value;
}
@@ -1766,18 +1766,18 @@ nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc )
return ret_value;
}
- c_size = (size_t)*nalloc;
/*
* Allocate buffer
*/
- if ((c_buf = HDmalloc(c_size)) == NULL)
+ c_size = (size_t)*nalloc;
+ if(NULL == (c_buf = (unsigned char *)HDmalloc(c_size)))
return ret_value;
+
/*
* Call H5Tencode function.
*/
- if(H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0){
+ if(H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0)
return ret_value;
- }
/* copy the C buffer to the FORTRAN buffer.
* Can not use HD5packFstring because we don't want to
@@ -1788,7 +1788,8 @@ nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc )
HDmemcpy(_fcdtocp(buf),(char *)c_buf,c_size);
ret_value = 0;
- if(c_buf) HDfree(c_buf);
+ if(c_buf)
+ HDfree(c_buf);
return ret_value;
}
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c
index e0748b5b..12c55af 100644
--- a/fortran/src/H5_f.c
+++ b/fortran/src/H5_f.c
@@ -36,7 +36,6 @@
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, August 3, 1999
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes )
@@ -254,7 +253,6 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, August 3, 1999
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
nh5close_types_c( hid_t_f * types, int_f *lentypes,
@@ -300,13 +298,6 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes,
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, August 3, 1999
- * Modifications: Added Z flags. EIP, March 12, 2003
- * Added more FD flags and new H5LIB flags
- * Added more FD flags for HDF5 file driver
- * EIP, April 9, 2005
- * Added Generic flags introduced in version 1.8
- * MSB, January, 2008
- * Added types in lines h5*_flags = ( )variable to match input
*---------------------------------------------------------------------------*/
int_f
nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags,
@@ -644,36 +635,34 @@ nh5init1_flags_c(int_f *h5lib_flags)
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Friday, November 17, 2000
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5open_c()
+nh5open_c(void)
{
-
int ret_value = -1;
+
if (H5open() < 0) return ret_value;
ret_value = 0;
return ret_value;
}
+
/*---------------------------------------------------------------------------
* Name: h5close_c
* Purpose: Calls H5close call to close C HDF5 library
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Friday, November 17, 2000
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5close_c()
+nh5close_c(void)
{
-
int ret_value = -1;
+
if (H5close() < 0) return ret_value;
ret_value = 0;
return ret_value;
}
-
/*---------------------------------------------------------------------------
* Name: h5get_libversion_c
* Purpose: Calls H5get_libversion function
@@ -687,10 +676,9 @@ nh5close_c()
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, September 24, 2002
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5get_libversion_c( int_f *majnum, int_f *minnum, int_f *relnum)
+nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum)
{
int ret_value = -1;
@@ -705,7 +693,6 @@ nh5get_libversion_c( int_f *majnum, int_f *minnum, int_f *relnum)
return ret_value;
}
-
/*---------------------------------------------------------------------------
* Name: h5check_version_c
* Purpose: Calls H5check_version function
@@ -719,14 +706,13 @@ nh5get_libversion_c( int_f *majnum, int_f *minnum, int_f *relnum)
* Returns: 0 on success, aborts on failure
* Programmer: Elena Pourmal
* Tuesday, September 24, 2002
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5check_version_c( int_f *majnum, int_f *minnum, int_f *relnum)
+nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum)
{
-
int ret_value = -1;
unsigned c_majnum, c_minnum, c_relnum;
+
c_majnum = (unsigned) *majnum;
c_minnum = (unsigned) *minnum;
c_relnum = (unsigned) *relnum;
@@ -743,13 +729,12 @@ nh5check_version_c( int_f *majnum, int_f *minnum, int_f *relnum)
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, September 24, 2002
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5garbage_collect_c()
+nh5garbage_collect_c(void)
{
-
int ret_value = -1;
+
if (H5garbage_collect() < 0) return ret_value;
ret_value = 0;
return ret_value;
@@ -761,14 +746,14 @@ nh5garbage_collect_c()
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, September 24, 2002
- * Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5dont_atexit_c()
+nh5dont_atexit_c(void)
{
-
int ret_value = -1;
+
if (H5dont_atexit() < 0) return ret_value;
ret_value = 0;
return ret_value;
}
+
diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c
index 68bb169..a809229 100644
--- a/fortran/src/H5f90kit.c
+++ b/fortran/src/H5f90kit.c
@@ -51,15 +51,15 @@ HD5f2cstring(_fcd fdesc, size_t len)
/* Search for the end of the string */
str = _fcdtocp(fdesc);
- for(i=(int)len-1; i>=0 && !isgraph((int)str[i]); i--)
+ for(i = (int)len - 1; i >= 0 && !HDisgraph((int)str[i]); i--)
/*EMPTY*/;
/* Allocate C string */
- if ((cstr = HDmalloc( (size_t)(i + 2))) == NULL)
+ if(NULL == (cstr = (char *)HDmalloc((size_t)(i + 2))))
return NULL;
/* Copy text from FORTRAN to C string */
- HDmemcpy(cstr,str,(size_t)(i+1));
+ HDmemcpy(cstr, str, (size_t)(i + 1));
/* Terminate C string */
cstr[i + 1] = '\0';
diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h
index 7f16359..3958e61 100644
--- a/fortran/src/H5f90proto.h
+++ b/fortran/src/H5f90proto.h
@@ -671,7 +671,7 @@ H5_FCDLL int_f nh5arename_c( hid_t_f *loc_id,
# define nh5tcompiler_conv_c H5_FC_FUNC_(h5tcompiler_conv_c, H5TCOMPILER_CONV_C)
# define nh5tget_native_type_c H5_FC_FUNC_(h5tget_native_type_c, H5TGET_NATIVE_TYPE_C)
-H5_FCDLL int_f nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id);
+H5_FCDLL int_f nh5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id);
H5_FCDLL int_f nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id );
H5_FCDLL int_f nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *lcpl_id, hid_t_f *tcpl_id, hid_t_f *tapl_id);
H5_FCDLL int_f nh5tclose_c ( hid_t_f *type_id );
@@ -726,7 +726,7 @@ H5_FCDLL int_f nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims);
H5_FCDLL int_f nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id);
H5_FCDLL int_f nh5tvlen_create_c ( hid_t_f *type_id , hid_t_f *vltype_id);
H5_FCDLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
-H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class );
+H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls );
H5_FCDLL int_f nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, hid_t_f *tcpl_id, hid_t_f *tapl_id);
H5_FCDLL int_f nh5tdecode_c ( _fcd buf, hid_t_f *obj_id );
H5_FCDLL int_f nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc );
@@ -908,7 +908,7 @@ H5_FCDLL int_f nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, s
# define nh5pset_chunk_cache_c H5_FC_FUNC_(h5pset_chunk_cache_c, H5PSET_CHUNK_CACHE_C)
# define nh5pget_chunk_cache_c H5_FC_FUNC_(h5pget_chunk_cache_c, H5PGET_CHUNK_CACHE_C)
-H5_FCDLL int_f nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id );
+H5_FCDLL int_f nh5pcreate_c ( hid_t_f *cls, hid_t_f *prp_id );
H5_FCDLL int_f nh5pclose_c ( hid_t_f *prp_id );
H5_FCDLL int_f nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id);
H5_FCDLL int_f nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f *c_flag);
@@ -990,12 +990,12 @@ H5_FCDLL int_f nh5pset_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size);
H5_FCDLL int_f nh5pget_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size);
H5_FCDLL int_f nh5pset_hyper_vector_size_c(hid_t_f *plist, size_t_f *size);
H5_FCDLL int_f nh5pget_hyper_vector_size_c(hid_t_f *plist, size_t_f *size);
-H5_FCDLL int_f nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class);
-H5_FCDLL int_f nh5pregister_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value);
-H5_FCDLL int_f nh5pregister_integer_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value);
-H5_FCDLL int_f nh5pregister_real_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value);
-H5_FCDLL int_f nh5pregister_double_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value);
-H5_FCDLL int_f nh5pregisterc_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len);
+H5_FCDLL int_f nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *cls);
+H5_FCDLL int_f nh5pregister_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, void *value);
+H5_FCDLL int_f nh5pregister_integer_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, void *value);
+H5_FCDLL int_f nh5pregister_real_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, void *value);
+H5_FCDLL int_f nh5pregister_double_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, void *value);
+H5_FCDLL int_f nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len);
H5_FCDLL int_f nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value);
H5_FCDLL int_f nh5pinsert_integer_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value);
H5_FCDLL int_f nh5pinsert_real_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value);
@@ -1018,8 +1018,8 @@ H5_FCDLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id);
H5_FCDLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass);
H5_FCDLL int_f nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len);
H5_FCDLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len);
-H5_FCDLL int_f nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len);
-H5_FCDLL int_f nh5pclose_class_c(hid_t_f * class);
+H5_FCDLL int_f nh5punregister_c(hid_t_f *cls, _fcd name, int_f *name_len);
+H5_FCDLL int_f nh5pclose_class_c(hid_t_f * cls);
H5_FCDLL int_f nh5pget_class_name_c(hid_t_f *prp_id, _fcd name, int_f *name_len);
H5_FCDLL int_f nh5pset_shuffle_c ( hid_t_f *prp_id);
H5_FCDLL int_f nh5pset_fletcher32_c ( hid_t_f *prp_id );
diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c
index e942138..76a3f1c 100755
--- a/hl/fortran/src/H5TBfc.c
+++ b/hl/fortran/src/H5TBfc.c
@@ -32,9 +32,6 @@
*
* Comments:
*
-* Modifications:
-*
-*
*-------------------------------------------------------------------------
*/
int_f
@@ -58,11 +55,7 @@ nh5tbmake_table_c(int_f *namelen1,
hsize_t num_elem;
hsize_t i;
int max_len = 1;
- hid_t c_loc_id = *loc_id;
- hsize_t c_nfields = *nfields;
- hsize_t c_nrecords = *nrecords;
- hsize_t c_chunk_size = *chunk_size;
- size_t c_type_size = *type_size;
+ hsize_t c_nfields = (hsize_t)*nfields;
size_t *c_field_offset = NULL;
hid_t *c_field_types = NULL;
char **c_field_names = NULL;
@@ -70,10 +63,9 @@ nh5tbmake_table_c(int_f *namelen1,
int_f ret_value = 0;
num_elem = *nfields;
- for(i = 0; i < num_elem; i++) {
+ for(i = 0; i < num_elem; i++)
if(namelen2[i] > max_len)
max_len = namelen2[i];
- }
/*
* convert FORTRAN name to C name
@@ -87,10 +79,10 @@ nh5tbmake_table_c(int_f *namelen1,
if(NULL == (c_field_types = (hid_t *)HDmalloc(sizeof(hid_t) * (size_t)c_nfields)))
HGOTO_DONE(FAIL)
- for (i = 0; i < num_elem; i++) {
+ for(i = 0; i < num_elem; i++) {
c_field_offset[i] = field_offset[i];
c_field_types[i] = field_types[i];
- }
+ } /* end for */
/*
* allocate array of character pointers
@@ -118,9 +110,9 @@ nh5tbmake_table_c(int_f *namelen1,
/*
* call H5TBmake_table function.
*/
- if(H5TBmake_table(c_name1, c_loc_id, c_name, c_nfields, c_nrecords,
- c_type_size, c_field_names, c_field_offset, c_field_types,
- c_chunk_size, NULL, *compress, NULL) < 0)
+ if(H5TBmake_table(c_name1, (hid_t)*loc_id, c_name, c_nfields, (hsize_t)*nrecords,
+ (size_t)*type_size, (const char **)c_field_names, c_field_offset, c_field_types,
+ (hsize_t)*chunk_size, NULL, *compress, NULL) < 0)
HGOTO_DONE(FAIL)
done:
@@ -132,7 +124,7 @@ done:
for(i = 0; i < num_elem; i++) {
if(c_field_names[i])
HDfree(c_field_names[i]);
- }
+ } /* end for */
HDfree(c_field_names);
} /* end if */
if(tmp)
@@ -143,8 +135,7 @@ done:
HDfree(c_field_types);
return ret_value;
-}
-
+} /* end nh5tbmake_table_c() */
/*-------------------------------------------------------------------------
* Function: h5tbwrite_field_name_c
@@ -159,12 +150,8 @@ done:
*
* Comments:
*
-* Modifications:
-*
-*
*-------------------------------------------------------------------------
*/
-
int_f
nh5tbwrite_field_name_c(hid_t_f *loc_id,
int_f *namelen,
@@ -177,26 +164,23 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id,
void *buf)
{
char *c_name = NULL;
- char *c_name1 = NULL;
- hid_t c_loc_id = *loc_id;
- hsize_t c_start = *start;
- hsize_t c_nrecords = *nrecords;
- size_t c_type_size = *type_size;
+ char *c_name1 = NULL;
+ size_t c_type_size[1] = {(size_t)*type_size};
int_f ret_value = 0;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
HGOTO_DONE(FAIL)
if(NULL == (c_name1 = (char *)HD5f2cstring(field_name, (size_t)*namelen1)))
HGOTO_DONE(FAIL)
/*
- * call H5TBwrite_fields_name function.
- */
- if(H5TBwrite_fields_name(c_loc_id, c_name, c_name1, c_start, c_nrecords,
- c_type_size, 0, &c_type_size, buf) < 0)
+ * call H5TBwrite_fields_name function.
+ */
+ if(H5TBwrite_fields_name((hid_t)*loc_id, c_name, c_name1, (hsize_t)*start,
+ (hsize_t)*nrecords, c_type_size[0], 0, c_type_size, buf) < 0)
HGOTO_DONE(FAIL)
done:
@@ -219,8 +203,10 @@ nh5tbwrite_field_name_int_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbwrite_field_name_c(loc_id,namelen,name,namelen1,field_name,start,nrecords,type_size,buf);
+ return nh5tbwrite_field_name_c(loc_id, namelen, name, namelen1, field_name,
+ start, nrecords, type_size, buf);
}
+
int_f
nh5tbwrite_field_name_fl_c(hid_t_f *loc_id,
int_f *namelen,
@@ -232,7 +218,8 @@ nh5tbwrite_field_name_fl_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbwrite_field_name_c(loc_id,namelen,name,namelen1,field_name,start,nrecords,type_size,buf);
+ return nh5tbwrite_field_name_c(loc_id, namelen, name, namelen1, field_name,
+ start, nrecords, type_size, buf);
}
int_f
@@ -246,7 +233,8 @@ nh5tbwrite_field_name_dl_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbwrite_field_name_c(loc_id,namelen,name,namelen1,field_name,start,nrecords,type_size,buf);
+ return nh5tbwrite_field_name_c(loc_id, namelen, name, namelen1, field_name,
+ start, nrecords, type_size, buf);
}
int_f
@@ -260,7 +248,8 @@ nh5tbwrite_field_name_st_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbwrite_field_name_c(loc_id,namelen,name,namelen1,field_name,start,nrecords,type_size,buf);
+ return nh5tbwrite_field_name_c(loc_id, namelen, name, namelen1, field_name,
+ start, nrecords, type_size, buf);
}
/*-------------------------------------------------------------------------
@@ -276,12 +265,8 @@ nh5tbwrite_field_name_st_c(hid_t_f *loc_id,
*
* Comments:
*
-* Modifications:
-*
-*
*-------------------------------------------------------------------------
*/
-
int_f
nh5tbread_field_name_c(hid_t_f *loc_id,
int_f *namelen,
@@ -295,25 +280,22 @@ nh5tbread_field_name_c(hid_t_f *loc_id,
{
char *c_name = NULL;
char *c_name1 = NULL;
- hid_t c_loc_id = *loc_id;
- hsize_t c_start = *start;
- hsize_t c_nrecords = *nrecords;
- size_t c_type_size = *type_size;
+ size_t c_type_size[1] = {(size_t)*type_size};
int_f ret_value = 0;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
HGOTO_DONE(FAIL)
if(NULL == (c_name1 = (char *)HD5f2cstring(field_name, (size_t)*namelen1)))
HGOTO_DONE(FAIL)
/*
- * call H5TBread_fields_name function.
- */
- if(H5TBread_fields_name(c_loc_id, c_name, c_name1, c_start, c_nrecords,
- c_type_size, 0, &c_type_size, buf) < 0)
+ * call H5TBread_fields_name function.
+ */
+ if(H5TBread_fields_name((hid_t)*loc_id, c_name, c_name1, (hsize_t)*start,
+ (hsize_t)*nrecords, c_type_size[0], 0, c_type_size, buf) < 0)
HGOTO_DONE(FAIL)
done:
@@ -336,7 +318,8 @@ nh5tbread_field_name_int_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbread_field_name_c(loc_id,namelen,name,namelen1,field_name,start,nrecords,type_size,buf);
+ return nh5tbread_field_name_c(loc_id, namelen, name, namelen1, field_name,
+ start, nrecords, type_size, buf);
}
int_f
@@ -350,7 +333,8 @@ nh5tbread_field_name_fl_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbread_field_name_c(loc_id,namelen,name,namelen1,field_name,start,nrecords,type_size,buf);
+ return nh5tbread_field_name_c(loc_id, namelen, name, namelen1, field_name,
+ start, nrecords, type_size, buf);
}
int_f
@@ -364,7 +348,8 @@ nh5tbread_field_name_dl_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbread_field_name_c(loc_id,namelen,name,namelen1,field_name,start,nrecords,type_size,buf);
+ return nh5tbread_field_name_c(loc_id, namelen, name, namelen1, field_name,
+ start, nrecords, type_size, buf);
}
int_f
@@ -378,7 +363,8 @@ nh5tbread_field_name_st_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbread_field_name_c(loc_id,namelen,name,namelen1,field_name,start,nrecords,type_size,buf);
+ return nh5tbread_field_name_c(loc_id, namelen, name, namelen1, field_name,
+ start, nrecords, type_size, buf);
}
/*-------------------------------------------------------------------------
@@ -394,12 +380,8 @@ nh5tbread_field_name_st_c(hid_t_f *loc_id,
*
* Comments:
*
-* Modifications:
-*
-*
*-------------------------------------------------------------------------
*/
-
int_f
nh5tbwrite_field_index_c(hid_t_f *loc_id,
int_f *namelen,
@@ -411,25 +393,22 @@ nh5tbwrite_field_index_c(hid_t_f *loc_id,
void *buf)
{
char *c_name = NULL;
- hid_t c_loc_id = *loc_id;
- hsize_t c_start = *start;
- hsize_t c_nrecords = *nrecords;
size_t c_type_size = *type_size;
int c_field_index = *field_index - 1; /* C zero based index */
int_f ret_value = 0;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
HGOTO_DONE(FAIL)
/*
- * call H5TBwrite_fields_name function.
- */
- if(H5TBwrite_fields_index(c_loc_id, c_name, (hsize_t)1, &c_field_index,
- c_start, c_nrecords, c_type_size, 0, &c_type_size, buf) < 0)
+ * call H5TBwrite_fields_name function.
+ */
+ if(H5TBwrite_fields_index((hid_t)*loc_id, c_name, (hsize_t)1, &c_field_index,
+ (hsize_t)*start, (hsize_t)*nrecords, c_type_size, 0, &c_type_size, buf) < 0)
HGOTO_DONE(FAIL)
done:
@@ -449,7 +428,8 @@ nh5tbwrite_field_index_int_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbwrite_field_index_c(loc_id,namelen,name,field_index,start,nrecords,type_size,buf);
+ return nh5tbwrite_field_index_c(loc_id, namelen, name, field_index, start,
+ nrecords, type_size, buf);
}
int_f
@@ -462,7 +442,8 @@ nh5tbwrite_field_index_fl_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbwrite_field_index_c(loc_id,namelen,name,field_index,start,nrecords,type_size,buf);
+ return nh5tbwrite_field_index_c(loc_id, namelen, name, field_index, start,
+ nrecords, type_size, buf);
}
int_f
@@ -475,7 +456,8 @@ nh5tbwrite_field_index_dl_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbwrite_field_index_c(loc_id,namelen,name,field_index,start,nrecords,type_size,buf);
+ return nh5tbwrite_field_index_c(loc_id, namelen, name, field_index, start,
+ nrecords, type_size, buf);
}
int_f
@@ -488,7 +470,8 @@ nh5tbwrite_field_index_st_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbwrite_field_index_c(loc_id,namelen,name,field_index,start,nrecords,type_size,buf);
+ return nh5tbwrite_field_index_c(loc_id, namelen, name, field_index, start,
+ nrecords, type_size, buf);
}
/*-------------------------------------------------------------------------
@@ -504,12 +487,8 @@ nh5tbwrite_field_index_st_c(hid_t_f *loc_id,
*
* Comments:
*
-* Modifications:
-*
-*
*-------------------------------------------------------------------------
*/
-
int_f
nh5tbread_field_index_c(hid_t_f *loc_id,
int_f *namelen,
@@ -521,9 +500,6 @@ nh5tbread_field_index_c(hid_t_f *loc_id,
void *buf)
{
char *c_name = NULL;
- hid_t c_loc_id = *loc_id;
- hsize_t c_start = *start;
- hsize_t c_nrecords = *nrecords;
size_t c_type_size = *type_size;
int c_field_index = *field_index - 1; /* C zero based index */
int_f ret_value = 0;
@@ -537,8 +513,8 @@ nh5tbread_field_index_c(hid_t_f *loc_id,
/*
* call H5TBread_fields_index function.
*/
- if(H5TBread_fields_index(c_loc_id, c_name,(hsize_t)1, &c_field_index,
- c_start, c_nrecords, c_type_size, 0, &c_type_size, buf) < 0)
+ if(H5TBread_fields_index((hid_t)*loc_id, c_name,(hsize_t)1, &c_field_index,
+ (hsize_t)*start, (hsize_t)*nrecords, c_type_size, 0, &c_type_size, buf) < 0)
HGOTO_DONE(FAIL)
done:
@@ -558,7 +534,8 @@ nh5tbread_field_index_int_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbread_field_index_c(loc_id,namelen,name,field_index,start,nrecords,type_size,buf);
+ return nh5tbread_field_index_c(loc_id, namelen, name, field_index, start,
+ nrecords, type_size, buf);
}
int_f
@@ -571,7 +548,8 @@ nh5tbread_field_index_fl_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbread_field_index_c(loc_id,namelen,name,field_index,start,nrecords,type_size,buf);
+ return nh5tbread_field_index_c(loc_id, namelen, name, field_index, start,
+ nrecords, type_size, buf);
}
int_f
@@ -584,7 +562,8 @@ nh5tbread_field_index_dl_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbread_field_index_c(loc_id,namelen,name,field_index,start,nrecords,type_size,buf);
+ return nh5tbread_field_index_c(loc_id, namelen, name, field_index, start,
+ nrecords, type_size, buf);
}
int_f
@@ -597,7 +576,8 @@ nh5tbread_field_index_st_c(hid_t_f *loc_id,
size_t_f *type_size,
void *buf)
{
- return nh5tbread_field_index_c(loc_id,namelen,name,field_index,start,nrecords,type_size,buf);
+ return nh5tbread_field_index_c(loc_id, namelen, name, field_index, start,
+ nrecords, type_size, buf);
}
/*-------------------------------------------------------------------------
@@ -613,12 +593,8 @@ nh5tbread_field_index_st_c(hid_t_f *loc_id,
*
* Comments:
*
-* Modifications:
-*
-*
*-------------------------------------------------------------------------
*/
-
int_f
nh5tbinsert_field_c(hid_t_f *loc_id,
int_f *namelen,
@@ -631,29 +607,25 @@ nh5tbinsert_field_c(hid_t_f *loc_id,
{
char *c_name = NULL;
char *c_name1 = NULL;
- hid_t c_loc_id = *loc_id;
- hid_t c_field_type = *field_type;
- hsize_t c_position = *position;
int_f ret_value = 0;
/*
- * convert FORTRAN name to C name
- */
+ * convert FORTRAN name to C name
+ */
if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
HGOTO_DONE(FAIL)
if(NULL == (c_name1 = (char *)HD5f2cstring(field_name, (size_t)*namelen1)))
HGOTO_DONE(FAIL)
/*
- * call H5TBinsert_field function.
- */
-
- if(H5TBinsert_field(c_loc_id, c_name, c_name1, c_field_type, c_position,
- NULL, buf) < 0)
+ * call H5TBinsert_field function.
+ */
+ if(H5TBinsert_field((hid_t)*loc_id, c_name, c_name1, (hid_t)*field_type,
+ (hsize_t)*position, NULL, buf) < 0)
HGOTO_DONE(FAIL)
done:
- if(c_name )
+ if(c_name)
HDfree(c_name);
if(c_name1)
HDfree(c_name1);
@@ -671,7 +643,8 @@ nh5tbinsert_field_int_c(hid_t_f *loc_id,
int_f *position,
void *buf)
{
- return nh5tbinsert_field_c(loc_id,namelen,name,namelen1,field_name,field_type,position,buf);
+ return nh5tbinsert_field_c(loc_id, namelen, name, namelen1, field_name,
+ field_type, position, buf);
}
int_f
@@ -684,7 +657,8 @@ nh5tbinsert_field_fl_c(hid_t_f *loc_id,
int_f *position,
void *buf)
{
- return nh5tbinsert_field_c(loc_id,namelen,name,namelen1,field_name,field_type,position,buf);
+ return nh5tbinsert_field_c(loc_id, namelen, name, namelen1, field_name,
+ field_type, position, buf);
}
int_f
@@ -697,7 +671,8 @@ nh5tbinsert_field_dl_c(hid_t_f *loc_id,
int_f *position,
void *buf)
{
- return nh5tbinsert_field_c(loc_id,namelen,name,namelen1,field_name,field_type,position,buf);
+ return nh5tbinsert_field_c(loc_id, namelen, name, namelen1, field_name,
+ field_type, position, buf);
}
int_f
@@ -710,7 +685,8 @@ nh5tbinsert_field_st_c(hid_t_f *loc_id,
int_f *position,
void *buf)
{
- return nh5tbinsert_field_c(loc_id,namelen,name,namelen1,field_name,field_type,position,buf);
+ return nh5tbinsert_field_c(loc_id, namelen, name, namelen1, field_name,
+ field_type, position, buf);
}
/*-------------------------------------------------------------------------
@@ -726,12 +702,8 @@ nh5tbinsert_field_st_c(hid_t_f *loc_id,
*
* Comments:
*
-* Modifications:
-*
-*
*-------------------------------------------------------------------------
*/
-
int_f
nh5tbdelete_field_c(hid_t_f *loc_id,
int_f *namelen,
@@ -741,7 +713,6 @@ nh5tbdelete_field_c(hid_t_f *loc_id,
{
char *c_name = NULL;
char *c_name1 = NULL;
- hid_t c_loc_id = *loc_id;
int_f ret_value = 0;
/*
@@ -755,13 +726,12 @@ nh5tbdelete_field_c(hid_t_f *loc_id,
/*
* call H5TBinsert_field function.
*/
- if(H5TBdelete_field(c_loc_id, c_name, c_name1) < 0)
+ if(H5TBdelete_field((hid_t)*loc_id, c_name, c_name1) < 0)
HGOTO_DONE(FAIL)
done:
if(c_name)
HDfree(c_name);
-
if(c_name1)
HDfree(c_name1);
@@ -781,12 +751,8 @@ done:
*
* Comments:
*
-* Modifications:
-*
-*
*-------------------------------------------------------------------------
*/
-
int_f
nh5tbget_table_info_c(hid_t_f *loc_id,
int_f *namelen,
@@ -795,7 +761,6 @@ nh5tbget_table_info_c(hid_t_f *loc_id,
hsize_t_f *nrecords)
{
char *c_name = NULL;
- hid_t c_loc_id = *loc_id;
hsize_t c_nfields;
hsize_t c_nrecords;
int_f ret_value = 0;
@@ -809,7 +774,7 @@ nh5tbget_table_info_c(hid_t_f *loc_id,
/*
* call H5TBread_fields_index function.
*/
- if(H5TBget_table_info(c_loc_id, c_name, &c_nfields, &c_nrecords) < 0)
+ if(H5TBget_table_info((hid_t)*loc_id, c_name, &c_nfields, &c_nrecords) < 0)
HGOTO_DONE(FAIL)
*nfields = (hsize_t_f) c_nfields;;
@@ -822,8 +787,6 @@ done:
return ret_value;
}
-
-
/*-------------------------------------------------------------------------
* Function: h5tbget_field_info_c
*
@@ -837,9 +800,6 @@ done:
*
* Comments:
*
-* Modifications:
-*
-*
*-------------------------------------------------------------------------
*/
int_f
@@ -856,9 +816,7 @@ nh5tbget_field_info_c(hid_t_f *loc_id,
{
char *c_name = NULL;
hsize_t num_elem;
- hsize_t i;
int max_len = 1;
- hid_t c_loc_id = *loc_id;
hsize_t c_nfields = *nfields;
size_t *c_field_sizes = NULL;
size_t *c_field_offsets = NULL;
@@ -866,13 +824,13 @@ nh5tbget_field_info_c(hid_t_f *loc_id,
char **c_field_names = NULL;
char *tmp = NULL, *tmp_p;
int c_lenmax = HLTB_MAX_FIELD_LEN;
+ hsize_t i;
int_f ret_value = 0;
num_elem = c_nfields;
- for(i = 0; i < num_elem; i++) {
+ for(i = 0; i < num_elem; i++)
if(namelen2[i] > max_len)
max_len = namelen2[i];
- }
/*
* convert FORTRAN name to C name
@@ -893,11 +851,11 @@ nh5tbget_field_info_c(hid_t_f *loc_id,
/*
* call H5TBget_field_info function.
*/
- if(H5TBget_field_info(c_loc_id, c_name, c_field_names, c_field_sizes,
+ if(H5TBget_field_info((hid_t)*loc_id, c_name, c_field_names, c_field_sizes,
c_field_offsets, &c_type_size) < 0)
HGOTO_DONE(FAIL)
- /* return values*/
+ /* return values */
/* names array */
if(NULL == (tmp = (char *)HDmalloc((c_lenmax * (size_t)c_nfields) + 1)))
@@ -912,14 +870,14 @@ nh5tbget_field_info_c(hid_t_f *loc_id,
HDmemcpy(tmp_p, c_field_names[i], field_name_len);
namelen2[i] = (int_f)field_name_len;
tmp_p += c_lenmax;
- }
+ } /* end for */
HD5packFstring(tmp, _fcdtocp(field_names), (int)(c_lenmax * c_nfields));
*type_size = (size_t_f)c_type_size;
for(i = 0; i < num_elem; i++) {
field_sizes[i] = (size_t_f)c_field_sizes[i];
field_offsets[i] = (size_t_f)c_field_offsets[i];
- }
+ } /* end for */
done:
if(c_name)
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 7a612a8..3c258c1 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -31,7 +31,9 @@
#define TEST_FILE_NAME "test_packet_table.h5"
#define TEST_COMPRESS_FILE "test_packet_compress.h5"
#define PT_NAME "Test Packet Table"
+#ifdef VLPT_REMOVED
#define VL_TABLE_NAME "Varlen Test Table"
+#endif /* VLPT_REMOVED */
#define H5TB_TABLE_NAME "Table1"
/*-------------------------------------------------------------------------
@@ -774,7 +776,7 @@ test_compress(void)
size_t c;
size_t num_elems = 1;
unsigned filter_vals[1];
- particle_t readPart;
+ particle_t readPart[1];
hsize_t count;
TESTING("packet table compression");
@@ -807,13 +809,14 @@ test_compress(void)
if( count != BIG_TABLE_SIZE ) TEST_ERROR;
/* Read particles to ensure that all of them were written correctly */
+ HDmemset(readPart, 0, sizeof(readPart));
for(c = 0; c < BIG_TABLE_SIZE; c++)
{
- err = H5PTget_next(table, 1, &readPart);
+ err = H5PTget_next(table, 1, readPart);
if(err < 0) TEST_ERROR;
/* Ensure that particles were read correctly */
- if( cmp_par(c % 8, 0, testPart, &readPart) != 0) TEST_ERROR;
+ if( cmp_par(c % 8, 0, testPart, readPart) != 0) TEST_ERROR;
}
/* Close the table */
diff --git a/src/H5AC.c b/src/H5AC.c
index f2a728f..cba1615 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -2500,7 +2500,9 @@ H5AC_open_trace_file(H5AC_t * cache_ptr,
#else /* H5_HAVE_PARALLEL */
- sprintf(file_name, "%s", trace_file_name);
+ HDsnprintf(file_name,
+ (size_t)(H5AC__MAX_TRACE_FILE_NAME_LEN + H5C__PREFIX_LEN + 1),
+ "%s", trace_file_name);
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5B.c b/src/H5B.c
index 389dbb5..40b221d 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -677,10 +677,6 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
if(H5AC_insert_entry(f, dxpl_id, H5AC_BT, addr, new_root_bt, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to add old B-tree root node to cache")
-#ifdef H5B_DEBUG
- H5B_assert(f, dxpl_id, addr, type, udata);
-#endif
-
done:
if(ret_value < 0)
if(new_root_bt && H5B_node_dest(new_root_bt) < 0)
@@ -694,6 +690,11 @@ done:
if(H5AC_unprotect(f, dxpl_id, H5AC_BT, split_bt_ud.addr, split_bt_ud.bt, split_bt_ud.cache_flags) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to unprotect new child")
+#ifdef H5B_DEBUG
+ if(ret_value >= 0)
+ H5B_assert(f, dxpl_id, addr, type, udata);
+#endif
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_insert() */
diff --git a/src/H5C.c b/src/H5C.c
index 9a7ba81..aed2b90 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -4392,15 +4392,26 @@ done:
herr_t
H5C_set_prefix(H5C_t * cache_ptr, char * prefix)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5C_set_prefix)
+ herr_t ret_value = SUCCEED; /* Return value */
- HDassert((cache_ptr) && (cache_ptr->magic == H5C__H5C_T_MAGIC));
- HDassert(prefix);
- HDassert(HDstrlen(prefix) < H5C__PREFIX_LEN);
+ FUNC_ENTER_NOAPI(H5C_set_prefix, FAIL)
- HDstrcpy(&(cache_ptr->prefix[0]), prefix);
+ if ( ( cache_ptr == NULL ) ||
+ ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ||
+ ( prefix == NULL ) ||
+ ( HDstrlen(prefix) >= H5C__PREFIX_LEN ) ) {
+
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.")
+ }
+
+ HDstrncpy(&(cache_ptr->prefix[0]), prefix, (size_t)(H5C__PREFIX_LEN));
+
+ cache_ptr->prefix[H5C__PREFIX_LEN - 1] = '\0';
+
+done:
+
+ FUNC_LEAVE_NOAPI(ret_value)
- FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5C_set_prefix() */
@@ -9263,7 +9274,7 @@ H5C_mark_tagged_entries(H5C_t * cache_ptr, haddr_t tag)
H5C_cache_entry_t *next_entry_ptr; /* entry pointer */
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT(H5C_mark_tagged_entries)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5C_mark_tagged_entries)
/* Assertions */
HDassert(0); /* This function is not yet used. We shouldn't be in here yet. */
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index 9b4f338..9a6e08f 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -1301,7 +1301,7 @@ H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src,
void *reclaim_buf = NULL; /* Buffer for reclaiming data */
H5S_t *buf_space = NULL; /* Dataspace describing buffer */
hid_t buf_sid = -1; /* ID for buffer dataspace */
- hsize_t buf_dim; /* Dimension for buffer */
+ hsize_t buf_dim[1] = {0}; /* Dimension for buffer */
hbool_t is_vlen = FALSE; /* Flag to indicate that VL type conversion should occur */
hbool_t fix_ref = FALSE; /* Flag to indicate that ref values should be fixed */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1382,10 +1382,10 @@ H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src,
buf_size = nelmts * max_dt_size;
/* Create dataspace for number of elements in buffer */
- buf_dim = nelmts;
+ buf_dim[0] = nelmts;
/* Create the space and set the initial extent */
- if(NULL == (buf_space = H5S_create_simple((unsigned)1, &buf_dim, NULL)))
+ if(NULL == (buf_space = H5S_create_simple((unsigned)1, buf_dim, NULL)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
/* Atomize */
@@ -1441,10 +1441,10 @@ H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src,
mem_nbytes = nelmts * mem_dt_size;
/* Adjust size of buffer's dataspace dimension */
- buf_dim = nelmts;
+ buf_dim[0] = nelmts;
/* Adjust size of buffer's dataspace */
- if(H5S_set_extent_real(buf_space, &buf_dim) < 0)
+ if(H5S_set_extent_real(buf_space, buf_dim) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "unable to change buffer dataspace size")
} /* end if */
else
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index 2c289b0..a52d538 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -279,6 +279,7 @@ H5T_bit_get_d(uint8_t *buf, size_t offset, size_t size)
case H5T_ORDER_ERROR:
case H5T_ORDER_VAX:
case H5T_ORDER_NONE:
+ case H5T_ORDER_MIXED:
default:
/* Unknown endianness. Bail out. */
HGOTO_DONE(UFAIL)
@@ -326,6 +327,7 @@ H5T_bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val)
case H5T_ORDER_ERROR:
case H5T_ORDER_VAX:
case H5T_ORDER_NONE:
+ case H5T_ORDER_MIXED:
default:
HDabort();
} /* end switch */
@@ -534,7 +536,7 @@ H5T_bit_inc(uint8_t *buf, size_t start, size_t size)
else
mask = ((unsigned)1 << (8 - start)) - 1;
acc = ((unsigned)buf[idx] >> start) & mask;
- acc += 1;
+ acc++;
carry = acc & ((unsigned)1 << MIN(size, 8 - start));
buf[idx] &= (uint8_t)(~(mask << start));
buf[idx] |= (uint8_t)((acc & mask) << start);
@@ -546,7 +548,7 @@ H5T_bit_inc(uint8_t *buf, size_t start, size_t size)
/* The middle */
while(carry && size >= 8) {
acc = buf[idx];
- acc += 1;
+ acc++;
carry = acc & 0x100;
buf[idx] = acc & 0xff;
idx++;
@@ -557,7 +559,7 @@ H5T_bit_inc(uint8_t *buf, size_t start, size_t size)
if(carry && size > 0) {
mask = ((unsigned)1 << size) - 1;
acc = buf[idx] & mask;
- acc += 1;
+ acc++;
carry = acc & ((unsigned)1 << size);
buf[idx] &= (uint8_t)(~mask);
buf[idx] |= (uint8_t)(acc & mask);
@@ -606,7 +608,7 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size)
*/
if(!(buf[idx] >> pos))
borrow = 1;
- buf[idx] -= 1 << pos;
+ buf[idx] = (uint8_t)(buf[idx] - (1 << pos));
idx++;
size -= (8 - pos);
@@ -614,7 +616,7 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size)
while(borrow && size >= 8) {
if(buf[idx])
borrow = 0;
- buf[idx] -= 1;
+ buf[idx]--;
idx++;
size -= 8;
@@ -624,9 +626,9 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size)
if(borrow && size > 0) {
/* Similar to the first byte case, where sequence ends in the same byte as starts */
tmp = buf[idx];
- buf[idx] -= 1;
+ buf[idx]--;
if((buf[idx] >> size) != tmp >> size)
- buf[idx] += 1 << size;
+ buf[idx] = (uint8_t)(buf[idx] + (1 << size));
} /* end if */
} /* end if */
else { /* bit sequence ends in the same byte as starts */
@@ -635,9 +637,9 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size)
* not equal). We need to put this bit back by increment 1000000.
*/
tmp = buf[idx];
- buf[idx] -= 1 << pos;
+ buf[idx] = (uint8_t)(buf[idx] - (1 << pos));
if((buf[idx] >> (pos + size)) != tmp >> (pos + size)) {
- buf[idx] += 1 << (pos + size);
+ buf[idx] = (uint8_t)(buf[idx] + (1 << (pos + size)));
borrow = 1;
} /* end if */
} /* end else */
@@ -664,7 +666,7 @@ H5T_bit_neg(uint8_t *buf, size_t start, size_t size)
{
size_t idx = start / 8;
size_t pos = start % 8;
- uint8_t tmp;
+ uint8_t tmp[1];
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_bit_neg);
@@ -673,12 +675,11 @@ H5T_bit_neg(uint8_t *buf, size_t start, size_t size)
HDassert(size);
/* The first partial byte */
- tmp = buf[idx];
- tmp = (uint8_t)~tmp;
+ tmp[0] = (uint8_t)~buf[idx];
/* Simply copy the negated bit field back to the original byte */
if((size + start - 1) / 8 > idx) { /*bit sequence doesn't end in the same byte as starts*/
- H5T_bit_copy(&(buf[idx]), pos, &tmp, pos, (8-pos));
+ H5T_bit_copy(&(buf[idx]), pos, tmp, pos, (8-pos));
idx++;
size -= (8 - pos);
@@ -692,13 +693,12 @@ H5T_bit_neg(uint8_t *buf, size_t start, size_t size)
/* The last partial byte */
if(size > 0) {
/* Similar to the first byte case, where sequence ends in the same byte as starts */
- tmp = buf[idx];
- tmp = (uint8_t)~tmp;
- H5T_bit_copy(&(buf[idx]), (size_t)0, &tmp, (size_t)0, size);
+ tmp[0] = (uint8_t)~buf[idx];
+ H5T_bit_copy(&(buf[idx]), (size_t)0, tmp, (size_t)0, size);
} /* end if */
} /* end if */
else /* bit sequence ends in the same byte as starts */
- H5T_bit_copy(&(buf[idx]), pos, &tmp, pos, size);
+ H5T_bit_copy(&(buf[idx]), pos, tmp, pos, size);
FUNC_LEAVE_NOAPI_VOID
} /* end H5T_bit_neg() */
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2bed576..b3af7e6 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -22,11 +22,9 @@ CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS})
-IF (BUILD_SHARED_LIBS)
- IF (MSVC)
- TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib")
- ENDIF (MSVC)
-ENDIF (BUILD_SHARED_LIBS)
+IF (MSVC)
+ TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib")
+ENDIF (MSVC)
TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TEST_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE})
diff --git a/test/fheap.c b/test/fheap.c
index e38302c..3d8e69d 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -7621,14 +7621,14 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "removing all objects from root direct block of absolute heap %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill the heap up */
state.man_size = DBLOCK_SIZE(fh, 0);
@@ -7695,14 +7695,14 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "removing all objects from two direct blocks of absolute heap %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill the first block in heap */
state.man_size = DBLOCK_SIZE(fh, 0);
@@ -7784,14 +7784,14 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "removing all objects from first row of direct blocks of absolute heap %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill first row of direct blocks */
if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
@@ -7855,14 +7855,14 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "removing all objects from first two rows of direct blocks of absolute heap %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill first two rows of direct blocks */
if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
@@ -7928,14 +7928,14 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "removing all objects from first four rows of direct blocks of absolute heap %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill first two rows of direct blocks */
if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
@@ -8005,14 +8005,14 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "removing all objects from all direct blocks of root group in absolute heap %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill direct blocks in root indirect block */
if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
@@ -8076,14 +8076,14 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "removing all objects from 2nd level indirect blocks of absolute heap %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill direct blocks in root indirect block */
if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
@@ -8151,14 +8151,14 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "removing all objects from 3rd level indirect blocks of absolute heap %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill direct blocks in root indirect block */
if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
@@ -8235,14 +8235,14 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "inserting object that is too large for starting block, then remove all objects %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1;
state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0);
state.man_size += cparam->managed.width * DBLOCK_SIZE(fh, 1);
@@ -8313,14 +8313,14 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "skipping starting block, then adding object back to first block, then remove all objects %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Insert object too large for starting block size */
obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1;
@@ -8413,14 +8413,14 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "skipping starting block, then adding objects to backfill and extend, then remove all objects %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Insert object too large for starting block size */
obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1;
@@ -8522,14 +8522,14 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "insert object to initial block, then add object too large for starting direct blocks, then remove all objects %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Insert small object, to create root direct block */
state.man_size = DBLOCK_SIZE(fh, 0);
@@ -8621,14 +8621,14 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes
const char *base_desc = "insert object to initial block, then add object too large for starting direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Insert small object, to create root direct block */
state.man_size = DBLOCK_SIZE(fh, 0);
@@ -8766,14 +8766,14 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *
const char *base_desc = "skipping blocks with indirect root, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u; /* Local index variable */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill initial direct block */
state.man_size = DBLOCK_SIZE(fh, 0);
@@ -8931,14 +8931,14 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "filling first row, then skipping rows, then backfill and extend, then remove all objects %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill first row of direct blocks */
if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
@@ -9060,14 +9060,14 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
const char *base_desc = "skipping direct blocks to last row and skipping two rows of root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Compute # direct block rows in root indirect block */
num_direct_rows = DTABLE_MAX_DROWS(fh);
@@ -9185,14 +9185,14 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "filling direct blocks and skipping blocks in non-root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill direct blocks in root indirect block */
if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
@@ -9312,14 +9312,14 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_
const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u; /* Local index variable */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -9440,14 +9440,14 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, except last one, and insert object too large for 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -9587,14 +9587,14 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5
const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then skip row of direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u; /* Local index variable */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -9757,14 +9757,14 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -9911,14 +9911,14 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t
const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, skip one row of root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -10088,14 +10088,14 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, and skip first rows of direct blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill direct blocks in root indirect block */
if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
@@ -10217,14 +10217,14 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first rows of direct blocks of 3rd level indirect block's 2nd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Fill direct blocks in root indirect block */
if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
@@ -10357,14 +10357,14 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first row of indirect blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -10509,14 +10509,14 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first two rows of indirect blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -10672,14 +10672,14 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect blocks, except last one, fill all direct blocks in last 3rd level indirect block, and insert object too large for it's 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -10835,14 +10835,14 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect blocks, fill all direct blocks in next 3rd level indirect block, fill all 1st row of 2nd level indirect blocks, except last one, and insert object too large for 2nd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -11002,14 +11002,14 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill 4th level indirect block's direct blocks, and skip first row of 2nd indirect blocks of 4th level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -11164,14 +11164,14 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill 4th level indirect block's direct, 2nd level indirect blocks and 3rd level direct block, and skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -11344,14 +11344,14 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 4th level indirect blocks, fill 2nd row 4th level indirect block's direct, 2nd level indirect blocks, first row of 3rd level indirect blocks, 3rd level direct block in 2nd row, and skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -11559,14 +11559,14 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 3rd level indirect blocks in 4th level indirect block except last 3rd level block, fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -11756,14 +11756,14 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_
const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 4th level indirect blocks, except last one, fill first row of 3rd level indirect blocks in last 4th level indirect block except last 3rd level block, fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -11982,14 +11982,14 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Insert objects small enough to fit into initial blocks, but not to
* share them with other objects of the same size, until the next larger
@@ -12115,14 +12115,14 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Retrieve # of direct rows in root indirect block */
root_direct_rows = H5HF_get_dtable_max_drows_test(fh);
@@ -12288,14 +12288,14 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
const char *base_desc = "fill root direct blocks, then fragment 2nd level indirect block's direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Compute # of bits used in first row */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
@@ -12402,14 +12402,14 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
const char *base_desc = "fill root direct blocks and 2nd level indirect blocks, then fragment 3rd level indirect block's direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */
unsigned u, v; /* Local index variables */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Compute # of direct rows in root indirect block */
root_direct_rows = DTABLE_MAX_DROWS(fh);
@@ -12519,14 +12519,14 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "insert one huge object, then remove %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Allocate heap ID(s) */
if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len)))
TEST_ERROR
@@ -12673,14 +12673,14 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "insert two huge objects, then remove %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Allocate heap ID(s) */
if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len)))
TEST_ERROR
@@ -12907,14 +12907,14 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "insert three huge objects, then remove %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Allocate heap ID(s) */
if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len)))
TEST_ERROR
@@ -13217,14 +13217,14 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "insert mix of normal & huge objects, then remove %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Allocate heap ID(s) */
if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len)))
TEST_ERROR
@@ -13855,14 +13855,14 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "insert one tiny object, then remove %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Allocate heap ID(s) */
if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len)))
TEST_ERROR
@@ -14009,14 +14009,14 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "insert two tiny objects, then remove %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Allocate heap ID(s) */
if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len)))
TEST_ERROR
@@ -14248,14 +14248,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
fheap_heap_state_t state; /* State of fractal heap */
const char *base_desc = "insert mix of normal, huge & tiny objects, then remove %s"; /* Test description */
- /* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
- TEST_ERROR
-
/* Perform common test initialization operations */
if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
TEST_ERROR
+ /* Perform common file & heap open operations */
+ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ TEST_ERROR
+
/* Allocate heap ID(s) */
if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len)))
TEST_ERROR
@@ -15365,6 +15365,9 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
fheap_heap_state_t state; /* State of fractal heap */
size_t u; /* Local index variable */
+ /* Initialize the heap ID structure */
+ HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t));
+
/* Copy heap creation properties */
HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
@@ -15404,9 +15407,6 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
TESTING("inserting random-sized objects, then remove all objects (all - random)")
} /* end else */
- /* Initialize the heap ID structure */
- HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t));
-
/* Choose random # seed */
seed = (unsigned long)HDtime(NULL);
#ifdef QAK
@@ -15569,6 +15569,9 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te
fheap_heap_state_t state; /* State of fractal heap */
size_t u; /* Local index variable */
+ /* Initialize the heap ID structure */
+ HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t));
+
/* Copy heap creation properties */
HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
@@ -15608,9 +15611,6 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te
TESTING("inserting random-sized objects with power of 2 distribution, then remove all objects (all - random)")
} /* end else */
- /* Initialize the heap ID structure */
- HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t));
-
/* Choose random # seed */
seed = (unsigned long)HDtime(NULL);
#ifdef QAK
@@ -15805,6 +15805,9 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
else
TESTING("writing objects in heap")
+ /* Initialize the heap ID structure */
+ HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t));
+
/* Copy heap creation properties */
HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
@@ -15843,9 +15846,6 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
if(id_len > MAX_HEAP_ID_LEN)
TEST_ERROR
- /* Initialize the heap ID structure */
- HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t));
-
/* Create 'tiny' and 'huge' objects */
obj_size = id_len / 2;
@@ -16072,6 +16072,9 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
*/
TESTING("bug1: inserting several objects & removing one, then re-inserting")
+ /* Initialize the heap ID structure */
+ HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t));
+
/* Perform common file & heap open operations */
if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -16082,9 +16085,6 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
if(id_len > MAX_HEAP_ID_LEN)
TEST_ERROR
- /* Initialize the heap ID structure */
- HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t));
-
/* Insert objects */
obj_size = 44;
obj_loc = 1;
diff --git a/test/ohdr.c b/test/ohdr.c
index 8494d51..109d59c 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -68,6 +68,9 @@ test_cont(char *filename, hid_t fapl)
TESTING("object header continuation block");
+ HDmemset(&oh_locA, 0, sizeof(oh_locA));
+ HDmemset(&oh_locB, 0, sizeof(oh_locB));
+
/* Create the file to operate on */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR
@@ -77,9 +80,6 @@ test_cont(char *filename, hid_t fapl)
goto error;
}
- HDmemset(&oh_locA, 0, sizeof(oh_locA));
- HDmemset(&oh_locB, 0, sizeof(oh_locB));
-
if(H5O_create(f, H5P_DATASET_XFER_DEFAULT, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locA/*out*/) < 0)
FAIL_STACK_ERROR
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 80e2abf..841d0b1 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -1832,8 +1832,8 @@ void rr_obj_hdr_flush_confusion(void)
disk_space[i] = H5Screate_simple(1, disk_size, NULL);
VRFY((disk_space[i] >= 0), "H5Screate_simple(1) failed.\n");
- dataset[i] = H5Dcreate(file_id, dataset_name[i], H5T_NATIVE_DOUBLE,
- disk_space[i], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset[i] = H5Dcreate2(file_id, dataset_name[i], H5T_NATIVE_DOUBLE,
+ disk_space[i], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset[i] >= 0), "H5Dcreate(1) failed.\n");
}
@@ -1936,8 +1936,8 @@ void rr_obj_hdr_flush_confusion(void)
att_space[i] = H5Screate_simple(1, att_size, NULL);
VRFY((att_space[i] >= 0), "H5Screate_simple(3) failed.\n");
- att_id[i] = H5Acreate(dataset[i], att_name[i], H5T_NATIVE_DOUBLE,
- att_space[i], H5P_DEFAULT, H5P_DEFAULT);
+ att_id[i] = H5Acreate2(dataset[i], att_name[i], H5T_NATIVE_DOUBLE,
+ att_space[i], H5P_DEFAULT, H5P_DEFAULT);
VRFY((att_id[i] >= 0), "H5Acreate(1) failed.\n");
@@ -1998,8 +1998,8 @@ void rr_obj_hdr_flush_confusion(void)
lg_att_space[i] = H5Screate_simple(1, lg_att_size, NULL);
VRFY((lg_att_space[i] >= 0), "H5Screate_simple(4) failed.\n");
- lg_att_id[i] = H5Acreate(dataset[i], lg_att_name[i], H5T_NATIVE_DOUBLE,
- lg_att_space[i], H5P_DEFAULT, H5P_DEFAULT);
+ lg_att_id[i] = H5Acreate2(dataset[i], lg_att_name[i], H5T_NATIVE_DOUBLE,
+ lg_att_space[i], H5P_DEFAULT, H5P_DEFAULT);
VRFY((lg_att_id[i] >= 0), "H5Acreate(2) failed.\n");
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 3cfe56b..896c310 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1299,8 +1299,8 @@ static int
h5tools_print_region_data_blocks(hid_t region_id,
FILE *stream, const h5tool_format_t *info, h5tools_context_t ctx,
h5tools_str_t *buffer/*string into which to render */, size_t ncols,
- int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata) {
- HERR_INIT(int, SUCCEED)
+ int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata)
+{
hbool_t dimension_break = TRUE;
hsize_t *dims1 = NULL;
hsize_t *start = NULL;
@@ -1311,11 +1311,13 @@ h5tools_print_region_data_blocks(hid_t region_id,
unsigned int region_flags; /* buffer extent flags */
hsize_t curr_pos;
int jndx;
+ size_t indx;
int type_size;
hid_t mem_space = -1;
void *region_buf = NULL;
int blkndx;
hid_t sid1 = -1;
+ int ret_value = SUCCEED;
/* Get the dataspace of the dataset */
if((sid1 = H5Dget_space(region_id)) < 0)
@@ -1371,8 +1373,8 @@ h5tools_print_region_data_blocks(hid_t region_id,
HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
/* assume entire data space to be printed */
- for (jndx = 0; jndx < (size_t) ctx.ndims; jndx++)
- ctx.p_min_idx[jndx] = start[jndx];
+ for (indx = 0; indx < (size_t) ctx.ndims; indx++)
+ ctx.p_min_idx[indx] = start[indx];
init_acc_pos(&ctx, total_size);
/* print the data */
@@ -1380,8 +1382,8 @@ h5tools_print_region_data_blocks(hid_t region_id,
if (blkndx == nblocks - 1)
region_flags |= END_OF_DATA;
- for (jndx = 0; jndx < ctx.ndims; jndx++)
- ctx.p_max_idx[jndx] = dims1[jndx];
+ for (indx = 0; indx < (size_t)ctx.ndims; indx++)
+ ctx.p_max_idx[indx] = dims1[indx];
curr_pos = 0;
ctx.sm_pos = blkndx*2*ndims;
@@ -1390,24 +1392,24 @@ h5tools_print_region_data_blocks(hid_t region_id,
h5tools_region_simple_prefix(stream, info, &ctx, curr_pos, ptdata, 0);
elmtno = 0;
- for (jndx = 0; jndx < numelem; jndx++, elmtno++, ctx.cur_elmt++) {
+ for (indx = 0; indx < numelem; indx++, elmtno++, ctx.cur_elmt++) {
/* Render the region data element begin */
h5tools_str_reset(buffer);
- h5tools_str_append(buffer, "%s", jndx ? OPTIONAL_LINE_BREAK "" : "");
+ h5tools_str_append(buffer, "%s", indx ? OPTIONAL_LINE_BREAK "" : "");
h5tools_str_sprint(buffer, info, region_id, type_id,
- ((char*)region_buf + jndx * type_size), &ctx);
+ ((char*)region_buf + indx * type_size), &ctx);
- if (jndx + 1 < numelem || (region_flags & END_OF_DATA) == 0)
+ if (indx + 1 < numelem || (region_flags & END_OF_DATA) == 0)
h5tools_str_append(buffer, "%s", OPT(info->elmt_suf1, ","));
dimension_break = h5tools_render_region_element(stream, info, &ctx, buffer, &curr_pos,
- ncols, ptdata, jndx, elmtno);
+ ncols, ptdata, indx, elmtno);
/* Render the region data element end */
if(FALSE == dimension_break)
elmtno = 0;
- } /* end for (jndx = 0; jndx < numelem; jndx++, region_elmtno++, ctx.cur_elmt++) */
+ } /* end for (indx = 0; indx < numelem; indx++, region_elmtno++, ctx.cur_elmt++) */
ctx.indent_level--;
} /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */
@@ -1423,7 +1425,6 @@ h5tools_print_region_data_blocks(hid_t region_id,
if(H5Sclose(sid1) < 0)
HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
-CATCH
return ret_value;
}
@@ -1457,7 +1458,8 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
h5tools_str_t *buffer/*string into which to render */,
hsize_t *curr_pos/*total data element position*/,
size_t ncols, hsize_t region_elmt_counter/*element counter*/,
- hsize_t elmt_counter) {
+ hsize_t elmt_counter)
+{
HERR_INIT(hbool_t, TRUE)
hbool_t dimension_break = TRUE;
hssize_t nblocks;
@@ -1643,17 +1645,17 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
h5tools_str_t *buffer, size_t ncols,
int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata)
{
- HERR_INIT(int, SUCCEED)
hbool_t dimension_break = TRUE;
hsize_t *dims1 = NULL;
hsize_t elmtno; /* elemnt index */
unsigned int region_flags; /* buffer extent flags */
hsize_t curr_pos;
- int indx;
+ size_t indx;
int jndx;
int type_size;
hid_t mem_space = -1;
void *region_buf = NULL;
+ int ret_value = SUCCEED;
if((type_size = H5Tget_size(type_id)) == 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
@@ -1717,7 +1719,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
dimension_break =
h5tools_render_region_element(stream, info, &ctx, buffer, &curr_pos,
- ncols, ptdata, 0, elmtno);
+ ncols, ptdata, (hsize_t)0, elmtno);
/* Render the point element end */
ctx.indent_level--;
@@ -1731,7 +1733,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
if(H5Sclose(mem_space) < 0)
HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
-CATCH
+
return ret_value;
}
@@ -1769,7 +1771,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
hsize_t alloc_size;
hsize_t *ptdata;
int ndims;
- int indx;
+ hssize_t indx;
hid_t dtype;
hid_t type_id;
@@ -1796,7 +1798,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
alloc_size = npoints * ndims * sizeof(ptdata[0]);
assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
- if((ptdata = malloc((size_t) alloc_size)) == NULL)
+ if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size)))
HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
H5_CHECK_OVERFLOW(npoints, hssize_t, hsize_t);
@@ -1965,7 +1967,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
HERR_INIT(herr_t, SUCCEED)
size_t i; /* counters */
size_t j; /* counters */
- hsize_t zero = 0; /* vector of zeros */
+ hsize_t zero[1] = {0}; /* vector of zeros */
unsigned int flags; /* buffer extent flags */
hsize_t elmtno; /* elemnt index */
hsize_t low[H5S_MAX_RANK]; /* low bound of hyperslab */
@@ -2028,13 +2030,13 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
}
assert(sm_nbytes == (hsize_t) ((size_t) sm_nbytes)); /*check for overflow*/
- if((sm_buf = HDmalloc((size_t) sm_nelmts * p_type_nbytes)) == NULL)
+ if(NULL == (sm_buf = (unsigned char *)HDmalloc((size_t) sm_nelmts * p_type_nbytes)))
H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for strip-mine");
if((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0)
H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed");
- if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, &zero, NULL, &sm_nelmts, NULL) < 0)
+ if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &sm_nelmts, NULL) < 0)
H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
/* read the data */
@@ -2129,7 +2131,6 @@ h5tools_display_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools
hid_t dset, hid_t p_type, struct subset_t *sset,
hid_t f_space, hsize_t *total_size)
{
- HERR_INIT(herr_t, SUCCEED)
size_t i; /* counters */
hsize_t n; /* counters */
hsize_t count; /* hyperslab count */
@@ -2142,6 +2143,7 @@ h5tools_display_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools
hsize_t temp_block[H5S_MAX_RANK];/* temporary block size used in loop */
hsize_t temp_stride[H5S_MAX_RANK];/* temporary stride size used in loop */
int reset_dim;
+ herr_t ret_value = SUCCEED;
if (ctx->ndims == 1)
row_dim = 0;
@@ -2230,7 +2232,6 @@ h5tools_display_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools
} /* outer_count */
-CATCH
return ret_value;
}
@@ -2440,7 +2441,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info,
}
assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
- sm_buf = malloc((size_t)sm_nbytes);
+ sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes);
sm_nelmts = sm_nbytes / p_type_nbytes;
sm_space = H5Screate_simple(1, &sm_nelmts, NULL);
@@ -2516,7 +2517,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info,
H5Sclose(sm_space);
H5Sclose(f_space);
- free(sm_buf);
+ HDfree(sm_buf);
return SUCCEED;
}
@@ -3333,9 +3334,9 @@ h5tools_print_enum(h5tools_str_t *buffer, hid_t type)
dst_size = type_size;
/* Get the names and raw values of all members */
- if((name = calloc(nmembs, sizeof(char *))) == NULL)
+ if(NULL == (name = (char **)HDcalloc(nmembs, sizeof(char *))))
H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member name");
- if((value = calloc(nmembs, MAX(type_size, dst_size))) == NULL)
+ if(NULL == (value = (unsigned char *)HDcalloc(nmembs, MAX(type_size, dst_size))))
H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member value");
for (i = 0; i < nmembs; i++) {
@@ -3914,7 +3915,6 @@ static int
render_bin_output_region_data_blocks(hid_t region_id, FILE *stream,
hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata)
{
- HERR_INIT(int, SUCCEED)
hsize_t *dims1 = NULL;
hsize_t *start = NULL;
hsize_t *count = NULL;
@@ -3926,6 +3926,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream,
void *region_buf = NULL;
int blkndx;
hid_t sid1 = -1;
+ int ret_value = SUCCEED;
/* Get the dataspace of the dataset */
if((sid1 = H5Dget_space(region_id)) < 0)
@@ -3994,7 +3995,6 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream,
if(H5Sclose(sid1) < 0)
HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
-CATCH
return ret_value;
}
@@ -4085,12 +4085,12 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id,
FILE *stream, hid_t container,
int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata)
{
- HERR_INIT(int, SUCCEED)
hsize_t *dims1 = NULL;
int jndx;
int type_size;
hid_t mem_space = -1;
void *region_buf = NULL;
+ int ret_value = SUCCEED;
if((type_size = H5Tget_size(type_id)) == 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed");
@@ -4122,7 +4122,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id,
if(H5Sclose(mem_space) < 0)
HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
-CATCH
+
return ret_value;
}
@@ -4160,7 +4160,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id,
alloc_size = npoints * ndims * sizeof(ptdata[0]);
assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
- if((ptdata = malloc((size_t) alloc_size)) == NULL)
+ if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size)))
HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
H5_CHECK_OVERFLOW(npoints, hssize_t, hsize_t);