From 41a6b581aef055821796fc9d31f58778dc1c4197 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 27 Jul 2023 15:28:33 -0700 Subject: Sync Fortran w/ develop (#3296) --- fortran/src/H5Af.c | 20 +++++----- fortran/src/H5Aff.F90 | 3 +- fortran/src/H5Dff.F90 | 7 ++-- fortran/src/H5ESff.F90 | 1 - fortran/src/H5Ef.c | 24 ++++++------ fortran/src/H5Eff.F90 | 2 +- fortran/src/H5Fff.F90 | 2 +- fortran/src/H5Gff.F90 | 4 +- fortran/src/H5Iff.F90 | 2 +- fortran/src/H5Lf.c | 22 +++++------ fortran/src/H5Lff.F90 | 5 +-- fortran/src/H5Of.c | 8 ++-- fortran/src/H5Off.F90 | 2 - fortran/src/H5Pf.c | 80 +++++++++++++++++++-------------------- fortran/src/H5Pff.F90 | 1 - fortran/src/H5Rf.c | 10 ++--- fortran/src/H5Rff.F90 | 3 +- fortran/src/H5Sf.c | 20 +++++----- fortran/src/H5Sff.F90 | 3 +- fortran/src/H5Tf.c | 2 +- fortran/src/H5Tff.F90 | 1 - fortran/src/H5VLff.F90 | 1 - fortran/src/H5Zff.F90 | 1 + fortran/src/H5_ff.F90 | 1 - fortran/src/H5f90kit.c | 4 +- fortran/test/t.c | 8 ++-- fortran/test/tH5A_1_8.F90 | 12 +++--- fortran/test/tH5G_1_8.F90 | 18 ++++----- fortran/test/tH5Sselect.F90 | 8 ++-- hl/fortran/src/H5DSfc.c | 22 +++++------ hl/fortran/src/H5IMfc.c | 4 +- hl/fortran/src/H5LTfc.c | 20 +++++----- hl/fortran/src/H5TBfc.c | 92 ++++++++++++++++++++++----------------------- 33 files changed, 203 insertions(+), 210 deletions(-) diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index da5488d..364d2c5 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -220,14 +220,14 @@ h5adelete_by_idx_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f * Convert FORTRAN name to C name */ if (NULL == (c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Adelete_by_name function. */ if (H5Adelete_by_idx((hid_t)*loc_id, c_obj_name, (H5_index_t)*idx_type, (H5_iter_order_t)*order, (hsize_t)*n, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_obj_name) @@ -289,14 +289,14 @@ h5aget_name_by_idx_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_ * Convert FORTRAN name to C name */ if (NULL == (c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Allocate buffer to hold name of an attribute */ c_buf_size = (size_t)*size + 1; if (NULL == (c_buf = (char *)malloc(c_buf_size))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Aget_name_by_idx function. @@ -304,7 +304,7 @@ h5aget_name_by_idx_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_ c_size = H5Aget_name_by_idx((hid_t)*loc_id, c_obj_name, (H5_index_t)*idx_type, (H5_iter_order_t)*order, (hsize_t)*n, c_buf, c_buf_size, (hid_t)*lapl_id); if (c_size < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Convert C name to FORTRAN and place it in the given buffer @@ -415,14 +415,14 @@ h5aget_info_by_idx_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_ * Convert FORTRAN name to C name */ if (NULL == (c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Ainfo_by_idx function. */ if (H5Aget_info_by_idx((hid_t)*loc_id, c_obj_name, (H5_index_t)*idx_type, (H5_iter_order_t)*order, (hsize_t)*n, &ainfo, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* Unpack the structure */ *corder_valid = 0; @@ -477,15 +477,15 @@ h5aget_info_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fc * Convert FORTRAN name to C name */ if (NULL == (c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_attr_name = HD5f2cstring(attr_name, (size_t)*attr_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Ainfo_by_name function. */ if (H5Aget_info_by_name((hid_t)*loc_id, c_obj_name, c_attr_name, &ainfo, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* Unpack the structure */ *corder_valid = 0; diff --git a/fortran/src/H5Aff.F90 b/fortran/src/H5Aff.F90 index 57e4bdb..3cb1191 100644 --- a/fortran/src/H5Aff.F90 +++ b/fortran/src/H5Aff.F90 @@ -70,9 +70,8 @@ MODULE H5A - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_NULL_CHAR, C_LOC, C_INT - USE H5GLOBAL + IMPLICIT NONE PRIVATE h5awrite_char_scalar, h5awrite_ptr PRIVATE h5aread_char_scalar, h5aread_ptr diff --git a/fortran/src/H5Dff.F90 b/fortran/src/H5Dff.F90 index 5b571e5..6073570 100644 --- a/fortran/src/H5Dff.F90 +++ b/fortran/src/H5Dff.F90 @@ -85,10 +85,10 @@ MODULE H5D - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR USE H5GLOBAL USE H5LIB, ONLY : h5kind_to_type USE H5S, ONLY : H5Sget_simple_extent_ndims_f, H5Sclose_f + IMPLICIT NONE PRIVATE h5dread_vl_integer, h5dread_vl_real, h5dread_vl_string PRIVATE h5dwrite_vl_integer, h5dwrite_vl_real, h5dwrite_vl_string @@ -2266,6 +2266,9 @@ CONTAINS CALL h5dfill_ptr(f_ptr_fill_value, fill_type_id, f_ptr_buf, mem_type_id, space_id, hdferr) END SUBROUTINE h5dfill_char + +#endif + !> !! \ingroup FH5D !! @@ -2369,8 +2372,6 @@ CONTAINS END SUBROUTINE h5dwrite_multi_f -#endif - END MODULE H5D diff --git a/fortran/src/H5ESff.F90 b/fortran/src/H5ESff.F90 index f102d23..76e8488 100644 --- a/fortran/src/H5ESff.F90 +++ b/fortran/src/H5ESff.F90 @@ -33,7 +33,6 @@ MODULE H5ES - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_INT64_T, C_BOOL USE H5GLOBAL IMPLICIT NONE diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index 9631a87..7e3a25f 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -43,7 +43,7 @@ h5eclear_c(hid_t_f *estack_id) * Call H5Eclear function. */ if (H5Eclear2((hid_t)*estack_id) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: return ret_value; @@ -72,19 +72,19 @@ h5eprint_c1(_fcd name, int_f *namelen) int_f ret_value = 0; if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (file = fopen(c_name, "a"))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Eprint2 function. */ if (H5Eprint2(H5E_DEFAULT, file) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (file) - HDfclose(file); + fclose(file); if (c_name) free(c_name); @@ -115,7 +115,7 @@ h5eprint_c2(void) * Call H5Eprint2 function. */ if (H5Eprint2(H5E_DEFAULT, NULL) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: return ret_value; @@ -147,15 +147,15 @@ h5eget_major_c(int_f *error_no, _fcd name, size_t_f *namelen) c_name = (char *)malloc(c_namelen + 1); if (!c_name) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Eget_msg function. */ H5Eget_msg((hid_t)*error_no, NULL, c_name, c_namelen); HD5packFstring((char *)c_name, _fcdtocp(name), c_namelen); - if (!HDstrcmp(c_name, "Invalid major error number")) - HGOTO_DONE(FAIL) + if (!strcmp(c_name, "Invalid major error number")) + HGOTO_DONE(FAIL); done: if (c_name) @@ -190,15 +190,15 @@ h5eget_minor_c(int_f *error_no, _fcd name, size_t_f *namelen) c_name = (char *)malloc(c_namelen + 1); if (!c_name) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Eget_msg function. */ H5Eget_msg((hid_t)*error_no, NULL, c_name, c_namelen); HD5packFstring((char *)c_name, _fcdtocp(name), c_namelen); - if (!HDstrcmp(c_name, "Invalid minor error number")) - HGOTO_DONE(FAIL) + if (!strcmp(c_name, "Invalid minor error number")) + HGOTO_DONE(FAIL); done: if (c_name) diff --git a/fortran/src/H5Eff.F90 b/fortran/src/H5Eff.F90 index a4c9e8c..4ef18c1 100644 --- a/fortran/src/H5Eff.F90 +++ b/fortran/src/H5Eff.F90 @@ -37,8 +37,8 @@ MODULE H5E - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_FUNPTR, C_CHAR USE H5GLOBAL + IMPLICIT NONE INTEGER, PARAMETER :: PRINTON = 1 !< Turn on automatic printing of errors INTEGER, PARAMETER :: PRINTOFF = 0 !< Turn off automatic printing of errors diff --git a/fortran/src/H5Fff.F90 b/fortran/src/H5Fff.F90 index aec149f..f8a7405 100644 --- a/fortran/src/H5Fff.F90 +++ b/fortran/src/H5Fff.F90 @@ -36,7 +36,7 @@ ! MODULE H5F - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_NULL_PTR + USE H5GLOBAL IMPLICIT NONE diff --git a/fortran/src/H5Gff.F90 b/fortran/src/H5Gff.F90 index 94a7285..8f805ab 100644 --- a/fortran/src/H5Gff.F90 +++ b/fortran/src/H5Gff.F90 @@ -36,10 +36,10 @@ ! MODULE H5G - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_CHAR, C_INT + USE H5GLOBAL USE H5P, ONLY : H5Pcreate_f, H5Pset_local_heap_size_hint_f, H5Pclose_f - + IMPLICIT NONE ! ! @brief Fortran2003 Derived Type for @ref H5G_info_t diff --git a/fortran/src/H5Iff.F90 b/fortran/src/H5Iff.F90 index 6e6662c..7c449ea 100644 --- a/fortran/src/H5Iff.F90 +++ b/fortran/src/H5Iff.F90 @@ -37,8 +37,8 @@ MODULE H5I - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR USE H5GLOBAL + IMPLICIT NONE CONTAINS diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index 172c595..5fb5a34 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -57,16 +57,16 @@ h5lcopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *de * Convert FORTRAN name to C name */ if (NULL == (c_src_name = HD5f2cstring(src_name, (size_t)*src_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_dest_name = HD5f2cstring(dest_name, (size_t)*dest_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Lcopy function. */ if (H5Lcopy((hid_t)*src_loc_id, c_src_name, (hid_t)*dest_loc_id, c_dest_name, (hid_t)*lcpl_id, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_src_name) @@ -350,16 +350,16 @@ h5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *de * Convert FORTRAN name to C name */ if (NULL == (c_src_name = HD5f2cstring(src_name, (size_t)*src_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_dest_name = HD5f2cstring(dest_name, (size_t)*dest_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Lmove function. */ if (H5Lmove((hid_t)*src_loc_id, c_src_name, (hid_t)*dest_loc_id, c_dest_name, (hid_t)*lcpl_id, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_src_name) @@ -407,7 +407,7 @@ h5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, * Convert FORTRAN name to C name */ if (NULL == (c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); c_size = (size_t)*size + 1; @@ -415,12 +415,12 @@ h5lget_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 (NULL == (c_name = (char *)malloc(c_size))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if ((c_size_link = H5Lget_name_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field, (H5_iter_order_t)*order, (hsize_t)*n, c_name, c_size, (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); *size = (size_t_f)c_size_link; @@ -625,13 +625,13 @@ h5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_ * Convert FORTRAN name to C name */ if (NULL == (c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Lget_val */ if (H5Lget_val((hid_t)*link_loc_id, c_link_name, &linkval_buff, (size_t)*size, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_link_name) diff --git a/fortran/src/H5Lff.F90 b/fortran/src/H5Lff.F90 index 219ebec..c474754 100644 --- a/fortran/src/H5Lff.F90 +++ b/fortran/src/H5Lff.F90 @@ -37,12 +37,9 @@ MODULE H5L - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_FUNPTR, C_CHAR, C_INT64_T, C_INT USE H5GLOBAL - IMPLICIT NONE - TYPE, bind(c) :: union_t TYPE(H5O_TOKEN_T_F) :: token !< Type for object tokens INTEGER(size_t) :: val_size !< Size of a soft link or user-defined link value @@ -57,7 +54,7 @@ MODULE H5L !< \li H5L_TYPE_SOFT_F Soft link !< \li H5L_TYPE_EXTERNAL_F External link !< \li H5L_TYPE_ERROR_F Invalid link type id - ! LOGICAL(c_bool) :: corder_valid ! hbool_t corder_valid + ! LOGICAL(c_bool) :: corder_valid ! bool corder_valid INTEGER(c_int64_t) :: corder !< Creation order INTEGER(c_int) :: cset !< Character set of link name is encoded. Valid values include the following: !< \li H5T_CSET_ASCII US ASCII diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index addc6e3..393f505 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -38,7 +38,7 @@ fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info) object_info->type = (int_f)Oinfo.type; object_info->rc = (int_f)Oinfo.rc; - ts = HDgmtime(&Oinfo.atime); + ts = gmtime(&Oinfo.atime); object_info->atime[0] = (int_f)ts->tm_year + 1900; /* year starts at 1900 */ object_info->atime[1] = (int_f)ts->tm_mon + 1; /* month starts at 0 in C */ @@ -49,7 +49,7 @@ fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info) object_info->atime[6] = (int_f)ts->tm_sec; object_info->atime[7] = -32767; /* millisecond is not available, assign it -HUGE(0) */ - ts = HDgmtime(&Oinfo.btime); + ts = gmtime(&Oinfo.btime); object_info->btime[0] = (int_f)ts->tm_year + 1900; /* year starts at 1900 */ object_info->btime[1] = (int_f)ts->tm_mon + 1; /* month starts at 0 in C */ @@ -60,7 +60,7 @@ fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info) object_info->btime[6] = (int_f)ts->tm_sec; object_info->btime[7] = -32767; /* millisecond is not available, assign it -HUGE(0) */ - ts = HDgmtime(&Oinfo.ctime); + ts = gmtime(&Oinfo.ctime); object_info->ctime[0] = (int_f)ts->tm_year + 1900; /* year starts at 1900 */ object_info->ctime[1] = (int_f)ts->tm_mon + 1; /* month starts at 0 in C */ @@ -71,7 +71,7 @@ fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info) object_info->ctime[6] = (int_f)ts->tm_sec; object_info->ctime[7] = -32767; /* millisecond is not available, assign it -HUGE(0) */ - ts = HDgmtime(&Oinfo.mtime); + ts = gmtime(&Oinfo.mtime); object_info->mtime[0] = (int_f)ts->tm_year + 1900; /* year starts at 1900 */ object_info->mtime[1] = (int_f)ts->tm_mon + 1; /* month starts at 0 in C */ diff --git a/fortran/src/H5Off.F90 b/fortran/src/H5Off.F90 index 90e9990..75e0717 100644 --- a/fortran/src/H5Off.F90 +++ b/fortran/src/H5Off.F90 @@ -37,11 +37,9 @@ MODULE H5O - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_FUNPTR, C_CHAR, C_INT64_T, C_LONG, C_INT, C_LOC USE H5GLOBAL IMPLICIT NONE - !> @brief h5o_info_t derived type. The time values are an integer array as specified in the Fortran intrinsic DATE_AND_TIME(VALUES). TYPE, BIND(C) :: h5o_info_t INTEGER(C_LONG) :: fileno !< File number that object is located in diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index ecfa835..0efd205 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -61,7 +61,7 @@ h5pcreate_c(hid_t_f *cls, hid_t_f *prp_id) c_prp_id = H5Pcreate((hid_t)*cls); if (c_prp_id < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); *prp_id = (hid_t_f)c_prp_id; @@ -115,7 +115,7 @@ h5pcopy_c(hid_t_f *prp_id, hid_t_f *new_prp_id) c_new_prp_id = H5Pcopy((hid_t)*prp_id); if (c_new_prp_id < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); *new_prp_id = (hid_t_f)c_new_prp_id; @@ -146,7 +146,7 @@ h5pequal_c(hid_t_f *plist1_id, hid_t_f *plist2_id, int_f *c_flag) c_c_flag = H5Pequal((hid_t)*plist1_id, (hid_t)*plist2_id); if (c_c_flag < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); *c_flag = (int_f)c_c_flag; @@ -176,7 +176,7 @@ h5pget_class_c(hid_t_f *prp_id, hid_t_f *classtype) int_f ret_value = 0; if ((c_classtype = H5Pget_class((hid_t)*prp_id)) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); *classtype = (hid_t_f)c_classtype; @@ -202,10 +202,10 @@ int_f h5pset_preserve_c(hid_t_f *prp_id, int_f *flag) /******/ { - int ret_value = 0; - hid_t c_prp_id; - herr_t status; - hbool_t c_flag = 0; + int ret_value = 0; + hid_t c_prp_id; + herr_t status; + bool c_flag = 0; if (*flag > 0) c_flag = 1; @@ -1035,13 +1035,13 @@ int_f h5pset_fapl_core_c(hid_t_f *prp_id, size_t_f *increment, int_f *flag) /******/ { - int ret_value = -1; - hid_t c_prp_id; - herr_t ret = -1; - size_t c_increment; - hbool_t c_backing_store; + int ret_value = -1; + hid_t c_prp_id; + herr_t ret = -1; + size_t c_increment; + bool c_backing_store; c_increment = (size_t)*increment; - c_backing_store = (hbool_t)*flag; + c_backing_store = (bool)*flag; /* * Call H5Pset_fapl_core function. @@ -1071,11 +1071,11 @@ int_f h5pget_fapl_core_c(hid_t_f *prp_id, size_t_f *increment, int_f *flag) /******/ { - int ret_value = -1; - hid_t c_prp_id; - herr_t ret = -1; - size_t c_increment = 0; - hbool_t c_backing_store; + int ret_value = -1; + hid_t c_prp_id; + herr_t ret = -1; + size_t c_increment = 0; + bool c_backing_store; *flag = 0; /* * Call H5Pset_fapl_core function. @@ -2871,7 +2871,7 @@ h5pget_class_name_c(hid_t_f *cls, _fcd name, int_f *name_len) goto DONE; HD5packFstring(c_name, _fcdtocp(name), (size_t)*name_len); - ret_value = (int_f)HDstrlen(c_name); + ret_value = (int_f)strlen(c_name); H5free_memory(c_name); DONE: @@ -3130,14 +3130,14 @@ h5pset_fapl_multi_c(hid_t_f *prp_id, int_f *memb_map, hid_t_f *memb_fapl, _fcd m hid_t c_memb_fapl[H5FD_MEM_NTYPES]; char *c_memb_name[H5FD_MEM_NTYPES]; haddr_t c_memb_addr[H5FD_MEM_NTYPES]; - hbool_t relax; + bool relax; herr_t status; char *tmp, *tmp_p, *tmp_pp; int i; int c_lenmax; long double tmp_max_addr; c_lenmax = (int)*lenmax; - relax = (hbool_t)*flag; + relax = (bool)*flag; /* * Check that we got correct values from Fortran for memb_addr array */ @@ -3206,12 +3206,12 @@ int_f h5pset_fapl_multi_sc(hid_t_f *prp_id, int_f *flag) /******/ { - int_f ret_value = -1; - hid_t c_prp_id; - hbool_t relax; - herr_t status; + int_f ret_value = -1; + hid_t c_prp_id; + bool relax; + herr_t status; - relax = (hbool_t)*flag; + relax = (bool)*flag; c_prp_id = (hid_t)*prp_id; /* * Call H5Pset_fapl_multi function @@ -3253,7 +3253,7 @@ h5pget_fapl_multi_c(hid_t_f *prp_id, int_f *memb_map, hid_t_f *memb_fapl, _fcd m hid_t c_memb_fapl[H5FD_MEM_NTYPES]; char *c_memb_name[H5FD_MEM_NTYPES]; haddr_t c_memb_addr[H5FD_MEM_NTYPES]; - hbool_t relax; + bool relax; herr_t status; char *tmp, *tmp_p; int i; @@ -3428,7 +3428,7 @@ h5pget_filter_by_id_c(hid_t_f *prp_id, int_f *filter_id, int_f *flags, size_t_f *cd_nelmts = (size_t_f)c_cd_nelmts; *flags = (int_f)c_flags; - HD5packFstring(c_name, _fcdtocp(name), HDstrlen(c_name)); + HD5packFstring(c_name, _fcdtocp(name), strlen(c_name)); for (i = 0; i < c_cd_nelmts_in; i++) cd_values[i] = (int_f)c_cd_values[i]; @@ -3804,9 +3804,9 @@ int_f h5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag) /******/ { - int ret_value = -1; - hbool_t c_track_times = 0; - herr_t ret; + int ret_value = -1; + bool c_track_times = 0; + herr_t ret; /* * Call H5Pget_obj_track_times function. @@ -3841,11 +3841,11 @@ int_f h5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag) /******/ { - int ret_value = -1; - hbool_t c_track_times; - herr_t ret; + int ret_value = -1; + bool c_track_times; + herr_t ret; - c_track_times = (hbool_t)*flag; + c_track_times = (bool)*flag; /* * Call H5Pset_obj_track_times function. @@ -4117,7 +4117,7 @@ h5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_le if (c_expression_len) { c_expression = (char *)malloc(c_expression_len); if (NULL == c_expression) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); } /* end if */ /* @@ -4125,7 +4125,7 @@ h5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_le */ ret = H5Pget_data_transform((hid_t)*plist_id, c_expression, c_expression_len); if (ret < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* or strlen ? */ HD5packFstring(c_expression, _fcdtocp(expression), (size_t)*expression_len); @@ -4170,13 +4170,13 @@ h5pset_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_le * Convert FORTRAN name to C name */ if (NULL == (c_expression = HD5f2cstring(expression, (size_t)*expression_len))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Pset_data_transform function. */ if (H5Pset_data_transform((hid_t)*plist_id, c_expression) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_expression) diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 6be8337..5f76b6c 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -39,7 +39,6 @@ MODULE H5P - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR USE H5GLOBAL USE H5fortkit diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index ad99418..d9ef5d0 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -50,13 +50,13 @@ h5rcreate_region_c(int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t * Convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call H5Rcreate function. */ if (H5Rcreate(&ref_c, (hid_t)*loc_id, c_name, H5R_DATASET_REGION, (hid_t)*space_id) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* Copy the reference created */ memcpy(ref, &ref_c, H5R_DSET_REG_REF_BUF_SIZE); @@ -170,7 +170,7 @@ h5rget_region_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *space_id) * Call H5Rget_region function. */ if ((c_space_id = H5Rget_region((hid_t)*dset_id, H5R_DATASET_REGION, &ref_c)) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* Copy the dataspace ID */ *space_id = (hid_t_f)c_space_id; @@ -204,7 +204,7 @@ h5rget_region_ptr_c(hid_t_f *dset_id, void *ref, hid_t_f *space_id) * Call H5Rget_region function. */ if ((c_space_id = H5Rget_region((hid_t)*dset_id, H5R_DATASET_REGION, ref)) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* Copy the dataspace ID */ *space_id = (hid_t_f)c_space_id; @@ -240,7 +240,7 @@ h5rget_object_type_obj_c(hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type) * Call H5Rget_object_type function. */ if (H5Rget_obj_type2((hid_t)*dset_id, H5R_OBJECT, &ref_c, &c_obj_type) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* Copy the object type */ *obj_type = (int_f)c_obj_type; diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90 index 1b2cd8a..ea7cbb6 100644 --- a/fortran/src/H5Rff.F90 +++ b/fortran/src/H5Rff.F90 @@ -46,8 +46,9 @@ ! MODULE H5R - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_SIGNED_CHAR + USE H5GLOBAL + IMPLICIT NONE ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index e8524df..41616f8 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -57,7 +57,7 @@ h5screate_simple_c(int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *sp c_space_id = H5Screate_simple(*rank, c_dims, c_maxdims); if (c_space_id < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); *space_id = (hid_t_f)c_space_id; @@ -323,10 +323,10 @@ h5sget_select_bounds_c(hid_t_f *space_id, hsize_t_f *start, hsize_t_f *end) c_space_id = (hid_t)*space_id; rank = H5Sget_simple_extent_ndims(c_space_id); if (rank < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (H5Sget_select_bounds(c_space_id, c_start, c_end) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); for (i = 0; i < rank; i++) { start[i] = (hsize_t_f)(c_start[rank - i - 1] + 1); @@ -644,7 +644,7 @@ h5soffset_simple_c(hid_t_f *space_id, hssize_t_f *offset) c_space_id = (hid_t)*space_id; rank = H5Sget_simple_extent_ndims(c_space_id); if (rank < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Reverse dimensions due to C-FORTRAN storage order. @@ -653,7 +653,7 @@ h5soffset_simple_c(hid_t_f *space_id, hssize_t_f *offset) c_offset[i] = offset[rank - i - 1]; if (H5Soffset_simple(c_space_id, c_offset) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: return ret_value; @@ -693,7 +693,7 @@ h5sset_extent_simple_c(hid_t_f *space_id, int_f *rank, hsize_t_f *current_size, } /* end for */ if (H5Sset_extent_simple((hid_t)*space_id, (int)*rank, c_current_size, c_maximum_size) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: return ret_value; @@ -729,10 +729,10 @@ h5sget_simple_extent_dims_c(hid_t_f *space_id, hsize_t_f *dims, hsize_t_f *maxdi c_space_id = (hid_t)*space_id; rank = H5Sget_simple_extent_ndims(c_space_id); if (rank < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (H5Sget_simple_extent_dims(c_space_id, c_dims, c_maxdims) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Reverse dimensions due to C-FORTRAN storage order. @@ -870,7 +870,7 @@ h5sselect_hyperslab_c(hid_t_f *space_id, int_f *op, hsize_t_f *start, hsize_t_f rank = H5Sget_simple_extent_ndims((hid_t)*space_id); if (rank < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Reverse dimensions due to C-FORTRAN storage order. @@ -885,7 +885,7 @@ h5sselect_hyperslab_c(hid_t_f *space_id, int_f *op, hsize_t_f *start, hsize_t_f } /* end for */ if (H5Sselect_hyperslab((hid_t)*space_id, (H5S_seloper_t)*op, c_start, c_stride, c_count, c_block) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: return ret_value; diff --git a/fortran/src/H5Sff.F90 b/fortran/src/H5Sff.F90 index 79386f3..fff32c0 100644 --- a/fortran/src/H5Sff.F90 +++ b/fortran/src/H5Sff.F90 @@ -37,8 +37,9 @@ ! MODULE H5S - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_INT + USE H5GLOBAL + IMPLICIT NONE CONTAINS !> diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index 32282d5..393873e 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -1743,7 +1743,7 @@ h5tget_tag_c(hid_t_f *type_id, _fcd tag, size_t_f *tag_size, int_f *taglen) return ret_value; HD5packFstring(c_tag, _fcdtocp(tag), (size_t)*tag_size); - *taglen = (int_f)HDstrlen(c_tag); + *taglen = (int_f)strlen(c_tag); H5free_memory(c_tag); ret_value = 0; return ret_value; diff --git a/fortran/src/H5Tff.F90 b/fortran/src/H5Tff.F90 index c69c122..b93e3c3 100644 --- a/fortran/src/H5Tff.F90 +++ b/fortran/src/H5Tff.F90 @@ -38,7 +38,6 @@ MODULE H5T - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_NULL_PTR USE H5GLOBAL IMPLICIT NONE diff --git a/fortran/src/H5VLff.F90 b/fortran/src/H5VLff.F90 index 56edccb..5a1fa9f 100644 --- a/fortran/src/H5VLff.F90 +++ b/fortran/src/H5VLff.F90 @@ -37,7 +37,6 @@ MODULE H5VL - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_FUNPTR, C_CHAR, C_INT64_T, C_INT USE H5GLOBAL USE H5fortkit diff --git a/fortran/src/H5Zff.F90 b/fortran/src/H5Zff.F90 index a31e597..eae94c5 100644 --- a/fortran/src/H5Zff.F90 +++ b/fortran/src/H5Zff.F90 @@ -38,6 +38,7 @@ MODULE H5Z USE H5GLOBAL + IMPLICIT NONE CONTAINS diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index ecea23d..42e7058 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -51,7 +51,6 @@ MODULE H5LIB - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_INTPTR_T, C_INT64_T USE H5GLOBAL IMPLICIT NONE diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c index ebe5955..5129bda 100644 --- a/fortran/src/H5f90kit.c +++ b/fortran/src/H5f90kit.c @@ -50,7 +50,7 @@ HD5f2cstring(_fcd fdesc, size_t len) /* Search for the end of the string */ str = _fcdtocp(fdesc); - for (i = (int)len - 1; i >= 0 && HDisspace((int)str[i]) && str[i] == ' '; i--) + for (i = (int)len - 1; i >= 0 && isspace((int)str[i]) && str[i] == ' '; i--) /*EMPTY*/; /* Allocate C string */ @@ -90,7 +90,7 @@ void HD5packFstring(char *src, char *dest, size_t dst_len) /******/ { - size_t src_len = HDstrlen(src); + size_t src_len = strlen(src); /* Copy over the string information, up to the length of the src */ /* (Don't copy the NUL terminator from the C string to the FORTRAN string */ diff --git a/fortran/test/t.c b/fortran/test/t.c index bda1226..1336540 100644 --- a/fortran/test/t.c +++ b/fortran/test/t.c @@ -46,15 +46,15 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl, _fcd full_n * Convert FORTRAN name to C name */ if (NULL == (c_base_name = (char *)HD5f2cstring(base_name, (size_t)*base_namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_full_name = (char *)malloc((size_t)*full_namelen + 1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Call h5_fixname function. */ if (NULL == h5_fixname(c_base_name, (hid_t)*fapl, c_full_name, (size_t)*full_namelen + 1)) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); HD5packFstring(c_full_name, _fcdtocp(full_name), (size_t)*full_namelen); done: @@ -139,6 +139,6 @@ void nh5_env_nocleanup_c(int_f *status) { *status = (int_f)0; - if (HDgetenv(HDF5_NOCLEANUP)) + if (getenv(HDF5_NOCLEANUP)) *status = (int_f)1; } /* h5_env_nocleanup_c */ diff --git a/fortran/test/tH5A_1_8.F90 b/fortran/test/tH5A_1_8.F90 index 8201675..2a479e4 100644 --- a/fortran/test/tH5A_1_8.F90 +++ b/fortran/test/tH5A_1_8.F90 @@ -621,7 +621,7 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) my_dataset = dset3 dsetname = DSET3_NAME ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") + ! CALL assert(0.AND."Toomanydatasets!") END SELECT @@ -1487,7 +1487,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CASE (2) my_dataset = dset3 ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") + ! CALL assert(0.AND."Toomanydatasets!") END SELECT @@ -1536,7 +1536,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CASE (2) my_dataset = dset3 ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") + ! CALL assert(0.AND."Toomanydatasets!") END SELECT ! Delete attributes from compact storage @@ -1552,7 +1552,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ! Verify the attribute information for first attribute in appropriate order - ! HDmemset(&ainfo, 0, sizeof(ainfo)); + ! memset(&ainfo, 0, sizeof(ainfo)); !EP CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, & CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, hzero, & @@ -1602,7 +1602,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CASE (2) my_dataset = dset3 ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") + ! CALL assert(0.AND."Toomanydatasets!") END SELECT ! Create more attributes, to push into dense form @@ -1667,7 +1667,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ENDIF ! Verify the name for first attribute in appropriate order - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); + ! memset(tmpname, 0, (size_t)NAME_BUF_SIZE); size = 7 ! *CHECK* if not the correct size CALL h5aget_name_by_idx_f(my_dataset, ".", idx_type, order,INT(0,hsize_t), & diff --git a/fortran/test/tH5G_1_8.F90 b/fortran/test/tH5G_1_8.F90 index 0be6c7b..dca4cf2 100644 --- a/fortran/test/tH5G_1_8.F90 +++ b/fortran/test/tH5G_1_8.F90 @@ -919,8 +919,8 @@ END SUBROUTINE group_info ! old_modification_time = oinfo.mtime; ! If this test happens too quickly, the times will all be the same. Make sure the time changes. -! curr_time = HDtime(NULL); -! while(HDtime(NULL) <= curr_time) +! curr_time = time(NULL); +! while(time(NULL) <= curr_time) ! ; ! Close the file and reopen it @@ -1380,7 +1380,7 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) CALL check("H5Ldelete_by_idx_f", error, total_error) ! Verify the link information for first link in appropriate order - ! HDmemset(&linfo, 0, sizeof(linfo)); + ! memset(&linfo, 0, sizeof(linfo)); CALL H5Lget_info_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), & link_type, f_corder_valid, corder, cset, token, val_size, error) @@ -1410,7 +1410,7 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) ! Verify the name for first link in appropriate order - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); + ! memset(tmpname, 0, (size_t)NAME_BUF_SIZE); !!$ size_tmp = 20 !!$ CALL H5Lget_name_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), size_tmp, tmpname, error) !!$ CALL check("delete_by_idx.H5Lget_name_by_idx_f", error, total_error) @@ -1495,14 +1495,14 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & valname = 'valn.'//chr2 ! Verify the link information for first link, in increasing creation order - ! HDmemset(&linfo, 0, sizeof(linfo)); + ! memset(&linfo, 0, sizeof(linfo)); CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,HSIZE_T), & link_type, f_corder_valid, corder, cset, token, val_size, error) CALL check("H5Lget_info_by_idx_f", error, total_error) CALL verify("H5Lget_info_by_idx_f", corder, 0, total_error) ! Verify the link information for new link, in increasing creation order - ! HDmemset(&linfo, 0, sizeof(linfo)); + ! memset(&linfo, 0, sizeof(linfo)); CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), & link_type, f_corder_valid, corder, cset, token, val_size, error) CALL check("H5Lget_info_by_idx_f", error, total_error) @@ -1510,16 +1510,16 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! Verify value for new soft link, in increasing creation order !!$ IF(hard_link)THEN -!!$ ! HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); +!!$ ! memset(tmpval, 0, (size_t)NAME_BUF_SIZE); !!$ !!$ CALL H5Lget_val_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, n, tmpval, INT(7,SIZE_T),error) !!$ CALL check("H5Lget_val_by_idx",error,total_error) !!$ -!!$! IF(HDstrcmp(valname, tmpval)) TEST_ERROR +!!$! IF(strcmp(valname, tmpval)) TEST_ERROR !!$ ENDIF ! Verify the name for new link, in increasing creation order - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); + ! memset(tmpname, 0, (size_t)NAME_BUF_SIZE); ! The actual size of tmpname should be 7 diff --git a/fortran/test/tH5Sselect.F90 b/fortran/test/tH5Sselect.F90 index f0b2c85..bf1658c 100644 --- a/fortran/test/tH5Sselect.F90 +++ b/fortran/test/tH5Sselect.F90 @@ -1086,8 +1086,8 @@ SUBROUTINE test_select_point(cleanup, total_error) ! MESSAGE(5, ("Testing Element Selection Functions\n")); ! Allocate write & read buffers -!!$ wbuf = HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); -!!$ rbuf = HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); +!!$ wbuf = malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); +!!$ rbuf = calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); !!$ ! Initialize WRITE buffer @@ -1204,7 +1204,7 @@ SUBROUTINE test_select_point(cleanup, total_error) !!$ Save points for later iteration !!$ (these are in the second half of the buffer, because we are prepending !!$ the next list of points to the beginning of the point selection list) -!!$ HDmemcpy(((char *)pi.coord)+sizeof(coord2),coord2,sizeof(coord2)); +!!$ memcpy(((char *)pi.coord)+sizeof(coord2),coord2,sizeof(coord2)); !!$ CALL H5Sget_select_npoints_f(sid2, npoints, error) @@ -1241,7 +1241,7 @@ SUBROUTINE test_select_point(cleanup, total_error) CALL verify("h5sget_select_npoints_f", INT(npoints), 20, total_error) !!$ Save points for later iteration -!!$ HDmemcpy(pi.coord,coord2,sizeof(coord2)); +!!$ memcpy(pi.coord,coord2,sizeof(coord2)); ! Create a dataset CALL h5dcreate_f(fid1, "Dataset1", H5T_NATIVE_CHARACTER, sid1, dataset, error) diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c index fc38d99..7b5dfe9 100644 --- a/hl/fortran/src/H5DSfc.c +++ b/hl/fortran/src/H5DSfc.c @@ -39,14 +39,14 @@ h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) if (*dimnamelen != 0) if (NULL == (c_dimname = (char *)HD5f2cstring(dimname, (size_t)*dimnamelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * call H5DSset_scale function. */ if (H5DSset_scale((hid_t)*dsid, c_dimname) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_dimname) @@ -77,7 +77,7 @@ h5dsattach_scale_c(hid_t_f *did, hid_t_f *dsid, int_f *idx) */ if (H5DSattach_scale((hid_t)*did, (hid_t)*dsid, (unsigned)*idx) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: return ret_value; @@ -105,7 +105,7 @@ h5dsdetach_scale_c(hid_t_f *did, hid_t_f *dsid, int_f *idx) */ if (H5DSdetach_scale((hid_t)*did, (hid_t)*dsid, (unsigned)*idx) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: return ret_value; @@ -134,7 +134,7 @@ h5dsis_attached_c(hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) */ if ((c_is_attached = H5DSis_attached((hid_t)*did, (hid_t)*dsid, (unsigned)*idx)) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); *is_attached = (int_f)c_is_attached; @@ -165,7 +165,7 @@ h5dsis_scale_c(hid_t_f *did, int_f *is_scale) */ if ((c_is_scale = H5DSis_scale((hid_t)*did)) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); *is_scale = (int_f)c_is_scale; @@ -196,14 +196,14 @@ h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) */ if (NULL == (c_label = (char *)HD5f2cstring(label, (size_t)*labellen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * call H5DSset_label function. */ if (H5DSset_label((hid_t)*did, (unsigned)*idx, c_label) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_label) @@ -242,7 +242,7 @@ h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) */ if ((size_c = H5DSget_label((hid_t)*did, (unsigned)*idx, c_label, (size_t)*size + 1)) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Convert C name to FORTRAN and place it in the given buffer @@ -288,7 +288,7 @@ h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) */ if ((size_c = H5DSget_scale_name((hid_t)*did, c_scale_name, (size_t)*size + 1)) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * Convert C name to FORTRAN and place it in the given buffer @@ -324,7 +324,7 @@ h5dsget_num_scales_c(hid_t_f *did, int_f *idx, int_f *num_scales) */ if ((*num_scales = (int_f)H5DSget_num_scales((hid_t)*did, (unsigned)*idx)) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: return ret_value; diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index a165ced..9d8baf2 100644 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -297,7 +297,7 @@ h5immake_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *dim * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); for (i = 0; i < rank; i++) c_dims[i] = (hsize_t)dims[i]; @@ -306,7 +306,7 @@ h5immake_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *dim * call H5IMmake_palette function. */ if (H5IMmake_palettef((hid_t)*loc_id, c_name, c_dims, (int_f *)buf) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_name) diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 17a2a74..b7f4540 100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -261,7 +261,7 @@ h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f c_loc_id = (hid_t)*loc_id; c_size = (size_t)*size; - if (HDstrncmp(dtype, "I", 1) == 0) { + if (strncmp(dtype, "I", 1) == 0) { if ((size_t)*sizeof_val == sizeof(int)) ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_INT, (const int *)buf); @@ -276,7 +276,7 @@ h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f else goto done; } - else if (HDstrncmp(dtype, "R", 1) == 0) { + else if (strncmp(dtype, "R", 1) == 0) { if ((size_t)*sizeof_val == sizeof(float)) ret = H5LT_set_attribute_numerical(c_loc_id, c_name, c_attrname, c_size, H5T_NATIVE_FLOAT, (const float *)buf); @@ -289,7 +289,7 @@ h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f else goto done; } - else if (HDstrncmp(dtype, "C", 1) == 0) { + else if (strncmp(dtype, "C", 1) == 0) { c_buf = (char *)HD5f2cstring((_fcd)buf, c_size); if (c_buf == NULL) @@ -351,7 +351,7 @@ h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f */ c_loc_id = (hid_t)*loc_id; - if (HDstrncmp(dtype, "I", 1) == 0) { + if (strncmp(dtype, "I", 1) == 0) { if ((size_t)*sizeof_val == sizeof(int)) ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_INT, buf); else if ((size_t)*sizeof_val == sizeof(long)) @@ -363,7 +363,7 @@ h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f else goto done; } - else if (HDstrncmp(dtype, "R", 1) == 0) { + else if (strncmp(dtype, "R", 1) == 0) { if ((size_t)*sizeof_val == sizeof(float)) ret = H5LTget_attribute(c_loc_id, c_name, c_attrname, H5T_NATIVE_FLOAT, buf); else if ((size_t)*sizeof_val == sizeof(double)) @@ -748,9 +748,9 @@ done: int_f h5ltpath_valid_c(hid_t_f *loc_id, _fcd path, size_t_f *pathlen, int_f *check_object_valid_c) { - htri_t ret = -1; - char *c_path = NULL; - hbool_t check_object_valid; + htri_t ret = -1; + char *c_path = NULL; + bool check_object_valid; /* * convert FORTRAN name to C name @@ -758,9 +758,9 @@ h5ltpath_valid_c(hid_t_f *loc_id, _fcd path, size_t_f *pathlen, int_f *check_obj if (NULL == (c_path = (char *)HD5f2cstring(path, (size_t)*pathlen))) goto done; - check_object_valid = FALSE; + check_object_valid = false; if (*check_object_valid_c == 1) - check_object_valid = TRUE; + check_object_valid = true; /* * call H5LTpath_valid function. diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index 61c2236..9c25777 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -54,13 +54,13 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_name1 = (char *)HD5f2cstring(name1, (size_t)*namelen1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_field_offset = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_field_types = (hid_t *)malloc(sizeof(hid_t) * (size_t)c_nfields))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); for (i = 0; i < num_elem; i++) { c_field_offset[i] = (size_t)field_offset[i]; @@ -71,19 +71,19 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name * allocate array of character pointers */ if (NULL == (c_field_names = (char **)calloc((size_t)num_elem, sizeof(char *)))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* copy data to long C string */ if (NULL == (tmp = (char *)HD5f2cstring(field_names, (size_t) * (max_char_size_field_names) * (size_t)num_elem))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * move data from temporary buffer */ tmp_p = tmp; for (i = 0; i < num_elem; i++) { if (NULL == (c_field_names[i] = (char *)malloc((size_t)char_len_field_names[i] + 1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); memcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]); c_field_names[i][char_len_field_names[i]] = '\0'; tmp_p = tmp_p + *max_char_size_field_names; @@ -95,7 +95,7 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name 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) + HGOTO_DONE(FAIL); done: if (c_name) @@ -155,13 +155,13 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_name1 = (char *)HD5f2cstring(name1, (size_t)*namelen1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_field_offset = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_field_types = (hid_t *)malloc(sizeof(hid_t) * (size_t)c_nfields))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); for (i = 0; i < num_elem; i++) { c_field_offset[i] = (size_t)field_offset[i]; @@ -172,19 +172,19 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * * allocate array of character pointers */ if (NULL == (c_field_names = (char **)calloc((size_t)num_elem, sizeof(char *)))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* copy data to long C string */ if (NULL == (tmp = (char *)HD5f2cstring(field_names, (size_t) * (max_char_size_field_names) * (size_t)num_elem))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * move data from temporary buffer */ tmp_p = tmp; for (i = 0; i < num_elem; i++) { if (NULL == (c_field_names[i] = (char *)malloc((size_t)char_len_field_names[i] + 1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); memcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]); c_field_names[i][char_len_field_names[i]] = '\0'; tmp_p = tmp_p + *max_char_size_field_names; @@ -196,7 +196,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * 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, fill_data, *compress, data) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_name) @@ -246,12 +246,12 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_dst_offset = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_dst_sizes = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); for (i = 0; i < c_nfields; i++) { c_dst_offset[i] = (size_t)dst_offset[i]; @@ -262,7 +262,7 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel * call H5TBread_table function. */ if (H5TBread_table((hid_t)*loc_id, c_name, (size_t)*dst_size, c_dst_offset, c_dst_sizes, dst_buf) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_name) @@ -300,16 +300,16 @@ h5tbwrite_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f * * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_name1 = (char *)HD5f2cstring(field_name, (size_t)*namelen1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * 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) + HGOTO_DONE(FAIL); done: if (c_name) @@ -344,16 +344,16 @@ h5tbread_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *n * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_name1 = (char *)HD5f2cstring(field_name, (size_t)*namelen1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * 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) + HGOTO_DONE(FAIL); done: if (c_name) @@ -388,14 +388,14 @@ h5tbwrite_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *fi * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * 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) + HGOTO_DONE(FAIL); done: if (c_name) @@ -428,14 +428,14 @@ h5tbread_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *fie * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * call H5TBread_fields_index function. */ 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) + HGOTO_DONE(FAIL); done: if (c_name) @@ -467,16 +467,16 @@ h5tbinsert_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *name * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_name1 = (char *)HD5f2cstring(field_name, (size_t)*namelen1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * 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) + HGOTO_DONE(FAIL); done: if (c_name) @@ -509,15 +509,15 @@ h5tbdelete_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *name * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_name1 = (char *)HD5f2cstring(field_name, (size_t)*namelen1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * call H5TBinsert_field function. */ if (H5TBdelete_field((hid_t)*loc_id, c_name, c_name1) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); done: if (c_name) @@ -551,14 +551,14 @@ h5tbget_table_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * call H5TBread_fields_index function. */ if (H5TBget_table_info((hid_t)*loc_id, c_name, &c_nfields, &c_nrecords) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); *nfields = (hsize_t_f)c_nfields; *nrecords = (hsize_t_f)c_nrecords; @@ -610,35 +610,35 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n * convert FORTRAN name to C name */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_field_offsets = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_field_sizes = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); if (NULL == (c_field_names = (char **)calloc((size_t)c_nfields, sizeof(char *)))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); for (i = 0; i < c_nfields; i++) if (NULL == (c_field_names[i] = (char *)malloc(sizeof(char) * HLTB_MAX_FIELD_LEN))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* * call H5TBget_field_info function. */ 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) + HGOTO_DONE(FAIL); /* return values */ /* names array */ if (NULL == (tmp = (char *)malloc((c_lenmax * (size_t)c_nfields) + 1))) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); tmp_p = tmp; memset(tmp, ' ', c_lenmax * (size_t)c_nfields); tmp[c_lenmax * c_nfields] = '\0'; for (i = 0; i < c_nfields; i++) { - size_t field_name_len = HDstrlen(c_field_names[i]); + size_t field_name_len = strlen(c_field_names[i]); memcpy(tmp_p, c_field_names[i], field_name_len); namelen2[i] = (size_t_f)field_name_len; -- cgit v0.12