summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-02-22 17:37:12 (GMT)
committerGitHub <noreply@github.com>2021-02-22 17:37:12 (GMT)
commit5ed255a607d604b45e92b06548682ae9b716535d (patch)
tree3dcf8239efca99143e561743c2ae997ce9ceca09 /examples
parent99669024ff93df3ade5b8a1e6eee8bef6df57161 (diff)
downloadhdf5-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 'examples')
-rw-r--r--examples/h5_ref_compat.c4
-rw-r--r--examples/h5_ref_extern.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/h5_ref_compat.c b/examples/h5_ref_compat.c
index 82ef525..cce755b 100644
--- a/examples/h5_ref_compat.c
+++ b/examples/h5_ref_compat.c
@@ -76,9 +76,9 @@ main(void)
/* Access reference and read dataset data through new API */
assert(H5Rget_type((const H5R_ref_t *)&new_ref_buf[0]) == H5R_OBJECT2);
- H5Rget_obj_type3((const H5R_ref_t *)&new_ref_buf[0], H5P_DEFAULT, &obj_type);
+ H5Rget_obj_type3(&new_ref_buf[0], H5P_DEFAULT, &obj_type);
assert(obj_type == H5O_TYPE_DATASET);
- dset1 = H5Ropen_object((const H5R_ref_t *)&new_ref_buf[0], H5P_DEFAULT, H5P_DEFAULT);
+ dset1 = H5Ropen_object(&new_ref_buf[0], H5P_DEFAULT, H5P_DEFAULT);
H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_buf);
H5Dclose(dset1);
H5Rdestroy(&new_ref_buf[0]);
diff --git a/examples/h5_ref_extern.c b/examples/h5_ref_extern.c
index a46f676..691d235 100644
--- a/examples/h5_ref_extern.c
+++ b/examples/h5_ref_extern.c
@@ -78,9 +78,9 @@ main(void)
/* Access reference and read dataset data without opening original file */
assert(H5Rget_type((const H5R_ref_t *)&ref_buf[0]) == H5R_OBJECT2);
- H5Rget_obj_type3((const H5R_ref_t *)&ref_buf[0], H5P_DEFAULT, &obj_type);
+ H5Rget_obj_type3(&ref_buf[0], H5P_DEFAULT, &obj_type);
assert(obj_type == H5O_TYPE_DATASET);
- dset1 = H5Ropen_object((const H5R_ref_t *)&ref_buf[0], H5P_DEFAULT, H5P_DEFAULT);
+ dset1 = H5Ropen_object(&ref_buf[0], H5P_DEFAULT, H5P_DEFAULT);
H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_buf);
H5Dclose(dset1);
H5Rdestroy(&ref_buf[0]);