From eb0d1e4e8eff2d401f593e7f01194f8f323cbfca Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 9 Jul 2019 16:30:27 -0500 Subject: HDFFV-10581 add missed change and release note. --- c++/src/CMakeLists.txt | 2 +- release_docs/RELEASE.txt | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 8e7f8be..b141a5e 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -139,7 +139,7 @@ if (HDF5_EXPORTED_TARGETS) INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) endif () if (NOT ONLY_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries) + INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} cpplibraries) endif () install ( diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7c9bbfa..72a3fb1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -48,6 +48,15 @@ New Features Configuration: ------------- + - Windows PDB files are installed incorrectly + + For static builds, the PDB files for windows should be installed next + to the static libraries in the lib folder. Also the debug versions of + libraries and PDB files are now correctly built using the default + CMAKE_DEBUG_POSTFIX setting. + + (ADB - 2019/07/09, HDFFV-10581) + - Add option to build only shared libs A request was made to prevent building static libraries and only build @@ -286,13 +295,13 @@ Bug Fixes since HDF5-1.10.3 release together with library high bound setting to H5F_LIBVER_V18. When setting non-default file space info in fcpl via - H5Pset_file_space_strategy() and then creating a file with + H5Pset_file_space_strategy() and then creating a file with both high and low library bounds set to H5F_LIBVER_V18 in fapl, the library succeeds in creating the file. File creation should fail because the feature of setting non-default file space info does not exist in library release 1.8 or earlier. - This was fixed by setting and checking the proper version in the + This was fixed by setting and checking the proper version in the file space info message based on the library low and high bounds when creating and opening the HDF5 file. -- cgit v0.12 From 2015fa59fece3da35c27c7084ca9e0fd0dd6af8e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jul 2019 09:43:15 -0500 Subject: Remove tab characters --- src/H5FDmulti.c | 1210 +++++++++++++++++++++++++++---------------------------- 1 file changed, 605 insertions(+), 605 deletions(-) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index acd128c..19aa0df 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -12,15 +12,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, November 10, 1997 - * - * Purpose: Implements a file driver which dispatches I/O requests to - * other file drivers depending on the purpose of the address - * region being accessed. For instance, all meta-data could be - * place in one file while all raw data goes to some other file. - * This also serves as an example of coding a complex file driver, - * therefore, it should not use any non-public definitions. + * Programmer: Robb Matzke + * Monday, November 10, 1997 + * + * Purpose: Implements a file driver which dispatches I/O requests to + * other file drivers depending on the purpose of the address + * region being accessed. For instance, all meta-data could be + * place in one file while all raw data goes to some other file. + * This also serves as an example of coding a complex file driver, + * therefore, it should not use any non-public definitions. */ #include #include @@ -30,23 +30,23 @@ #ifndef FALSE -#define FALSE 0 +#define FALSE 0 #endif #ifndef TRUE -#define TRUE 1 +#define TRUE 1 #endif /* Loop through all mapped files */ -#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \ - H5FD_mem_t ITER, LOOPVAR; \ - unsigned SEEN[H5FD_MEM_NTYPES]; \ - \ - memset(SEEN, 0, sizeof SEEN); \ +#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \ + H5FD_mem_t ITER, LOOPVAR; \ + unsigned SEEN[H5FD_MEM_NTYPES]; \ + \ + memset(SEEN, 0, sizeof SEEN); \ for (ITER=H5FD_MEM_SUPER; ITER0 && LOOPVAR0 && LOOPVARsizeof(meta_name) - QK & JK - 2013/01/17 */ - strncpy(meta_name, meta_ext, sizeof(meta_name)); + strncpy(meta_name, meta_ext, sizeof(meta_name)); meta_name[sizeof(meta_name) - 1] = '\0'; } - else - sprintf(meta_name, "%%s%s", meta_ext); + else + sprintf(meta_name, "%%s%s", meta_ext); } else { - strncpy(meta_name, "%s.meta", sizeof(meta_name)); + strncpy(meta_name, "%s.meta", sizeof(meta_name)); meta_name[sizeof(meta_name) - 1] = '\0'; } memb_name[H5FD_MEM_SUPER] = meta_name; /* process raw filename */ if(raw_ext) { - if(strstr(raw_ext, "%s")) { + if(strstr(raw_ext, "%s")) { /* Note: this doesn't accommodate for when the '%s' in the user's * string is at a position >sizeof(raw_name) - QK & JK - 2013/01/17 */ - strncpy(raw_name, raw_ext, sizeof(raw_name)); + strncpy(raw_name, raw_ext, sizeof(raw_name)); raw_name[sizeof(raw_name) - 1] = '\0'; } - else - sprintf(raw_name, "%%s%s", raw_ext); + else + sprintf(raw_name, "%%s%s", raw_ext); } else { - strncpy(raw_name, "%s.raw", sizeof(raw_name)); + strncpy(raw_name, "%s.raw", sizeof(raw_name)); raw_name[sizeof(raw_name) - 1] = '\0'; } memb_name[H5FD_MEM_DRAW] = raw_name; @@ -343,96 +343,96 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, return H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE); } - + /*------------------------------------------------------------------------- - * Function: H5Pset_fapl_multi + * Function: H5Pset_fapl_multi * - * Purpose: Sets the file access property list FAPL_ID to use the multi - * driver. The MEMB_MAP array maps memory usage types to other - * memory usage types and is the mechanism which allows the - * caller to specify how many files are created. The array - * contains H5FD_MEM_NTYPES entries which are either the value - * H5FD_MEM_DEFAULT or a memory usage type and the number of - * unique values determines the number of files which are - * opened. For each memory usage type which will be associated - * with a file the MEMB_FAPL array should have a property list - * and the MEMB_NAME array should be a name generator (a - * printf-style format with a %s which will be replaced with the - * name passed to H5FDopen(), usually from H5Fcreate() or - * H5Fopen()). + * Purpose: Sets the file access property list FAPL_ID to use the multi + * driver. The MEMB_MAP array maps memory usage types to other + * memory usage types and is the mechanism which allows the + * caller to specify how many files are created. The array + * contains H5FD_MEM_NTYPES entries which are either the value + * H5FD_MEM_DEFAULT or a memory usage type and the number of + * unique values determines the number of files which are + * opened. For each memory usage type which will be associated + * with a file the MEMB_FAPL array should have a property list + * and the MEMB_NAME array should be a name generator (a + * printf-style format with a %s which will be replaced with the + * name passed to H5FDopen(), usually from H5Fcreate() or + * H5Fopen()). * - * If RELAX is set then opening an existing file for read-only - * access will not fail if some file members are missing. This - * allows a file to be accessed in a limited sense if just the - * meta data is available. + * If RELAX is set then opening an existing file for read-only + * access will not fail if some file members are missing. This + * allows a file to be accessed in a limited sense if just the + * meta data is available. * - * Defaults: Default values for each of the optional arguments are: + * Defaults: Default values for each of the optional arguments are: * - * memb_map: The default member map has the value - * H5FD_MEM_DEFAULT for each element. + * memb_map: The default member map has the value + * H5FD_MEM_DEFAULT for each element. * - * memb_fapl: The value H5P_DEFAULT for each element. + * memb_fapl: The value H5P_DEFAULT for each element. * - * memb_name: The string `%s-X.h5' where `X' is one of the - * letters `s' (H5FD_MEM_SUPER), - * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW), - * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP), - * `o' (H5FD_MEM_OHDR). + * memb_name: The string `%s-X.h5' where `X' is one of the + * letters `s' (H5FD_MEM_SUPER), + * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW), + * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP), + * `o' (H5FD_MEM_OHDR). * - * memb_addr: The value HADDR_UNDEF for each element. + * memb_addr: The value HADDR_UNDEF for each element. * * - * Example: To set up a multi file access property list which partitions - * data into meta and raw files each being 1/2 of the address - * space one would say: + * Example: To set up a multi file access property list which partitions + * data into meta and raw files each being 1/2 of the address + * space one would say: * - * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; - * hid_t memb_fapl[H5FD_MEM_NTYPES]; - * const char *memb[H5FD_MEM_NTYPES]; - * haddr_t memb_addr[H5FD_MEM_NTYPES]; + * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; + * hid_t memb_fapl[H5FD_MEM_NTYPES]; + * const char *memb[H5FD_MEM_NTYPES]; + * haddr_t memb_addr[H5FD_MEM_NTYPES]; * - * // The mapping... - * for (mt=0; mt=H5FD_MEM_NTYPES) + /* Map usage type */ + mmt = memb_map[mt]; + if (mmt<0 || mmt>=H5FD_MEM_NTYPES) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1) - if (H5FD_MEM_DEFAULT==mmt) mmt = mt; + if (H5FD_MEM_DEFAULT==mmt) mmt = mt; - /* - * All members of MEMB_FAPL must be either defaults or actual file - * access property lists. - */ - if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS)) + /* + * All members of MEMB_FAPL must be either defaults or actual file + * access property lists. + */ + if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1) - /* All names must be defined */ - if (!memb_name[mmt] || !memb_name[mmt][0]) + /* All names must be defined */ + if (!memb_name[mmt] || !memb_name[mmt][0]) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1) } @@ -506,30 +506,30 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, return H5Pset_driver(fapl_id, H5FD_MULTI, &fa); } - + /*------------------------------------------------------------------------- - * Function: H5Pget_fapl_multi + * Function: H5Pget_fapl_multi * - * Purpose: Returns information about the multi file access property - * list though the function arguments which are the same as for - * H5Pset_fapl_multi() above. + * Purpose: Returns information about the multi file access property + * list though the function arguments which are the same as for + * H5Pset_fapl_multi() above. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- */ herr_t H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, - hid_t *memb_fapl/*out*/, char **memb_name/*out*/, - haddr_t *memb_addr/*out*/, hbool_t *relax) + hid_t *memb_fapl/*out*/, char **memb_name/*out*/, + haddr_t *memb_addr/*out*/, hbool_t *relax) { const H5FD_multi_fapl_t *fa; - H5FD_mem_t mt; + H5FD_mem_t mt; static const char *func="H5FDget_fapl_multi"; /* Function Name for error reporting */ /*NO TRACE*/ @@ -548,41 +548,41 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, if (memb_map) memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES*sizeof(H5FD_mem_t)); if (memb_fapl) { - for (mt=H5FD_MEM_DEFAULT; mtmemb_fapl[mt]>=0) - memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]); - else - memb_fapl[mt] = fa->memb_fapl[mt]; /*default or bad ID*/ - } + for (mt=H5FD_MEM_DEFAULT; mtmemb_fapl[mt]>=0) + memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]); + else + memb_fapl[mt] = fa->memb_fapl[mt]; /*default or bad ID*/ + } } if(memb_name) { - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(fa->memb_name[mt]) - memb_name[mt] = my_strdup(fa->memb_name[mt]); - else - memb_name[mt] = NULL; - } + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if(fa->memb_name[mt]) + memb_name[mt] = my_strdup(fa->memb_name[mt]); + else + memb_name[mt] = NULL; + } } if (memb_addr) - memcpy(memb_addr, fa->memb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t)); + memcpy(memb_addr, fa->memb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t)); if (relax) - *relax = fa->relax; + *relax = fa->relax; return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_sb_size + * Function: H5FD_multi_sb_size * - * Purpose: Returns the size of the private information to be stored in - * the superblock. + * Purpose: Returns the size of the private information to be stored in + * the superblock. * - * Return: Success: The super block driver data size. + * Return: Success: The super block driver data size. * - * Failure: never fails + * Failure: never fails * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 16, 1999 * *------------------------------------------------------------------------- @@ -590,16 +590,16 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, static hsize_t H5FD_multi_sb_size(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - unsigned nseen = 0; - hsize_t nbytes = 8; /*size of header*/ + H5FD_multi_t *file = (H5FD_multi_t*)_file; + unsigned nseen = 0; + hsize_t nbytes = 8; /*size of header*/ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* How many unique files? */ UNIQUE_MEMBERS(file->fa.memb_map, mt) { - nseen++; + nseen++; } END_MEMBERS; /* Addresses and EOA markers */ @@ -614,40 +614,40 @@ H5FD_multi_sb_size(H5FD_t *_file) return nbytes; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_sb_encode + * Function: H5FD_multi_sb_encode * - * Purpose: Encode driver information for the superblock. The NAME - * argument is a nine-byte buffer which will be initialized with - * an eight-character name/version number and null termination. + * Purpose: Encode driver information for the superblock. The NAME + * argument is a nine-byte buffer which will be initialized with + * an eight-character name/version number and null termination. * - * The encoding is a six-byte member mapping followed two bytes - * which are unused. For each unique file in usage-type order - * encode all the starting addresses as unsigned 64-bit integers, - * then all the EOA values as unsigned 64-bit integers, then all - * the template names as null terminated strings which are - * multiples of 8 characters. + * The encoding is a six-byte member mapping followed two bytes + * which are unused. For each unique file in usage-type order + * encode all the starting addresses as unsigned 64-bit integers, + * then all the EOA values as unsigned 64-bit integers, then all + * the template names as null terminated strings which are + * multiples of 8 characters. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 16, 1999 * *------------------------------------------------------------------------- */ static herr_t H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, - unsigned char *buf/*out*/) + unsigned char *buf/*out*/) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - haddr_t memb_eoa; - unsigned char *p; - size_t nseen; - size_t i; - H5FD_mem_t m; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + haddr_t memb_eoa; + unsigned char *p; + size_t nseen; + size_t i; + H5FD_mem_t m; static const char *func="H5FD_multi_sb_encode"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -698,23 +698,23 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, return 0; } /* end H5FD_multi_sb_encode() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_sb_decode + * Function: H5FD_multi_sb_decode * - * Purpose: Decodes the superblock information for this driver. The NAME - * argument is the eight-character (plus null termination) name - * stored in the file. + * Purpose: Decodes the superblock information for this driver. The NAME + * argument is the eight-character (plus null termination) name + * stored in the file. * - * The FILE argument is updated according to the information in - * the superblock. This may mean that some member files are - * closed and others are opened. + * The FILE argument is updated according to the information in + * the superblock. This may mean that some member files are + * closed and others are opened. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 16, 1999 * *------------------------------------------------------------------------- @@ -722,17 +722,17 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, static herr_t H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - char x[2*H5FD_MEM_NTYPES*8]; - H5FD_mem_t map[H5FD_MEM_NTYPES]; - int i; - size_t nseen=0; - hbool_t map_changed=FALSE; - hbool_t in_use[H5FD_MEM_NTYPES]; - const char *memb_name[H5FD_MEM_NTYPES]; - haddr_t memb_addr[H5FD_MEM_NTYPES]; - haddr_t memb_eoa[H5FD_MEM_NTYPES]; - haddr_t *ap; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + char x[2*H5FD_MEM_NTYPES*8]; + H5FD_mem_t map[H5FD_MEM_NTYPES]; + int i; + size_t nseen=0; + hbool_t map_changed=FALSE; + hbool_t in_use[H5FD_MEM_NTYPES]; + const char *memb_name[H5FD_MEM_NTYPES]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; + haddr_t memb_eoa[H5FD_MEM_NTYPES]; + haddr_t *ap; static const char *func="H5FD_multi_sb_decode"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -831,28 +831,28 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) 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) - - /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */ - file->memb_eoa[mt] = memb_eoa[mt]; + + /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */ + file->memb_eoa[mt] = memb_eoa[mt]; } END_MEMBERS; return 0; } /* end H5FD_multi_sb_decode() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_fapl_get + * Function: H5FD_multi_fapl_get * - * Purpose: Returns a file access property list which indicates how the - * specified file is being accessed. The return list could be - * used to access another file the same way. + * Purpose: Returns a file access property list which indicates how the + * specified file is being accessed. The return list could be + * used to access another file the same way. * - * Return: Success: Ptr to new file access property list with all - * members copied from the file struct. + * Return: Success: Ptr to new file access property list with all + * members copied from the file struct. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, August 13, 1999 * *------------------------------------------------------------------------- @@ -860,7 +860,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) static void * H5FD_multi_fapl_get(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_multi_t *file = (H5FD_multi_t*)_file; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -868,17 +868,17 @@ H5FD_multi_fapl_get(H5FD_t *_file) return H5FD_multi_fapl_copy(&(file->fa)); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_fapl_copy + * Function: H5FD_multi_fapl_copy * - * Purpose: Copies the multi-specific file access properties. + * Purpose: Copies the multi-specific file access properties. * - * Return: Success: Ptr to a new property list + * Return: Success: Ptr to a new property list * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -898,20 +898,20 @@ H5FD_multi_fapl_copy(const void *_old_fa) memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t)); ALL_MEMBERS(mt) { - if (old_fa->memb_fapl[mt]>=0) { - if (H5Iinc_ref(old_fa->memb_fapl[mt]) < 0) { + if (old_fa->memb_fapl[mt]>=0) { + if (H5Iinc_ref(old_fa->memb_fapl[mt]) < 0) { nerrors++; break; } - new_fa->memb_fapl[mt] = old_fa->memb_fapl[mt]; - } - if (old_fa->memb_name[mt]) { - new_fa->memb_name[mt] = my_strdup(old_fa->memb_name[mt]); + new_fa->memb_fapl[mt] = old_fa->memb_fapl[mt]; + } + if (old_fa->memb_name[mt]) { + new_fa->memb_name[mt] = my_strdup(old_fa->memb_name[mt]); if (NULL == new_fa->memb_name[mt]) { nerrors++; break; } - } + } } END_MEMBERS; if (nerrors) { @@ -927,17 +927,17 @@ H5FD_multi_fapl_copy(const void *_old_fa) return new_fa; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_fapl_free + * Function: H5FD_multi_fapl_free * - * Purpose: Frees the multi-specific file access properties. + * Purpose: Frees the multi-specific file access properties. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -945,17 +945,17 @@ H5FD_multi_fapl_copy(const void *_old_fa) static herr_t H5FD_multi_fapl_free(void *_fa) { - H5FD_multi_fapl_t *fa = (H5FD_multi_fapl_t*)_fa; + H5FD_multi_fapl_t *fa = (H5FD_multi_fapl_t*)_fa; static const char *func="H5FD_multi_fapl_free"; /* Function Name for error reporting */ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { - if (fa->memb_fapl[mt]>=0) + if (fa->memb_fapl[mt]>=0) if(H5Idec_ref(fa->memb_fapl[mt])<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1) - if (fa->memb_name[mt]) + if (fa->memb_name[mt]) free(fa->memb_name[mt]); } END_MEMBERS; free(fa); @@ -963,19 +963,19 @@ H5FD_multi_fapl_free(void *_fa) return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_open + * Function: H5FD_multi_open * - * Purpose: Creates and/or opens a multi HDF5 file. + * Purpose: Creates and/or opens a multi HDF5 file. * - * Return: Success: A pointer to a new file data structure. The - * public fields will be initialized by the - * caller, which is always H5FD_open(). + * Return: Success: A pointer to a new file data structure. The + * public fields will be initialized by the + * caller, which is always H5FD_open(). * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -983,10 +983,10 @@ H5FD_multi_fapl_free(void *_fa) static H5FD_t * H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { - H5FD_multi_t *file=NULL; - hid_t close_fapl=-1; + H5FD_multi_t *file=NULL; + hid_t close_fapl=-1; const H5FD_multi_fapl_t *fa; - H5FD_mem_t m; + H5FD_mem_t m; static const char *func="H5FD_multi_open"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1001,7 +1001,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* * Initialize the file from the file access properties, using default * values if necessary. Make sure to use CALLOC here because the code - * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa + * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa * in H5FD_multi_t. */ if(NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t)))) @@ -1060,19 +1060,19 @@ error: return NULL; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_close + * Function: H5FD_multi_close * - * Purpose: Closes a multi file. + * Purpose: Closes a multi file. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative with as many members closed as - * possible. The only subsequent operation - * permitted on the file is a close operation. + * Failure: Negative with as many members closed as + * possible. The only subsequent operation + * permitted on the file is a close operation. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1080,8 +1080,8 @@ error: static herr_t H5FD_multi_close(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + int nerrors=0; static const char *func="H5FD_multi_close"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1089,21 +1089,21 @@ H5FD_multi_close(H5FD_t *_file) /* Close as many members as possible */ ALL_MEMBERS(mt) { - if (file->memb[mt]) { - if (H5FDclose(file->memb[mt])<0) { + if (file->memb[mt]) { + if (H5FDclose(file->memb[mt])<0) { nerrors++; - } else { + } else { file->memb[mt] = NULL; - } - } + } + } } END_MEMBERS; if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1) /* Clean up other stuff */ ALL_MEMBERS(mt) { - if (file->fa.memb_fapl[mt]>=0) (void)H5Idec_ref(file->fa.memb_fapl[mt]); - if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]); + if (file->fa.memb_fapl[mt]>=0) (void)H5Idec_ref(file->fa.memb_fapl[mt]); + if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]); } END_MEMBERS; free(file->name); @@ -1111,22 +1111,22 @@ H5FD_multi_close(H5FD_t *_file) return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_cmp + * Function: H5FD_multi_cmp * - * Purpose: Compares two file families to see if they are the same. It - * does this by comparing the first common member of the two - * families. If the families have no members in common then the - * file with the earliest member is smaller than the other file. - * We abort if neither file has any members. + * Purpose: Compares two file families to see if they are the same. It + * does this by comparing the first common member of the two + * families. If the families have no members in common then the + * file with the earliest member is smaller than the other file. + * We abort if neither file has any members. * - * Return: Success: like strcmp() + * Return: Success: like strcmp() * - * Failure: never fails (arguments were checked by the - * caller). + * Failure: never fails (arguments were checked by the + * caller). * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1134,24 +1134,24 @@ H5FD_multi_close(H5FD_t *_file) static int H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { - const H5FD_multi_t *f1 = (const H5FD_multi_t*)_f1; - const H5FD_multi_t *f2 = (const H5FD_multi_t*)_f2; - H5FD_mem_t out_mt = H5FD_MEM_DEFAULT; - int cmp=0; + const H5FD_multi_t *f1 = (const H5FD_multi_t*)_f1; + const H5FD_multi_t *f2 = (const H5FD_multi_t*)_f2; + H5FD_mem_t out_mt = H5FD_MEM_DEFAULT; + int cmp=0; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { out_mt = mt; - if(f1->memb[mt] && f2->memb[mt]) + if(f1->memb[mt] && f2->memb[mt]) break; - if(!cmp) { - if(f1->memb[mt]) + if(!cmp) { + if(f1->memb[mt]) cmp = -1; - else if(f2->memb[mt]) + else if(f2->memb[mt]) cmp = 1; - } + } } END_MEMBERS; assert(cmp || out_mt=H5FD_MEM_NTYPES) @@ -1160,18 +1160,18 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) return H5FDcmp(f1->memb[out_mt], f2->memb[out_mt]); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_query + * Function: H5FD_multi_query * - * Purpose: Set the flags that this VFL driver is capable of supporting. + * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, September 26, 2000 * *------------------------------------------------------------------------- @@ -1194,16 +1194,16 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */) return(0); } /* end H5FD_multi_query() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_get_type_map + * Function: H5FD_multi_get_type_map * - * Purpose: Retrieve the memory type mapping for this file + * Purpose: Retrieve the memory type mapping for this file * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, October 9, 2008 * *------------------------------------------------------------------------- @@ -1211,7 +1211,7 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */) static herr_t H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) { - const H5FD_multi_t *file = (const H5FD_multi_t*)_file; + const H5FD_multi_t *file = (const H5FD_multi_t*)_file; /* Copy file's free space type mapping */ memcpy(type_map, file->fa.memb_map, sizeof(file->fa.memb_map)); @@ -1219,19 +1219,19 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) return(0); } /* end H5FD_multi_get_type_map() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_get_eoa + * Function: H5FD_multi_get_eoa * - * Purpose: Returns the end-of-address marker for the file. The EOA - * marker is the first address past the last byte allocated in - * the format address space. + * Purpose: Returns the end-of-address marker for the file. The EOA + * marker is the first address past the last byte allocated in + * the format address space. * - * Return: Success: The end-of-address-marker + * Return: Success: The end-of-address-marker * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * * Modifications: @@ -1247,7 +1247,7 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) static haddr_t H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) { - const H5FD_multi_t *file = (const H5FD_multi_t*)_file; + const H5FD_multi_t *file = (const H5FD_multi_t*)_file; haddr_t eoa = 0; static const char *func="H5FD_multi_get_eoa"; /* Function Name for error reporting */ @@ -1264,26 +1264,26 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) UNIQUE_MEMBERS(file->fa.memb_map, mt) { haddr_t memb_eoa; - if (file->memb[mt]) { + if (file->memb[mt]) { /* Retrieve EOA */ - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { memb_eoa = H5FDget_eoa(file->memb[mt], mt); - } H5E_END_TRY; + } H5E_END_TRY; - if(HADDR_UNDEF == memb_eoa) + if(HADDR_UNDEF == memb_eoa) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) if(memb_eoa>0) memb_eoa += file->fa.memb_addr[mt]; - } else if(file->fa.relax) { - /* - * The member is not open yet (maybe it doesn't exist). Make the - * best guess about the end-of-file. - */ - memb_eoa = file->memb_next[mt]; - assert(HADDR_UNDEF != memb_eoa); - } else { + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + memb_eoa = file->memb_next[mt]; + assert(HADDR_UNDEF != memb_eoa); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) - } + } if(memb_eoa > eoa) eoa = memb_eoa; @@ -1294,44 +1294,44 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) if(H5FD_MEM_DEFAULT == mmt) mmt = type; - if(file->memb[mmt]) { + if(file->memb[mmt]) { H5E_BEGIN_TRY { - eoa = H5FDget_eoa(file->memb[mmt], mmt); + eoa = H5FDget_eoa(file->memb[mmt], mmt); } H5E_END_TRY; - if(HADDR_UNDEF == eoa) + if(HADDR_UNDEF == eoa) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) - if(eoa > 0) + if(eoa > 0) eoa += file->fa.memb_addr[mmt]; - } else if(file->fa.relax) { - /* - * The member is not open yet (maybe it doesn't exist). Make the - * best guess about the end-of-file. - */ - eoa = file->memb_next[mmt]; - assert(HADDR_UNDEF != eoa); - } else { + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + eoa = file->memb_next[mmt]; + assert(HADDR_UNDEF != eoa); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) - } + } } return eoa; } /* end H5FD_multi_get_eoa() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_set_eoa + * Function: H5FD_multi_set_eoa * - * Purpose: Set the end-of-address marker for the file by savig the new - * EOA value in the file struct. Also set the EOA marker for the - * subfile in which the new EOA value falls. We don't set the - * EOA values of any other subfiles. + * Purpose: Set the end-of-address marker for the file by savig the new + * EOA value in the file struct. Also set the EOA marker for the + * subfile in which the new EOA value falls. We don't set the + * EOA values of any other subfiles. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * * Modifications: @@ -1350,9 +1350,9 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) static herr_t H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mmt; - herr_t status; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mmt; + herr_t status; static const char *func="H5FD_multi_set_eoa"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1383,7 +1383,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) assert(eoa < file->memb_next[mmt]); H5E_BEGIN_TRY { - status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt])); + 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) @@ -1391,20 +1391,20 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) return 0; } /* end H5FD_multi_set_eoa() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_get_eof + * Function: H5FD_multi_get_eof * - * Purpose: Returns the end-of-file marker, which is the greater of - * either the total multi size or the current EOA marker. + * Purpose: Returns the end-of-file marker, which is the greater of + * either the total multi size or the current EOA marker. * - * Return: Success: End of file address, the first address past - * the end of the multi of files or the current - * EOA, whichever is larger. + * Return: Success: End of file address, the first address past + * the end of the multi of files or the current + * EOA, whichever is larger. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1412,8 +1412,8 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) static haddr_t H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type) { - const H5FD_multi_t *file = (const H5FD_multi_t*)_file; - haddr_t eof = 0; + const H5FD_multi_t *file = (const H5FD_multi_t*)_file; + haddr_t eof = 0; static const char *func="H5FD_multi_get_eof"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1452,31 +1452,31 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type) if(H5FD_MEM_DEFAULT == mmt) mmt = type; - if(file->memb[mmt]) { + if(file->memb[mmt]) { /* Retrieve EOF */ H5E_BEGIN_TRY { - eof = H5FDget_eof(file->memb[mmt], mmt); + eof = H5FDget_eof(file->memb[mmt], mmt); } H5E_END_TRY; - if(HADDR_UNDEF == eof) + if(HADDR_UNDEF == eof) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) - if(eof > 0) + if(eof > 0) eof += file->fa.memb_addr[mmt]; - } else if(file->fa.relax) { - /* - * The member is not open yet (maybe it doesn't exist). Make the - * best guess about the end-of-file. - */ - eof = file->memb_next[mmt]; - assert(HADDR_UNDEF != eof); - } else { + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + eof = file->memb_next[mmt]; + assert(HADDR_UNDEF != eof); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) - } + } } return eof; } - + /*------------------------------------------------------------------------- * Function: H5FD_multi_get_handle * @@ -1507,17 +1507,17 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) return (H5FDget_vfd_handle(file->memb[mmt], fapl, file_handle)); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_alloc + * Function: H5FD_multi_alloc * - * Purpose: Allocate file memory. + * Purpose: Allocate file memory. * - * Return: Success: Address of new memory + * Return: Success: Address of new memory * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, August 12, 1999 * *------------------------------------------------------------------------- @@ -1525,9 +1525,9 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) static haddr_t H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mmt; - haddr_t addr; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mmt; + haddr_t addr; static const char *func="H5FD_multi_alloc"; /* Function Name for error reporting */ mmt = file->fa.memb_map[type]; @@ -1548,31 +1548,31 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) /*#ifdef TMP if ( addr + size > file->eoa ) { - if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) { + if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, \ - "can't set eoa", HADDR_UNDEF) - } + "can't set eoa", HADDR_UNDEF) + } } #else if ( addr + size > file->eoa ) - file->eoa = addr + size; + file->eoa = addr + size; #endif */ return addr; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_free + * Function: H5FD_multi_free * - * Purpose: Frees memory + * Purpose: Frees memory * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, August 12, 1999 * *------------------------------------------------------------------------- @@ -1580,8 +1580,8 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) static herr_t H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mmt; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mmt; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -1594,20 +1594,20 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi return H5FDfree(file->memb[mmt], mmt, dxpl_id, addr-file->fa.memb_addr[mmt], size); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_read + * Function: H5FD_multi_read * - * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR - * into buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR + * into buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero. Result is stored in caller-supplied - * buffer BUF. + * Return: Success: Zero. Result is stored in caller-supplied + * buffer BUF. * - * Failure: -1, contents of buffer BUF are undefined. + * Failure: -1, contents of buffer BUF are undefined. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1616,26 +1616,26 @@ static herr_t H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf/*out*/) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; - haddr_t start_addr = 0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; + haddr_t start_addr = 0; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - mmt = file->fa.memb_map[mt]; - if(H5FD_MEM_DEFAULT == mmt) + mmt = file->fa.memb_map[mt]; + if(H5FD_MEM_DEFAULT == mmt) mmt = mt; - assert(mmt > 0 && mmt < H5FD_MEM_NTYPES); + assert(mmt > 0 && mmt < H5FD_MEM_NTYPES); - if(file->fa.memb_addr[mmt] > addr) + if(file->fa.memb_addr[mmt] > addr) continue; - if(file->fa.memb_addr[mmt] >= start_addr) { - start_addr = file->fa.memb_addr[mmt]; - hi = mmt; - } /* end if */ + if(file->fa.memb_addr[mmt] >= start_addr) { + start_addr = file->fa.memb_addr[mmt]; + hi = mmt; + } /* end if */ } /* end for */ assert(hi > 0); @@ -1643,19 +1643,19 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, return H5FDread(file->memb[hi], type, dxpl_id, addr - start_addr, size, _buf); } /* end H5FD_multi_read() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_write + * Function: H5FD_multi_write * - * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR - * from buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR + * from buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero + * Return: Success: Zero * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1664,26 +1664,26 @@ static herr_t H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; - haddr_t start_addr = 0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; + haddr_t start_addr = 0; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - mmt = file->fa.memb_map[mt]; - if(H5FD_MEM_DEFAULT == mmt) + mmt = file->fa.memb_map[mt]; + if(H5FD_MEM_DEFAULT == mmt) mmt = mt; - assert(mmt > 0 && mmt 0 && mmtfa.memb_addr[mmt] > addr) + if(file->fa.memb_addr[mmt] > addr) continue; - if(file->fa.memb_addr[mmt] >= start_addr) { - start_addr = file->fa.memb_addr[mmt]; - hi = mmt; - } /* end if */ + if(file->fa.memb_addr[mmt] >= start_addr) { + start_addr = file->fa.memb_addr[mmt]; + hi = mmt; + } /* end if */ } /* end for */ assert(hi > 0); @@ -1691,17 +1691,17 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, return H5FDwrite(file->memb[hi], type, dxpl_id, addr - start_addr, size, _buf); } /* end H5FD_multi_write() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_flush + * Function: H5FD_multi_flush * - * Purpose: Flushes all multi members. + * Purpose: Flushes all multi members. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1, as many files flushed as possible. + * Failure: -1, as many files flushed as possible. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1709,13 +1709,13 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, static herr_t H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt; + int nerrors=0; static const char *func="H5FD_multi_flush"; /* Function Name for error reporting */ #if 0 - H5FD_mem_t mmt; + H5FD_mem_t mmt; /* Debugging stuff... */ fprintf(stderr, "multifile access information:\n"); @@ -1723,9 +1723,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) /* print the map */ fprintf(stderr, " map="); for (mt=1; mtmemb_map[mt]; - if (H5FD_MEM_DEFAULT==mmt) mmt = mt; - fprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt); + mmt = file->memb_map[mt]; + if (H5FD_MEM_DEFAULT==mmt) mmt = mt; + fprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt); } fprintf(stderr, "\n"); @@ -1735,14 +1735,14 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) fprintf(stderr, " ------ -------------------- -------------------- -------------------- ------------------------------\n"); for (mt=1; mtmemb_addr[mt]) { - haddr_t eoa = H5FDget_eoa(file->memb[mt], mt); - fprintf(stderr, " %6d %20llu %20llu %20llu %s\n", - (int)mt, (unsigned long long)(file->memb_addr[mt]), - (unsigned long long)eoa, - (unsigned long long)(file->memb_next[mt]), - file->memb_name[mt]); - } + if (HADDR_UNDEF!=file->memb_addr[mt]) { + haddr_t eoa = H5FDget_eoa(file->memb[mt], mt); + fprintf(stderr, " %6d %20llu %20llu %20llu %s\n", + (int)mt, (unsigned long long)(file->memb_addr[mt]), + (unsigned long long)eoa, + (unsigned long long)(file->memb_next[mt]), + file->memb_name[mt]); + } } #endif @@ -1751,11 +1751,11 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) /* Flush each file */ for (mt=H5FD_MEM_SUPER; mtmemb[mt]) { - H5E_BEGIN_TRY { - if (H5FDflush(file->memb[mt],dxpl_id,closing)<0) nerrors++; - } H5E_END_TRY; - } + if (file->memb[mt]) { + H5E_BEGIN_TRY { + if (H5FDflush(file->memb[mt],dxpl_id,closing)<0) nerrors++; + } H5E_END_TRY; + } } if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1) @@ -1763,16 +1763,16 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_truncate + * Function: H5FD_multi_truncate * - * Purpose: Truncates all multi members. + * Purpose: Truncates all multi members. * - * Return: Success: 0 - * Failure: -1, as many files truncated as possible. + * Return: Success: 0 + * Failure: -1, as many files truncated as possible. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 31, 2008 * *------------------------------------------------------------------------- @@ -1780,9 +1780,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) static herr_t H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt; + int nerrors=0; static const char *func="H5FD_multi_truncate"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1790,12 +1790,12 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) /* Truncate each file */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(file->memb[mt]) { - H5E_BEGIN_TRY { - if(H5FDtruncate(file->memb[mt], dxpl_id, closing) < 0) + if(file->memb[mt]) { + H5E_BEGIN_TRY { + if(H5FDtruncate(file->memb[mt], dxpl_id, closing) < 0) nerrors++; - } H5E_END_TRY; - } + } H5E_END_TRY; + } } if(nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error truncating member files", -1) @@ -1803,28 +1803,28 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) return 0; } /* end H5FD_multi_truncate() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_lock + * Function: H5FD_multi_lock * - * Purpose: Place a lock on all multi members. - * When there is error in locking a member file, it will not - * proceed further and will try to remove the locks of those - * member files that are locked before error is encountered. + * Purpose: Place a lock on all multi members. + * When there is error in locking a member file, it will not + * proceed further and will try to remove the locks of those + * member files that are locked before error is encountered. * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Vailin Choi; March 2015 + * Programmer: Vailin Choi; March 2015 * *------------------------------------------------------------------------- */ static herr_t H5FD_multi_lock(H5FD_t *_file, hbool_t rw) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - int nerrors = 0; - H5FD_mem_t out_mt; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + int nerrors = 0; + H5FD_mem_t out_mt; static const char *func="H5FD_multi_unlock"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1861,26 +1861,26 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw) } /* H5FD_multi_lock() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_unlock + * Function: H5FD_multi_unlock * - * Purpose: Remove the lock on all multi members. - * It will try to unlock all member files but will record error - * encountered. + * Purpose: Remove the lock on all multi members. + * It will try to unlock all member files but will record error + * encountered. * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Vailin Choi; March 2015 + * Programmer: Vailin Choi; March 2015 * *------------------------------------------------------------------------- */ static herr_t H5FD_multi_unlock(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + int nerrors=0; static const char *func="H5FD_multi_unlock"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1889,7 +1889,7 @@ H5FD_multi_unlock(H5FD_t *_file) ALL_MEMBERS(mt) { if(file->memb[mt]) if(H5FDunlock(file->memb[mt]) < 0) - nerrors++; + nerrors++; } END_MEMBERS; if(nerrors) @@ -1898,18 +1898,18 @@ H5FD_multi_unlock(H5FD_t *_file) return 0; } /* H5FD_multi_unlock() */ - + /*------------------------------------------------------------------------- - * Function: compute_next + * Function: compute_next * - * Purpose: Compute the memb_next[] values of the file based on the - * file's member map and the member starting addresses. + * Purpose: Compute the memb_next[] values of the file based on the + * file's member map and the member starting addresses. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 23, 1999 * *------------------------------------------------------------------------- @@ -1921,36 +1921,36 @@ compute_next(H5FD_multi_t *file) H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { - file->memb_next[mt] = HADDR_UNDEF; + file->memb_next[mt] = HADDR_UNDEF; } END_MEMBERS; UNIQUE_MEMBERS(file->fa.memb_map, mt1) { - UNIQUE_MEMBERS2(file->fa.memb_map, mt2) { - if (file->fa.memb_addr[mt1]fa.memb_addr[mt2] && - (HADDR_UNDEF==file->memb_next[mt1] || - file->memb_next[mt1]>file->fa.memb_addr[mt2])) { - file->memb_next[mt1] = file->fa.memb_addr[mt2]; - } - } END_MEMBERS; - if (HADDR_UNDEF==file->memb_next[mt1]) { - file->memb_next[mt1] = HADDR_MAX; /*last member*/ - } + UNIQUE_MEMBERS2(file->fa.memb_map, mt2) { + if (file->fa.memb_addr[mt1]fa.memb_addr[mt2] && + (HADDR_UNDEF==file->memb_next[mt1] || + file->memb_next[mt1]>file->fa.memb_addr[mt2])) { + file->memb_next[mt1] = file->fa.memb_addr[mt2]; + } + } END_MEMBERS; + if (HADDR_UNDEF==file->memb_next[mt1]) { + file->memb_next[mt1] = HADDR_MAX; /*last member*/ + } } END_MEMBERS; return 0; } - + /*------------------------------------------------------------------------- - * Function: open_members + * Function: open_members * - * Purpose: Opens all members which are not opened yet. + * Purpose: Opens all members which are not opened yet. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 23, 1999 * *------------------------------------------------------------------------- @@ -1966,30 +1966,30 @@ compute_next(H5FD_multi_t *file) static int open_members(H5FD_multi_t *file) { - char tmp[H5FD_MULT_MAX_FILE_NAME_LEN]; - int nerrors=0; + char tmp[H5FD_MULT_MAX_FILE_NAME_LEN]; + int nerrors=0; static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); UNIQUE_MEMBERS(file->fa.memb_map, mt) { - if(file->memb[mt]) - continue; /*already open*/ - assert(file->fa.memb_name[mt]); - /* Note: This truncates the user's filename down to only sizeof(tmp) - * characters. -QK & JK, 2013/01/17 - */ - snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name); - tmp[sizeof(tmp) - 1] = '\0'; - - 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)) - nerrors++; - } + if(file->memb[mt]) + continue; /*already open*/ + assert(file->fa.memb_name[mt]); + /* Note: This truncates the user's filename down to only sizeof(tmp) + * characters. -QK & JK, 2013/01/17 + */ + snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name); + tmp[sizeof(tmp) - 1] = '\0'; + + 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)) + nerrors++; + } } END_MEMBERS; if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1) @@ -1998,7 +1998,7 @@ open_members(H5FD_multi_t *file) } #pragma GCC diagnostic pop - + #ifdef _H5private_H /* * This is not related to the functionality of the driver code. -- cgit v0.12 From 2f88d439c647e9c8e9d9c670224936fc2941c787 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jul 2019 09:46:10 -0500 Subject: Undo commit --- src/H5FDmulti.c | 1210 +++++++++++++++++++++++++++---------------------------- 1 file changed, 605 insertions(+), 605 deletions(-) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 19aa0df..acd128c 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -12,15 +12,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, November 10, 1997 - * - * Purpose: Implements a file driver which dispatches I/O requests to - * other file drivers depending on the purpose of the address - * region being accessed. For instance, all meta-data could be - * place in one file while all raw data goes to some other file. - * This also serves as an example of coding a complex file driver, - * therefore, it should not use any non-public definitions. + * Programmer: Robb Matzke + * Monday, November 10, 1997 + * + * Purpose: Implements a file driver which dispatches I/O requests to + * other file drivers depending on the purpose of the address + * region being accessed. For instance, all meta-data could be + * place in one file while all raw data goes to some other file. + * This also serves as an example of coding a complex file driver, + * therefore, it should not use any non-public definitions. */ #include #include @@ -30,23 +30,23 @@ #ifndef FALSE -#define FALSE 0 +#define FALSE 0 #endif #ifndef TRUE -#define TRUE 1 +#define TRUE 1 #endif /* Loop through all mapped files */ -#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \ - H5FD_mem_t ITER, LOOPVAR; \ - unsigned SEEN[H5FD_MEM_NTYPES]; \ - \ - memset(SEEN, 0, sizeof SEEN); \ +#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \ + H5FD_mem_t ITER, LOOPVAR; \ + unsigned SEEN[H5FD_MEM_NTYPES]; \ + \ + memset(SEEN, 0, sizeof SEEN); \ for (ITER=H5FD_MEM_SUPER; ITER0 && LOOPVAR0 && LOOPVARsizeof(meta_name) - QK & JK - 2013/01/17 */ - strncpy(meta_name, meta_ext, sizeof(meta_name)); + strncpy(meta_name, meta_ext, sizeof(meta_name)); meta_name[sizeof(meta_name) - 1] = '\0'; } - else - sprintf(meta_name, "%%s%s", meta_ext); + else + sprintf(meta_name, "%%s%s", meta_ext); } else { - strncpy(meta_name, "%s.meta", sizeof(meta_name)); + strncpy(meta_name, "%s.meta", sizeof(meta_name)); meta_name[sizeof(meta_name) - 1] = '\0'; } memb_name[H5FD_MEM_SUPER] = meta_name; /* process raw filename */ if(raw_ext) { - if(strstr(raw_ext, "%s")) { + if(strstr(raw_ext, "%s")) { /* Note: this doesn't accommodate for when the '%s' in the user's * string is at a position >sizeof(raw_name) - QK & JK - 2013/01/17 */ - strncpy(raw_name, raw_ext, sizeof(raw_name)); + strncpy(raw_name, raw_ext, sizeof(raw_name)); raw_name[sizeof(raw_name) - 1] = '\0'; } - else - sprintf(raw_name, "%%s%s", raw_ext); + else + sprintf(raw_name, "%%s%s", raw_ext); } else { - strncpy(raw_name, "%s.raw", sizeof(raw_name)); + strncpy(raw_name, "%s.raw", sizeof(raw_name)); raw_name[sizeof(raw_name) - 1] = '\0'; } memb_name[H5FD_MEM_DRAW] = raw_name; @@ -343,96 +343,96 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, return H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE); } - + /*------------------------------------------------------------------------- - * Function: H5Pset_fapl_multi + * Function: H5Pset_fapl_multi * - * Purpose: Sets the file access property list FAPL_ID to use the multi - * driver. The MEMB_MAP array maps memory usage types to other - * memory usage types and is the mechanism which allows the - * caller to specify how many files are created. The array - * contains H5FD_MEM_NTYPES entries which are either the value - * H5FD_MEM_DEFAULT or a memory usage type and the number of - * unique values determines the number of files which are - * opened. For each memory usage type which will be associated - * with a file the MEMB_FAPL array should have a property list - * and the MEMB_NAME array should be a name generator (a - * printf-style format with a %s which will be replaced with the - * name passed to H5FDopen(), usually from H5Fcreate() or - * H5Fopen()). + * Purpose: Sets the file access property list FAPL_ID to use the multi + * driver. The MEMB_MAP array maps memory usage types to other + * memory usage types and is the mechanism which allows the + * caller to specify how many files are created. The array + * contains H5FD_MEM_NTYPES entries which are either the value + * H5FD_MEM_DEFAULT or a memory usage type and the number of + * unique values determines the number of files which are + * opened. For each memory usage type which will be associated + * with a file the MEMB_FAPL array should have a property list + * and the MEMB_NAME array should be a name generator (a + * printf-style format with a %s which will be replaced with the + * name passed to H5FDopen(), usually from H5Fcreate() or + * H5Fopen()). * - * If RELAX is set then opening an existing file for read-only - * access will not fail if some file members are missing. This - * allows a file to be accessed in a limited sense if just the - * meta data is available. + * If RELAX is set then opening an existing file for read-only + * access will not fail if some file members are missing. This + * allows a file to be accessed in a limited sense if just the + * meta data is available. * - * Defaults: Default values for each of the optional arguments are: + * Defaults: Default values for each of the optional arguments are: * - * memb_map: The default member map has the value - * H5FD_MEM_DEFAULT for each element. + * memb_map: The default member map has the value + * H5FD_MEM_DEFAULT for each element. * - * memb_fapl: The value H5P_DEFAULT for each element. + * memb_fapl: The value H5P_DEFAULT for each element. * - * memb_name: The string `%s-X.h5' where `X' is one of the - * letters `s' (H5FD_MEM_SUPER), - * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW), - * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP), - * `o' (H5FD_MEM_OHDR). + * memb_name: The string `%s-X.h5' where `X' is one of the + * letters `s' (H5FD_MEM_SUPER), + * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW), + * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP), + * `o' (H5FD_MEM_OHDR). * - * memb_addr: The value HADDR_UNDEF for each element. + * memb_addr: The value HADDR_UNDEF for each element. * * - * Example: To set up a multi file access property list which partitions - * data into meta and raw files each being 1/2 of the address - * space one would say: + * Example: To set up a multi file access property list which partitions + * data into meta and raw files each being 1/2 of the address + * space one would say: * - * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; - * hid_t memb_fapl[H5FD_MEM_NTYPES]; - * const char *memb[H5FD_MEM_NTYPES]; - * haddr_t memb_addr[H5FD_MEM_NTYPES]; + * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; + * hid_t memb_fapl[H5FD_MEM_NTYPES]; + * const char *memb[H5FD_MEM_NTYPES]; + * haddr_t memb_addr[H5FD_MEM_NTYPES]; * - * // The mapping... - * for (mt=0; mt=H5FD_MEM_NTYPES) + /* Map usage type */ + mmt = memb_map[mt]; + if (mmt<0 || mmt>=H5FD_MEM_NTYPES) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1) - if (H5FD_MEM_DEFAULT==mmt) mmt = mt; + if (H5FD_MEM_DEFAULT==mmt) mmt = mt; - /* - * All members of MEMB_FAPL must be either defaults or actual file - * access property lists. - */ - if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS)) + /* + * All members of MEMB_FAPL must be either defaults or actual file + * access property lists. + */ + if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1) - /* All names must be defined */ - if (!memb_name[mmt] || !memb_name[mmt][0]) + /* All names must be defined */ + if (!memb_name[mmt] || !memb_name[mmt][0]) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1) } @@ -506,30 +506,30 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, return H5Pset_driver(fapl_id, H5FD_MULTI, &fa); } - + /*------------------------------------------------------------------------- - * Function: H5Pget_fapl_multi + * Function: H5Pget_fapl_multi * - * Purpose: Returns information about the multi file access property - * list though the function arguments which are the same as for - * H5Pset_fapl_multi() above. + * Purpose: Returns information about the multi file access property + * list though the function arguments which are the same as for + * H5Pset_fapl_multi() above. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- */ herr_t H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, - hid_t *memb_fapl/*out*/, char **memb_name/*out*/, - haddr_t *memb_addr/*out*/, hbool_t *relax) + hid_t *memb_fapl/*out*/, char **memb_name/*out*/, + haddr_t *memb_addr/*out*/, hbool_t *relax) { const H5FD_multi_fapl_t *fa; - H5FD_mem_t mt; + H5FD_mem_t mt; static const char *func="H5FDget_fapl_multi"; /* Function Name for error reporting */ /*NO TRACE*/ @@ -548,41 +548,41 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, if (memb_map) memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES*sizeof(H5FD_mem_t)); if (memb_fapl) { - for (mt=H5FD_MEM_DEFAULT; mtmemb_fapl[mt]>=0) - memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]); - else - memb_fapl[mt] = fa->memb_fapl[mt]; /*default or bad ID*/ - } + for (mt=H5FD_MEM_DEFAULT; mtmemb_fapl[mt]>=0) + memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]); + else + memb_fapl[mt] = fa->memb_fapl[mt]; /*default or bad ID*/ + } } if(memb_name) { - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(fa->memb_name[mt]) - memb_name[mt] = my_strdup(fa->memb_name[mt]); - else - memb_name[mt] = NULL; - } + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if(fa->memb_name[mt]) + memb_name[mt] = my_strdup(fa->memb_name[mt]); + else + memb_name[mt] = NULL; + } } if (memb_addr) - memcpy(memb_addr, fa->memb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t)); + memcpy(memb_addr, fa->memb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t)); if (relax) - *relax = fa->relax; + *relax = fa->relax; return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_sb_size + * Function: H5FD_multi_sb_size * - * Purpose: Returns the size of the private information to be stored in - * the superblock. + * Purpose: Returns the size of the private information to be stored in + * the superblock. * - * Return: Success: The super block driver data size. + * Return: Success: The super block driver data size. * - * Failure: never fails + * Failure: never fails * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 16, 1999 * *------------------------------------------------------------------------- @@ -590,16 +590,16 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, static hsize_t H5FD_multi_sb_size(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - unsigned nseen = 0; - hsize_t nbytes = 8; /*size of header*/ + H5FD_multi_t *file = (H5FD_multi_t*)_file; + unsigned nseen = 0; + hsize_t nbytes = 8; /*size of header*/ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* How many unique files? */ UNIQUE_MEMBERS(file->fa.memb_map, mt) { - nseen++; + nseen++; } END_MEMBERS; /* Addresses and EOA markers */ @@ -614,40 +614,40 @@ H5FD_multi_sb_size(H5FD_t *_file) return nbytes; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_sb_encode + * Function: H5FD_multi_sb_encode * - * Purpose: Encode driver information for the superblock. The NAME - * argument is a nine-byte buffer which will be initialized with - * an eight-character name/version number and null termination. + * Purpose: Encode driver information for the superblock. The NAME + * argument is a nine-byte buffer which will be initialized with + * an eight-character name/version number and null termination. * - * The encoding is a six-byte member mapping followed two bytes - * which are unused. For each unique file in usage-type order - * encode all the starting addresses as unsigned 64-bit integers, - * then all the EOA values as unsigned 64-bit integers, then all - * the template names as null terminated strings which are - * multiples of 8 characters. + * The encoding is a six-byte member mapping followed two bytes + * which are unused. For each unique file in usage-type order + * encode all the starting addresses as unsigned 64-bit integers, + * then all the EOA values as unsigned 64-bit integers, then all + * the template names as null terminated strings which are + * multiples of 8 characters. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 16, 1999 * *------------------------------------------------------------------------- */ static herr_t H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, - unsigned char *buf/*out*/) + unsigned char *buf/*out*/) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - haddr_t memb_eoa; - unsigned char *p; - size_t nseen; - size_t i; - H5FD_mem_t m; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + haddr_t memb_eoa; + unsigned char *p; + size_t nseen; + size_t i; + H5FD_mem_t m; static const char *func="H5FD_multi_sb_encode"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -698,23 +698,23 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, return 0; } /* end H5FD_multi_sb_encode() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_sb_decode + * Function: H5FD_multi_sb_decode * - * Purpose: Decodes the superblock information for this driver. The NAME - * argument is the eight-character (plus null termination) name - * stored in the file. + * Purpose: Decodes the superblock information for this driver. The NAME + * argument is the eight-character (plus null termination) name + * stored in the file. * - * The FILE argument is updated according to the information in - * the superblock. This may mean that some member files are - * closed and others are opened. + * The FILE argument is updated according to the information in + * the superblock. This may mean that some member files are + * closed and others are opened. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 16, 1999 * *------------------------------------------------------------------------- @@ -722,17 +722,17 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, static herr_t H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - char x[2*H5FD_MEM_NTYPES*8]; - H5FD_mem_t map[H5FD_MEM_NTYPES]; - int i; - size_t nseen=0; - hbool_t map_changed=FALSE; - hbool_t in_use[H5FD_MEM_NTYPES]; - const char *memb_name[H5FD_MEM_NTYPES]; - haddr_t memb_addr[H5FD_MEM_NTYPES]; - haddr_t memb_eoa[H5FD_MEM_NTYPES]; - haddr_t *ap; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + char x[2*H5FD_MEM_NTYPES*8]; + H5FD_mem_t map[H5FD_MEM_NTYPES]; + int i; + size_t nseen=0; + hbool_t map_changed=FALSE; + hbool_t in_use[H5FD_MEM_NTYPES]; + const char *memb_name[H5FD_MEM_NTYPES]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; + haddr_t memb_eoa[H5FD_MEM_NTYPES]; + haddr_t *ap; static const char *func="H5FD_multi_sb_decode"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -831,28 +831,28 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) 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) - - /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */ - file->memb_eoa[mt] = memb_eoa[mt]; + + /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */ + file->memb_eoa[mt] = memb_eoa[mt]; } END_MEMBERS; return 0; } /* end H5FD_multi_sb_decode() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_fapl_get + * Function: H5FD_multi_fapl_get * - * Purpose: Returns a file access property list which indicates how the - * specified file is being accessed. The return list could be - * used to access another file the same way. + * Purpose: Returns a file access property list which indicates how the + * specified file is being accessed. The return list could be + * used to access another file the same way. * - * Return: Success: Ptr to new file access property list with all - * members copied from the file struct. + * Return: Success: Ptr to new file access property list with all + * members copied from the file struct. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, August 13, 1999 * *------------------------------------------------------------------------- @@ -860,7 +860,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) static void * H5FD_multi_fapl_get(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_multi_t *file = (H5FD_multi_t*)_file; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -868,17 +868,17 @@ H5FD_multi_fapl_get(H5FD_t *_file) return H5FD_multi_fapl_copy(&(file->fa)); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_fapl_copy + * Function: H5FD_multi_fapl_copy * - * Purpose: Copies the multi-specific file access properties. + * Purpose: Copies the multi-specific file access properties. * - * Return: Success: Ptr to a new property list + * Return: Success: Ptr to a new property list * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -898,20 +898,20 @@ H5FD_multi_fapl_copy(const void *_old_fa) memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t)); ALL_MEMBERS(mt) { - if (old_fa->memb_fapl[mt]>=0) { - if (H5Iinc_ref(old_fa->memb_fapl[mt]) < 0) { + if (old_fa->memb_fapl[mt]>=0) { + if (H5Iinc_ref(old_fa->memb_fapl[mt]) < 0) { nerrors++; break; } - new_fa->memb_fapl[mt] = old_fa->memb_fapl[mt]; - } - if (old_fa->memb_name[mt]) { - new_fa->memb_name[mt] = my_strdup(old_fa->memb_name[mt]); + new_fa->memb_fapl[mt] = old_fa->memb_fapl[mt]; + } + if (old_fa->memb_name[mt]) { + new_fa->memb_name[mt] = my_strdup(old_fa->memb_name[mt]); if (NULL == new_fa->memb_name[mt]) { nerrors++; break; } - } + } } END_MEMBERS; if (nerrors) { @@ -927,17 +927,17 @@ H5FD_multi_fapl_copy(const void *_old_fa) return new_fa; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_fapl_free + * Function: H5FD_multi_fapl_free * - * Purpose: Frees the multi-specific file access properties. + * Purpose: Frees the multi-specific file access properties. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -945,17 +945,17 @@ H5FD_multi_fapl_copy(const void *_old_fa) static herr_t H5FD_multi_fapl_free(void *_fa) { - H5FD_multi_fapl_t *fa = (H5FD_multi_fapl_t*)_fa; + H5FD_multi_fapl_t *fa = (H5FD_multi_fapl_t*)_fa; static const char *func="H5FD_multi_fapl_free"; /* Function Name for error reporting */ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { - if (fa->memb_fapl[mt]>=0) + if (fa->memb_fapl[mt]>=0) if(H5Idec_ref(fa->memb_fapl[mt])<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1) - if (fa->memb_name[mt]) + if (fa->memb_name[mt]) free(fa->memb_name[mt]); } END_MEMBERS; free(fa); @@ -963,19 +963,19 @@ H5FD_multi_fapl_free(void *_fa) return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_open + * Function: H5FD_multi_open * - * Purpose: Creates and/or opens a multi HDF5 file. + * Purpose: Creates and/or opens a multi HDF5 file. * - * Return: Success: A pointer to a new file data structure. The - * public fields will be initialized by the - * caller, which is always H5FD_open(). + * Return: Success: A pointer to a new file data structure. The + * public fields will be initialized by the + * caller, which is always H5FD_open(). * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -983,10 +983,10 @@ H5FD_multi_fapl_free(void *_fa) static H5FD_t * H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { - H5FD_multi_t *file=NULL; - hid_t close_fapl=-1; + H5FD_multi_t *file=NULL; + hid_t close_fapl=-1; const H5FD_multi_fapl_t *fa; - H5FD_mem_t m; + H5FD_mem_t m; static const char *func="H5FD_multi_open"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1001,7 +1001,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* * Initialize the file from the file access properties, using default * values if necessary. Make sure to use CALLOC here because the code - * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa + * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa * in H5FD_multi_t. */ if(NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t)))) @@ -1060,19 +1060,19 @@ error: return NULL; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_close + * Function: H5FD_multi_close * - * Purpose: Closes a multi file. + * Purpose: Closes a multi file. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative with as many members closed as - * possible. The only subsequent operation - * permitted on the file is a close operation. + * Failure: Negative with as many members closed as + * possible. The only subsequent operation + * permitted on the file is a close operation. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1080,8 +1080,8 @@ error: static herr_t H5FD_multi_close(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + int nerrors=0; static const char *func="H5FD_multi_close"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1089,21 +1089,21 @@ H5FD_multi_close(H5FD_t *_file) /* Close as many members as possible */ ALL_MEMBERS(mt) { - if (file->memb[mt]) { - if (H5FDclose(file->memb[mt])<0) { + if (file->memb[mt]) { + if (H5FDclose(file->memb[mt])<0) { nerrors++; - } else { + } else { file->memb[mt] = NULL; - } - } + } + } } END_MEMBERS; if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1) /* Clean up other stuff */ ALL_MEMBERS(mt) { - if (file->fa.memb_fapl[mt]>=0) (void)H5Idec_ref(file->fa.memb_fapl[mt]); - if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]); + if (file->fa.memb_fapl[mt]>=0) (void)H5Idec_ref(file->fa.memb_fapl[mt]); + if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]); } END_MEMBERS; free(file->name); @@ -1111,22 +1111,22 @@ H5FD_multi_close(H5FD_t *_file) return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_cmp + * Function: H5FD_multi_cmp * - * Purpose: Compares two file families to see if they are the same. It - * does this by comparing the first common member of the two - * families. If the families have no members in common then the - * file with the earliest member is smaller than the other file. - * We abort if neither file has any members. + * Purpose: Compares two file families to see if they are the same. It + * does this by comparing the first common member of the two + * families. If the families have no members in common then the + * file with the earliest member is smaller than the other file. + * We abort if neither file has any members. * - * Return: Success: like strcmp() + * Return: Success: like strcmp() * - * Failure: never fails (arguments were checked by the - * caller). + * Failure: never fails (arguments were checked by the + * caller). * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1134,24 +1134,24 @@ H5FD_multi_close(H5FD_t *_file) static int H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { - const H5FD_multi_t *f1 = (const H5FD_multi_t*)_f1; - const H5FD_multi_t *f2 = (const H5FD_multi_t*)_f2; - H5FD_mem_t out_mt = H5FD_MEM_DEFAULT; - int cmp=0; + const H5FD_multi_t *f1 = (const H5FD_multi_t*)_f1; + const H5FD_multi_t *f2 = (const H5FD_multi_t*)_f2; + H5FD_mem_t out_mt = H5FD_MEM_DEFAULT; + int cmp=0; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { out_mt = mt; - if(f1->memb[mt] && f2->memb[mt]) + if(f1->memb[mt] && f2->memb[mt]) break; - if(!cmp) { - if(f1->memb[mt]) + if(!cmp) { + if(f1->memb[mt]) cmp = -1; - else if(f2->memb[mt]) + else if(f2->memb[mt]) cmp = 1; - } + } } END_MEMBERS; assert(cmp || out_mt=H5FD_MEM_NTYPES) @@ -1160,18 +1160,18 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) return H5FDcmp(f1->memb[out_mt], f2->memb[out_mt]); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_query + * Function: H5FD_multi_query * - * Purpose: Set the flags that this VFL driver is capable of supporting. + * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, September 26, 2000 * *------------------------------------------------------------------------- @@ -1194,16 +1194,16 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */) return(0); } /* end H5FD_multi_query() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_get_type_map + * Function: H5FD_multi_get_type_map * - * Purpose: Retrieve the memory type mapping for this file + * Purpose: Retrieve the memory type mapping for this file * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, October 9, 2008 * *------------------------------------------------------------------------- @@ -1211,7 +1211,7 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */) static herr_t H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) { - const H5FD_multi_t *file = (const H5FD_multi_t*)_file; + const H5FD_multi_t *file = (const H5FD_multi_t*)_file; /* Copy file's free space type mapping */ memcpy(type_map, file->fa.memb_map, sizeof(file->fa.memb_map)); @@ -1219,19 +1219,19 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) return(0); } /* end H5FD_multi_get_type_map() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_get_eoa + * Function: H5FD_multi_get_eoa * - * Purpose: Returns the end-of-address marker for the file. The EOA - * marker is the first address past the last byte allocated in - * the format address space. + * Purpose: Returns the end-of-address marker for the file. The EOA + * marker is the first address past the last byte allocated in + * the format address space. * - * Return: Success: The end-of-address-marker + * Return: Success: The end-of-address-marker * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * * Modifications: @@ -1247,7 +1247,7 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) static haddr_t H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) { - const H5FD_multi_t *file = (const H5FD_multi_t*)_file; + const H5FD_multi_t *file = (const H5FD_multi_t*)_file; haddr_t eoa = 0; static const char *func="H5FD_multi_get_eoa"; /* Function Name for error reporting */ @@ -1264,26 +1264,26 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) UNIQUE_MEMBERS(file->fa.memb_map, mt) { haddr_t memb_eoa; - if (file->memb[mt]) { + if (file->memb[mt]) { /* Retrieve EOA */ - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { memb_eoa = H5FDget_eoa(file->memb[mt], mt); - } H5E_END_TRY; + } H5E_END_TRY; - if(HADDR_UNDEF == memb_eoa) + if(HADDR_UNDEF == memb_eoa) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) if(memb_eoa>0) memb_eoa += file->fa.memb_addr[mt]; - } else if(file->fa.relax) { - /* - * The member is not open yet (maybe it doesn't exist). Make the - * best guess about the end-of-file. - */ - memb_eoa = file->memb_next[mt]; - assert(HADDR_UNDEF != memb_eoa); - } else { + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + memb_eoa = file->memb_next[mt]; + assert(HADDR_UNDEF != memb_eoa); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) - } + } if(memb_eoa > eoa) eoa = memb_eoa; @@ -1294,44 +1294,44 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) if(H5FD_MEM_DEFAULT == mmt) mmt = type; - if(file->memb[mmt]) { + if(file->memb[mmt]) { H5E_BEGIN_TRY { - eoa = H5FDget_eoa(file->memb[mmt], mmt); + eoa = H5FDget_eoa(file->memb[mmt], mmt); } H5E_END_TRY; - if(HADDR_UNDEF == eoa) + if(HADDR_UNDEF == eoa) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) - if(eoa > 0) + if(eoa > 0) eoa += file->fa.memb_addr[mmt]; - } else if(file->fa.relax) { - /* - * The member is not open yet (maybe it doesn't exist). Make the - * best guess about the end-of-file. - */ - eoa = file->memb_next[mmt]; - assert(HADDR_UNDEF != eoa); - } else { + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + eoa = file->memb_next[mmt]; + assert(HADDR_UNDEF != eoa); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) - } + } } return eoa; } /* end H5FD_multi_get_eoa() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_set_eoa + * Function: H5FD_multi_set_eoa * - * Purpose: Set the end-of-address marker for the file by savig the new - * EOA value in the file struct. Also set the EOA marker for the - * subfile in which the new EOA value falls. We don't set the - * EOA values of any other subfiles. + * Purpose: Set the end-of-address marker for the file by savig the new + * EOA value in the file struct. Also set the EOA marker for the + * subfile in which the new EOA value falls. We don't set the + * EOA values of any other subfiles. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * * Modifications: @@ -1350,9 +1350,9 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) static herr_t H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mmt; - herr_t status; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mmt; + herr_t status; static const char *func="H5FD_multi_set_eoa"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1383,7 +1383,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) assert(eoa < file->memb_next[mmt]); H5E_BEGIN_TRY { - status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt])); + 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) @@ -1391,20 +1391,20 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) return 0; } /* end H5FD_multi_set_eoa() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_get_eof + * Function: H5FD_multi_get_eof * - * Purpose: Returns the end-of-file marker, which is the greater of - * either the total multi size or the current EOA marker. + * Purpose: Returns the end-of-file marker, which is the greater of + * either the total multi size or the current EOA marker. * - * Return: Success: End of file address, the first address past - * the end of the multi of files or the current - * EOA, whichever is larger. + * Return: Success: End of file address, the first address past + * the end of the multi of files or the current + * EOA, whichever is larger. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1412,8 +1412,8 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) static haddr_t H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type) { - const H5FD_multi_t *file = (const H5FD_multi_t*)_file; - haddr_t eof = 0; + const H5FD_multi_t *file = (const H5FD_multi_t*)_file; + haddr_t eof = 0; static const char *func="H5FD_multi_get_eof"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1452,31 +1452,31 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type) if(H5FD_MEM_DEFAULT == mmt) mmt = type; - if(file->memb[mmt]) { + if(file->memb[mmt]) { /* Retrieve EOF */ H5E_BEGIN_TRY { - eof = H5FDget_eof(file->memb[mmt], mmt); + eof = H5FDget_eof(file->memb[mmt], mmt); } H5E_END_TRY; - if(HADDR_UNDEF == eof) + if(HADDR_UNDEF == eof) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) - if(eof > 0) + if(eof > 0) eof += file->fa.memb_addr[mmt]; - } else if(file->fa.relax) { - /* - * The member is not open yet (maybe it doesn't exist). Make the - * best guess about the end-of-file. - */ - eof = file->memb_next[mmt]; - assert(HADDR_UNDEF != eof); - } else { + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + eof = file->memb_next[mmt]; + assert(HADDR_UNDEF != eof); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) - } + } } return eof; } - + /*------------------------------------------------------------------------- * Function: H5FD_multi_get_handle * @@ -1507,17 +1507,17 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) return (H5FDget_vfd_handle(file->memb[mmt], fapl, file_handle)); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_alloc + * Function: H5FD_multi_alloc * - * Purpose: Allocate file memory. + * Purpose: Allocate file memory. * - * Return: Success: Address of new memory + * Return: Success: Address of new memory * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, August 12, 1999 * *------------------------------------------------------------------------- @@ -1525,9 +1525,9 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) static haddr_t H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mmt; - haddr_t addr; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mmt; + haddr_t addr; static const char *func="H5FD_multi_alloc"; /* Function Name for error reporting */ mmt = file->fa.memb_map[type]; @@ -1548,31 +1548,31 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) /*#ifdef TMP if ( addr + size > file->eoa ) { - if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) { + if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, \ - "can't set eoa", HADDR_UNDEF) - } + "can't set eoa", HADDR_UNDEF) + } } #else if ( addr + size > file->eoa ) - file->eoa = addr + size; + file->eoa = addr + size; #endif */ return addr; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_free + * Function: H5FD_multi_free * - * Purpose: Frees memory + * Purpose: Frees memory * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, August 12, 1999 * *------------------------------------------------------------------------- @@ -1580,8 +1580,8 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) static herr_t H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mmt; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mmt; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -1594,20 +1594,20 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi return H5FDfree(file->memb[mmt], mmt, dxpl_id, addr-file->fa.memb_addr[mmt], size); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_read + * Function: H5FD_multi_read * - * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR - * into buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR + * into buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero. Result is stored in caller-supplied - * buffer BUF. + * Return: Success: Zero. Result is stored in caller-supplied + * buffer BUF. * - * Failure: -1, contents of buffer BUF are undefined. + * Failure: -1, contents of buffer BUF are undefined. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1616,26 +1616,26 @@ static herr_t H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf/*out*/) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; - haddr_t start_addr = 0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; + haddr_t start_addr = 0; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - mmt = file->fa.memb_map[mt]; - if(H5FD_MEM_DEFAULT == mmt) + mmt = file->fa.memb_map[mt]; + if(H5FD_MEM_DEFAULT == mmt) mmt = mt; - assert(mmt > 0 && mmt < H5FD_MEM_NTYPES); + assert(mmt > 0 && mmt < H5FD_MEM_NTYPES); - if(file->fa.memb_addr[mmt] > addr) + if(file->fa.memb_addr[mmt] > addr) continue; - if(file->fa.memb_addr[mmt] >= start_addr) { - start_addr = file->fa.memb_addr[mmt]; - hi = mmt; - } /* end if */ + if(file->fa.memb_addr[mmt] >= start_addr) { + start_addr = file->fa.memb_addr[mmt]; + hi = mmt; + } /* end if */ } /* end for */ assert(hi > 0); @@ -1643,19 +1643,19 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, return H5FDread(file->memb[hi], type, dxpl_id, addr - start_addr, size, _buf); } /* end H5FD_multi_read() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_write + * Function: H5FD_multi_write * - * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR - * from buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR + * from buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero + * Return: Success: Zero * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1664,26 +1664,26 @@ static herr_t H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; - haddr_t start_addr = 0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; + haddr_t start_addr = 0; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - mmt = file->fa.memb_map[mt]; - if(H5FD_MEM_DEFAULT == mmt) + mmt = file->fa.memb_map[mt]; + if(H5FD_MEM_DEFAULT == mmt) mmt = mt; - assert(mmt > 0 && mmt 0 && mmtfa.memb_addr[mmt] > addr) + if(file->fa.memb_addr[mmt] > addr) continue; - if(file->fa.memb_addr[mmt] >= start_addr) { - start_addr = file->fa.memb_addr[mmt]; - hi = mmt; - } /* end if */ + if(file->fa.memb_addr[mmt] >= start_addr) { + start_addr = file->fa.memb_addr[mmt]; + hi = mmt; + } /* end if */ } /* end for */ assert(hi > 0); @@ -1691,17 +1691,17 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, return H5FDwrite(file->memb[hi], type, dxpl_id, addr - start_addr, size, _buf); } /* end H5FD_multi_write() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_flush + * Function: H5FD_multi_flush * - * Purpose: Flushes all multi members. + * Purpose: Flushes all multi members. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1, as many files flushed as possible. + * Failure: -1, as many files flushed as possible. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1709,13 +1709,13 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, static herr_t H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt; + int nerrors=0; static const char *func="H5FD_multi_flush"; /* Function Name for error reporting */ #if 0 - H5FD_mem_t mmt; + H5FD_mem_t mmt; /* Debugging stuff... */ fprintf(stderr, "multifile access information:\n"); @@ -1723,9 +1723,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) /* print the map */ fprintf(stderr, " map="); for (mt=1; mtmemb_map[mt]; - if (H5FD_MEM_DEFAULT==mmt) mmt = mt; - fprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt); + mmt = file->memb_map[mt]; + if (H5FD_MEM_DEFAULT==mmt) mmt = mt; + fprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt); } fprintf(stderr, "\n"); @@ -1735,14 +1735,14 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) fprintf(stderr, " ------ -------------------- -------------------- -------------------- ------------------------------\n"); for (mt=1; mtmemb_addr[mt]) { - haddr_t eoa = H5FDget_eoa(file->memb[mt], mt); - fprintf(stderr, " %6d %20llu %20llu %20llu %s\n", - (int)mt, (unsigned long long)(file->memb_addr[mt]), - (unsigned long long)eoa, - (unsigned long long)(file->memb_next[mt]), - file->memb_name[mt]); - } + if (HADDR_UNDEF!=file->memb_addr[mt]) { + haddr_t eoa = H5FDget_eoa(file->memb[mt], mt); + fprintf(stderr, " %6d %20llu %20llu %20llu %s\n", + (int)mt, (unsigned long long)(file->memb_addr[mt]), + (unsigned long long)eoa, + (unsigned long long)(file->memb_next[mt]), + file->memb_name[mt]); + } } #endif @@ -1751,11 +1751,11 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) /* Flush each file */ for (mt=H5FD_MEM_SUPER; mtmemb[mt]) { - H5E_BEGIN_TRY { - if (H5FDflush(file->memb[mt],dxpl_id,closing)<0) nerrors++; - } H5E_END_TRY; - } + if (file->memb[mt]) { + H5E_BEGIN_TRY { + if (H5FDflush(file->memb[mt],dxpl_id,closing)<0) nerrors++; + } H5E_END_TRY; + } } if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1) @@ -1763,16 +1763,16 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_truncate + * Function: H5FD_multi_truncate * - * Purpose: Truncates all multi members. + * Purpose: Truncates all multi members. * - * Return: Success: 0 - * Failure: -1, as many files truncated as possible. + * Return: Success: 0 + * Failure: -1, as many files truncated as possible. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 31, 2008 * *------------------------------------------------------------------------- @@ -1780,9 +1780,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) static herr_t H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt; + int nerrors=0; static const char *func="H5FD_multi_truncate"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1790,12 +1790,12 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) /* Truncate each file */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(file->memb[mt]) { - H5E_BEGIN_TRY { - if(H5FDtruncate(file->memb[mt], dxpl_id, closing) < 0) + if(file->memb[mt]) { + H5E_BEGIN_TRY { + if(H5FDtruncate(file->memb[mt], dxpl_id, closing) < 0) nerrors++; - } H5E_END_TRY; - } + } H5E_END_TRY; + } } if(nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error truncating member files", -1) @@ -1803,28 +1803,28 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) return 0; } /* end H5FD_multi_truncate() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_lock + * Function: H5FD_multi_lock * - * Purpose: Place a lock on all multi members. - * When there is error in locking a member file, it will not - * proceed further and will try to remove the locks of those - * member files that are locked before error is encountered. + * Purpose: Place a lock on all multi members. + * When there is error in locking a member file, it will not + * proceed further and will try to remove the locks of those + * member files that are locked before error is encountered. * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Vailin Choi; March 2015 + * Programmer: Vailin Choi; March 2015 * *------------------------------------------------------------------------- */ static herr_t H5FD_multi_lock(H5FD_t *_file, hbool_t rw) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - int nerrors = 0; - H5FD_mem_t out_mt; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + int nerrors = 0; + H5FD_mem_t out_mt; static const char *func="H5FD_multi_unlock"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1861,26 +1861,26 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw) } /* H5FD_multi_lock() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_unlock + * Function: H5FD_multi_unlock * - * Purpose: Remove the lock on all multi members. - * It will try to unlock all member files but will record error - * encountered. + * Purpose: Remove the lock on all multi members. + * It will try to unlock all member files but will record error + * encountered. * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Vailin Choi; March 2015 + * Programmer: Vailin Choi; March 2015 * *------------------------------------------------------------------------- */ static herr_t H5FD_multi_unlock(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + int nerrors=0; static const char *func="H5FD_multi_unlock"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1889,7 +1889,7 @@ H5FD_multi_unlock(H5FD_t *_file) ALL_MEMBERS(mt) { if(file->memb[mt]) if(H5FDunlock(file->memb[mt]) < 0) - nerrors++; + nerrors++; } END_MEMBERS; if(nerrors) @@ -1898,18 +1898,18 @@ H5FD_multi_unlock(H5FD_t *_file) return 0; } /* H5FD_multi_unlock() */ - + /*------------------------------------------------------------------------- - * Function: compute_next + * Function: compute_next * - * Purpose: Compute the memb_next[] values of the file based on the - * file's member map and the member starting addresses. + * Purpose: Compute the memb_next[] values of the file based on the + * file's member map and the member starting addresses. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 23, 1999 * *------------------------------------------------------------------------- @@ -1921,36 +1921,36 @@ compute_next(H5FD_multi_t *file) H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { - file->memb_next[mt] = HADDR_UNDEF; + file->memb_next[mt] = HADDR_UNDEF; } END_MEMBERS; UNIQUE_MEMBERS(file->fa.memb_map, mt1) { - UNIQUE_MEMBERS2(file->fa.memb_map, mt2) { - if (file->fa.memb_addr[mt1]fa.memb_addr[mt2] && - (HADDR_UNDEF==file->memb_next[mt1] || - file->memb_next[mt1]>file->fa.memb_addr[mt2])) { - file->memb_next[mt1] = file->fa.memb_addr[mt2]; - } - } END_MEMBERS; - if (HADDR_UNDEF==file->memb_next[mt1]) { - file->memb_next[mt1] = HADDR_MAX; /*last member*/ - } + UNIQUE_MEMBERS2(file->fa.memb_map, mt2) { + if (file->fa.memb_addr[mt1]fa.memb_addr[mt2] && + (HADDR_UNDEF==file->memb_next[mt1] || + file->memb_next[mt1]>file->fa.memb_addr[mt2])) { + file->memb_next[mt1] = file->fa.memb_addr[mt2]; + } + } END_MEMBERS; + if (HADDR_UNDEF==file->memb_next[mt1]) { + file->memb_next[mt1] = HADDR_MAX; /*last member*/ + } } END_MEMBERS; return 0; } - + /*------------------------------------------------------------------------- - * Function: open_members + * Function: open_members * - * Purpose: Opens all members which are not opened yet. + * Purpose: Opens all members which are not opened yet. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 23, 1999 * *------------------------------------------------------------------------- @@ -1966,30 +1966,30 @@ compute_next(H5FD_multi_t *file) static int open_members(H5FD_multi_t *file) { - char tmp[H5FD_MULT_MAX_FILE_NAME_LEN]; - int nerrors=0; + char tmp[H5FD_MULT_MAX_FILE_NAME_LEN]; + int nerrors=0; static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); UNIQUE_MEMBERS(file->fa.memb_map, mt) { - if(file->memb[mt]) - continue; /*already open*/ - assert(file->fa.memb_name[mt]); - /* Note: This truncates the user's filename down to only sizeof(tmp) - * characters. -QK & JK, 2013/01/17 - */ - snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name); - tmp[sizeof(tmp) - 1] = '\0'; - - 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)) - nerrors++; - } + if(file->memb[mt]) + continue; /*already open*/ + assert(file->fa.memb_name[mt]); + /* Note: This truncates the user's filename down to only sizeof(tmp) + * characters. -QK & JK, 2013/01/17 + */ + snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name); + tmp[sizeof(tmp) - 1] = '\0'; + + 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)) + nerrors++; + } } END_MEMBERS; if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1) @@ -1998,7 +1998,7 @@ open_members(H5FD_multi_t *file) } #pragma GCC diagnostic pop - + #ifdef _H5private_H /* * This is not related to the functionality of the driver code. -- cgit v0.12 From ede618741953c9ff70f9a0f3a0d22e7c92043437 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 10 Jul 2019 10:32:43 -0500 Subject: Fix note text and cmake module include --- config/cmake_ext_mod/FindSZIP.cmake | 2 +- release_docs/RELEASE.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index 152f8ac..b84d768 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -57,7 +57,7 @@ endforeach() if(NOT SZIP_LIBRARY) find_library(SZIP_LIBRARY_RELEASE NAMES ${szip_names}) find_library(SZIP_LIBRARY_DEBUG NAMES ${szip_names_debug}) - include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + include(SelectLibraryConfigurations) select_library_configurations(SZIP) mark_as_advanced(SZIP_LIBRARY_RELEASE SZIP_LIBRARY_DEBUG) endif() diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 72a3fb1..01d8658 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -63,7 +63,7 @@ New Features shared. A new option was added to CMake, ONLY_SHARED_LIBS, which will skip building static libraries. Certain utility functions will build with static libs but are not published. Tests are adjusted to use the correct - libraries. + libraries depending on SHARED/STATIC settings. (ADB - 2019/06/12, HDFFV-10805) @@ -82,8 +82,8 @@ New Features - Change tools test that test the error stack There are some use cases which can cause the error stack of tools to be - different then the expected. These tests now use grepTest.cmake, this was - changed to allow the error file to be searched for an expected string. + different then the expected output. These tests now use grepTest.cmake, + this was changed to allow the error file to be searched for an expected string. (ADB - 2019/04/15, HDFFV-10741) -- cgit v0.12