summaryrefslogtreecommitdiffstats
path: root/src/H5FDmulti.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2023-06-16 04:49:02 (GMT)
committerGitHub <noreply@github.com>2023-06-16 04:49:02 (GMT)
commit68eba3da69e659fab69bbef5901ce42e82cea1dc (patch)
treef36805f798df6c04092c14dc6803d2cb82f6eff2 /src/H5FDmulti.c
parent10093f7c4345061bdbebc12888debbf08fe85a5b (diff)
downloadhdf5-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 'src/H5FDmulti.c')
-rw-r--r--src/H5FDmulti.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 7885add..371942d 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -439,7 +439,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid_t *memb_fapl
{
fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (!fa || (H5P_FILE_ACCESS_DEFAULT == fapl_id)) {
if (H5FD_multi_populate_config(NULL, NULL, NULL, NULL, TRUE, &default_fa) < 0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTSET, "can't setup default driver configuration",
@@ -509,7 +509,7 @@ H5FD_split_populate_config(const char *meta_ext, hid_t meta_plist_id, const char
_memb_name[mt] = NULL;
_memb_addr[mt] = HADDR_UNDEF;
}
- END_MEMBERS;
+ END_MEMBERS
/* The file access properties */
_memb_fapl[H5FD_MEM_SUPER] = meta_plist_id;
@@ -573,7 +573,7 @@ H5FD_split_populate_config(const char *meta_ext, hid_t meta_plist_id, const char
if (!_memb_name[mmt] || !_memb_name[mmt][0])
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1);
}
- END_MEMBERS;
+ END_MEMBERS
/*
* Initialize driver specific information. No need to copy it into the FA
@@ -595,7 +595,7 @@ H5FD_split_populate_config(const char *meta_ext, hid_t meta_plist_id, const char
"can't set sec2 driver on member FAPL", -1);
}
}
- END_MEMBERS;
+ END_MEMBERS
return ret_value;
}
@@ -727,7 +727,7 @@ H5FD_multi_sb_size(H5FD_t *_file)
UNIQUE_MEMBERS (file->fa.memb_map, mt) {
nseen++;
}
- END_MEMBERS;
+ END_MEMBERS
/* Addresses and EOA markers */
nbytes += nseen * 2 * 8;
@@ -737,7 +737,7 @@ H5FD_multi_sb_size(H5FD_t *_file)
size_t n = strlen(file->fa.memb_name[mt]) + 1;
nbytes += (n + 7) & ~((size_t)0x0007);
}
- END_MEMBERS;
+ END_MEMBERS
return nbytes;
}
@@ -808,7 +808,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out
p += sizeof(haddr_t);
nseen++;
}
- END_MEMBERS;
+ END_MEMBERS
if (H5Tconvert(H5T_NATIVE_HADDR, H5T_STD_U64LE, nseen * 2, buf + 8, NULL, H5P_DEFAULT) < 0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
@@ -821,7 +821,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out
for (i = n; i % 8; i++)
*p++ = '\0';
}
- END_MEMBERS;
+ END_MEMBERS
return 0;
} /* end H5FD_multi_sb_encode() */
@@ -875,7 +875,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
memb_eoa[mt] = HADDR_UNDEF;
memb_name[mt] = NULL;
}
- END_MEMBERS;
+ END_MEMBERS
/*
* Read the map and count the unique members.
@@ -891,7 +891,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
UNIQUE_MEMBERS (map, mt) {
nseen++;
}
- END_MEMBERS;
+ END_MEMBERS
buf += 8;
/* Decode Address and EOA values */
@@ -906,7 +906,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
memb_addr[_unmapped] = *ap++;
memb_eoa[_unmapped] = *ap++;
}
- END_MEMBERS;
+ END_MEMBERS
/* Decode name templates */
UNIQUE_MEMBERS (map, mt) {
@@ -914,7 +914,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
memb_name[_unmapped] = (const char *)buf;
buf += (n + 7) & ~((unsigned)0x0007);
}
- END_MEMBERS;
+ END_MEMBERS
/*
* Use the mapping saved in the superblock in preference to the one
@@ -927,14 +927,14 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
ALL_MEMBERS (mt) {
file->fa.memb_map[mt] = map[mt];
}
- END_MEMBERS;
+ END_MEMBERS
/* Close files which are unused now */
memset(in_use, 0, sizeof in_use);
UNIQUE_MEMBERS (map, mt) {
in_use[mt] = TRUE;
}
- END_MEMBERS;
+ END_MEMBERS
ALL_MEMBERS (mt) {
if (!in_use[mt] && file->memb[mt]) {
(void)H5FDclose(file->memb[mt]);
@@ -942,7 +942,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
}
file->fa.memb_map[mt] = map[mt];
}
- END_MEMBERS;
+ END_MEMBERS
}
/* Commit member starting addresses and name templates */
@@ -954,7 +954,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
file->fa.memb_name[mt] = my_strdup(memb_name[mt]);
}
}
- END_MEMBERS;
+ END_MEMBERS
if (compute_next(file) < 0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", -1);
@@ -972,7 +972,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
*/
file->memb_eoa[mt] = memb_eoa[mt];
}
- END_MEMBERS;
+ END_MEMBERS
return 0;
} /* end H5FD_multi_sb_decode() */
@@ -1049,7 +1049,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
}
}
}
- END_MEMBERS;
+ END_MEMBERS
if (nerrors) {
ALL_MEMBERS (mt) {
@@ -1058,7 +1058,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
if (new_fa->memb_name[mt])
free(new_fa->memb_name[mt]);
}
- END_MEMBERS;
+ END_MEMBERS
free(new_fa);
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "can't release object on error", NULL);
}
@@ -1095,7 +1095,7 @@ H5FD_multi_fapl_free(void *_fa)
if (fa->memb_name[mt])
free(fa->memb_name[mt]);
}
- END_MEMBERS;
+ END_MEMBERS
free(fa);
return 0;
@@ -1147,7 +1147,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
{
fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (!fa || (H5P_FILE_ACCESS_DEFAULT == fapl_id) || (H5FD_MULTI != H5Pget_driver(fapl_id))) {
char *env = getenv(HDF5_DRIVER);
@@ -1175,7 +1175,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
else
file->fa.memb_name[mt] = NULL;
}
- END_MEMBERS;
+ END_MEMBERS
file->fa.relax = fa->relax;
file->flags = flags;
file->name = my_strdup(name);
@@ -1208,7 +1208,7 @@ error:
if (file->fa.memb_name[mt])
free(file->fa.memb_name[mt]);
}
- END_MEMBERS;
+ END_MEMBERS
if (file->name)
free(file->name);
free(file);
@@ -1253,7 +1253,7 @@ H5FD_multi_close(H5FD_t *_file)
}
}
}
- END_MEMBERS;
+ END_MEMBERS
if (nerrors)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1);
@@ -1264,7 +1264,7 @@ H5FD_multi_close(H5FD_t *_file)
if (file->fa.memb_name[mt])
free(file->fa.memb_name[mt]);
}
- END_MEMBERS;
+ END_MEMBERS
free(file->name);
free(file);
@@ -1311,7 +1311,7 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
cmp = 1;
}
}
- END_MEMBERS;
+ END_MEMBERS
assert(cmp || out_mt < H5FD_MEM_NTYPES);
if (out_mt >= H5FD_MEM_NTYPES)
return cmp;
@@ -1418,7 +1418,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
{
memb_eoa = H5FDget_eoa(file->memb[mt], mt);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (HADDR_UNDEF == memb_eoa)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa",
@@ -1441,7 +1441,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
if (memb_eoa > eoa)
eoa = memb_eoa;
}
- END_MEMBERS;
+ END_MEMBERS
}
else {
H5FD_mem_t mmt = file->fa.memb_map[type];
@@ -1454,7 +1454,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
{
eoa = H5FDget_eoa(file->memb[mmt], mmt);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (HADDR_UNDEF == eoa)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa",
@@ -1535,7 +1535,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa)
{
status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt]));
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status < 0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1);
@@ -1579,7 +1579,7 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
{
tmp_eof = H5FDget_eof(file->memb[mt], type);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (HADDR_UNDEF == tmp_eof)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof",
@@ -1601,7 +1601,7 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
if (tmp_eof > eof)
eof = tmp_eof;
}
- END_MEMBERS;
+ END_MEMBERS
}
else {
H5FD_mem_t mmt = file->fa.memb_map[type];
@@ -1615,7 +1615,7 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
{
eof = H5FDget_eof(file->memb[mmt], mmt);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (HADDR_UNDEF == eof)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof",
@@ -1702,7 +1702,7 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
if (file->memb[mt])
file->memb[mt]->paged_aggr = file->pub.paged_aggr;
}
- END_MEMBERS;
+ END_MEMBERS
}
if (HADDR_UNDEF == (addr = H5FDalloc(file->memb[mmt], mmt, dxpl_id, size)))
@@ -1916,7 +1916,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
if (H5FDflush(file->memb[mt], dxpl_id, closing) < 0)
nerrors++;
}
- H5E_END_TRY;
+ H5E_END_TRY
}
}
if (nerrors)
@@ -1957,7 +1957,7 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
if (H5FDtruncate(file->memb[mt], dxpl_id, closing) < 0)
nerrors++;
}
- H5E_END_TRY;
+ H5E_END_TRY
}
}
if (nerrors)
@@ -2003,10 +2003,10 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw)
break;
} /* end if */
}
- H5E_END_TRY;
+ H5E_END_TRY
} /* end if */
}
- END_MEMBERS;
+ END_MEMBERS
/* Try to unlock the member files that are locked before error is encountered */
if (nerrors) {
@@ -2018,7 +2018,7 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw)
if (H5FDunlock(file->memb[k]) < 0)
nerrors++;
}
- H5E_END_TRY;
+ H5E_END_TRY
} /* end for */
} /* end if */
@@ -2057,7 +2057,7 @@ H5FD_multi_unlock(H5FD_t *_file)
if (H5FDunlock(file->memb[mt]) < 0)
nerrors++;
}
- END_MEMBERS;
+ END_MEMBERS
if (nerrors)
H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTUNLOCKFILE, "error unlocking member files", -1);
@@ -2089,7 +2089,7 @@ compute_next(H5FD_multi_t *file)
ALL_MEMBERS (mt) {
file->memb_next[mt] = HADDR_UNDEF;
}
- END_MEMBERS;
+ END_MEMBERS
UNIQUE_MEMBERS (file->fa.memb_map, mt1) {
UNIQUE_MEMBERS2(file->fa.memb_map, mt2)
@@ -2099,12 +2099,12 @@ compute_next(H5FD_multi_t *file)
file->memb_next[mt1] = file->fa.memb_addr[mt2];
}
}
- END_MEMBERS;
+ END_MEMBERS
if (HADDR_UNDEF == file->memb_next[mt1]) {
file->memb_next[mt1] = HADDR_MAX; /*last member*/
}
}
- END_MEMBERS;
+ END_MEMBERS
return 0;
}
@@ -2155,13 +2155,13 @@ open_members(H5FD_multi_t *file)
{
file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (!file->memb[mt]) {
if (!file->fa.relax || (file->flags & H5F_ACC_RDWR))
nerrors++;
}
}
- END_MEMBERS;
+ END_MEMBERS
if (nerrors)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1);
@@ -2198,7 +2198,7 @@ H5FD_multi_delete(const char *filename, hid_t fapl_id)
{
fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (!fa) {
char *env = getenv(HDF5_DRIVER);
@@ -2228,7 +2228,7 @@ H5FD_multi_delete(const char *filename, hid_t fapl_id)
if (H5FDdelete(full_filename, fa->memb_fapl[mt]) < 0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_BADVALUE, "error deleting member files", -1);
}
- END_MEMBERS;
+ END_MEMBERS
return 0;
} /* end H5FD_multi_delete() */