From 05db7c16acc835b609a5894a70394e4f699323cb Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:50:43 -0700 Subject: Normalize examples w/ develop (#3282) --- examples/h5_cmprss.c | 2 +- examples/h5_crtatt.c | 2 +- examples/h5_crtdat.c | 2 +- examples/h5_crtgrp.c | 2 +- examples/h5_crtgrpar.c | 2 +- examples/h5_crtgrpd.c | 2 +- examples/h5_elink_unix2win.c | 2 +- examples/h5_extlink.c | 6 +++--- examples/h5_rdwt.c | 2 +- examples/h5_vds-exc.c | 2 +- examples/h5_vds-exclim.c | 2 +- examples/h5_vds.c | 2 +- examples/ph5_filtered_writes.c | 2 -- examples/ph5_filtered_writes_no_sel.c | 1 - examples/ph5example.c | 14 ++++++++------ examples/testh5cc.sh.in | 8 -------- 16 files changed, 22 insertions(+), 31 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_elink_unix2win.c b/examples/h5_elink_unix2win.c index ac5f63a..24525ff 100644 --- a/examples/h5_elink_unix2win.c +++ b/examples/h5_elink_unix2win.c @@ -187,7 +187,7 @@ error: H5Gclose(gid); H5Fclose(fid); } - H5E_END_TRY; + H5E_END_TRY return -1; } 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 */ diff --git a/examples/ph5_filtered_writes.c b/examples/ph5_filtered_writes.c index f5c1169..104704a 100644 --- a/examples/ph5_filtered_writes.c +++ b/examples/ph5_filtered_writes.c @@ -125,7 +125,6 @@ write_dataset_no_overlap(hid_t file_id, hid_t dxpl_id) hsize_t start[EXAMPLE_DSET_DIMS]; hsize_t stride[EXAMPLE_DSET_DIMS]; hsize_t count[EXAMPLE_DSET_DIMS]; - size_t i, j; hid_t dset_id = H5I_INVALID_HID; hid_t dcpl_id = H5I_INVALID_HID; hid_t file_dataspace = H5I_INVALID_HID; @@ -244,7 +243,6 @@ write_dataset_overlap(hid_t file_id, hid_t dxpl_id) hsize_t start[EXAMPLE_DSET_DIMS]; hsize_t stride[EXAMPLE_DSET_DIMS]; hsize_t count[EXAMPLE_DSET_DIMS]; - size_t i, j; hid_t dset_id = H5I_INVALID_HID; hid_t dcpl_id = H5I_INVALID_HID; hid_t file_dataspace = H5I_INVALID_HID; diff --git a/examples/ph5_filtered_writes_no_sel.c b/examples/ph5_filtered_writes_no_sel.c index 05367d7..a4d9e16 100644 --- a/examples/ph5_filtered_writes_no_sel.c +++ b/examples/ph5_filtered_writes_no_sel.c @@ -126,7 +126,6 @@ write_dataset_some_no_sel(hid_t file_id, hid_t dxpl_id) hsize_t stride[EXAMPLE_DSET_DIMS]; hsize_t count[EXAMPLE_DSET_DIMS]; hbool_t no_selection; - size_t i, j; hid_t dset_id = H5I_INVALID_HID; hid_t dcpl_id = H5I_INVALID_HID; hid_t file_dataspace = H5I_INVALID_HID; diff --git a/examples/ph5example.c b/examples/ph5example.c index e0fc644..5ec2cdc 100644 --- a/examples/ph5example.c +++ b/examples/ph5example.c @@ -46,23 +46,25 @@ /* Define some handy debugging shorthands, routines, ... */ /* debugging tools */ #define MESG(x) \ - if (verbose) \ - printf("%s\n", x); + do { \ + if (verbose) \ + printf("%s\n", x); \ + } while (0) #define MPI_BANNER(mesg) \ - { \ + do { \ printf("--------------------------------\n"); \ printf("Proc %d: ", mpi_rank); \ printf("*** %s\n", mesg); \ printf("--------------------------------\n"); \ - } + } while (0) #define SYNC(comm) \ - { \ + do { \ MPI_BANNER("doing a SYNC"); \ MPI_Barrier(comm); \ MPI_BANNER("SYNC DONE"); \ - } + } while (0) /* End of Define some handy debugging shorthands, routines, ... */ /* Constants definitions */ diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index a958b66..17b2563 100644 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -11,14 +11,6 @@ # help@hdfgroup.org. # # Tests for the h5cc compiler tool -# Created: Albert Cheng, 2007/4/11 -# -# Modification: -# Albert Cheng, 2008/9/27 -# Added -shlib tests and verbose control. -# Albert Cheng, 2009/10/28 -# Added version compatibility tests. -# srcdir=@srcdir@ -- cgit v0.12