summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-01-31 19:53:26 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-01-31 19:53:26 (GMT)
commitd42bee368850f0bf47ee3a708e3c5d8b7119a632 (patch)
tree485fee1f9156c7c21b57d1cf48967a7c2dd0fc5c /src
parent561a0c8ff556f7b3cee58eb867ae1aa74edc61a2 (diff)
downloadhdf5-d42bee368850f0bf47ee3a708e3c5d8b7119a632.zip
hdf5-d42bee368850f0bf47ee3a708e3c5d8b7119a632.tar.gz
hdf5-d42bee368850f0bf47ee3a708e3c5d8b7119a632.tar.bz2
Squashed commit of the following:
commit ff7a9a34de2fcd78f5d32a1532f3d0e224b20d94 Author: Kimmy Mu <kmu@hdfgroup.org> Date: Wed Jan 29 14:12:18 2020 -0600 Merge pull request #2324 in HDFFV/hdf5 from ~KMU/hdf5:hdf5_1_12 to hdf5_1_12 * commit '781fa57f6ee816e037dd12fff02d37ff7ec9c2b1': pick up missing piece from merge Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop remove redundent definition Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop Merge pull request #2315 in HDFFV/hdf5 from ~KMU/hdf5:develop to develop missing prototype warning prototype issue Merge pull request #2306 in HDFFV/hdf5 from ~KMU/hdf5:develop to develop Merge pull request #2300 in HDFFV/hdf5 from ~KMU/hdf5:squashed_cast to develop Merge pull request #2291 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/uninitialized to develop Merge pull request #2295 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/float to develop Merge pull request #2292 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/prototype to develop Merge pull request #2094 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/unused to develop commit 9f3d808c05d2a3b308f32c958c6671fcac0a432c Author: David Young <dyoung@hdfgroup.org> Date: Wed Jan 29 11:43:55 2020 -0600 testpar/t_2Gio.c: Fix a typo that I think was introduced by a previous warnings PR. An array element was assigned to itself---shape[2]Â =Â shape[2];---instead of being assigned to chunk[2]. fortran/src/H5Pf.c: move conditional compilation controlled by H5_NO_DEPRECATED_SYMBOLS outside of a function for readability. fortran/src/H5match_types.c: put a variable's declaration under the same conditional compilation (H5_FORTRAN_HAVE_C_LONG_DOUBLE) as its use. For now, skip compilation of some unused debug dump routines in the JNI. While I'm in the JNI, delete a set-but-unused variable. src/H5Z.c: condition a variable declaration on H5_NO_DEPRECATED_SYMBOLS so that it's not declared but unused or vice versa. test/cache_common.h: add an #include in to get some symbols we need to avoid implicit declaration warnings. test/dsets.c: use a more conventional conditional-compilation syntax. test/dt_arith.c, test/fillval.c: initialize a bunch of uninitialized variables before use. test/vfd.c: pass the expected type of `void **` to posix_memalign(3) instead of `int **`. testpar/t_bigio.c: explicitly compare with 0 instead of using ! when "equal to 0?" is the question not "is false?" Repair some indentation while I'm here. testpar/testpar.h: repair misaligned line-continuation backslashes in a macro that probably should be a function so that we don't have to fiddle with the line continuation to begin with. tools/src/h5repack/h5repack_main.c: fix some compiler fussing about enums. tools/test/perform/pio_engine.c: the compiler fusses if you cast a function call returning double directly to off_t. It's ok if you cast a variable that's a double to off_t, however. Write and use a new function, sqrto(), to avoid the cast warnings. commit 43a4b80b21c0329fbc1f9a0e2854795189f0bb50 Author: David Young <dyoung@hdfgroup.org> Date: Wed Jan 29 10:47:30 2020 -0600 Reduce casts of HDcalloc()/HDmalloc() that -Wc++-compat required. Reduce gratuitous casts---e.g., (size_t)1. Use the right format string for a pointer. In the H5C sanity checks, change a "size increase" variable from ssize_t (too narrow) to int64_t (wide enough). Parenthesize every appearance of `storage` in the macro `H5D_CHUNK_STORAGE_INDEX_CHK(storage)` so that you can pass in an expression like &sc and it works properly. Disallow re-assignment of the `dset` parameter to H5D__chunk_init() because it helped assure me that it's safe to replace the repeating expression `&dset->shared->layout.storage.u.chunk` with `sc` throughout. Replace lengthy expressions such as `&dset->shared->layout.storage.u.chunk` with `sc` throughout several functions in H5Dchunk.c ISTR that the compiler warned that `sc` was declared but unused in a couple of functions, and then I found that `sc` could be used in many places. Maybe the disused `sc` appeared because a bunch of code was copied and pasted, I don't know. Anyway, it's a lot tighter code now that I use `sc`. In H5D__chunk_update_old_edge_chunks() and H5D__chunk_delete() I actually expand `sc` and another temporary variable, `pline`, because they're used only in !defined(NDEBUG) code. This squashes unused-variable warnings in the defined(NDEBUG) configuration. Don't drop the `volatile` qualification with a cast in tools/src/h5import/h5import.c. commit 035bfa0769a4012881fc659b673bacf44d146537 Author: David Young <dyoung@hdfgroup.org> Date: Tue Jan 28 20:35:28 2020 -0600 Reduce differences between my -Werror branch and `develop`: Rename index -> idx, fileno -> fnumber, fileno -> fno to avoid GCC shadowed declaration warnings about index(3). Convert #pragma GCC diagnostic push/pop/ignored to the HDF5 library's H5_GCC_DIAG_OFF()/H5_GCC_DIAG_ON() macros.
Diffstat (limited to 'src')
-rw-r--r--src/H5B.c2
-rw-r--r--src/H5Cdbg.c5
-rw-r--r--src/H5Cpkg.h2
-rw-r--r--src/H5Dchunk.c101
-rw-r--r--src/H5Dint.c5
-rw-r--r--src/H5Dio.c15
-rw-r--r--src/H5F.c10
-rw-r--r--src/H5FDdirect.c16
-rw-r--r--src/H5FDfamily.c10
-rw-r--r--src/H5FDmulti.c5
-rw-r--r--src/H5Fsuper_cache.c14
-rw-r--r--src/H5PL.c32
-rw-r--r--src/H5PLint.c5
-rw-r--r--src/H5PLpath.c64
-rw-r--r--src/H5PLplugin_cache.c5
-rw-r--r--src/H5Pdcpl.c62
-rw-r--r--src/H5Tnative.c15
-rw-r--r--src/H5VLnative_file.c4
-rw-r--r--src/H5VLpassthru.c12
-rw-r--r--src/H5Z.c4
-rw-r--r--src/H5detect.c3
-rw-r--r--src/H5system.c5
22 files changed, 195 insertions, 201 deletions
diff --git a/src/H5B.c b/src/H5B.c
index 4c1abfd..f909d90 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -2037,7 +2037,7 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr)
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, NULL)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
- HDassert((H5B_shared_t *)H5UC_GET_OBJ(rc_shared));
+ HDassert(H5UC_GET_OBJ(rc_shared) != NULL);
/*
* Load the tree node.
diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c
index 1f55e86..cb1d0e2 100644
--- a/src/H5Cdbg.c
+++ b/src/H5Cdbg.c
@@ -319,9 +319,8 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn)
(int)(entry_ptr->is_dirty),
entry_ptr->type->name);
- HDfprintf(stdout, " node_ptr = 0x%llx, item = %p\n",
- (unsigned long long)node_ptr,
- H5SL_item(node_ptr));
+ HDfprintf(stdout, " node_ptr = %p, item = %p\n",
+ node_ptr, H5SL_item(node_ptr));
/* increment node_ptr before we delete its target */
node_ptr = H5SL_next(node_ptr);
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index cafc6d5..6608bc2 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -4694,7 +4694,7 @@ struct H5C_t {
uint32_t num_last_entries;
#if H5C_DO_SANITY_CHECKS
int32_t slist_len_increase;
- ssize_t slist_size_increase;
+ int64_t slist_size_increase;
#endif /* H5C_DO_SANITY_CHECKS */
/* Fields for maintaining list of tagged entries */
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 8d1ba80..b06c9e5 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -74,12 +74,12 @@
/* Sanity check on chunk index types: commonly used by a lot of routines in this file */
#define H5D_CHUNK_STORAGE_INDEX_CHK(storage) \
- HDassert((H5D_CHUNK_IDX_EARRAY == storage->idx_type && H5D_COPS_EARRAY == storage->ops) || \
- (H5D_CHUNK_IDX_FARRAY == storage->idx_type && H5D_COPS_FARRAY == storage->ops) || \
- (H5D_CHUNK_IDX_BT2 == storage->idx_type && H5D_COPS_BT2 == storage->ops) || \
- (H5D_CHUNK_IDX_BTREE == storage->idx_type && H5D_COPS_BTREE == storage->ops) || \
- (H5D_CHUNK_IDX_SINGLE == storage->idx_type && H5D_COPS_SINGLE == storage->ops) || \
- (H5D_CHUNK_IDX_NONE == storage->idx_type && H5D_COPS_NONE == storage->ops));
+ HDassert((H5D_CHUNK_IDX_EARRAY == (storage)->idx_type && H5D_COPS_EARRAY == (storage)->ops) || \
+ (H5D_CHUNK_IDX_FARRAY == (storage)->idx_type && H5D_COPS_FARRAY == (storage)->ops) || \
+ (H5D_CHUNK_IDX_BT2 == (storage)->idx_type && H5D_COPS_BT2 == (storage)->ops) || \
+ (H5D_CHUNK_IDX_BTREE == (storage)->idx_type && H5D_COPS_BTREE == (storage)->ops) || \
+ (H5D_CHUNK_IDX_SINGLE == (storage)->idx_type && H5D_COPS_SINGLE == (storage)->ops) || \
+ (H5D_CHUNK_IDX_NONE == (storage)->idx_type && H5D_COPS_NONE == (storage)->ops));
/*
* Feature: If this constant is defined then every cache preemption and load
@@ -936,7 +936,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id)
+H5D__chunk_init(H5F_t *f, const H5D_t * const dset, hid_t dapl_id)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */
@@ -1012,11 +1012,11 @@ H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id)
idx_info.f = f;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.storage = sc;
/* Allocate any indexing structures */
- if(dset->shared->layout.storage.u.chunk.ops->init && (dset->shared->layout.storage.u.chunk.ops->init)(&idx_info, dset->shared->space, dset->oloc.addr) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information")
+ if(sc->ops->init && (sc->ops->init)(&idx_info, dset->shared->space, dset->oloc.addr) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information")
/* Set the number of chunks in dataset, etc. */
if(H5D__chunk_set_info(dset) < 0)
@@ -1052,7 +1052,7 @@ H5D__chunk_is_space_alloc(const H5O_storage_t *storage)
H5D_CHUNK_STORAGE_INDEX_CHK(sc);
/* Query index layer */
- ret_value = (storage->u.chunk.ops->is_space_alloc)(&storage->u.chunk);
+ ret_value = (sc->ops->is_space_alloc)(sc);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_is_space_alloc() */
@@ -2931,12 +2931,11 @@ H5D__chunk_dest(H5D_t *dset)
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.storage = sc;
/* Free any index structures */
- if(dset->shared->layout.storage.u.chunk.ops->dest &&
- (dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
+ if(sc->ops->dest && (sc->ops->dest)(&idx_info) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
@@ -3132,11 +3131,11 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/)
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.storage = sc;
/* Create the index for the chunks */
- if((dset->shared->layout.storage.u.chunk.ops->create)(&idx_info) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index")
+ if((sc->ops->create)(&idx_info) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create chunk index")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -3219,7 +3218,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled,
/* Initialize the query information about the chunk we are looking for */
udata->common.layout = &(dset->shared->layout.u.chunk);
- udata->common.storage = &(dset->shared->layout.storage.u.chunk);
+ udata->common.storage = sc;
udata->common.scaled = scaled;
/* Reset information about the chunk we are looking for */
@@ -3269,7 +3268,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled,
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.storage = sc;
#ifdef H5_HAVE_PARALLEL
/* Disable collective metadata read for chunk indexes as it is
@@ -3281,7 +3280,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled,
#endif /* H5_HAVE_PARALLEL */
/* Go get the chunk information */
- if((dset->shared->layout.storage.u.chunk.ops->get_addr)(&idx_info, udata) < 0)
+ if((sc->ops->get_addr)(&idx_info, udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query chunk address")
/*
@@ -3367,7 +3366,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset)
/* Set up user data for index callbacks */
udata.common.layout = &dset->shared->layout.u.chunk;
- udata.common.storage = &dset->shared->layout.storage.u.chunk;
+ udata.common.storage = sc;
udata.common.scaled = ent->scaled;
udata.chunk_block.offset = ent->chunk_block.offset;
udata.chunk_block.length = dset->shared->layout.u.chunk.size;
@@ -3452,7 +3451,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset)
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.storage = sc;
/* Create the chunk it if it doesn't exist, or reallocate the chunk
* if its size changed.
@@ -3472,8 +3471,8 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file")
/* Insert the chunk record into the index */
- if(need_insert && dset->shared->layout.storage.u.chunk.ops->insert)
- if((dset->shared->layout.storage.u.chunk.ops->insert)(&idx_info, &udata, dset) < 0)
+ if(need_insert && sc->ops->insert)
+ if((sc->ops->insert)(&idx_info, &udata, dset) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert chunk addr into index")
/* Cache the chunk's info, in case it's accessed again shortly */
@@ -4282,10 +4281,10 @@ H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes)
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.storage = sc;
/* Iterate over the chunks */
- if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_allocated_cb, &chunk_bytes) < 0)
+ if((sc->ops->iterate)(&idx_info, H5D__chunk_allocated_cb, &chunk_bytes) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve allocated chunk information from index")
/* Set number of bytes for caller */
@@ -4484,7 +4483,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.storage = sc;
/* Loop over all chunks */
/* The algorithm is:
@@ -4555,7 +4554,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
#ifndef NDEBUG
/* None of the chunks should be allocated */
- if(H5D_CHUNK_IDX_NONE != layout->storage.u.chunk.idx_type) {
+ if(H5D_CHUNK_IDX_NONE != sc->idx_type) {
HDassert(!H5F_addr_defined(udata.chunk_block.offset));
}
@@ -4630,7 +4629,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
/* Initialize the chunk information */
udata.common.layout = &layout->u.chunk;
- udata.common.storage = &layout->storage.u.chunk;
+ udata.common.storage = sc;
udata.common.scaled = scaled;
udata.chunk_block.offset = HADDR_UNDEF;
H5_CHECKED_ASSIGN(udata.chunk_block.length, uint32_t, chunk_size, size_t);
@@ -4780,7 +4779,6 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[])
hsize_t max_edge_chunk_sc[H5O_LAYOUT_NDIMS]; /* largest offset of chunks that might need to be modified in each dimension */
hbool_t new_full_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of chunks in this dimension needs to be modified */
const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */
- const H5O_pline_t *pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info */
hsize_t chunk_sc[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */
const uint32_t *chunk_dim = layout->u.chunk.dim; /* Convenience pointer to chunk dimensions */
unsigned space_ndims; /* Dataset's space rank */
@@ -4791,7 +4789,6 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[])
H5D_storage_t chk_store; /* Chunk storage information */
void *chunk; /* The file chunk */
hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */
- const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk);
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -4799,8 +4796,8 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[])
/* Check args */
HDassert(dset && H5D_CHUNKED == layout->type);
HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS);
- H5D_CHUNK_STORAGE_INDEX_CHK(sc);
- HDassert(pline->nused > 0);
+ H5D_CHUNK_STORAGE_INDEX_CHK(&layout->storage.u.chunk);
+ HDassert(dset->shared->dcpl_cache.pline.nused > 0);
HDassert(layout->u.chunk.flags
& H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS);
@@ -5393,7 +5390,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
/* Initialize the user data for the iteration */
HDmemset(&udata, 0, sizeof udata);
udata.common.layout = &layout->u.chunk;
- udata.common.storage = &layout->storage.u.chunk;
+ udata.common.storage = sc;
udata.common.scaled = scaled;
udata.io_info = &chk_io_info;
udata.idx_info = &idx_info;
@@ -5406,7 +5403,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
/* Initialize user data for removal */
idx_udata.layout = &layout->u.chunk;
- idx_udata.storage = &layout->storage.u.chunk;
+ idx_udata.storage = sc;
/* Determine if partial edge chunk filters are disabled */
disable_edge_filters = (layout->u.chunk.flags
@@ -5563,7 +5560,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
idx_udata.scaled = udata.common.scaled;
/* Remove the chunk from disk */
- if((layout->storage.u.chunk.ops->remove)(&idx_info, &idx_udata) < 0)
+ if((sc->ops->remove)(&idx_info, &idx_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to remove chunk entry from index")
} /* end if */
} /* end else */
@@ -5693,17 +5690,17 @@ H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[])
/* Set up user data for B-tree callback */
HDmemset(&udata, 0, sizeof(udata));
udata.common.layout = &dset->shared->layout.u.chunk;
- udata.common.storage = &dset->shared->layout.storage.u.chunk;
+ udata.common.storage = sc;
udata.chunk_addr = chunk_addr;
/* Compose chunked index info struct */
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.storage = sc;
/* Iterate over chunks to build mapping of chunk addresses */
- if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_addrmap_cb, &udata) < 0)
+ if((sc->ops->iterate)(&idx_info, H5D__chunk_addrmap_cb, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to iterate over chunk index to build address map")
done:
@@ -5734,7 +5731,6 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage)
H5O_pline_t pline; /* I/O pipeline message */
hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */
htri_t exists; /* Flag if header message of interest exists */
- H5O_storage_chunk_t *sc = &(storage->u.chunk);
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -5743,7 +5739,7 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage)
HDassert(f);
HDassert(oh);
HDassert(storage);
- H5D_CHUNK_STORAGE_INDEX_CHK(sc);
+ H5D_CHUNK_STORAGE_INDEX_CHK(&storage->u.chunk);
/* Check for I/O pipeline message */
if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0)
@@ -6470,26 +6466,25 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout,
idx_info.f = loc->file;
idx_info.pline = &pline;
idx_info.layout = &layout->u.chunk;
- idx_info.storage = &layout->storage.u.chunk;
+ idx_info.storage = sc;
/* Get the dataspace for the dataset */
if(NULL == (space = H5S_read(loc)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header")
/* Allocate any indexing structures */
- if(layout->storage.u.chunk.ops->init && (layout->storage.u.chunk.ops->init)(&idx_info, space, loc->addr) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information")
+ if(sc->ops->init && (sc->ops->init)(&idx_info, space, loc->addr) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information")
idx_info_init = TRUE;
/* Get size of index structure */
- if(layout->storage.u.chunk.ops->size && (layout->storage.u.chunk.ops->size)(&idx_info, index_size) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve chunk index info")
+ if(sc->ops->size && (sc->ops->size)(&idx_info, index_size) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve chunk index info")
done:
/* Free resources, if they've been initialized */
- if(idx_info_init && layout->storage.u.chunk.ops->dest &&
- (layout->storage.u.chunk.ops->dest)(&idx_info) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
+ if(idx_info_init && sc->ops->dest && (sc->ops->dest)(&idx_info) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
if(pline_read && H5O_msg_reset(H5O_PLINE_ID, &pline) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline message")
if(space && H5S_close(space) < 0)
@@ -6576,14 +6571,14 @@ H5D__chunk_dump_index(H5D_t *dset, FILE *stream)
H5D_chunk_it_ud4_t udata; /* User data for callback */
/* Display info for index */
- if((dset->shared->layout.storage.u.chunk.ops->dump)(&dset->shared->layout.storage.u.chunk, stream) < 0)
+ if((sc->ops->dump)(sc, stream) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to dump chunk index info")
/* Compose chunked index info struct */
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.storage = sc;
/* Set up user data for callback */
udata.stream = stream;
@@ -6592,7 +6587,7 @@ H5D__chunk_dump_index(H5D_t *dset, FILE *stream)
udata.chunk_dim = dset->shared->layout.u.chunk.dim;
/* Iterate over index and dump chunk info */
- if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_dump_index_cb, &udata) < 0)
+ if((sc->ops->iterate)(&idx_info, H5D__chunk_dump_index_cb, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to dump chunk info")
} /* end if */
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 436a507..0d67fd0 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -133,11 +133,10 @@ H5FL_EXTERN(H5D_chunk_info_t);
H5FL_BLK_EXTERN(type_conv);
/* Disable warning for intentional identical branches here -QAK */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wlarger-than="
+H5_GCC_DIAG_OFF(larger-than=)
/* Define a static "default" dataset structure to use to initialize new datasets */
static H5D_shared_t H5D_def_dset;
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(larger-than=)
/* Dataset ID class */
static const H5I_class_t H5I_DATASET_CLS[1] = {{
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 0f4e703..3d49df7 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -1131,7 +1131,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset,
uint32_t global_no_collective_cause;
hbool_t local_error_message_previously_written = FALSE;
hbool_t global_error_message_previously_written = FALSE;
- size_t index;
+ size_t idx;
size_t cause_strings_len;
char local_no_collective_cause_string[512] = "";
char global_no_collective_cause_string[512] = "";
@@ -1153,8 +1153,11 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset,
/* Append each of the "reason for breaking collective I/O" error messages to the
* local and global no collective cause strings */
- for (cause = 1, index = 0; (cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE) && (index < cause_strings_len); cause <<= 1, index++) {
- size_t cause_strlen = HDstrlen(cause_strings[index]);
+ for (cause = 1, idx = 0;
+ (cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE) &&
+ (idx < cause_strings_len);
+ cause <<= 1, idx++) {
+ size_t cause_strlen = HDstrlen(cause_strings[idx]);
if (cause & local_no_collective_cause) {
/* Check if there were any previous error messages included. If so, prepend a semicolon
@@ -1163,7 +1166,8 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset,
if(local_error_message_previously_written)
HDstrncat(local_no_collective_cause_string, "; ", 2);
- HDstrncat(local_no_collective_cause_string, cause_strings[index], cause_strlen);
+ HDstrncat(local_no_collective_cause_string,
+ cause_strings[idx], cause_strlen);
local_error_message_previously_written = TRUE;
} /* end if */
@@ -1175,7 +1179,8 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset,
if(global_error_message_previously_written)
HDstrncat(global_no_collective_cause_string, "; ", 2);
- HDstrncat(global_no_collective_cause_string, cause_strings[index], cause_strlen);
+ HDstrncat(global_no_collective_cause_string,
+ cause_strings[idx], cause_strlen);
global_error_message_previously_written = TRUE;
} /* end if */
diff --git a/src/H5F.c b/src/H5F.c
index 50473fe..b623491 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1059,15 +1059,15 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_fileno(hid_t file_id, unsigned long *fileno)
+H5Fget_fileno(hid_t file_id, unsigned long *fnumber)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Ul", file_id, fileno);
+ H5TRACE2("e", "i*Ul", file_id, fnumber);
- /* If no fileno pointer was passed in, exit quietly */
- if(fileno) {
+ /* If no fnumber pointer was passed in, exit quietly */
+ if(fnumber) {
H5VL_object_t *vol_obj; /* File info */
/* Get the internal file structure */
@@ -1075,7 +1075,7 @@ H5Fget_fileno(hid_t file_id, unsigned long *fileno)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
/* Get the flags */
- if((ret_value = H5VL_file_get(vol_obj, H5VL_FILE_GET_FILENO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fileno)) < 0)
+ if((ret_value = H5VL_file_get(vol_obj, H5VL_FILE_GET_FILENO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fnumber)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file's 'file number'")
} /* end if */
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 33a0ef4..ce5e081 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -459,8 +459,8 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
#endif
h5_stat_t sb;
H5P_genplist_t *plist; /* Property list */
- int *buf1, *buf2;
- H5FD_t *ret_value;
+ void *buf1, *buf2;
+ H5FD_t *ret_value = NULL;
FUNC_ENTER_NOAPI_NOINIT
@@ -525,13 +525,13 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
/* NOTE: Use HDmalloc and HDfree here to ensure compatibility with
* HDposix_memalign.
*/
- buf1 = (int *)HDmalloc(sizeof(int));
+ buf1 = HDmalloc(sizeof(int));
if(HDposix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed")
if(o_flags & O_CREAT) {
- if(HDwrite(file->fd, (void*)buf1, sizeof(int))<0) {
- if(HDwrite(file->fd, (void*)buf2, file->fa.fbsize)<0)
+ if(HDwrite(file->fd, buf1, sizeof(int))<0) {
+ if(HDwrite(file->fd, buf2, file->fa.fbsize)<0)
HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "file system may not support Direct I/O")
else
file->fa.must_align = TRUE;
@@ -540,8 +540,8 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
HDftruncate(file->fd, (HDoff_t)0);
}
} else {
- if(HDread(file->fd, (void*)buf1, sizeof(int))<0) {
- if(HDread(file->fd, (void*)buf2, file->fa.fbsize)<0)
+ if(HDread(file->fd, buf1, sizeof(int))<0) {
+ if(HDread(file->fd, buf2, file->fa.fbsize)<0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "file system may not support Direct I/O")
else
file->fa.must_align = TRUE;
@@ -549,7 +549,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
if(o_flags & O_RDWR) {
if(HDlseek(file->fd, (HDoff_t)0, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to seek to proper position")
- if(HDwrite(file->fd, (void *)buf1, sizeof(int))<0)
+ if(HDwrite(file->fd, buf1, sizeof(int))<0)
file->fa.must_align = TRUE;
else
file->fa.must_align = FALSE;
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index bc00403..d110ef7 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -619,8 +619,7 @@ done:
* memb_name & temp in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+H5_GCC_DIAG_OFF(format-nonliteral)
static H5FD_t *
H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr)
@@ -771,7 +770,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_family_open() */
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(format-nonliteral)
/*-------------------------------------------------------------------------
@@ -957,8 +956,7 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
* memb_name in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+H5_GCC_DIAG_OFF(format-nonliteral)
static herr_t
H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
{
@@ -1025,7 +1023,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(format-nonliteral)
/*-------------------------------------------------------------------------
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 800869d..d7fc88d 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -1961,8 +1961,7 @@ compute_next(H5FD_multi_t *file)
* tmp in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+H5_GCC_DIAG_OFF(format-nonliteral)
static int
open_members(H5FD_multi_t *file)
{
@@ -1996,7 +1995,7 @@ open_members(H5FD_multi_t *file)
return 0;
}
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(format-nonliteral)
#ifdef _H5private_H
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index f95f13d..f8a40b2 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -347,7 +347,7 @@ static herr_t
H5F__cache_superblock_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len,
void *_udata, size_t *actual_len)
{
- const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
+ const uint8_t *image = _image; /* Pointer into raw data buffer */
H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */
H5F_super_t sblock; /* Temporary file superblock */
htri_t ret_value = SUCCEED; /* Return value */
@@ -393,7 +393,7 @@ done:
static htri_t
H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata)
{
- const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
+ const uint8_t *image = _image; /* Pointer into raw data buffer */
H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
@@ -439,7 +439,7 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS
{
H5F_super_t *sblock = NULL; /* File's superblock */
H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */
- const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
+ const uint8_t *image = _image; /* Pointer into raw data buffer */
H5F_super_t *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -664,7 +664,7 @@ H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNU
void *_thing)
{
H5F_super_t *sblock = (H5F_super_t *)_thing; /* Pointer to the object */
- uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */
+ uint8_t *image = _image; /* Pointer into raw data buffer */
haddr_t rel_eof; /* Relative EOF for file */
herr_t ret_value = SUCCEED; /* Return value */
@@ -870,7 +870,7 @@ static herr_t
H5F__cache_drvrinfo_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len,
void *_udata, size_t *actual_len)
{
- const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
+ const uint8_t *image = _image; /* Pointer into raw data buffer */
H5F_drvrinfo_cache_ud_t *udata = (H5F_drvrinfo_cache_ud_t *)_udata; /* User data */
H5O_drvinfo_t drvrinfo; /* Driver info */
herr_t ret_value = SUCCEED; /* Return value */
@@ -916,7 +916,7 @@ H5F__cache_drvrinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
{
H5O_drvinfo_t *drvinfo = NULL; /* Driver info */
H5F_drvrinfo_cache_ud_t *udata = (H5F_drvrinfo_cache_ud_t *)_udata; /* User data */
- const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
+ const uint8_t *image = _image; /* Pointer into raw data buffer */
char drv_name[9]; /* Name of driver */
H5O_drvinfo_t *ret_value = NULL; /* Return value */
@@ -1010,7 +1010,7 @@ H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBU
void *_thing)
{
H5O_drvinfo_t *drvinfo = (H5O_drvinfo_t *)_thing; /* Pointer to the object */
- uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */
+ uint8_t *image = _image; /* Pointer into raw data buffer */
uint8_t *dbuf; /* Pointer to beginning of driver info */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5PL.c b/src/H5PL.c
index fc42554..0f0f88a 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -210,13 +210,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5PLreplace(const char *search_path, unsigned int index)
+H5PLreplace(const char *search_path, unsigned int idx)
{
unsigned num_paths; /* Current number of stored paths */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "*sIu", search_path, index);
+ H5TRACE2("e", "*sIu", search_path, idx);
/* Check args */
if (NULL == search_path)
@@ -228,11 +228,11 @@ H5PLreplace(const char *search_path, unsigned int index)
num_paths = H5PL__get_num_paths();
if (0 == num_paths)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "path table is empty")
- else if (index >= num_paths)
+ else if (idx >= num_paths)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1))
/* Insert the search path into the path table */
- if (H5PL__replace_path(search_path, index) < 0)
+ if (H5PL__replace_path(search_path, idx) < 0)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to replace search path")
done:
@@ -252,13 +252,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5PLinsert(const char *search_path, unsigned int index)
+H5PLinsert(const char *search_path, unsigned int idx)
{
unsigned num_paths; /* Current number of stored paths */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "*sIu", search_path, index);
+ H5TRACE2("e", "*sIu", search_path, idx);
/* Check args */
if (NULL == search_path)
@@ -268,11 +268,11 @@ H5PLinsert(const char *search_path, unsigned int index)
/* Check index */
num_paths = H5PL__get_num_paths();
- if ((0 != num_paths) && (index >= num_paths))
+ if ((0 != num_paths) && (idx >= num_paths))
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1))
/* Insert the search path into the path table */
- if (H5PL__insert_path(search_path, index) < 0)
+ if (H5PL__insert_path(search_path, idx) < 0)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to insert search path")
done:
@@ -294,23 +294,23 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5PLremove(unsigned int index)
+H5PLremove(unsigned int idx)
{
unsigned num_paths; /* Current number of stored paths */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE1("e", "Iu", index);
+ H5TRACE1("e", "Iu", idx);
/* Check index */
num_paths = H5PL__get_num_paths();
if (0 == num_paths)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "path table is empty")
- else if (index >= num_paths)
+ else if (idx >= num_paths)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1))
/* Delete the search path from the path table */
- if (H5PL__remove_path(index) < 0)
+ if (H5PL__remove_path(idx) < 0)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTDELETE, FAIL, "unable to remove search path")
done:
@@ -343,7 +343,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5PLget(unsigned int index, char *path_buf, size_t buf_size)
+H5PLget(unsigned int idx, char *path_buf, size_t buf_size)
{
unsigned num_paths; /* Current number of stored paths */
const char *path = NULL; /* path from table */
@@ -351,13 +351,13 @@ H5PLget(unsigned int index, char *path_buf, size_t buf_size)
ssize_t ret_value = 0; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("Zs", "Iu*sz", index, path_buf, buf_size);
+ H5TRACE3("Zs", "Iu*sz", idx, path_buf, buf_size);
/* Check index */
num_paths = H5PL__get_num_paths();
if (0 == num_paths)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "path table is empty")
- else if (index >= num_paths)
+ else if (idx >= num_paths)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "index path out of bounds for table - can't be more than %u", (num_paths - 1))
/* Check if the search table is empty */
@@ -365,7 +365,7 @@ H5PLget(unsigned int index, char *path_buf, size_t buf_size)
HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, (-1), "plugin search path table is empty")
/* Get the path at the specified index and its length */
- if (NULL == (path = H5PL__get_path(index)))
+ if (NULL == (path = H5PL__get_path(idx)))
HGOTO_ERROR(H5E_PLUGIN, H5E_BADVALUE, (-1), "no path stored at that index")
path_len = HDstrlen(path);
diff --git a/src/H5PLint.c b/src/H5PLint.c
index 8dec14b..b69a788 100644
--- a/src/H5PLint.c
+++ b/src/H5PLint.c
@@ -304,8 +304,7 @@ done:
* get_plugin_info function pointer, but early (4.4.7, at least) gcc
* only allows diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
+H5_GCC_DIAG_OFF(pedantic)
herr_t
H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key,
hbool_t *success, const void **plugin_info)
@@ -417,7 +416,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__open() */
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(pedantic)
/*-------------------------------------------------------------------------
diff --git a/src/H5PLpath.c b/src/H5PLpath.c
index e270c73..ba23fd3 100644
--- a/src/H5PLpath.c
+++ b/src/H5PLpath.c
@@ -62,9 +62,9 @@
/* Local Prototypes */
/********************/
-static herr_t H5PL__insert_at(const char *path, unsigned int index);
-static herr_t H5PL__make_space_at(unsigned int index);
-static herr_t H5PL__replace_at(const char *path, unsigned int index);
+static herr_t H5PL__insert_at(const char *path, unsigned int idx);
+static herr_t H5PL__make_space_at(unsigned int idx);
+static herr_t H5PL__replace_at(const char *path, unsigned int idx);
static herr_t H5PL__expand_path_table(void);
static herr_t H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *found, const char *dir, const void **plugin_info);
@@ -105,7 +105,7 @@ static unsigned H5PL_path_capacity_g = H5PL_INITIAL_PATH_CAPACITY;
*-------------------------------------------------------------------------
*/
static herr_t
-H5PL__insert_at(const char *path, unsigned int index)
+H5PL__insert_at(const char *path, unsigned int idx)
{
char *path_copy = NULL; /* copy of path string (for storing) */
herr_t ret_value = SUCCEED; /* Return value */
@@ -132,12 +132,12 @@ H5PL__insert_at(const char *path, unsigned int index)
#endif /* H5_HAVE_WIN32_API */
/* If the table entry is in use, make some space */
- if (H5PL_paths_g[index])
- if (H5PL__make_space_at(index) < 0)
+ if (H5PL_paths_g[idx])
+ if (H5PL__make_space_at(idx) < 0)
HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "unable to make space in the table for the new entry")
/* Insert the copy of the search path into the table at the specified index */
- H5PL_paths_g[index] = path_copy;
+ H5PL_paths_g[idx] = path_copy;
H5PL_num_paths_g++;
done:
@@ -156,7 +156,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5PL__make_space_at(unsigned int index)
+H5PL__make_space_at(unsigned int idx)
{
unsigned u; /* iterator */
herr_t ret_value = SUCCEED; /* Return value */
@@ -164,13 +164,13 @@ H5PL__make_space_at(unsigned int index)
FUNC_ENTER_STATIC_NOERR
/* Check args - Just assert on package functions */
- HDassert(index < H5PL_path_capacity_g);
+ HDassert(idx < H5PL_path_capacity_g);
/* Copy the paths back to make a space */
- for (u = H5PL_num_paths_g; u > index; u--)
+ for (u = H5PL_num_paths_g; u > idx; u--)
H5PL_paths_g[u] = H5PL_paths_g[u-1];
- H5PL_paths_g[index] = NULL;
+ H5PL_paths_g[idx] = NULL;
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__make_space_at() */
@@ -188,7 +188,7 @@ H5PL__make_space_at(unsigned int index)
*-------------------------------------------------------------------------
*/
static herr_t
-H5PL__replace_at(const char *path, unsigned int index)
+H5PL__replace_at(const char *path, unsigned int idx)
{
char *path_copy = NULL; /* copy of path string (for storing) */
herr_t ret_value = SUCCEED; /* Return value */
@@ -200,8 +200,8 @@ H5PL__replace_at(const char *path, unsigned int index)
HDassert(HDstrlen(path));
/* Check that the table entry is in use */
- if (!H5PL_paths_g[index])
- HGOTO_ERROR(H5E_PLUGIN, H5E_CANTFREE, FAIL, "path entry at index %u in the table is NULL", index)
+ if (!H5PL_paths_g[idx])
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTFREE, FAIL, "path entry at index %u in the table is NULL", idx)
/* Copy the path for storage so the caller can dispose of theirs */
if (NULL == (path_copy = H5MM_strdup(path)))
@@ -214,10 +214,10 @@ H5PL__replace_at(const char *path, unsigned int index)
#endif /* H5_HAVE_WIN32_API */
/* Free the existing path entry */
- H5PL_paths_g[index] = (char *)H5MM_xfree(H5PL_paths_g[index]);
+ H5PL_paths_g[idx] = (char *)H5MM_xfree(H5PL_paths_g[idx]);
/* Copy the search path into the table at the specified index */
- H5PL_paths_g[index] = path_copy;
+ H5PL_paths_g[idx] = path_copy;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -448,7 +448,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5PL__replace_path(const char *path, unsigned int index)
+H5PL__replace_path(const char *path, unsigned int idx)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -457,10 +457,10 @@ H5PL__replace_path(const char *path, unsigned int index)
/* Check args - Just assert on package functions */
HDassert(path);
HDassert(HDstrlen(path));
- HDassert(index < H5PL_path_capacity_g);
+ HDassert(idx < H5PL_path_capacity_g);
/* Insert the path at the requested index */
- if (H5PL__replace_at(path, index) < 0)
+ if (H5PL__replace_at(path, idx) < 0)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to replace search path")
done:
@@ -479,7 +479,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5PL__insert_path(const char *path, unsigned int index)
+H5PL__insert_path(const char *path, unsigned int idx)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -488,10 +488,10 @@ H5PL__insert_path(const char *path, unsigned int index)
/* Check args - Just assert on package functions */
HDassert(path);
HDassert(HDstrlen(path));
- HDassert(index < H5PL_path_capacity_g);
+ HDassert(idx < H5PL_path_capacity_g);
/* Insert the path at the requested index */
- if (H5PL__insert_at(path, index) < 0)
+ if (H5PL__insert_at(path, idx) < 0)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to insert search path")
done:
@@ -510,7 +510,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5PL__remove_path(unsigned int index)
+H5PL__remove_path(unsigned int idx)
{
unsigned u; /* iterator */
herr_t ret_value = SUCCEED; /* Return value */
@@ -518,18 +518,18 @@ H5PL__remove_path(unsigned int index)
FUNC_ENTER_PACKAGE
/* Check args - Just assert on package functions */
- HDassert(index < H5PL_path_capacity_g);
+ HDassert(idx < H5PL_path_capacity_g);
/* Check if the path at that index is set */
- if (!H5PL_paths_g[index])
- HGOTO_ERROR(H5E_PLUGIN, H5E_CANTDELETE, FAIL, "search path at index %u is NULL", index)
+ if (!H5PL_paths_g[idx])
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTDELETE, FAIL, "search path at index %u is NULL", idx)
/* Delete the path */
H5PL_num_paths_g--;
- H5PL_paths_g[index] = (char *)H5MM_xfree(H5PL_paths_g[index]);
+ H5PL_paths_g[idx] = (char *)H5MM_xfree(H5PL_paths_g[idx]);
/* Shift the paths down to close the gap */
- for (u = index; u < H5PL_num_paths_g; u++)
+ for (u = idx; u < H5PL_num_paths_g; u++)
H5PL_paths_g[u] = H5PL_paths_g[u+1];
/* Set the (former) last path to NULL */
@@ -551,17 +551,17 @@ done:
*-------------------------------------------------------------------------
*/
const char *
-H5PL__get_path(unsigned int index)
+H5PL__get_path(unsigned int idx)
{
char *ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE
/* Get the path at the requested index */
- if (index >= H5PL_num_paths_g)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "path index %u is out of range in table", index)
+ if (idx >= H5PL_num_paths_g)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "path index %u is out of range in table", idx)
- return H5PL_paths_g[index];
+ return H5PL_paths_g[idx];
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__replace_path() */
diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c
index cd0b4d6..c58828f 100644
--- a/src/H5PLplugin_cache.c
+++ b/src/H5PLplugin_cache.c
@@ -253,8 +253,7 @@ done:
/* See the other use of H5PL_GET_LIB_FUNC() for an explanation
* for why we disable -Wpedantic here.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
+H5_GCC_DIAG_OFF(pedantic)
herr_t
H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found, const void **plugin_info)
{
@@ -303,5 +302,5 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__find_plugin_in_cache() */
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(pedantic)
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 739865f..7b98f1e 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -2353,7 +2353,7 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
-H5Pget_virtual_vspace(hid_t dcpl_id, size_t index)
+H5Pget_virtual_vspace(hid_t dcpl_id, size_t idx)
{
H5P_genplist_t *plist; /* Property list pointer */
H5O_layout_t layout; /* Layout information */
@@ -2361,7 +2361,7 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t index)
hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("i", "iz", dcpl_id, index);
+ H5TRACE2("i", "iz", dcpl_id, idx);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
@@ -2374,10 +2374,10 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t index)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout")
/* Get the virtual space */
- if(index >= layout.storage.u.virt.list_nused)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)")
+ if(idx >= layout.storage.u.virt.list_nused)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)")
HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc);
- if(NULL == (space = H5S_copy(layout.storage.u.virt.list[index].source_dset.virtual_select, FALSE, TRUE)))
+ if(NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_dset.virtual_select, FALSE, TRUE)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection")
/* Register ID */
@@ -2411,7 +2411,7 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
-H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index)
+H5Pget_virtual_srcspace(hid_t dcpl_id, size_t idx)
{
H5P_genplist_t *plist; /* Property list pointer */
H5O_layout_t layout; /* Layout information */
@@ -2419,7 +2419,7 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index)
hid_t ret_value = FAIL; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("i", "iz", dcpl_id, index);
+ H5TRACE2("i", "iz", dcpl_id, idx);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
@@ -2431,28 +2431,28 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index)
if(H5D_VIRTUAL != layout.type)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout")
- /* Check index */
- if(index >= layout.storage.u.virt.list_nused)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)")
+ /* Check idx */
+ if(idx >= layout.storage.u.virt.list_nused)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)")
HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc);
/* Attempt to open source dataset and patch extent if extent status is not
* H5O_VIRTUAL_STATUS_CORRECT? -NAF */
/* If source space status is H5O_VIRTUAL_STATUS_INVALID, patch with bounds
* of selection */
- if((H5O_VIRTUAL_STATUS_INVALID == layout.storage.u.virt.list[index].source_space_status)
- && (layout.storage.u.virt.list[index].unlim_dim_source < 0)) {
+ if((H5O_VIRTUAL_STATUS_INVALID == layout.storage.u.virt.list[idx].source_space_status)
+ && (layout.storage.u.virt.list[idx].unlim_dim_source < 0)) {
hsize_t bounds_start[H5S_MAX_RANK];
hsize_t bounds_end[H5S_MAX_RANK];
int rank;
int i;
/* Get rank of source space */
- if((rank = H5S_GET_EXTENT_NDIMS(layout.storage.u.virt.list[index].source_select)) < 0)
+ if((rank = H5S_GET_EXTENT_NDIMS(layout.storage.u.virt.list[idx].source_select)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get source space rank")
/* Get bounds of selection */
- if(H5S_SELECT_BOUNDS(layout.storage.u.virt.list[index].source_select, bounds_start, bounds_end) < 0)
+ if(H5S_SELECT_BOUNDS(layout.storage.u.virt.list[idx].source_select, bounds_start, bounds_end) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get selection bounds")
/* Adjust bounds to extent */
@@ -2460,15 +2460,15 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index)
bounds_end[i]++;
/* Set extent */
- if(H5S_set_extent_simple(layout.storage.u.virt.list[index].source_select, (unsigned)rank, bounds_end, NULL) < 0)
+ if(H5S_set_extent_simple(layout.storage.u.virt.list[idx].source_select, (unsigned)rank, bounds_end, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set source space extent")
/* Update source space status */
- layout.storage.u.virt.list[index].source_space_status = H5O_VIRTUAL_STATUS_SEL_BOUNDS;
+ layout.storage.u.virt.list[idx].source_space_status = H5O_VIRTUAL_STATUS_SEL_BOUNDS;
} /* end if */
/* Get the source space */
- if(NULL == (space = H5S_copy(layout.storage.u.virt.list[index].source_select, FALSE, TRUE)))
+ if(NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_select, FALSE, TRUE)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy source selection")
/* Register ID */
@@ -2515,7 +2515,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/,
+H5Pget_virtual_filename(hid_t dcpl_id, size_t idx, char *name/*out*/,
size_t size)
{
H5P_genplist_t *plist; /* Property list pointer */
@@ -2523,7 +2523,7 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/,
ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("Zs", "izxz", dcpl_id, index, name, size);
+ H5TRACE4("Zs", "izxz", dcpl_id, idx, name, size);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
@@ -2536,13 +2536,13 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name/*out*/,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout")
/* Get the virtual filename */
- if(index >= layout.storage.u.virt.list_nused)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)")
+ if(idx >= layout.storage.u.virt.list_nused)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)")
HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc);
- HDassert(layout.storage.u.virt.list[index].source_file_name);
+ HDassert(layout.storage.u.virt.list[idx].source_file_name);
if(name && (size > 0))
- (void)HDstrncpy(name, layout.storage.u.virt.list[index].source_file_name, size);
- ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[index].source_file_name);
+ (void)HDstrncpy(name, layout.storage.u.virt.list[idx].source_file_name, size);
+ ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[idx].source_file_name);
done:
FUNC_LEAVE_API(ret_value)
@@ -2578,7 +2578,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/,
+H5Pget_virtual_dsetname(hid_t dcpl_id, size_t idx, char *name/*out*/,
size_t size)
{
H5P_genplist_t *plist; /* Property list pointer */
@@ -2586,7 +2586,7 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/,
ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("Zs", "izxz", dcpl_id, index, name, size);
+ H5TRACE4("Zs", "izxz", dcpl_id, idx, name, size);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
@@ -2599,13 +2599,13 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name/*out*/,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a virtual storage layout")
/* Get the virtual filename */
- if(index >= layout.storage.u.virt.list_nused)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)")
+ if(idx >= layout.storage.u.virt.list_nused)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid idx (out of range)")
HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc);
- HDassert(layout.storage.u.virt.list[index].source_dset_name);
+ HDassert(layout.storage.u.virt.list[idx].source_dset_name);
if(name && (size > 0))
- (void)HDstrncpy(name, layout.storage.u.virt.list[index].source_dset_name, size);
- ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[index].source_dset_name);
+ (void)HDstrncpy(name, layout.storage.u.virt.list[idx].source_dset_name, size);
+ ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[idx].source_dset_name);
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index 1d203c7..8859102 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -530,8 +530,7 @@ done:
* the code below, but early (4.4.7, at least) gcc only allows
* diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wduplicated-branches"
+H5_GCC_DIAG_OFF(duplicated-branches)
/*-------------------------------------------------------------------------
* Function: H5T__get_native_integer
@@ -672,7 +671,7 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__get_native_integer() */
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(duplicated-branches)
/* Disable warning for intentional identical branches here -QAK */
/*
@@ -680,8 +679,7 @@ done:
* the code below, but early (4.4.7, at least) gcc only allows
* diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wduplicated-branches"
+H5_GCC_DIAG_OFF(duplicated-branches)
/*-------------------------------------------------------------------------
* Function: H5T__get_native_float
@@ -806,7 +804,7 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__get_native_float() */
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(duplicated-branches)
/* Disable warning for intentional identical branches here -QAK */
/*
@@ -814,8 +812,7 @@ done:
* the code below, but early (4.4.7, at least) gcc only allows
* diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wduplicated-branches"
+H5_GCC_DIAG_OFF(duplicated-branches)
/*-------------------------------------------------------------------------
* Function: H5T__get_native_bitfield
@@ -901,7 +898,7 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction,
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__get_native_bitfield() */
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(duplicated-branches)
/*-------------------------------------------------------------------------
diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c
index 23ea37b..1f213dd 100644
--- a/src/H5VLnative_file.c
+++ b/src/H5VLnative_file.c
@@ -207,12 +207,12 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type,
/* H5Fget_fileno */
case H5VL_FILE_GET_FILENO:
{
- unsigned long *fileno = HDva_arg(arguments, unsigned long *);
+ unsigned long *fno = HDva_arg(arguments, unsigned long *);
unsigned long my_fileno = 0;
f = (H5F_t *)obj;
H5F_GET_FILENO(f, my_fileno);
- *fileno = my_fileno; /* sigh */
+ *fno = my_fileno; /* sigh */
break;
}
diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c
index 5c9f28c..8b3dc62 100644
--- a/src/H5VLpassthru.c
+++ b/src/H5VLpassthru.c
@@ -2788,22 +2788,24 @@ H5VL_pass_through_request_specific(void *obj, H5VL_request_specific_t specific_t
/* Release requests that have completed */
if(H5VL_REQUEST_WAITANY == specific_type) {
- size_t *index; /* Pointer to the index of completed request */
+ size_t *idx; /* Pointer to the index of completed request */
H5ES_status_t *status; /* Pointer to the request's status */
/* Retrieve the remaining arguments */
- index = va_arg(tmp_arguments, size_t *);
- assert(*index <= req_count);
+ idx = va_arg(tmp_arguments, size_t *);
+ assert(*idx <= req_count);
status = va_arg(tmp_arguments, H5ES_status_t *);
/* Reissue the WAITANY 'request specific' call */
- ret_value = H5VL_pass_through_request_specific_reissue(o->under_object, o->under_vol_id, specific_type, req_count, under_req_array, timeout, index, status);
+ ret_value = H5VL_pass_through_request_specific_reissue(o->under_object, o->under_vol_id, specific_type, req_count, under_req_array, timeout,
+ idx,
+ status);
/* Release the completed request, if it completed */
if(ret_value >= 0 && *status != H5ES_STATUS_IN_PROGRESS) {
H5VL_pass_through_t *tmp_o;
- tmp_o = (H5VL_pass_through_t *)req_array[*index];
+ tmp_o = (H5VL_pass_through_t *)req_array[*idx];
H5VL_pass_through_free_obj(tmp_o);
} /* end if */
} /* end if */
diff --git a/src/H5Z.c b/src/H5Z.c
index b703958..53186f1 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -215,8 +215,10 @@ herr_t
H5Zregister(const void *cls)
{
const H5Z_class2_t *cls_real = (const H5Z_class2_t *) cls; /* "Real" class pointer */
- H5Z_class2_t cls_new; /* Translated class struct */
herr_t ret_value = SUCCEED; /* Return value */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ H5Z_class2_t cls_new; /* Translated class struct */
+#endif
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "*x", cls);
diff --git a/src/H5detect.c b/src/H5detect.c
index d01ee9f..655b05c 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -49,7 +49,7 @@ static const char *FileHeader = "\n\
/* Disable warning about cast increasing the alignment of the target type,
* that's _exactly_ what this code is probing. -QAK
*/
-#pragma GCC diagnostic ignored "-Wcast-align"
+H5_GCC_DIAG_OFF(cast-align)
#if defined(__has_attribute)
# if __has_attribute(no_sanitize_address)
@@ -1707,3 +1707,4 @@ main(int argc, char *argv[])
return EXIT_SUCCESS;
}
+H5_GCC_DIAG_ON(cast-align)
diff --git a/src/H5system.c b/src/H5system.c
index 9310243..dd1f10d 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -107,8 +107,7 @@ static hbool_t H5_ntzset = FALSE;
* format_templ in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+H5_GCC_DIAG_OFF(format-nonliteral)
int
HDfprintf(FILE *stream, const char *fmt, ...)
{
@@ -460,7 +459,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
HDva_end(ap);
return nout;
} /* end HDfprintf() */
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON(format-nonliteral)
/*-------------------------------------------------------------------------