diff options
author | Sean McBride <sean@rogue-research.com> | 2023-06-19 05:13:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 05:13:38 (GMT) |
commit | 65d8c9347010771473b53c91adcec2f281772213 (patch) | |
tree | 487567dae0dc005de896f616b90e67744239a5e2 /examples | |
parent | 1f20354ee6cdfa9fd157ac9cdfff9acdf320a32d (diff) | |
download | hdf5-65d8c9347010771473b53c91adcec2f281772213.zip hdf5-65d8c9347010771473b53c91adcec2f281772213.tar.gz hdf5-65d8c9347010771473b53c91adcec2f281772213.tar.bz2 |
Many fixes to various compiler warnings (#3124)
* Fixed various -Wmissing-variable-declarations by adding static keyword
* In a few cases, renamed the variable suffix from _g to _s.
* Fixed some -Wmissing-variable-declarations by using different declaration macros
* Fixed various -Wconditional-uninitialized warnings by just initializing variable to zero
* Fixed various -Wcomma warnings
* Fixed clang -Wstrict-prototypes warnings
* Fixed various -Wunused-variable warnings
* Updated some casts to fix the only 3 -Wcast-qual warnings
* Fixed the only -Wsometimes-uninitialized warning
Diffstat (limited to 'examples')
-rw-r--r-- | examples/h5_cmprss.c | 2 | ||||
-rw-r--r-- | examples/h5_crtatt.c | 2 | ||||
-rw-r--r-- | examples/h5_crtdat.c | 2 | ||||
-rw-r--r-- | examples/h5_crtgrp.c | 2 | ||||
-rw-r--r-- | examples/h5_crtgrpar.c | 2 | ||||
-rw-r--r-- | examples/h5_crtgrpd.c | 2 | ||||
-rw-r--r-- | examples/h5_extlink.c | 6 | ||||
-rw-r--r-- | examples/h5_rdwt.c | 2 | ||||
-rw-r--r-- | examples/h5_vds-exc.c | 2 | ||||
-rw-r--r-- | examples/h5_vds-exclim.c | 2 | ||||
-rw-r--r-- | examples/h5_vds.c | 2 |
11 files changed, 13 insertions, 13 deletions
diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index 9aefe32..ffd3191 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -23,7 +23,7 @@ #define DIM1 20 int -main() +main(void) { hid_t file_id, dataset_id, dataspace_id; /* identifiers */ diff --git a/examples/h5_crtatt.c b/examples/h5_crtatt.c index f33e1f1..8534703f 100644 --- a/examples/h5_crtatt.c +++ b/examples/h5_crtatt.c @@ -19,7 +19,7 @@ #define FILE "dset.h5" int -main() +main(void) { hid_t file_id, dataset_id, attribute_id, dataspace_id; /* identifiers */ diff --git a/examples/h5_crtdat.c b/examples/h5_crtdat.c index 8de9077..d8ac072 100644 --- a/examples/h5_crtdat.c +++ b/examples/h5_crtdat.c @@ -19,7 +19,7 @@ #define FILE "dset.h5" int -main() +main(void) { hid_t file_id, dataset_id, dataspace_id; /* identifiers */ diff --git a/examples/h5_crtgrp.c b/examples/h5_crtgrp.c index f9066f4..3517bf3 100644 --- a/examples/h5_crtgrp.c +++ b/examples/h5_crtgrp.c @@ -19,7 +19,7 @@ #define FILE "group.h5" int -main() +main(void) { hid_t file_id, group_id; /* identifiers */ diff --git a/examples/h5_crtgrpar.c b/examples/h5_crtgrpar.c index f397155..1b47429 100644 --- a/examples/h5_crtgrpar.c +++ b/examples/h5_crtgrpar.c @@ -19,7 +19,7 @@ #define FILE "groups.h5" int -main() +main(void) { hid_t file_id, group1_id, group2_id, group3_id; /* identifiers */ diff --git a/examples/h5_crtgrpd.c b/examples/h5_crtgrpd.c index 364a3b9..f1750d6 100644 --- a/examples/h5_crtgrpd.c +++ b/examples/h5_crtgrpd.c @@ -19,7 +19,7 @@ #define FILE "groups.h5" int -main() +main(void) { hid_t file_id, group_id, dataset_id, dataspace_id; /* identifiers */ diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c index 8d3fc8c..e1f02cf 100644 --- a/examples/h5_extlink.c +++ b/examples/h5_extlink.c @@ -411,7 +411,7 @@ UD_hard_create(const char *link_name, hid_t loc_group, const void *udata, size_t goto done; } - token = *((H5O_token_t *)udata); + token = *((const H5O_token_t *)udata); //! [H5Oopen_by_token_snip] @@ -459,7 +459,7 @@ UD_hard_delete(const char *link_name, hid_t loc_group, const void *udata, size_t goto done; } - token = *((H5O_token_t *)udata); + token = *((const H5O_token_t *)udata); /* Open the object this link points to */ target_obj = H5Oopen_by_token(loc_group, token); @@ -498,7 +498,7 @@ UD_hard_traverse(const char *link_name, hid_t cur_group, const void *udata, size if (udata_size != sizeof(H5O_token_t)) return H5I_INVALID_HID; - token = *((H5O_token_t *)udata); + token = *((const H5O_token_t *)udata); /* Open the object by token. If H5Oopen_by_token fails, ret_value will * be negative to indicate that the traversal function failed. diff --git a/examples/h5_rdwt.c b/examples/h5_rdwt.c index 679dc46..9947f59 100644 --- a/examples/h5_rdwt.c +++ b/examples/h5_rdwt.c @@ -19,7 +19,7 @@ #define FILE "dset.h5" int -main() +main(void) { hid_t file_id, dataset_id; /* identifiers */ diff --git a/examples/h5_vds-exc.c b/examples/h5_vds-exc.c index fa6b720..01597cc 100644 --- a/examples/h5_vds-exc.c +++ b/examples/h5_vds-exc.c @@ -49,7 +49,7 @@ main(void) kdims[3] = {KDIM0, KDIM1, KDIM2}, kdims_max[3] = {H5S_UNLIMITED, KDIM1, KDIM2}, ndims[3] = {NDIM0, NDIM1, NDIM2}, ndims_max[3] = {H5S_UNLIMITED, NDIM1, NDIM2}, start[3], /* Hyperslab parameters */ - stride[3], count[3], block[3]; + count[3], block[3]; hsize_t start_out[3], stride_out[3], count_out[3], block_out[3]; int k = 2; int n = 3; diff --git a/examples/h5_vds-exclim.c b/examples/h5_vds-exclim.c index 58ed1f8..4fb5536 100644 --- a/examples/h5_vds-exclim.c +++ b/examples/h5_vds-exclim.c @@ -48,7 +48,7 @@ main(void) herr_t status; hsize_t vdsdims[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, kdims[3] = {KDIM0, KDIM1, KDIM2}, ndims[3] = {NDIM0, NDIM1, NDIM2}, start[3], /* Hyperslab parameters */ - stride[3], count[3], block[3]; + count[3], block[3]; hsize_t start_out[3], stride_out[3], count_out[3], block_out[3]; int k = 2; int n = 3; diff --git a/examples/h5_vds.c b/examples/h5_vds.c index ceb4956..96bd8a2 100644 --- a/examples/h5_vds.c +++ b/examples/h5_vds.c @@ -55,7 +55,7 @@ main(void) hsize_t vdsdims[2] = {VDSDIM0, VDSDIM1}, /* Virtual datasets dimension */ dims[1] = {DIM0}, /* Source datasets dimensions */ start[2], /* Hyperslab parameters */ - stride[2], count[2], block[2]; + count[2], block[2]; hsize_t start_out[2], stride_out[2], count_out[2], block_out[2]; int wdata[DIM0], /* Write buffer for source dataset */ rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */ |