Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed more warnings about extra semicolons #3249

Merged
merged 11 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions fortran/src/H5Af.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -289,22 +289,22 @@ 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.
*/
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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions fortran/src/H5Ef.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,15 +72,15 @@ 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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 (!strcmp(c_name, "Invalid major error number"))
HGOTO_DONE(FAIL)
HGOTO_DONE(FAIL);

done:
if (c_name)
Expand Down Expand Up @@ -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 (!strcmp(c_name, "Invalid minor error number"))
HGOTO_DONE(FAIL)
HGOTO_DONE(FAIL);

done:
if (c_name)
Expand Down
22 changes: 11 additions & 11 deletions fortran/src/H5Lf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -407,20 +407,20 @@ 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;

/*
* 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;

Expand Down Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions fortran/src/H5Pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -4117,15 +4117,15 @@ 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 */

/*
* Call H5Pget_data_transform function.
*/
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);
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions fortran/src/H5Rf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading