summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2021-09-27 16:51:37 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2021-09-27 16:51:37 (GMT)
commit5115f8b7ac3a3b41d4bf1531815026017666a761 (patch)
tree96dfbc4ea48a6d441d9ffbbad16fb700451b30f2
parent57cd77c478e5828bb89708d0efe109629f88ac3e (diff)
downloadhdf5-5115f8b7ac3a3b41d4bf1531815026017666a761.zip
hdf5-5115f8b7ac3a3b41d4bf1531815026017666a761.tar.gz
hdf5-5115f8b7ac3a3b41d4bf1531815026017666a761.tar.bz2
Fix comments and run formatter.
-rw-r--r--src/H5.c13
-rw-r--r--src/H5Dchunk.c27
-rw-r--r--src/H5Dcompact.c5
-rw-r--r--src/H5Dcontig.c30
-rw-r--r--src/H5Defl.c6
-rw-r--r--src/H5Dio.c4
-rw-r--r--src/H5Dpkg.h5
-rw-r--r--src/H5FDint.c40
-rw-r--r--src/H5FDmpio.c48
-rw-r--r--src/H5FDprivate.h12
-rw-r--r--src/H5Fio.c9
-rw-r--r--src/H5Fprivate.h10
12 files changed, 106 insertions, 103 deletions
diff --git a/src/H5.c b/src/H5.c
index 0c7c8c1..f97fe31 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -147,8 +147,8 @@ done:
herr_t
H5_init_library(void)
{
- char *env_use_select_io = NULL;
- herr_t ret_value = SUCCEED;
+ char * env_use_select_io = NULL;
+ herr_t ret_value = SUCCEED;
/* Set the 'library initialized' flag as early as possible, to avoid
* possible re-entrancy.
@@ -281,11 +281,10 @@ H5_init_library(void)
/* Check for HDF5_USE_SELECTION_IO env variable */
env_use_select_io = HDgetenv("HDF5_USE_SELECTION_IO");
- if (NULL != env_use_select_io && HDstrcmp(env_use_select_io, "")
- && HDstrcmp(env_use_select_io, "0") && HDstrcmp(env_use_select_io, "no")
- && HDstrcmp(env_use_select_io, "No") && HDstrcmp(env_use_select_io, "NO")
- && HDstrcmp(env_use_select_io, "false") && HDstrcmp(env_use_select_io, "False")
- && HDstrcmp(env_use_select_io, "FALSE"))
+ if (NULL != env_use_select_io && HDstrcmp(env_use_select_io, "") && HDstrcmp(env_use_select_io, "0") &&
+ HDstrcmp(env_use_select_io, "no") && HDstrcmp(env_use_select_io, "No") &&
+ HDstrcmp(env_use_select_io, "NO") && HDstrcmp(env_use_select_io, "false") &&
+ HDstrcmp(env_use_select_io, "False") && HDstrcmp(env_use_select_io, "FALSE"))
H5_use_selection_io_g = TRUE;
/* Debugging? */
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index f11e717..8de023d 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -254,9 +254,8 @@ typedef struct H5D_chunk_coll_info_t {
/* Chunked layout operation callbacks */
static herr_t H5D__chunk_construct(H5F_t *f, H5D_t *dset);
static herr_t H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id);
-static herr_t H5D__chunk_io_init(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
- hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
- H5D_chunk_map_t *fm);
+static herr_t H5D__chunk_io_init(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts,
+ const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm);
static herr_t H5D__chunk_io_init_selections(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
H5D_chunk_map_t *fm);
static herr_t H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts,
@@ -1064,10 +1063,10 @@ H5D__chunk_io_init(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsi
hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */
htri_t file_space_normalized = FALSE; /* File dataspace was normalized */
unsigned f_ndims; /* The number of dimensions of the file's dataspace */
- int sm_ndims; /* The number of dimensions of the memory buffer's dataspace (signed) */
- htri_t use_selection_io = FALSE; /* Whether to use selection I/O */
- unsigned u; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ int sm_ndims; /* The number of dimensions of the memory buffer's dataspace (signed) */
+ htri_t use_selection_io = FALSE; /* Whether to use selection I/O */
+ unsigned u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -2541,7 +2540,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_
H5S_t * chunk_file_spaces_static[8]; /* Static buffer for chunk_file_spaces */
haddr_t * chunk_addrs = NULL; /* Array of chunk addresses */
haddr_t chunk_addrs_static[8]; /* Static buffer for chunk_addrs */
- herr_t ret_value = SUCCEED; /*return value */
+ herr_t ret_value = SUCCEED; /*return value */
FUNC_ENTER_STATIC
@@ -2651,8 +2650,9 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_
* already verified it won't be used, and the metadata accumulator
* because this is raw data) */
if (H5F_shared_select_read(H5F_SHARED(io_info->dset->oloc.file), H5FD_MEM_DRAW, (uint32_t)num_chunks,
- (const H5S_t * const *)chunk_mem_spaces, (const H5S_t * const *)chunk_file_spaces,
- chunk_addrs, element_sizes, bufs) < 0)
+ (const H5S_t *const *)chunk_mem_spaces,
+ (const H5S_t *const *)chunk_file_spaces, chunk_addrs, element_sizes,
+ bufs) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunk selection read failed")
/* Clean up memory */
@@ -2815,7 +2815,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize
H5S_t * chunk_file_spaces_static[8]; /* Static buffer for chunk_file_spaces */
haddr_t * chunk_addrs = NULL; /* Array of chunk addresses */
haddr_t chunk_addrs_static[8]; /* Static buffer for chunk_addrs */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -2985,8 +2985,9 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize
* already verified it won't be used, and the metadata accumulator
* because this is raw data) */
if (H5F_shared_select_write(H5F_SHARED(io_info->dset->oloc.file), H5FD_MEM_DRAW, (uint32_t)num_chunks,
- (const H5S_t * const *)chunk_mem_spaces, (const H5S_t * const *)chunk_file_spaces,
- chunk_addrs, element_sizes, bufs) < 0)
+ (const H5S_t *const *)chunk_mem_spaces,
+ (const H5S_t *const *)chunk_file_spaces, chunk_addrs, element_sizes,
+ bufs) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunk selection read failed")
/* Clean up memory */
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index 9a6d4b2..f68a93a 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -54,9 +54,8 @@
/* Layout operation callbacks */
static herr_t H5D__compact_construct(H5F_t *f, H5D_t *dset);
static hbool_t H5D__compact_is_space_alloc(const H5O_storage_t *storage);
-static herr_t H5D__compact_io_init(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
- hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
- H5D_chunk_map_t *cm);
+static herr_t H5D__compact_io_init(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts,
+ const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm);
static ssize_t H5D__compact_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq,
size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq,
size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]);
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index cf6f543..d7ebbee 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -91,9 +91,8 @@ typedef struct H5D_contig_writevv_ud_t {
/* Layout operation callbacks */
static herr_t H5D__contig_construct(H5F_t *f, H5D_t *dset);
static herr_t H5D__contig_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id);
-static herr_t H5D__contig_io_init(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
- hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
- H5D_chunk_map_t *cm);
+static herr_t H5D__contig_io_init(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts,
+ const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm);
static ssize_t H5D__contig_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq,
size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq,
size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]);
@@ -555,8 +554,8 @@ H5D__contig_io_init(H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED
hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space,
const H5S_t H5_ATTR_UNUSED *mem_space, H5D_chunk_map_t H5_ATTR_UNUSED *cm)
{
- htri_t use_selection_io = FALSE; /* Whether to use selection I/O */
- htri_t ret_value = SUCCEED; /* Return value */
+ htri_t use_selection_io = FALSE; /* Whether to use selection I/O */
+ htri_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -601,10 +600,10 @@ H5D__contig_may_use_select_io(const H5D_io_info_t *io_info, H5D_io_op_type_t op_
/* Don't use selection I/O if it's globally disabled, if there is a type
* conversion, or if it's not a contiguous dataset, or if the sieve buffer
* exists (write) or is dirty (read) */
- if (!H5_use_selection_io_g || io_info->io_ops.single_read != H5D__select_read
- || io_info->layout_ops.readvv != H5D__contig_readvv
- || (op_type == H5D_IO_OP_READ && io_info->dset->shared->cache.contig.sieve_dirty)
- || (op_type == H5D_IO_OP_WRITE && io_info->dset->shared->cache.contig.sieve_buf))
+ if (!H5_use_selection_io_g || io_info->io_ops.single_read != H5D__select_read ||
+ io_info->layout_ops.readvv != H5D__contig_readvv ||
+ (op_type == H5D_IO_OP_READ && io_info->dset->shared->cache.contig.sieve_dirty) ||
+ (op_type == H5D_IO_OP_WRITE && io_info->dset->shared->cache.contig.sieve_buf))
ret_value = FALSE;
else {
htri_t page_buf_enabled;
@@ -641,7 +640,7 @@ herr_t
H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts,
const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t H5_ATTR_UNUSED *fm)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -657,7 +656,7 @@ H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize
/* Issue selection I/O call (we can skip the page buffer because we've
* already verified it won't be used, and the metadata accumulator
- * because this is raw data) Only call funciton if nelmts > 0. */
+ * because this is raw data) */
if (H5F_shared_select_read(H5F_SHARED(io_info->dset->oloc.file), H5FD_MEM_DRAW, nelmts > 0 ? 1 : 0,
&mem_space, &file_space, &(io_info->store->contig.dset_addr),
&dst_type_size, &(io_info->u.rbuf)) < 0)
@@ -666,7 +665,7 @@ H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize
else
/* Read data through legacy (non-selection I/O) pathway */
if ((io_info->io_ops.single_read)(io_info, type_info, nelmts, file_space, mem_space) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "contiguous read failed")
+ HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "contiguous read failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -688,7 +687,7 @@ herr_t
H5D__contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts,
const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t H5_ATTR_UNUSED *fm)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -704,7 +703,7 @@ H5D__contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsiz
/* Issue selection I/O call (we can skip the page buffer because we've
* already verified it won't be used, and the metadata accumulator
- * because this is raw data). Only call funciton if nelmts > 0. */
+ * because this is raw data) */
if (H5F_shared_select_write(H5F_SHARED(io_info->dset->oloc.file), H5FD_MEM_DRAW, nelmts > 0 ? 1 : 0,
&mem_space, &file_space, &(io_info->store->contig.dset_addr),
&dst_type_size, &(io_info->u.wbuf)) < 0)
@@ -713,7 +712,7 @@ H5D__contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsiz
else
/* Write data through legacy (non-selection I/O) pathway */
if ((io_info->io_ops.single_write)(io_info, type_info, nelmts, file_space, mem_space) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "contiguous write failed")
+ HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "contiguous write failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1649,4 +1648,3 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__contig_copy() */
-
diff --git a/src/H5Defl.c b/src/H5Defl.c
index fea70b0..ce6d481 100644
--- a/src/H5Defl.c
+++ b/src/H5Defl.c
@@ -60,9 +60,9 @@ typedef struct H5D_efl_writevv_ud_t {
/********************/
/* Layout operation callbacks */
-static herr_t H5D__efl_construct(H5F_t *f, H5D_t *dset);
-static herr_t H5D__efl_io_init(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts,
- const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm);
+static herr_t H5D__efl_construct(H5F_t *f, H5D_t *dset);
+static herr_t H5D__efl_io_init(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts,
+ const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm);
static ssize_t H5D__efl_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq,
size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq,
size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]);
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 191ee5c..c7f8a3e 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -868,13 +868,13 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, const H5S_t *file_
* selection I/O is to be used - in this case the file driver will
* handle collective I/O */
/* Check for selection/vector support in file driver? -NAF */
- if(!io_info->use_select_io) {
+ if (!io_info->use_select_io) {
io_info->io_ops.multi_read = dset->shared->layout.ops->par_read;
io_info->io_ops.multi_write = dset->shared->layout.ops->par_write;
io_info->io_ops.single_read = H5D__mpio_select_read;
io_info->io_ops.single_write = H5D__mpio_select_write;
} /* end if */
- } /* end if */
+ } /* end if */
else {
/* Check if there are any filters in the pipeline. If there are,
* we cannot break to independent I/O if this is a write operation;
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index f9014a7..22712ee 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -121,9 +121,8 @@ typedef herr_t (*H5D_layout_construct_func_t)(H5F_t *f, H5D_t *dset);
typedef herr_t (*H5D_layout_init_func_t)(H5F_t *f, const H5D_t *dset, hid_t dapl_id);
typedef hbool_t (*H5D_layout_is_space_alloc_func_t)(const H5O_storage_t *storage);
typedef hbool_t (*H5D_layout_is_data_cached_func_t)(const H5D_shared_t *shared_dset);
-typedef herr_t (*H5D_layout_io_init_func_t)(struct H5D_io_info_t *io_info,
- const H5D_type_info_t *type_info, hsize_t nelmts,
- const H5S_t *file_space, const H5S_t *mem_space,
+typedef herr_t (*H5D_layout_io_init_func_t)(struct H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
+ hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
struct H5D_chunk_map_t *cm);
typedef herr_t (*H5D_layout_read_func_t)(struct H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
diff --git a/src/H5FDint.c b/src/H5FDint.c
index 69dbdc4..b23b918 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -712,7 +712,7 @@ done:
*/
static herr_t
H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
- const H5S_t * const *mem_spaces, const H5S_t * const *file_spaces,
+ const H5S_t *const *mem_spaces, const H5S_t *const *file_spaces,
haddr_t offsets[], size_t element_sizes[], void *bufs[] /* out */)
{
hbool_t extend_sizes = FALSE;
@@ -822,9 +822,9 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin
/* Initialize values so sequence lists are retrieved on the first
* iteration */
file_seq_i = H5FD_SEQ_LIST_LEN;
- mem_seq_i = H5FD_SEQ_LIST_LEN;
- file_nseq = 0;
- mem_nseq = 0;
+ mem_seq_i = H5FD_SEQ_LIST_LEN;
+ file_nseq = 0;
+ mem_nseq = 0;
/* Loop until all elements are processed */
while (file_seq_i < file_nseq || nelmts > 0) {
@@ -891,7 +891,8 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory reallocation failed for size list")
sizes = tmp_ptr;
- if (NULL == (tmp_ptr = H5MM_realloc(vec_bufs, vec_arr_nalloc * sizeof(*vec_bufs) * 2)))
+ if (NULL ==
+ (tmp_ptr = H5MM_realloc(vec_bufs, vec_arr_nalloc * sizeof(*vec_bufs) * 2)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory reallocation failed for buffer list")
vec_bufs = tmp_ptr;
@@ -1009,8 +1010,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, const H5S_t * const *mem_spaces,
- const H5S_t * const *file_spaces, haddr_t offsets[], size_t element_sizes[],
+H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, const H5S_t *const *mem_spaces,
+ const H5S_t *const *file_spaces, haddr_t offsets[], size_t element_sizes[],
void *bufs[] /* out */)
{
hbool_t offsets_cooked = FALSE;
@@ -1283,8 +1284,9 @@ H5FD_read_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_
}
/* Translate to vector or scalar I/O */
- if (H5FD__read_selection_translate(file, type, dxpl_id, count, (const H5S_t * const *)mem_spaces,
- (const H5S_t * const *)file_spaces, offsets, element_sizes, bufs) < 0)
+ if (H5FD__read_selection_translate(file, type, dxpl_id, count, (const H5S_t *const *)mem_spaces,
+ (const H5S_t *const *)file_spaces, offsets, element_sizes,
+ bufs) < 0)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "translation to vector or scalar read failed")
}
@@ -1330,7 +1332,7 @@ done:
*/
static herr_t
H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
- const H5S_t * const *mem_spaces, const H5S_t * const *file_spaces,
+ const H5S_t *const *mem_spaces, const H5S_t *const *file_spaces,
haddr_t offsets[], size_t element_sizes[], const void *bufs[])
{
hbool_t extend_sizes = FALSE;
@@ -1440,9 +1442,9 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui
/* Initialize values so sequence lists are retrieved on the first
* iteration */
file_seq_i = H5FD_SEQ_LIST_LEN;
- mem_seq_i = H5FD_SEQ_LIST_LEN;
- file_nseq = 0;
- mem_nseq = 0;
+ mem_seq_i = H5FD_SEQ_LIST_LEN;
+ file_nseq = 0;
+ mem_nseq = 0;
/* Loop until all elements are processed */
while (file_seq_i < file_nseq || nelmts > 0) {
@@ -1509,7 +1511,8 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory reallocation failed for size list")
sizes = tmp_ptr;
- if (NULL == (tmp_ptr = H5MM_realloc(vec_bufs, vec_arr_nalloc * sizeof(*vec_bufs) * 2)))
+ if (NULL ==
+ (tmp_ptr = H5MM_realloc(vec_bufs, vec_arr_nalloc * sizeof(*vec_bufs) * 2)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory reallocation failed for buffer list")
vec_bufs = tmp_ptr;
@@ -1625,8 +1628,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, const H5S_t * const *mem_spaces,
- const H5S_t * const *file_spaces, haddr_t offsets[], size_t element_sizes[],
+H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, const H5S_t *const *mem_spaces,
+ const H5S_t *const *file_spaces, haddr_t offsets[], size_t element_sizes[],
const void *bufs[])
{
hbool_t offsets_cooked = FALSE;
@@ -1884,8 +1887,9 @@ H5FD_write_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem
}
/* Translate to vector or scalar I/O */
- if (H5FD__write_selection_translate(file, type, dxpl_id, count, (const H5S_t * const *)mem_spaces,
- (const H5S_t * const *)file_spaces, offsets, element_sizes, bufs) < 0)
+ if (H5FD__write_selection_translate(file, type, dxpl_id, count, (const H5S_t *const *)mem_spaces,
+ (const H5S_t *const *)file_spaces, offsets, element_sizes,
+ bufs) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "translation to vector or scalar write failed")
}
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 6a6dd2b..707715d 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -1281,7 +1281,7 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
#endif
HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", 0)
- /* Get the type's size */
+ /* Get the type's size */
#if MPI_VERSION >= 3
if (MPI_SUCCESS != (mpi_code = MPI_Type_size_x(buf_type, &type_size)))
#else
@@ -1570,9 +1570,9 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
hbool_t vector_was_sorted = TRUE;
hbool_t fixed_size = FALSE;
size_t size;
- H5FD_mem_t * s_types = NULL;
- haddr_t * s_addrs = NULL;
- size_t * s_sizes = NULL;
+ H5FD_mem_t * s_types = NULL;
+ haddr_t * s_addrs = NULL;
+ size_t * s_sizes = NULL;
size_t s_size;
void ** s_bufs = NULL;
int * mpi_block_lengths = NULL;
@@ -1594,18 +1594,18 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
H5FD_mpio_collective_opt_t coll_opt_mode; /* whether we are doing collective or independent I/O */
int size_i;
#if MPI_VERSION >= 3
- MPI_Count bytes_read = 0; /* Number of bytes read in */
- MPI_Count type_size; /* MPI datatype used for I/O's size */
- MPI_Count io_size; /* Actual number of bytes requested */
- MPI_Count n;
+ MPI_Count bytes_read = 0; /* Number of bytes read in */
+ MPI_Count type_size; /* MPI datatype used for I/O's size */
+ MPI_Count io_size; /* Actual number of bytes requested */
+ MPI_Count n;
#else
- int bytes_read = 0; /* Number of bytes read in */
- int type_size; /* MPI datatype used for I/O's size */
- int io_size; /* Actual number of bytes requested */
- int n;
+ int bytes_read = 0; /* Number of bytes read in */
+ int type_size; /* MPI datatype used for I/O's size */
+ int io_size; /* Actual number of bytes requested */
+ int n;
#endif
- hbool_t rank0_bcast = FALSE; /* If read-with-rank0-and-bcast flag was used */
- herr_t ret_value = SUCCEED;
+ hbool_t rank0_bcast = FALSE; /* If read-with-rank0-and-bcast flag was used */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
@@ -1644,14 +1644,14 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
if (count == 1) {
/* Single block. Just use a series of MPI_BYTEs for the file view.
*/
- size_i = (int)sizes[0];
- buf_type = MPI_BYTE;
- file_type = MPI_BYTE;
+ size_i = (int)sizes[0];
+ buf_type = MPI_BYTE;
+ file_type = MPI_BYTE;
mpi_bufs_base = bufs[0];
/* Setup s_sizes (needed for incomplete read filling code) */
vector_was_sorted = TRUE;
- s_sizes = sizes;
+ s_sizes = sizes;
/* some numeric conversions */
if (H5FD_mpi_haddr_to_MPIOff(addrs[0], &mpi_off) < 0)
@@ -1668,8 +1668,8 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
* are allocated, populated, and returned in s_types, s_addrs, s_sizes, and s_bufs respectively.
* In this case, this function must free the memory allocated for the sorted vectors.
*/
- if (H5FD_sort_vector_io_req(&vector_was_sorted, count, types, addrs, sizes, bufs, &s_types, &s_addrs,
- &s_sizes, &s_bufs) < 0)
+ if (H5FD_sort_vector_io_req(&vector_was_sorted, count, types, addrs, sizes, bufs, &s_types,
+ &s_addrs, &s_sizes, &s_bufs) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't sort vector I/O request")
if ((NULL == (mpi_block_lengths = (int *)HDmalloc((size_t)count * sizeof(int)))) ||
@@ -1890,7 +1890,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
#endif
HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", 0)
- /* Get the type's size */
+ /* Get the type's size */
#if MPI_VERSION >= 3
if (MPI_SUCCESS != (mpi_code = MPI_Type_size_x(buf_type, &type_size)))
#else
@@ -1916,10 +1916,10 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
HDassert(i >= 0);
#if MPI_VERSION >= 3
- io_size = MIN(n, (MPI_Count)s_sizes[i]);
+ io_size = MIN(n, (MPI_Count)s_sizes[i]);
bytes_read = (MPI_Count)s_sizes[i] - io_size;
#else
- io_size = MIN(n, (int)s_sizes[i]);
+ io_size = MIN(n, (int)s_sizes[i]);
bytes_read = (int)s_sizes[i] - io_size;
#endif
HDassert(bytes_read >= 0);
@@ -1984,7 +1984,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code)
- /* How many bytes were actually read? */
+ /* How many bytes were actually read? */
#if MPI_VERSION >= 3
if (MPI_SUCCESS != (mpi_code = MPI_Get_elements_x(&mpi_stat, MPI_BYTE, &bytes_read)))
#else
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index 03b1e9e..60784f4 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -129,12 +129,12 @@ H5_DLL herr_t H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[]
size_t sizes[], void *bufs[] /* out */);
H5_DLL herr_t H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs[],
size_t sizes[], const void *bufs[] /* out */);
-H5_DLL herr_t H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, const H5S_t * const *mem_spaces,
- const H5S_t * const *file_spaces, haddr_t offsets[], size_t element_sizes[],
- void *bufs[] /* out */);
-H5_DLL herr_t H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, const H5S_t * const *mem_spaces,
- const H5S_t * const *file_spaces, haddr_t offsets[], size_t element_sizes[],
- const void *bufs[]);
+H5_DLL herr_t H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count,
+ const H5S_t *const *mem_spaces, const H5S_t *const *file_spaces,
+ haddr_t offsets[], size_t element_sizes[], void *bufs[] /* out */);
+H5_DLL herr_t H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count,
+ const H5S_t *const *mem_spaces, const H5S_t *const *file_spaces,
+ haddr_t offsets[], size_t element_sizes[], const void *bufs[]);
H5_DLL herr_t H5FD_read_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_space_ids[],
hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[],
void *bufs[] /* out */);
diff --git a/src/H5Fio.c b/src/H5Fio.c
index 9982dbc..123fe40 100644
--- a/src/H5Fio.c
+++ b/src/H5Fio.c
@@ -254,8 +254,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F_shared_select_read(H5F_shared_t *f_sh, H5FD_mem_t type, uint32_t count, const H5S_t * const *mem_spaces,
- const H5S_t * const *file_spaces, haddr_t offsets[], size_t element_sizes[],
+H5F_shared_select_read(H5F_shared_t *f_sh, H5FD_mem_t type, uint32_t count, const H5S_t *const *mem_spaces,
+ const H5S_t *const *file_spaces, haddr_t offsets[], size_t element_sizes[],
void *bufs[] /* out */)
{
H5FD_mem_t map_type; /* Mapped memory type */
@@ -300,8 +300,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F_shared_select_write(H5F_shared_t *f_sh, H5FD_mem_t type, uint32_t count, const H5S_t * const *mem_spaces,
- const H5S_t * const *file_spaces, haddr_t offsets[], size_t element_sizes[], const void *bufs[])
+H5F_shared_select_write(H5F_shared_t *f_sh, H5FD_mem_t type, uint32_t count, const H5S_t *const *mem_spaces,
+ const H5S_t *const *file_spaces, haddr_t offsets[], size_t element_sizes[],
+ const void *bufs[])
{
H5FD_mem_t map_type; /* Mapped memory type */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index cd9682d..2779a2b 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -924,11 +924,13 @@ H5_DLL herr_t H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t si
/* Functions that operate on selections of elements in the file */
H5_DLL herr_t H5F_shared_select_read(H5F_shared_t *f_sh, H5FD_mem_t type, uint32_t count,
- const struct H5S_t * const *mem_spaces, const struct H5S_t * const *file_spaces,
- haddr_t offsets[], size_t element_sizes[], void *bufs[] /* out */);
+ const struct H5S_t *const *mem_spaces,
+ const struct H5S_t *const *file_spaces, haddr_t offsets[],
+ size_t element_sizes[], void *bufs[] /* out */);
H5_DLL herr_t H5F_shared_select_write(H5F_shared_t *f_sh, H5FD_mem_t type, uint32_t count,
- const struct H5S_t * const *mem_spaces, const struct H5S_t * const *file_spaces,
- haddr_t offsets[], size_t element_sizes[], const void *bufs[]);
+ const struct H5S_t *const *mem_spaces,
+ const struct H5S_t *const *file_spaces, haddr_t offsets[],
+ size_t element_sizes[], const void *bufs[]);
/* Functions that flush or evict */
H5_DLL herr_t H5F_flush_tagged_metadata(H5F_t *f, haddr_t tag);