diff options
author | Sean McBride <sean@rogue-research.com> | 2021-02-22 17:37:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-22 17:37:12 (GMT) |
commit | 5ed255a607d604b45e92b06548682ae9b716535d (patch) | |
tree | 3dcf8239efca99143e561743c2ae997ce9ceca09 /src | |
parent | 99669024ff93df3ade5b8a1e6eee8bef6df57161 (diff) | |
download | hdf5-5ed255a607d604b45e92b06548682ae9b716535d.zip hdf5-5ed255a607d604b45e92b06548682ae9b716535d.tar.gz hdf5-5ed255a607d604b45e92b06548682ae9b716535d.tar.bz2 |
Fixed all -Wincompatible-pointer-types-discards-qualifiers warnings (#341)
* Fixed various -Wincompatible-pointer-types-discards-qualifiers warnings by adding const
* Fixed various -Wincompatible-pointer-types-discards-qualifiers warning by removing extraneous consts
There were casts with const, but the function parameter doesn't actaully take const, so just modified the casts.
In the other case, a local variable was const that should not have been, becuase its source wasn't const either.
* Fixed a -Wincompatible-pointer-types-discards-qualifiers warning by strdup-ing a string
Create a duplicate string instead of mutating a supposedly const one.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dchunk.c | 24 | ||||
-rw-r--r-- | src/H5Gtest.c | 8 | ||||
-rw-r--r-- | src/H5Idbg.c | 8 | ||||
-rw-r--r-- | src/H5Ocopy_ref.c | 6 | ||||
-rw-r--r-- | src/H5Oprivate.h | 2 | ||||
-rw-r--r-- | src/H5Shyper.c | 4 | ||||
-rw-r--r-- | src/H5Sprivate.h | 2 |
7 files changed, 27 insertions, 27 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index bd3b1ed..9d47a4a 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -4267,18 +4267,18 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ coordinates) */ hsize_t max_unalloc[H5O_LAYOUT_NDIMS]; /* Last chunk in each dimension that is unallocated (in scaled coordinates) */ - hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Offset of current chunk (in scaled coordinates) */ - size_t orig_chunk_size; /* Original size of chunk in bytes */ - size_t chunk_size; /* Actual size of chunk in bytes, possibly filtered */ - unsigned filter_mask = 0; /* Filter mask for chunks that have them */ - const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ - const H5O_pline_t * pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info */ - const H5O_pline_t def_pline = H5O_CRT_PIPELINE_DEF; /* Default pipeline */ - const H5O_fill_t * fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */ - H5D_fill_value_t fill_status; /* The fill value status */ - hbool_t should_fill = FALSE; /* Whether fill values should be written */ - void * unfilt_fill_buf = NULL; /* Unfiltered fill value buffer */ - void ** fill_buf = NULL; /* Pointer to the fill buffer to use for a chunk */ + hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Offset of current chunk (in scaled coordinates) */ + size_t orig_chunk_size; /* Original size of chunk in bytes */ + size_t chunk_size; /* Actual size of chunk in bytes, possibly filtered */ + unsigned filter_mask = 0; /* Filter mask for chunks that have them */ + H5O_layout_t * layout = &(dset->shared->layout); /* Dataset layout */ + const H5O_pline_t *pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info */ + const H5O_pline_t def_pline = H5O_CRT_PIPELINE_DEF; /* Default pipeline */ + const H5O_fill_t * fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */ + H5D_fill_value_t fill_status; /* The fill value status */ + hbool_t should_fill = FALSE; /* Whether fill values should be written */ + void * unfilt_fill_buf = NULL; /* Unfiltered fill value buffer */ + void ** fill_buf = NULL; /* Pointer to the fill buffer to use for a chunk */ #ifdef H5_HAVE_PARALLEL hbool_t blocks_written = FALSE; /* Flag to indicate that chunk was actually written */ hbool_t using_mpi = diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 5f45c8c..9f0dca2 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -553,10 +553,10 @@ done: herr_t H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsigned *obj_hidden) { - void * obj_ptr; /* Pointer to object for ID */ - H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - herr_t ret_value = SUCCEED; /* Return value */ + void * obj_ptr; /* Pointer to object for ID */ + const H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Idbg.c b/src/H5Idbg.c index ea58d59..8894230 100644 --- a/src/H5Idbg.c +++ b/src/H5Idbg.c @@ -76,10 +76,10 @@ static int H5I__id_dump_cb(void *_item, void *_key, void *_udata); static int H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) { - H5I_id_info_t *info = (H5I_id_info_t *)_item; /* Pointer to the ID node */ - H5I_type_t type = *(H5I_type_t *)_udata; /* User data */ - H5G_name_t * path = NULL; /* Path to file object */ - const void * object = NULL; /* Pointer to VOL connector object */ + H5I_id_info_t * info = (H5I_id_info_t *)_item; /* Pointer to the ID node */ + H5I_type_t type = *(H5I_type_t *)_udata; /* User data */ + const H5G_name_t *path = NULL; /* Path to file object */ + const void * object = NULL; /* Pointer to VOL connector object */ FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Ocopy_ref.c b/src/H5Ocopy_ref.c index f2372c1..f1f8aaf 100644 --- a/src/H5Ocopy_ref.c +++ b/src/H5Ocopy_ref.c @@ -63,7 +63,7 @@ static herr_t H5O__copy_expand_ref_object1(H5O_loc_t *src_oloc, const void *buf_ static herr_t H5O__copy_expand_ref_region1(H5O_loc_t *src_oloc, const void *buf_src, H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, void *buf_dst, size_t ref_count, H5O_copy_t *cpy_info); -static herr_t H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, H5T_t *dt_src, +static herr_t H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt_src, const void *buf_src, size_t nbytes_src, H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, void *buf_dst, size_t ref_count, H5O_copy_t *cpy_info); @@ -284,7 +284,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, H5T_t *dt_src, const void *buf_src, +H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt_src, const void *buf_src, size_t nbytes_src, H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, void *buf_dst, size_t ref_count, H5O_copy_t *cpy_info) { @@ -423,7 +423,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_src, H5T_t *dt_src, void *buf_src, size_t nbytes_src, +H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_src, const H5T_t *dt_src, void *buf_src, size_t nbytes_src, H5F_t *file_dst, void *buf_dst, H5O_copy_t *cpy_info) { H5O_loc_t dst_oloc; /* Copied object object location */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index b6bd3fe..5b4c11b 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -994,7 +994,7 @@ H5_DLL herr_t H5O_are_mdc_flushes_disabled(H5O_loc_t *oloc, hbool_t *are_disable H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, H5O_copy_t *cpy_info, hbool_t inc_depth, H5O_type_t *obj_type, void **udata); -H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_src, H5T_t *dt_src, void *buf_src, +H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_src, const H5T_t *dt_src, void *buf_src, size_t nbytes_src, H5F_t *file_dst, void *buf_dst, H5O_copy_t *cpy_info); /* Debugging routines */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 8777661..e12ff93 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -10273,7 +10273,7 @@ done: Specify a hyperslab to combine with the current hyperslab selection, and store the result in the new hyperslab selection. USAGE - herr_t H5S_combine_hyperslab(new_space, old_space, op, start, stride, count, block) + herr_t H5S_combine_hyperslab(old_space, op, start, stride, count, block, new_space) H5S_t *old_space; IN: The old space the selection is performed on H5S_seloper_t op; IN: Operation to perform on current selection const hsize_t start[]; IN: Offset of start of hyperslab @@ -10297,7 +10297,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_combine_hyperslab(H5S_t *old_space, H5S_seloper_t op, const hsize_t start[], const hsize_t *stride, +H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t start[], const hsize_t *stride, const hsize_t count[], const hsize_t *block, H5S_t **new_space) { unsigned u; /* Local index variable */ diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index f5e4f2c..738d9ae 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -276,7 +276,7 @@ H5_DLL herr_t H5S_select_elements(H5S_t *space, H5S_seloper_t op, size_t num_ele /* Operations on hyperslab selections */ H5_DLL herr_t H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], const hsize_t *stride, const hsize_t count[], const hsize_t *block); -H5_DLL herr_t H5S_combine_hyperslab(H5S_t *old_space, H5S_seloper_t op, const hsize_t start[], +H5_DLL herr_t H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t start[], const hsize_t *stride, const hsize_t count[], const hsize_t *block, H5S_t **new_space); H5_DLL herr_t H5S_hyper_add_span_element(H5S_t *space, unsigned rank, const hsize_t *coords); |