diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2021-04-20 00:17:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 00:17:24 (GMT) |
commit | 168c1245b4aa6fa4779b3df5cc050d0272abdc2e (patch) | |
tree | 6e4dc53920a8c2c0bbdb7cfb6f190e6703e80446 /src/H5FDmulti.c | |
parent | 100e132a62ae1aaf97f379684d04ed00d6016208 (diff) | |
download | hdf5-168c1245b4aa6fa4779b3df5cc050d0272abdc2e.zip hdf5-168c1245b4aa6fa4779b3df5cc050d0272abdc2e.tar.gz hdf5-168c1245b4aa6fa4779b3df5cc050d0272abdc2e.tar.bz2 |
1 8 Merge dev changes for long double and cmake (#548)
* Update supported platforms
* Merge PR#3 changes from develop
* # WARNING: head commit changed in the meantime
Merge gcc 10 diagnostics option from develop
Merge CMake changes from develop
Merge warnings from develop
Merge #318 OSX changes from develop
Merge tools changes from develop
Merge test macros from develop
* Format updates
* Fix missing semicolon and format fix
* Format update
* Correct actions, remove java option
* Update autotools build files
* Add testfiles
* Fix configure issue with make flags
* Init fapls to default
* Update generated files and fix h5repack id closure
* update format
* Merges from develop
#358 patches from vtk
#361 fix header guard spelling
* Merges from develop
#340 clang -Wformat-security warnings
#360 Fixed uninitialized warnings
header guard underscore cleanup
whitespace cleanup
tools sync
* format alignment
* initialize vars
* revert H5private change
* Merge #380 from develop
* Split format source and commit changes on repo push
* Change windows TS to use older VS.
* HDFFV-11229 merge dev changes for long double display in tools
* Committing clang-format changes
* Update unsupported types with precision
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5FDmulti.c')
-rw-r--r-- | src/H5FDmulti.c | 116 |
1 files changed, 61 insertions, 55 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 943a679..04560c1 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -280,8 +280,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, const c H5Eclear2(H5E_DEFAULT); /* Initialize */ - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { /* Treat global heap as raw data, not metadata */ memb_map[mt] = ((mt == H5FD_MEM_DRAW || mt == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : H5FD_MEM_SUPER); memb_fapl[mt] = -1; @@ -586,15 +585,16 @@ H5FD_multi_sb_size(H5FD_t *_file) H5Eclear2(H5E_DEFAULT); /* How many unique files? */ - UNIQUE_MEMBERS(file->fa.memb_map, mt) { nseen++; } + UNIQUE_MEMBERS (file->fa.memb_map, mt) { + nseen++; + } END_MEMBERS; /* Addresses and EOA markers */ nbytes += nseen * 2 * 8; /* Name templates */ - UNIQUE_MEMBERS(file->fa.memb_map, mt) - { + UNIQUE_MEMBERS (file->fa.memb_map, mt) { size_t n = strlen(file->fa.memb_name[mt]) + 1; nbytes += (n + 7) & ~((size_t)0x0007); } @@ -661,8 +661,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out nseen = 0; p = buf + 8; assert(sizeof(haddr_t) <= 8); - UNIQUE_MEMBERS(file->fa.memb_map, mt) - { + UNIQUE_MEMBERS (file->fa.memb_map, mt) { memcpy(p, &(file->fa.memb_addr[mt]), sizeof(haddr_t)); p += sizeof(haddr_t); memb_eoa = H5FDget_eoa(file->memb[mt], mt); @@ -676,8 +675,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out /* Encode all name templates */ p = buf + 8 + nseen * 2 * 8; - UNIQUE_MEMBERS(file->fa.memb_map, mt) - { + UNIQUE_MEMBERS (file->fa.memb_map, mt) { size_t n = strlen(file->fa.memb_name[mt]) + 1; strncpy((char *)p, file->fa.memb_name[mt], n); p += n; @@ -733,8 +731,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1); /* Set default values */ - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { memb_addr[mt] = HADDR_UNDEF; memb_eoa[mt] = HADDR_UNDEF; memb_name[mt] = NULL; @@ -752,7 +749,9 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) map_changed = TRUE; } - UNIQUE_MEMBERS(map, mt) { nseen++; } + UNIQUE_MEMBERS (map, mt) { + nseen++; + } END_MEMBERS; buf += 8; @@ -764,16 +763,14 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1); ap = (haddr_t *)((void *)x); /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */ - UNIQUE_MEMBERS(map, mt) - { + UNIQUE_MEMBERS (map, mt) { memb_addr[_unmapped] = *ap++; memb_eoa[_unmapped] = *ap++; } END_MEMBERS; /* Decode name templates */ - UNIQUE_MEMBERS(map, mt) - { + UNIQUE_MEMBERS (map, mt) { size_t n = strlen((const char *)buf) + 1; memb_name[_unmapped] = (const char *)buf; buf += (n + 7) & ~((unsigned)0x0007); @@ -788,15 +785,18 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) */ if (map_changed) { /* Commit map */ - ALL_MEMBERS(mt) { file->fa.memb_map[mt] = map[mt]; } + ALL_MEMBERS (mt) { + file->fa.memb_map[mt] = map[mt]; + } END_MEMBERS; /* Close files which are unused now */ memset(in_use, 0, sizeof in_use); - UNIQUE_MEMBERS(map, mt) { in_use[mt] = TRUE; } + UNIQUE_MEMBERS (map, mt) { + in_use[mt] = TRUE; + } END_MEMBERS; - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { if (!in_use[mt] && file->memb[mt]) { (void)H5FDclose(file->memb[mt]); file->memb[mt] = NULL; @@ -807,8 +807,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) } /* Commit member starting addresses and name templates */ - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { file->fa.memb_addr[mt] = memb_addr[mt]; if (memb_name[mt]) { if (file->fa.memb_name[mt]) @@ -825,8 +824,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", -1); /* Set the EOA marker for all open files */ - UNIQUE_MEMBERS(file->fa.memb_map, mt) - { + UNIQUE_MEMBERS (file->fa.memb_map, mt) { if (file->memb[mt]) if (H5FDset_eoa(file->memb[mt], mt, memb_eoa[mt]) < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1); @@ -896,8 +894,7 @@ H5FD_multi_fapl_copy(const void *_old_fa) H5Eclear2(H5E_DEFAULT); memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t)); - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { if (old_fa->memb_fapl[mt] >= 0) { new_fa->memb_fapl[mt] = H5Pcopy(old_fa->memb_fapl[mt]); if (new_fa->memb_fapl[mt] < 0) @@ -911,8 +908,7 @@ H5FD_multi_fapl_copy(const void *_old_fa) END_MEMBERS; if (nerrors) { - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { if (new_fa->memb_fapl[mt] >= 0) (void)H5Pclose(new_fa->memb_fapl[mt]); if (new_fa->memb_name[mt]) @@ -948,8 +944,7 @@ H5FD_multi_fapl_free(void *_fa) /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { if (fa->memb_fapl[mt] >= 0) if (H5Pclose(fa->memb_fapl[mt]) < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1); @@ -1011,8 +1006,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); assert(fa); - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { file->fa.memb_map[mt] = fa->memb_map[mt]; file->fa.memb_addr[mt] = fa->memb_addr[mt]; if (fa->memb_fapl[mt] >= 0) @@ -1049,8 +1043,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr error: /* Cleanup and fail */ if (file) { - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { if (file->memb[mt]) (void)H5FDclose(file->memb[mt]); if (file->fa.memb_fapl[mt] >= 0) @@ -1093,8 +1086,7 @@ H5FD_multi_close(H5FD_t *_file) H5Eclear2(H5E_DEFAULT); /* Close as many members as possible */ - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { if (file->memb[mt]) { if (H5FDclose(file->memb[mt]) < 0) { nerrors++; @@ -1109,8 +1101,7 @@ H5FD_multi_close(H5FD_t *_file) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1); /* Clean up other stuff */ - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { if (file->fa.memb_fapl[mt] >= 0) (void)H5Pclose(file->fa.memb_fapl[mt]); if (file->fa.memb_name[mt]) @@ -1152,8 +1143,7 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - ALL_MEMBERS(mt) - { + ALL_MEMBERS (mt) { out_mt = mt; if (f1->memb[mt] && f2->memb[mt]) break; @@ -1261,11 +1251,13 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) * the query is for TYPE == H5FD_MEM_DEFAULT. */ if (H5FD_MEM_DEFAULT == type) { - UNIQUE_MEMBERS(file->fa.memb_map, mt) - { + UNIQUE_MEMBERS (file->fa.memb_map, mt) { if (file->memb[mt]) { /* Retrieve EOA */ - H5E_BEGIN_TRY { memb_eoa = H5FDget_eoa(file->memb[mt], mt); } + H5E_BEGIN_TRY + { + memb_eoa = H5FDget_eoa(file->memb[mt], mt); + } H5E_END_TRY; if (HADDR_UNDEF == memb_eoa) @@ -1296,7 +1288,10 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) mmt = type; if (file->memb[mmt]) { - H5E_BEGIN_TRY { eoa = H5FDget_eoa(file->memb[mmt], mmt); } + H5E_BEGIN_TRY + { + eoa = H5FDget_eoa(file->memb[mmt], mmt); + } H5E_END_TRY; if (HADDR_UNDEF == eoa) @@ -1369,7 +1364,10 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) assert(eoa >= file->fa.memb_addr[mmt]); assert(eoa < file->memb_next[mmt]); - H5E_BEGIN_TRY { status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt])); } + H5E_BEGIN_TRY + { + status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt])); + } H5E_END_TRY; if (status < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1); @@ -1405,11 +1403,13 @@ H5FD_multi_get_eof(const H5FD_t *_file) /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - UNIQUE_MEMBERS(file->fa.memb_map, mt) - { + UNIQUE_MEMBERS (file->fa.memb_map, mt) { if (file->memb[mt]) { /* Retrieve EOF */ - H5E_BEGIN_TRY { tmp_eof = H5FDget_eof(file->memb[mt]); } + H5E_BEGIN_TRY + { + tmp_eof = H5FDget_eof(file->memb[mt]); + } H5E_END_TRY; if (HADDR_UNDEF == tmp_eof) @@ -1419,7 +1419,10 @@ H5FD_multi_get_eof(const H5FD_t *_file) tmp_eof += file->fa.memb_addr[mt]; /* Retrieve EOA */ - H5E_BEGIN_TRY { tmp_eoa = H5FDget_eoa(file->memb[mt], mt); } + H5E_BEGIN_TRY + { + tmp_eoa = H5FDget_eoa(file->memb[mt], mt); + } H5E_END_TRY; if (HADDR_UNDEF == tmp_eoa) @@ -1799,11 +1802,12 @@ compute_next(H5FD_multi_t *file) /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - ALL_MEMBERS(mt) { file->memb_next[mt] = HADDR_UNDEF; } + ALL_MEMBERS (mt) { + file->memb_next[mt] = HADDR_UNDEF; + } END_MEMBERS; - UNIQUE_MEMBERS(file->fa.memb_map, mt1) - { + UNIQUE_MEMBERS (file->fa.memb_map, mt1) { UNIQUE_MEMBERS2(file->fa.memb_map, mt2) { if (file->fa.memb_addr[mt1] < file->fa.memb_addr[mt2] && @@ -1852,8 +1856,7 @@ open_members(H5FD_multi_t *file) /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - UNIQUE_MEMBERS(file->fa.memb_map, mt) - { + UNIQUE_MEMBERS (file->fa.memb_map, mt) { if (file->memb[mt]) continue; /*already open*/ assert(file->fa.memb_name[mt]); @@ -1862,7 +1865,10 @@ open_members(H5FD_multi_t *file) */ sprintf(tmp, file->fa.memb_name[mt], file->name); - H5E_BEGIN_TRY { file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF); } + H5E_BEGIN_TRY + { + file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF); + } H5E_END_TRY; if (!file->memb[mt]) { if (!file->fa.relax || (file->flags & H5F_ACC_RDWR)) |