diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-07-27 22:28:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 22:28:33 (GMT) |
commit | 41a6b581aef055821796fc9d31f58778dc1c4197 (patch) | |
tree | f36f43cc54acdaeab80edd100183719402121508 /hl/fortran/src | |
parent | 0e82707100cf3d1b698d2ec0cad08db61d552d63 (diff) | |
download | hdf5-41a6b581aef055821796fc9d31f58778dc1c4197.zip hdf5-41a6b581aef055821796fc9d31f58778dc1c4197.tar.gz hdf5-41a6b581aef055821796fc9d31f58778dc1c4197.tar.bz2 |
Sync Fortran w/ develop (#3296)
Diffstat (limited to 'hl/fortran/src')
-rw-r--r-- | hl/fortran/src/H5DSfc.c | 22 | ||||
-rw-r--r-- | hl/fortran/src/H5IMfc.c | 4 | ||||
-rw-r--r-- | hl/fortran/src/H5LTfc.c | 20 | ||||
-rw-r--r-- | hl/fortran/src/H5TBfc.c | 92 |
4 files changed, 69 insertions, 69 deletions
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; |