diff options
author | Sean McBride <sean@rogue-research.com> | 2023-06-16 04:49:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 04:49:02 (GMT) |
commit | 68eba3da69e659fab69bbef5901ce42e82cea1dc (patch) | |
tree | f36805f798df6c04092c14dc6803d2cb82f6eff2 /hl/src | |
parent | 10093f7c4345061bdbebc12888debbf08fe85a5b (diff) | |
download | hdf5-68eba3da69e659fab69bbef5901ce42e82cea1dc.zip hdf5-68eba3da69e659fab69bbef5901ce42e82cea1dc.tar.gz hdf5-68eba3da69e659fab69bbef5901ce42e82cea1dc.tar.bz2 |
Many clang -Wextra-semi-stmt fixes (#2537)
* Adds semicolons to function-like macros
* Adds a do..while(0) loop to some macros
* Removes semicolons when inappropriate, especially H5E_TRY_BEGIN/END
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/H5DS.c | 24 | ||||
-rw-r--r-- | hl/src/H5LD.c | 7 | ||||
-rw-r--r-- | hl/src/H5LT.c | 16 |
3 files changed, 21 insertions, 26 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 34de473..87973fa 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -697,7 +697,7 @@ out: H5Tclose(ntid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -1198,7 +1198,7 @@ out: buf = NULL; } } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -1538,7 +1538,7 @@ out: H5Tclose(tid); H5Tclose(ntid); } - H5E_END_TRY; + H5E_END_TRY if (buf) { HDfree(buf); @@ -1700,7 +1700,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi if ((scale_id = H5Ropen_object(&nref, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; } - H5E_END_TRY; + H5E_END_TRY } else { /* get the reference */ @@ -1713,7 +1713,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi if ((scale_id = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &ref)) < 0) goto out; } - H5E_END_TRY; + H5E_END_TRY } /* set the return IDX OUT value at current scale index */ @@ -1765,7 +1765,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -1965,7 +1965,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -2113,7 +2113,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -2231,7 +2231,7 @@ out: H5Tclose(tid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY if (buf) HDfree(buf); return FAIL; @@ -2343,7 +2343,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY } return is_ds; } @@ -2460,7 +2460,7 @@ out: H5Aclose(aid); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY if (buf) HDfree(buf); @@ -2539,7 +2539,7 @@ error: H5Tclose(tid); H5Aclose(aid); } - H5E_END_TRY; + H5E_END_TRY HDfree(buf); diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c index 30257f6..65a15e3 100644 --- a/hl/src/H5LD.c +++ b/hl/src/H5LD.c @@ -194,8 +194,7 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid) switch (*fields_ptr) { case '\0': /* end of list */ if (gotmember) { /* getting something and end of "fields" */ - *cur++ = '\0'; - ; + *cur++ = '\0'; memb->names[++j] = NULL; } /* end if */ else /* getting nothing but end of list */ @@ -215,7 +214,6 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid) case '.': /* nested field separator */ *fields_ptr++ = *cur++ = '\0'; - ; if (gotmember) { memb->names[++j] = cur; gotmember = FALSE; @@ -226,7 +224,6 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid) case ',': /* field separator */ *fields_ptr++ = *cur++ = '\0'; - ; if (gotmember) { memb->names[++j] = NULL; gotmember = FALSE; @@ -308,7 +305,7 @@ done: { H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return (ret_value); } /* H5LD_get_dset_dims() */ diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 4c61aa8..657e562 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -535,7 +535,7 @@ out: H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -772,7 +772,7 @@ out: H5Tclose(tid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -886,7 +886,7 @@ out: { H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end H5LTopen_file_image() */ @@ -1121,7 +1121,7 @@ out: H5Dclose(did); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1177,7 +1177,7 @@ out: H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1254,7 +1254,7 @@ out: H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1898,7 +1898,6 @@ H5LTget_attribute_ndims(hid_t loc_id, const char *obj_name, const char *attr_nam /* End access to the attribute */ if (H5Aclose(attr_id)) goto out; - ; /* Close the object */ if (H5Oclose(obj_id) < 0) @@ -3405,7 +3404,6 @@ H5LT_get_attribute_disk(hid_t loc_id, const char *attr_name, void *attr_out) if (H5Aclose(attr_id) < 0) return -1; - ; return 0; @@ -3493,7 +3491,7 @@ out: H5Tclose(tid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } |