diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-03-31 12:38:25 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-03-31 12:38:25 (GMT) |
commit | d9d6e19d6faa2fb60df8c8e011b4d0d66201de5c (patch) | |
tree | 85240d9da990b85cf0bc15ba2bc63f1b4a79d9ea /src | |
parent | 9cc69ae1f308336e0e522c989d4cee9f72090815 (diff) | |
download | hdf5-d9d6e19d6faa2fb60df8c8e011b4d0d66201de5c.zip hdf5-d9d6e19d6faa2fb60df8c8e011b4d0d66201de5c.tar.gz hdf5-d9d6e19d6faa2fb60df8c8e011b4d0d66201de5c.tar.bz2 |
TRILAB-192 merging warnings changes from develop
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/H5Dio.c | 277 | ||||
-rw-r--r-- | src/H5FDhdfs.c | 14 | ||||
-rw-r--r-- | src/H5FDmulti.c | 175 | ||||
-rw-r--r-- | src/H5FDpublic.h | 4 | ||||
-rw-r--r-- | src/H5Oefl.c | 2 | ||||
-rw-r--r-- | src/H5Shyper.c | 1 | ||||
-rw-r--r-- | src/H5Tconv.c | 4 | ||||
-rw-r--r-- | src/H5Tprivate.h | 7 |
9 files changed, 228 insertions, 262 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0114280..9a22fd5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -965,6 +965,9 @@ if (NOT ONLY_SHARED_LIBS) PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) + target_compile_options(${HDF5_LIB_TARGET} + PRIVATE "${HDF5_CMAKE_C_FLAGS}" + ) target_compile_definitions(${HDF5_LIB_TARGET} PUBLIC ${HDF_EXTRA_C_FLAGS} @@ -1001,6 +1004,9 @@ if (BUILD_SHARED_LIBS) PUBLIC "$<$<BOOL:${HDF5_ENABLE_HDFS}>:${HDFS_INCLUDE_DIR}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) + target_compile_options(${HDF5_LIBSH_TARGET} + PRIVATE "${HDF5_CMAKE_C_FLAGS}" + ) target_compile_definitions(${HDF5_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" diff --git a/src/H5Dio.c b/src/H5Dio.c index 1973b54..b359117 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -15,19 +15,20 @@ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#define H5D_PACKAGE /* suppress error about including H5Dpkg */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Dpkg.h" /* Dataset functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Sprivate.h" /* Dataspace */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dpkg.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Sprivate.h" /* Dataspace */ +#include "H5Tprivate.h" /* Datatype */ #ifdef H5_HAVE_PARALLEL /* Remove this if H5R_DATASET_REGION is no longer used in this file */ @@ -89,45 +90,45 @@ static herr_t H5D__typeinfo_term(const H5D_type_info_t *type_info); H5FL_BLK_DEFINE(type_conv); - + /*------------------------------------------------------------------------- - * Function: H5Dread + * Function: H5Dread * - * Purpose: Reads (part of) a DSET from the file into application - * memory BUF. The part of the dataset to read is defined with - * MEM_SPACE_ID and FILE_SPACE_ID. The data points are - * converted from their file type to the MEM_TYPE_ID specified. - * Additional miscellaneous data transfer properties can be - * passed to this function with the PLIST_ID argument. + * Purpose: Reads (part of) a DSET from the file into application + * memory BUF. The part of the dataset to read is defined with + * MEM_SPACE_ID and FILE_SPACE_ID. The data points are + * converted from their file type to the MEM_TYPE_ID specified. + * Additional miscellaneous data transfer properties can be + * passed to this function with the PLIST_ID argument. * - * The FILE_SPACE_ID can be the constant H5S_ALL which indicates - * that the entire file data space is to be referenced. + * The FILE_SPACE_ID can be the constant H5S_ALL which indicates + * that the entire file data space is to be referenced. * - * The MEM_SPACE_ID can be the constant H5S_ALL in which case - * the memory data space is the same as the file data space - * defined when the dataset was created. + * The MEM_SPACE_ID can be the constant H5S_ALL in which case + * the memory data space is the same as the file data space + * defined when the dataset was created. * - * The number of elements in the memory data space must match - * the number of elements in the file data space. + * The number of elements in the memory data space must match + * the number of elements in the file data space. * - * The PLIST_ID can be the constant H5P_DEFAULT in which - * case the default data transfer properties are used. + * The PLIST_ID can be the constant H5P_DEFAULT in which + * case the default data transfer properties are used. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * *------------------------------------------------------------------------- */ herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t plist_id, void *buf/*out*/) + hid_t file_space_id, hid_t plist_id, void *buf/*out*/) { - H5D_t *dset = NULL; - H5P_genplist_t *plist; /* Property list pointer */ - const H5S_t *mem_space = NULL; - const H5S_t *file_space = NULL; + H5D_t *dset = NULL; + H5P_genplist_t *plist; /* Property list pointer */ + const H5S_t *mem_space = NULL; + const H5S_t *file_space = NULL; herr_t ret_value = SUCCEED; /* Return value */ hsize_t *direct_offset = NULL; hbool_t direct_read = FALSE; @@ -227,44 +228,44 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Dread() */ - + /*------------------------------------------------------------------------- - * Function: H5Dwrite + * Function: H5Dwrite * - * Purpose: Writes (part of) a DSET from application memory BUF to the - * file. The part of the dataset to write is defined with the - * MEM_SPACE_ID and FILE_SPACE_ID arguments. The data points - * are converted from their current type (MEM_TYPE_ID) to their - * file datatype. Additional miscellaneous data transfer - * properties can be passed to this function with the - * PLIST_ID argument. + * Purpose: Writes (part of) a DSET from application memory BUF to the + * file. The part of the dataset to write is defined with the + * MEM_SPACE_ID and FILE_SPACE_ID arguments. The data points + * are converted from their current type (MEM_TYPE_ID) to their + * file datatype. Additional miscellaneous data transfer + * properties can be passed to this function with the + * PLIST_ID argument. * - * The FILE_SPACE_ID can be the constant H5S_ALL which indicates - * that the entire file data space is to be referenced. + * The FILE_SPACE_ID can be the constant H5S_ALL which indicates + * that the entire file data space is to be referenced. * - * The MEM_SPACE_ID can be the constant H5S_ALL in which case - * the memory data space is the same as the file data space - * defined when the dataset was created. + * The MEM_SPACE_ID can be the constant H5S_ALL in which case + * the memory data space is the same as the file data space + * defined when the dataset was created. * - * The number of elements in the memory data space must match - * the number of elements in the file data space. + * The number of elements in the memory data space must match + * the number of elements in the file data space. * - * The PLIST_ID can be the constant H5P_DEFAULT in which - * case the default data transfer properties are used. + * The PLIST_ID can be the constant H5P_DEFAULT in which + * case the default data transfer properties are used. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * *------------------------------------------------------------------------- */ herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t dxpl_id, const void *buf) + hid_t file_space_id, hid_t dxpl_id, const void *buf) { - H5D_t *dset = NULL; - H5P_genplist_t *plist; /* Property list pointer */ + H5D_t *dset = NULL; + H5P_genplist_t *plist; /* Property list pointer */ const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_write = FALSE; @@ -298,7 +299,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* Check dataspace selections if this is not a direct write */ if(!direct_write) { if(mem_space_id < 0 || file_space_id < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") if(H5S_ALL != mem_space_id) { if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE))) @@ -325,16 +326,16 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Dwrite() */ - + /*------------------------------------------------------------------------- - * Function: H5D__pre_write + * Function: H5D__pre_write * - * Purpose: Preparation for writing data. + * Purpose: Preparation for writing data. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * 2 November 2012 + * Programmer: Raymond Lu + * 2 November 2012 * *------------------------------------------------------------------------- */ @@ -407,23 +408,23 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__pre_write() */ - + /*------------------------------------------------------------------------- - * Function: H5D__read + * Function: H5D__read * - * Purpose: Reads (part of) a DATASET into application memory BUF. See - * H5Dread() for complete details. + * Purpose: Reads (part of) a DATASET into application memory BUF. See + * H5Dread() for complete details. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * *------------------------------------------------------------------------- */ herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, - const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/) + const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/) { H5D_chunk_map_t fm; /* Chunk file<->memory mapping */ H5D_io_info_t io_info; /* Dataset I/O info */ @@ -443,8 +444,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* projected mem space must be discarded at the */ /* end of the function to avoid a memory leak. */ H5D_storage_t store; /*union of EFL and chunk pointer in file space */ - hssize_t snelmts; /*total number of elmts (signed) */ - hsize_t nelmts; /*total number of elmts */ + hssize_t snelmts; /*total number of elmts (signed) */ + hsize_t nelmts; /*total number of elmts */ #ifdef H5_HAVE_PARALLEL hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ #endif /*H5_HAVE_PARALLEL*/ @@ -452,7 +453,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ char fake_char; /* Temporary variable for NULL buffer pointers */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -464,7 +465,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(!mem_space) mem_space = file_space; if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection") H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); /* Fill the DXPL cache values for later use */ @@ -496,10 +497,10 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(nelmts > 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer") - /* If the buffer is nil, and 0 element is selected, make a fake buffer. - * This is for some MPI package like ChaMPIon on NCSA's tungsten which - * doesn't support this feature. - */ + /* If the buffer is nil, and 0 element is selected, make a fake buffer. + * This is for some MPI package like ChaMPIon on NCSA's tungsten which + * doesn't support this feature. + */ buf = &fake_char; } /* end if */ @@ -628,23 +629,23 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__read() */ - + /*------------------------------------------------------------------------- - * Function: H5D__write + * Function: H5D__write * - * Purpose: Writes (part of) a DATASET to a file from application memory - * BUF. See H5Dwrite() for complete details. + * Purpose: Writes (part of) a DATASET to a file from application memory + * BUF. See H5Dwrite() for complete details. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Thursday, December 4, 1997 + * Programmer: Robb Matzke + * Thursday, December 4, 1997 * *------------------------------------------------------------------------- */ static herr_t H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, - const H5S_t *file_space, hid_t dxpl_id, const void *buf) + const H5S_t *file_space, hid_t dxpl_id, const void *buf) { H5D_chunk_map_t fm; /* Chunk file<->memory mapping */ H5D_io_info_t io_info; /* Dataset I/O info */ @@ -664,8 +665,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* projected mem space must be discarded at the */ /* end of the function to avoid a memory leak. */ H5D_storage_t store; /*union of EFL and chunk pointer in file space */ - hssize_t snelmts; /*total number of elmts (signed) */ - hsize_t nelmts; /*total number of elmts */ + hssize_t snelmts; /*total number of elmts (signed) */ + hsize_t nelmts; /*total number of elmts */ #ifdef H5_HAVE_PARALLEL hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ #endif /*H5_HAVE_PARALLEL*/ @@ -673,7 +674,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ char fake_char; /* Temporary variable for NULL buffer pointers */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -690,7 +691,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Check if we are allowed to write to this file */ if(0 == (H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file") /* Fill the DXPL cache values for later use */ if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) @@ -742,12 +743,12 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, mem_space = file_space; if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); /* Make certain that the number of elements in each selection is the same */ if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes") /* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */ if(NULL == buf) { @@ -755,10 +756,10 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(nelmts > 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer") - /* If the buffer is nil, and 0 element is selected, make a fake buffer. - * This is for some MPI package like ChaMPIon on NCSA's tungsten which - * doesn't support this feature. - */ + /* If the buffer is nil, and 0 element is selected, make a fake buffer. + * This is for some MPI package like ChaMPIon on NCSA's tungsten which + * doesn't support this feature. + */ buf = &fake_char; } /* end if */ @@ -817,7 +818,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, else full_overwrite = (hbool_t)((hsize_t)file_nelmts == nelmts ? TRUE : FALSE); - /* Allocate storage */ + /* Allocate storage */ if(H5D__alloc_storage(dataset, dxpl_id, H5D_ALLOC_WRITE, full_overwrite, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") } /* end if */ @@ -886,17 +887,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__write() */ - + /*------------------------------------------------------------------------- - * Function: H5D__ioinfo_init + * Function: H5D__ioinfo_init * - * Purpose: Routine for determining correct I/O operations for + * Purpose: Routine for determining correct I/O operations for * each I/O action. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, September 30, 2004 + * Programmer: Quincey Koziol + * Thursday, September 30, 2004 * *------------------------------------------------------------------------- */ @@ -955,17 +956,17 @@ const FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__ioinfo_init() */ - + /*------------------------------------------------------------------------- - * Function: H5D__typeinfo_init + * Function: H5D__typeinfo_init * - * Purpose: Routine for determining correct datatype information for + * Purpose: Routine for determining correct datatype information for * each I/O action. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, March 4, 2008 + * Programmer: Quincey Koziol + * Tuesday, March 4, 2008 * *------------------------------------------------------------------------- */ @@ -974,9 +975,9 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, H5D_type_info_t *type_info) { - const H5T_t *src_type; /* Source datatype */ - const H5T_t *dst_type; /* Destination datatype */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5T_t *src_type; /* Source datatype */ + const H5T_t *dst_type; /* Destination datatype */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -989,7 +990,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, /* Get the memory & dataset datatypes */ if(NULL == (type_info->mem_type = (const H5T_t *)H5I_object_verify(mem_type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") type_info->dset_type = dset->shared->type; if(do_write) { @@ -1014,7 +1015,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, * turns off background preservation. */ if(NULL == (type_info->tpath = H5T_path_find(src_type, dst_type, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") + HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") /* Precompute some useful information */ type_info->src_type_size = H5T_get_size(src_type); @@ -1027,7 +1028,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, type_info->need_bkg = H5T_BKG_NO; } /* end if */ else { - size_t target_size; /* Desired buffer size */ + size_t target_size; /* Desired buffer size */ /* Check if the datatypes are compound subsets of one another */ type_info->cmpd_subset = H5T_path_compound_subset(type_info->tpath); @@ -1091,7 +1092,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, type_info->tconv_buf_allocated = TRUE; } /* end if */ if(type_info->need_bkg && NULL == (type_info->bkg_buf = (uint8_t *)dxpl_cache->bkgr_buf)) { - size_t bkg_size; /* Desired background buffer size */ + size_t bkg_size; /* Desired background buffer size */ /* Compute the background buffer size */ /* (don't try to use buffers smaller than the default size) */ @@ -1112,16 +1113,16 @@ done: } /* end H5D__typeinfo_init() */ #ifdef H5_HAVE_PARALLEL - + /*------------------------------------------------------------------------- - * Function: H5D__ioinfo_adjust + * Function: H5D__ioinfo_adjust * - * Purpose: Adjust operation's I/O info for any parallel I/O + * Purpose: Adjust operation's I/O info for any parallel I/O * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, March 27, 2008 + * Programmer: Quincey Koziol + * Thursday, March 27, 2008 * *------------------------------------------------------------------------- */ @@ -1133,7 +1134,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, H5P_genplist_t *dx_plist; /* Data transer property list */ H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode; /* performed chunk optimization */ H5D_mpio_actual_io_mode_t actual_io_mode; /* performed io mode */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1204,24 +1205,24 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_adjust() */ - + /*------------------------------------------------------------------------- - * Function: H5D__ioinfo_term + * Function: H5D__ioinfo_term * - * Purpose: Common logic for terminating an I/O info object + * Purpose: Common logic for terminating an I/O info object * (Only used for restoring MPI transfer mode currently) * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Friday, February 6, 2004 + * Programmer: Quincey Koziol + * Friday, February 6, 2004 * *------------------------------------------------------------------------- */ static herr_t H5D__ioinfo_term(H5D_io_info_t *io_info) { - herr_t ret_value = SUCCEED; /*return value */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_STATIC @@ -1260,16 +1261,16 @@ done: #endif /* H5_HAVE_PARALLEL */ - + /*------------------------------------------------------------------------- - * Function: H5D__typeinfo_term + * Function: H5D__typeinfo_term * - * Purpose: Common logic for terminating a type info object + * Purpose: Common logic for terminating a type info object * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, March 6, 2008 + * Programmer: Quincey Koziol + * Thursday, March 6, 2008 * *------------------------------------------------------------------------- */ diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 49604f4..b1bd4a7 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -478,7 +478,7 @@ static int H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_hdfs_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static haddr_t H5FD_hdfs_get_eof(const H5FD_t *_file); static herr_t H5FD_hdfs_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, @@ -549,7 +549,7 @@ H5FD_hdfs_init_interface(void) FUNC_LEAVE_NOAPI(H5FD_hdfs_init()) } /* H5FD_hdfs_init_interface() */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_init * @@ -767,7 +767,7 @@ done: } /* H5FD_hdfs_open() */ #endif /* H5_HAVE_LIBHDFS */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_close * @@ -945,7 +945,7 @@ H5FD_hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) /* out FUNC_LEAVE_NOAPI(SUCCEED) } /* H5FD_hdfs_query() */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_get_eoa() * @@ -1056,7 +1056,7 @@ H5FD_hdfs_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, #ifdef H5_HAVE_LIBHDFS static haddr_t -H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD_hdfs_get_eof(const H5FD_t *_file) { const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file; @@ -1075,7 +1075,7 @@ H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) #else /* H5_HAVE_LIBHDFS not defined */ static haddr_t -H5FD_hdfs_get_eof(const H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD_hdfs_get_eof(const H5FD_t H5_ATTR_UNUSED *_file) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1282,7 +1282,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FD_hdfs_write() */ - + /*------------------------------------------------------------------------- * Function: H5FD_hdfs_truncate * diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index f784fac..0c48466 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -46,16 +46,22 @@ #endif /* Loop through all mapped files */ -#define UNIQUE_MEMBERS(MAP,LOOPVAR) { \ - H5FD_mem_t _unmapped, LOOPVAR; \ - hbool_t _seen[H5FD_MEM_NTYPES]; \ +#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \ + H5FD_mem_t ITER, LOOPVAR; \ + unsigned SEEN[H5FD_MEM_NTYPES]; \ \ - memset(_seen, 0, sizeof _seen); \ - for (_unmapped=H5FD_MEM_SUPER; _unmapped<H5FD_MEM_NTYPES; _unmapped=(H5FD_mem_t)(_unmapped+1)) { \ - LOOPVAR = MAP[_unmapped]; \ - if (H5FD_MEM_DEFAULT==LOOPVAR) LOOPVAR=_unmapped; \ + memset(SEEN, 0, sizeof SEEN); \ + for (ITER=H5FD_MEM_SUPER; ITER<H5FD_MEM_NTYPES; ITER=(H5FD_mem_t)(ITER+1)) { \ + LOOPVAR = MAP[ITER]; \ + if (H5FD_MEM_DEFAULT==LOOPVAR) LOOPVAR=ITER; \ assert(LOOPVAR>0 && LOOPVAR<H5FD_MEM_NTYPES); \ - if (_seen[LOOPVAR]++) continue; + if (SEEN[LOOPVAR]++) continue; \ + +/* Need two front-ends, since they are nested sometimes */ +#define UNIQUE_MEMBERS(MAP, LOOPVAR) \ + UNIQUE_MEMBERS_CORE(MAP, _unmapped, _seen, LOOPVAR) +#define UNIQUE_MEMBERS2(MAP, LOOPVAR) \ + UNIQUE_MEMBERS_CORE(MAP, _unmapped2, _seen2, LOOPVAR) #define ALL_MEMBERS(LOOPVAR) { \ H5FD_mem_t LOOPVAR; \ @@ -71,11 +77,11 @@ static hid_t H5FD_MULTI_g = 0; /* Driver-specific file access properties */ typedef struct H5FD_multi_fapl_t { - H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /*memory usage map */ - hid_t memb_fapl[H5FD_MEM_NTYPES];/*member access properties */ - char *memb_name[H5FD_MEM_NTYPES];/*name generators */ - haddr_t memb_addr[H5FD_MEM_NTYPES];/*starting addr per member */ - hbool_t relax; /*less stringent error checking */ + H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /*memory usage map */ + hid_t memb_fapl[H5FD_MEM_NTYPES]; /*member access properties */ + char *memb_name[H5FD_MEM_NTYPES]; /*name generators */ + haddr_t memb_addr[H5FD_MEM_NTYPES]; /*starting addr per member */ + hbool_t relax; /*less stringent error checking */ } H5FD_multi_fapl_t; /* @@ -85,17 +91,17 @@ typedef struct H5FD_multi_fapl_t { * copied into the parent file struct in H5F_open(). */ typedef struct H5FD_multi_t { - H5FD_t pub; /*public stuff, must be first */ - H5FD_multi_fapl_t fa; /*driver-specific file access properties*/ - haddr_t memb_next[H5FD_MEM_NTYPES];/*addr of next member */ - H5FD_t *memb[H5FD_MEM_NTYPES]; /*member pointers */ - haddr_t memb_eoa[H5FD_MEM_NTYPES]; /*EOA for individual files, - *end of allocated addresses. v1.6 library - *have the EOA for the entire file. But it's - *meaningless for MULTI file. We replaced it - *with the EOAs for individual files */ - unsigned flags; /*file open flags saved for debugging */ - char *name; /*name passed to H5Fopen or H5Fcreate */ + H5FD_t pub; /*public stuff, must be first */ + H5FD_multi_fapl_t fa; /*driver-specific file access properties */ + haddr_t memb_next[H5FD_MEM_NTYPES]; /*addr of next member */ + H5FD_t *memb[H5FD_MEM_NTYPES]; /*member pointers */ + haddr_t memb_eoa[H5FD_MEM_NTYPES]; /*EOA for individual files, + *end of allocated addresses. v1.6 library + *have the EOA for the entire file. But it's + *meaningless for MULTI file. We replaced it + *with the EOAs for individual files */ + unsigned flags; /*file open flags saved for debugging */ + char *name; /*name passed to H5Fopen or H5Fcreate */ } H5FD_multi_t; /* Driver specific data transfer properties */ @@ -185,8 +191,6 @@ static const H5FD_class_t H5FD_multi_g = { * Programmer: Robb Matzke * Friday, August 13, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static char * @@ -219,8 +223,6 @@ my_strdup(const char *s) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t @@ -229,9 +231,9 @@ H5FD_multi_init(void) /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - if (H5I_VFL!=H5Iget_type(H5FD_MULTI_g)) { - H5FD_MULTI_g = H5FDregister(&H5FD_multi_g); - } + if(H5I_VFL!=H5Iget_type(H5FD_MULTI_g)) + H5FD_MULTI_g = H5FDregister(&H5FD_multi_g); + return H5FD_MULTI_g; } @@ -246,8 +248,6 @@ H5FD_multi_init(void) * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Modification: - * *--------------------------------------------------------------------------- */ void @@ -273,14 +273,6 @@ H5FD_multi_term(void) * Programmer: Robb Matzke * Wednesday, August 11, 1999 * - * Modifications: - * Albert Cheng, Sep 17, 2001 - * Added feature that if the raw or meta extension string contains - * a "%s", it will be substituted by the filename given for H5Fopen - * or H5Fcreate. This is same as the multi-file syntax. If no %s - * is found, one is inserted at the beginning. This is the previous - * behavior. - * *------------------------------------------------------------------------- */ herr_t @@ -290,7 +282,8 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; const char *memb_name[H5FD_MEM_NTYPES]; - char meta_name[H5FD_MULT_MAX_FILE_NAME_LEN], raw_name[H5FD_MULT_MAX_FILE_NAME_LEN]; + char meta_name[H5FD_MULT_MAX_FILE_NAME_LEN]; + char raw_name[H5FD_MULT_MAX_FILE_NAME_LEN]; haddr_t memb_addr[H5FD_MEM_NTYPES]; /*NO TRACE*/ @@ -430,11 +423,6 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * - * Raymond Lu, 2001-10-25 - * Use new generic property list for argument checking. - * *------------------------------------------------------------------------- */ herr_t @@ -537,11 +525,6 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * - * Raymond Lu, 2001-10-25 - * Use new generic property list for argument checking. - * *------------------------------------------------------------------------- */ herr_t @@ -606,8 +589,6 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, * Programmer: Robb Matzke * Monday, August 16, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static hsize_t @@ -659,8 +640,6 @@ H5FD_multi_sb_size(H5FD_t *_file) * Programmer: Robb Matzke * Monday, August 16, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -880,8 +859,6 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) * Programmer: Robb Matzke * Friday, August 13, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * @@ -908,8 +885,6 @@ H5FD_multi_fapl_get(H5FD_t *_file) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * @@ -964,8 +939,6 @@ H5FD_multi_fapl_copy(const void *_old_fa) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1004,8 +977,6 @@ H5FD_multi_fapl_free(void *_fa) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5FD_t * @@ -1104,8 +1075,6 @@ error: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1136,6 +1105,7 @@ H5FD_multi_close(H5FD_t *_file) if (file->fa.memb_fapl[mt]>=0) (void)H5Pclose(file->fa.memb_fapl[mt]); if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]); } END_MEMBERS; + free(file->name); free(file); return 0; @@ -1159,8 +1129,6 @@ H5FD_multi_close(H5FD_t *_file) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1176,14 +1144,18 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) ALL_MEMBERS(mt) { out_mt = mt; - if (f1->memb[mt] && f2->memb[mt]) break; - if (!cmp) { - if (f1->memb[mt]) cmp = -1; - else if (f2->memb[mt]) cmp = 1; + if(f1->memb[mt] && f2->memb[mt]) + break; + if(!cmp) { + if(f1->memb[mt]) + cmp = -1; + else if(f2->memb[mt]) + cmp = 1; } } END_MEMBERS; assert(cmp || out_mt<H5FD_MEM_NTYPES); - if (out_mt>=H5FD_MEM_NTYPES) return cmp; + if(out_mt>=H5FD_MEM_NTYPES) + return cmp; return H5FDcmp(f1->memb[out_mt], f2->memb[out_mt]); } @@ -1202,8 +1174,6 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) * Programmer: Quincey Koziol * Tuesday, September 26, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1297,7 +1267,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) memb_eoa = H5FDget_eoa(file->memb[mt], mt); } 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) } else if (file->fa.relax) { /* @@ -1305,7 +1275,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) * best guess about the end-of-file. */ memb_eoa = file->memb_next[mt]; - assert(HADDR_UNDEF!=memb_eoa); + assert(HADDR_UNDEF != memb_eoa); } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) } @@ -1315,23 +1285,26 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) } END_MEMBERS; } else { H5FD_mem_t mmt = file->fa.memb_map[type]; - if (H5FD_MEM_DEFAULT==mmt) mmt = type; - if (file->memb[mmt]) { + if(H5FD_MEM_DEFAULT == mmt) + mmt = type; + + if(file->memb[mmt]) { H5E_BEGIN_TRY { 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) eoa += file->fa.memb_addr[mmt]; - } else if (file->fa.relax) { + 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); + assert(HADDR_UNDEF != eoa); } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) } @@ -1384,13 +1357,15 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) if(H5FD_MEM_DEFAULT == mmt) mmt = type; - /* Handle backward compatibility in a quick and simple way. v1.6 library had EOA for the entire virtual - * file. But it wasn't meaningful. So v1.8 library doesn't have it anymore. It saves the EOA for the - * metadata file, instead. Here we try to figure out whether the EOA is from a v1.6 file by comparing its - * value. If it is a big value, we assume it's from v1.6 and simply discard it. This is the normal case - * when the metadata file has the smallest starting address. If the metadata file has the biggest address, - * the EOAs of v1.6 and v1.8 files are the same. It won't cause any trouble. (Please see Issue 2598 - * in Jira) SLU - 2011/6/21 + /* Handle backward compatibility in a quick and simple way. v1.6 library + * had EOA for the entire virtual file. But it wasn't meaningful. So v1.8 + * library doesn't have it anymore. It saves the EOA for the metadata file, + * instead. Here we try to figure out whether the EOA is from a v1.6 file + * by comparing its value. If it is a big value, we assume it's from v1.6 + * and simply discard it. This is the normal case when the metadata file + * has the smallest starting address. If the metadata file has the biggest + * address, the EOAs of v1.6 and v1.8 files are the same. It won't cause + * any trouble. (Please see Issue 2598 in Jira) SLU - 2011/6/21 */ if(H5FD_MEM_SUPER == type && file->memb_eoa[H5FD_MEM_SUPER] > 0 && eoa > file->memb_eoa[H5FD_MEM_SUPER]) return 0; @@ -1401,7 +1376,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) H5E_BEGIN_TRY { status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt])); } H5E_END_TRY; - if (status<0) + if(status < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1) return 0; @@ -1423,12 +1398,6 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 5 January 2007 - * Multi driver no longer has EOA for the whole file. Calculate - * it in the same way as EOF instead. - * *------------------------------------------------------------------------- */ static haddr_t @@ -1493,8 +1462,6 @@ H5FD_multi_get_eof(const H5FD_t *_file) * Programmer: Raymond Lu * Sept. 16, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1528,8 +1495,6 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) * Programmer: Robb Matzke * Thursday, August 12, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static haddr_t @@ -1577,8 +1542,6 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) * Programmer: Robb Matzke * Thursday, August 12, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1827,8 +1790,6 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) * Programmer: Robb Matzke * Monday, August 23, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1842,7 +1803,7 @@ compute_next(H5FD_multi_t *file) } END_MEMBERS; UNIQUE_MEMBERS(file->fa.memb_map, mt1) { - UNIQUE_MEMBERS(file->fa.memb_map, mt2) { + UNIQUE_MEMBERS2(file->fa.memb_map, mt2) { if (file->fa.memb_addr[mt1]<file->fa.memb_addr[mt2] && (HADDR_UNDEF==file->memb_next[mt1] || file->memb_next[mt1]>file->fa.memb_addr[mt2])) { @@ -1870,8 +1831,6 @@ compute_next(H5FD_multi_t *file) * Programmer: Robb Matzke * Monday, August 23, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 3faaf33..819385f 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -238,8 +238,8 @@ typedef struct H5FD_class_t { haddr_t addr, size_t size, const void *buffer); herr_t (*flush)(H5FD_t *file, hid_t dxpl_id, unsigned closing); herr_t (*truncate)(H5FD_t *file, hid_t dxpl_id, hbool_t closing); - herr_t (*lock)(H5FD_t *file, unsigned char *oid, unsigned lock_type, hbool_t last); - herr_t (*unlock)(H5FD_t *file, unsigned char *oid, hbool_t last); + herr_t (*lock)(H5FD_t *file, hbool_t last); + herr_t (*unlock)(H5FD_t *file); H5FD_mem_t fl_map[H5FD_MEM_NTYPES]; } H5FD_class_t; diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 546eb4f..958c1e0 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -152,7 +152,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name") - if(*s == (char)NULL) + if(*s == (char)'\0') HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "invalid external file name") mesg->slot[u].name = H5MM_xstrdup (s); HDassert(mesg->slot[u].name); diff --git a/src/H5Shyper.c b/src/H5Shyper.c index af37b81..6c94b4d 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -2131,7 +2131,6 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Check for a "regular" hyperslab selection */ if(space->select.sel_info.hslab->diminfo_valid) { - unsigned u; /* Local counting variable */ /* Encode number of hyperslabs */ H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 2054eb5..90391aa 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -8912,7 +8912,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Allocate enough space for the buffer holding temporary * converted value */ - buf_size = (size_t)HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1; + buf_size = (size_t) (HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1); int_buf = (uint8_t*)H5MM_calloc(buf_size); /* Get the plist structure. Do I need to close it? */ @@ -9709,7 +9709,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Check if the exponent is too big */ - expo_max = (hsize_t)HDpow((double)2.0f, (double)dst.u.f.esize) - 1; + expo_max = (hsize_t) (HDpow((double)2.0f, (double)dst.u.f.esize) - 1); if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index f519141..e7211f7 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -24,9 +24,9 @@ #include "H5MMpublic.h" /* Memory management */ /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Rprivate.h" /* References */ +#include "H5private.h" /* Generic Functions */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Rprivate.h" /* References */ /* Macro for size of temporary buffers to contain a single element */ #define H5T_ELEM_BUF_SIZE 256 @@ -138,6 +138,7 @@ H5_DLL uint32_t H5T_hash(H5F_t * file, const H5T_t *dt); H5_DLL herr_t H5T_set_latest_version(H5T_t *dt); H5_DLL herr_t H5T_patch_file(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt); +H5_DLL herr_t H5T_patch_vlen_file(H5T_t *dt, H5F_t *f); /* Reference specific functions */ H5_DLL H5R_type_t H5T_get_ref_type(const H5T_t *dt); |