From 1b520d93124deaefd6f5c7869f211c4699131e66 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 22 Dec 2023 10:33:41 -0600 Subject: [PATCH 1/5] Use 110 version file only for the 1.10 library --- JAVA/H5J/Java_sourcefiles.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JAVA/H5J/Java_sourcefiles.cmake b/JAVA/H5J/Java_sourcefiles.cmake index c643a16..e78e12e 100644 --- a/JAVA/H5J/Java_sourcefiles.cmake +++ b/JAVA/H5J/Java_sourcefiles.cmake @@ -10,7 +10,7 @@ set (HDF_JAVA_EXAMPLES HDF5GroupDatasetCreate.java HDF5SubsetSelect.java ) -if (NOT ${EXAMPLE_VARNAME}_USE_110_API AND H5_LIBVER_DIR EQUAL 110) +if (H5_LIBVER_DIR EQUAL 110) set (HDF_JAVA_EXAMPLES ${HDF_JAVA_EXAMPLES} 110/HDF5FileStructure.java ) From 37f424a9127d7f598d29f6260549838fa83adeaf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 22 Dec 2023 13:21:26 -0600 Subject: [PATCH 2/5] Fix version check and format issues --- C/H5G/CMakeLists.txt | 6 +++--- C/H5G/h5ex_g_traverse.c | 27 +++++++++++++-------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/C/H5G/CMakeLists.txt b/C/H5G/CMakeLists.txt index f517199..cb13612 100644 --- a/C/H5G/CMakeLists.txt +++ b/C/H5G/CMakeLists.txt @@ -37,7 +37,7 @@ foreach (example_name ${common_examples}) endif () endforeach () -if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.8") +if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.8" AND NOT ${EXAMPLE_VARNAME}_USE_16_API) foreach (example_name ${1_8_examples}) add_executable (${EXAMPLE_VARNAME}_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.c) target_compile_options(${EXAMPLE_VARNAME}_${example_name} @@ -212,7 +212,7 @@ if (H5EX_BUILD_TESTING) h5ex_g_iterate h5ex_g_traverse ) - if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.8") + if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.8" AND NOT ${EXAMPLE_VARNAME}_USE_16_API) set (exfiles ${exfiles} h5ex_g_visit ) @@ -369,7 +369,7 @@ if (H5EX_BUILD_TESTING) ADD_DUMP_TEST (h5ex_g_create) ADD_H5_CMP_TEST (h5ex_g_iterate) ADD_H5_CMP_TEST (h5ex_g_traverse) - if (NOT ${H5_LIBVER_DIR} EQUAL 16) + if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.8" AND NOT ${EXAMPLE_VARNAME}_USE_16_API) ADD_H5_DUMP2_TEST (h5ex_g_compact) ADD_H5_CMP_TEST (h5ex_g_corder) ADD_H5_CMP_TEST (h5ex_g_phase) diff --git a/C/H5G/h5ex_g_traverse.c b/C/H5G/h5ex_g_traverse.c index 99110f7..88bf290 100644 --- a/C/H5G/h5ex_g_traverse.c +++ b/C/H5G/h5ex_g_traverse.c @@ -26,9 +26,9 @@ struct opdata { unsigned recurs; /* Recursion level. 0=root */ struct opdata *prev; /* Pointer to previous opdata */ #if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API) - H5O_token_t token; + H5O_token_t token; #else - haddr_t addr; /* Group address */ + haddr_t addr; /* Group address */ #endif }; @@ -46,7 +46,7 @@ herr_t op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *ope */ #if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API) int group_check(hid_t loc_id, struct opdata *od, H5O_token_t target_tok); -#else +#else int group_check(struct opdata *od, haddr_t target_addr); #endif @@ -74,9 +74,9 @@ main(void) od.recurs = 0; od.prev = NULL; #if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API) - od.token = infobuf.token; + od.token = infobuf.token; #else - od.addr = infobuf.addr; + od.addr = infobuf.addr; #endif /* @@ -156,11 +156,11 @@ op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_d * H5Odecr_refcount. */ #if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API) - if (group_check(loc_id, od, infobuf.token)) { + if (group_check(loc_id, od, infobuf.token)) { #else - if (group_check(od, infobuf.addr)) { + if (group_check(od, infobuf.addr)) { #endif - printf("%*s Warning: Loop detected!\n", spaces, ""); + printf("%*s Warning: Loop detected!\n", spaces, ""); } else { @@ -174,14 +174,13 @@ op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_d nextod.recurs = od->recurs + 1; nextod.prev = od; #if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API) - nextod.token = infobuf.token; - return_val = H5Literate_by_name2(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, + nextod.token = infobuf.token; + return_val = H5Literate_by_name2(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, (void *)&nextod, H5P_DEFAULT); #else - nextod.addr = infobuf.addr; - return_val = H5Literate_by_name(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, + nextod.addr = infobuf.addr; + return_val = H5Literate_by_name(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, (void *)&nextod, H5P_DEFAULT); - #endif } printf("%*s}\n", spaces, ""); @@ -235,5 +234,5 @@ group_check(struct opdata *od, haddr_t target_addr) return group_check(od->prev, target_addr); /* Recursively examine the next node */ } -#endif +#endif From d4bb06e3123c4fd22b0bc10b5cffed272998c713 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 22 Dec 2023 13:27:20 -0600 Subject: [PATCH 3/5] Formatting --- C/H5G/h5ex_g_traverse.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/C/H5G/h5ex_g_traverse.c b/C/H5G/h5ex_g_traverse.c index 88bf290..2c4f16d 100644 --- a/C/H5G/h5ex_g_traverse.c +++ b/C/H5G/h5ex_g_traverse.c @@ -28,7 +28,7 @@ struct opdata { #if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API) H5O_token_t token; #else - haddr_t addr; /* Group address */ + haddr_t addr; /* Group address */ #endif }; @@ -176,11 +176,11 @@ op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_d #if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API) nextod.token = infobuf.token; return_val = H5Literate_by_name2(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, - (void *)&nextod, H5P_DEFAULT); + (void *)&nextod, H5P_DEFAULT); #else nextod.addr = infobuf.addr; return_val = H5Literate_by_name(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, - (void *)&nextod, H5P_DEFAULT); + (void *)&nextod, H5P_DEFAULT); #endif } printf("%*s}\n", spaces, ""); @@ -235,4 +235,3 @@ group_check(struct opdata *od, haddr_t target_addr) /* Recursively examine the next node */ } #endif - From ec7e6600450dd000b23da895c13b2e1809394d2c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 22 Dec 2023 13:29:23 -0600 Subject: [PATCH 4/5] format indentation --- C/H5G/h5ex_g_traverse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C/H5G/h5ex_g_traverse.c b/C/H5G/h5ex_g_traverse.c index 2c4f16d..4962986 100644 --- a/C/H5G/h5ex_g_traverse.c +++ b/C/H5G/h5ex_g_traverse.c @@ -179,8 +179,8 @@ op_func(hid_t loc_id, const char *name, const H5L_info_t *info, void *operator_d (void *)&nextod, H5P_DEFAULT); #else nextod.addr = infobuf.addr; - return_val = H5Literate_by_name(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, - (void *)&nextod, H5P_DEFAULT); + return_val = H5Literate_by_name(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, NULL, op_func, + (void *)&nextod, H5P_DEFAULT); #endif } printf("%*s}\n", spaces, ""); From a6f337acc5b9e984386079626ef50b09e20dcac3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 22 Dec 2023 13:51:45 -0600 Subject: [PATCH 5/5] Fix 1.6 API C examples --- C/H5D/16/h5ex_d_alloc.c | 13 +++++++++---- C/H5D/16/h5ex_d_checksum.c | 12 ++++++++---- C/H5D/16/h5ex_d_chunk.c | 18 +++++++++++++----- C/H5D/16/h5ex_d_compact.c | 11 +++++++---- C/H5D/16/h5ex_d_extern.c | 11 +++++++---- C/H5D/16/h5ex_d_fillval.c | 21 +++++++++++++-------- C/H5D/16/h5ex_d_gzip.c | 18 ++++++++++++------ C/H5D/16/h5ex_d_hyper.c | 16 +++++++++++----- C/H5D/16/h5ex_d_rdwr.c | 10 ++++++---- C/H5D/16/h5ex_d_shuffle.c | 18 ++++++++++++------ C/H5D/16/h5ex_d_szip.c | 19 +++++++++++++------ C/H5D/16/h5ex_d_unlimadd.c | 23 +++++++++++++++-------- C/H5D/16/h5ex_d_unlimgzip.c | 23 +++++++++++++++-------- C/H5D/16/h5ex_d_unlimmod.c | 20 +++++++++++++------- C/H5D/CMakeLists.txt | 2 +- C/H5G/CMakeLists.txt | 2 +- C/H5T/CMakeLists.txt | 2 +- 17 files changed, 157 insertions(+), 82 deletions(-) diff --git a/C/H5D/16/h5ex_d_alloc.c b/C/H5D/16/h5ex_d_alloc.c index d4ae7b9..78f0ce8 100644 --- a/C/H5D/16/h5ex_d_alloc.c +++ b/C/H5D/16/h5ex_d_alloc.c @@ -26,13 +26,18 @@ int main(void) { - hid_t file, space, dset1, dset2, dcpl; + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset1 = H5I_INVALID_HID; + hid_t dset2 = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; /* Handles */ herr_t status; H5D_space_status_t space_status; - hsize_t dims[2] = {DIM0, DIM1}, storage_size; - int wdata[DIM0][DIM1], /* Write buffer */ - i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t storage_size; + int wdata[DIM0][DIM1]; /* Write buffer */ + hsize_t i, j; /* * Initialize data. diff --git a/C/H5D/16/h5ex_d_checksum.c b/C/H5D/16/h5ex_d_checksum.c index ce057aa..a03e004 100644 --- a/C/H5D/16/h5ex_d_checksum.c +++ b/C/H5D/16/h5ex_d_checksum.c @@ -27,7 +27,10 @@ int main(void) { - hid_t file, space, dset, dcpl; + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; /* Handles */ herr_t status; htri_t avail; @@ -35,9 +38,10 @@ main(void) hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts; unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - max, i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int max; + hsize_t i, j; /* * Check if the Fletcher32 filter is available and can be used for diff --git a/C/H5D/16/h5ex_d_chunk.c b/C/H5D/16/h5ex_d_chunk.c index b19e7c7..4697261 100644 --- a/C/H5D/16/h5ex_d_chunk.c +++ b/C/H5D/16/h5ex_d_chunk.c @@ -27,13 +27,21 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; H5D_layout_t layout; - hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}, start[2], stride[2], count[2], block[2]; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + hsize_t start[2]; + hsize_t stride[2]; + hsize_t count[2]; + hsize_t block[2]; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data to "1", to make it easier to see the selections. diff --git a/C/H5D/16/h5ex_d_compact.c b/C/H5D/16/h5ex_d_compact.c index 2d199ec..0c10a87 100644 --- a/C/H5D/16/h5ex_d_compact.c +++ b/C/H5D/16/h5ex_d_compact.c @@ -22,13 +22,16 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; H5D_layout_t layout; hsize_t dims[2] = {DIM0, DIM1}; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data. diff --git a/C/H5D/16/h5ex_d_extern.c b/C/H5D/16/h5ex_d_extern.c index f0cc60d..6291c3c 100644 --- a/C/H5D/16/h5ex_d_extern.c +++ b/C/H5D/16/h5ex_d_extern.c @@ -25,13 +25,16 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; hsize_t dims[2] = {DIM0, DIM1}; char name[NAME_BUF_SIZE]; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data. diff --git a/C/H5D/16/h5ex_d_fillval.c b/C/H5D/16/h5ex_d_fillval.c index e2fd100..4f6eee3 100644 --- a/C/H5D/16/h5ex_d_fillval.c +++ b/C/H5D/16/h5ex_d_fillval.c @@ -30,15 +30,20 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; - hsize_t dims[2] = {DIM0, DIM1}, extdims[2] = {EDIM0, EDIM1}, maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}, - chunk[2] = {CHUNK0, CHUNK1}; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - rdata2[EDIM0][EDIM1], /* Read buffer for - extension */ - fillval, i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t extdims[2] = {EDIM0, EDIM1}; + hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int rdata2[EDIM0][EDIM1]; /* Read buffer for extension */ + int fillval; + hsize_t i, j; /* * Initialize data. diff --git a/C/H5D/16/h5ex_d_gzip.c b/C/H5D/16/h5ex_d_gzip.c index cd44d8e..2b35559 100644 --- a/C/H5D/16/h5ex_d_gzip.c +++ b/C/H5D/16/h5ex_d_gzip.c @@ -26,16 +26,22 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; htri_t avail; H5Z_filter_t filter_type; - hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts; - unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - max, i, j; + unsigned int flags; + unsigned int filter_info; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int max; + hsize_t i, j; /* * Check if gzip compression is available and can be used for both diff --git a/C/H5D/16/h5ex_d_hyper.c b/C/H5D/16/h5ex_d_hyper.c index df361d6..1d81ec2 100644 --- a/C/H5D/16/h5ex_d_hyper.c +++ b/C/H5D/16/h5ex_d_hyper.c @@ -25,12 +25,18 @@ int main(void) { - hid_t file, space, dset; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; herr_t status; - hsize_t dims[2] = {DIM0, DIM1}, start[2], stride[2], count[2], block[2]; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t start[2]; + hsize_t stride[2]; + hsize_t count[2]; + hsize_t block[2]; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data to "1", to make it easier to see the selections. diff --git a/C/H5D/16/h5ex_d_rdwr.c b/C/H5D/16/h5ex_d_rdwr.c index 4b6a56a..fbdc180 100644 --- a/C/H5D/16/h5ex_d_rdwr.c +++ b/C/H5D/16/h5ex_d_rdwr.c @@ -22,12 +22,14 @@ int main(void) { - hid_t file, space, dset; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; herr_t status; hsize_t dims[2] = {DIM0, DIM1}; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + hsize_t i, j; /* * Initialize data. diff --git a/C/H5D/16/h5ex_d_shuffle.c b/C/H5D/16/h5ex_d_shuffle.c index cff4730..137b4b8 100644 --- a/C/H5D/16/h5ex_d_shuffle.c +++ b/C/H5D/16/h5ex_d_shuffle.c @@ -27,16 +27,22 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; htri_t avail; H5Z_filter_t filter_type; - hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts; - unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - max, nfilters, i, j; + unsigned int flags; + unsigned int filter_info; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int max, nfilters; + int i, j; /* * Check if gzip compression is available and can be used for both diff --git a/C/H5D/16/h5ex_d_szip.c b/C/H5D/16/h5ex_d_szip.c index 6ecc6ef..cf2f639 100644 --- a/C/H5D/16/h5ex_d_szip.c +++ b/C/H5D/16/h5ex_d_szip.c @@ -26,16 +26,23 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + herr_t status; htri_t avail; H5Z_filter_t filter_type; - hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts; - unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - rdata[DIM0][DIM1], /* Read buffer */ - max, i, j; + unsigned int flags; + unsigned int filter_info; + int wdata[DIM0][DIM1]; /* Write buffer */ + int rdata[DIM0][DIM1]; /* Read buffer */ + int max; + hsize_t i, j; /* * Check if szip compression is available and can be used for both diff --git a/C/H5D/16/h5ex_d_unlimadd.c b/C/H5D/16/h5ex_d_unlimadd.c index 1c271d3..6f855ea 100644 --- a/C/H5D/16/h5ex_d_unlimadd.c +++ b/C/H5D/16/h5ex_d_unlimadd.c @@ -29,15 +29,22 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; - hsize_t dims[2] = {DIM0, DIM1}, extdims[2] = {EDIM0, EDIM1}, maxdims[2], chunk[2] = {CHUNK0, CHUNK1}, - start[2], count[2]; - int wdata[DIM0][DIM1], /* Write buffer */ - wdata2[EDIM0][EDIM1], /* Write buffer for - extension */ - **rdata, /* Read buffer */ - ndims, i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t extdims[2] = {EDIM0, EDIM1}; + hsize_t maxdims[2]; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + hsize_t start[2]; + hsize_t count[2]; + int wdata[DIM0][DIM1]; /* Write buffer */ + int wdata2[EDIM0][EDIM1]; /* Write buffer for extension */ + int **rdata = NULL; /* Read buffer */ + int ndims; + hsize_t i, j; /* * Initialize data. diff --git a/C/H5D/16/h5ex_d_unlimgzip.c b/C/H5D/16/h5ex_d_unlimgzip.c index 3e90506..227b3aa 100644 --- a/C/H5D/16/h5ex_d_unlimgzip.c +++ b/C/H5D/16/h5ex_d_unlimgzip.c @@ -30,19 +30,26 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; htri_t avail; H5Z_filter_t filter_type; - hsize_t dims[2] = {DIM0, DIM1}, extdims[2] = {EDIM0, EDIM1}, maxdims[2], chunk[2] = {CHUNK0, CHUNK1}, - start[2], count[2]; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t extdims[2] = {EDIM0, EDIM1}; + hsize_t maxdims[2]; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + hsize_t start[2]; + hsize_t count[2]; size_t nelmts; unsigned int flags, filter_info; - int wdata[DIM0][DIM1], /* Write buffer */ - wdata2[EDIM0][EDIM1], /* Write buffer for - extension */ - **rdata, /* Read buffer */ - ndims, i, j; + int wdata[DIM0][DIM1]; /* Write buffer */ + int wdata2[EDIM0][EDIM1]; /* Write buffer for extension */ + int **rdata = NULL; /* Read buffer */ + int ndims; + hsize_t i, j; /* * Check if gzip compression is available and can be used for both diff --git a/C/H5D/16/h5ex_d_unlimmod.c b/C/H5D/16/h5ex_d_unlimmod.c index 6601427..f06a1ff 100644 --- a/C/H5D/16/h5ex_d_unlimmod.c +++ b/C/H5D/16/h5ex_d_unlimmod.c @@ -29,14 +29,20 @@ int main(void) { - hid_t file, space, dset, dcpl; /* Handles */ + hid_t file = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t dset = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; herr_t status; - hsize_t dims[2] = {DIM0, DIM1}, extdims[2] = {EDIM0, EDIM1}, maxdims[2], chunk[2] = {CHUNK0, CHUNK1}; - int wdata[DIM0][DIM1], /* Write buffer */ - wdata2[EDIM0][EDIM1], /* Write buffer for - extension */ - **rdata, /* Read buffer */ - ndims, i, j; + hsize_t dims[2] = {DIM0, DIM1}; + hsize_t extdims[2] = {EDIM0, EDIM1}; + hsize_t maxdims[2]; + hsize_t chunk[2] = {CHUNK0, CHUNK1}; + int wdata[DIM0][DIM1]; /* Write buffer */ + int wdata2[EDIM0][EDIM1]; /* Write buffer for extension */ + int **rdata = NULL; /* Read buffer */ + int ndims; + hsize_t i, j; /* * Initialize data. diff --git a/C/H5D/CMakeLists.txt b/C/H5D/CMakeLists.txt index 02f9ac7..b530f4c 100644 --- a/C/H5D/CMakeLists.txt +++ b/C/H5D/CMakeLists.txt @@ -7,7 +7,7 @@ project (HDF5Examples_C_H5D C) include (C_sourcefiles.cmake) foreach (example_name ${common_examples}) - if (${H5_LIBVER_DIR} EQUAL 16) + if (${H5_LIBVER_DIR} EQUAL 16 OR ${EXAMPLE_VARNAME}_USE_16_API) add_executable (${EXAMPLE_VARNAME}_${example_name} ${PROJECT_SOURCE_DIR}/16/${example_name}.c) else () add_executable (${EXAMPLE_VARNAME}_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.c) diff --git a/C/H5G/CMakeLists.txt b/C/H5G/CMakeLists.txt index cb13612..308349a 100644 --- a/C/H5G/CMakeLists.txt +++ b/C/H5G/CMakeLists.txt @@ -7,7 +7,7 @@ project (HDF5Examples_C_H5G C) include (C_sourcefiles.cmake) foreach (example_name ${common_examples}) - if (${H5_LIBVER_DIR} EQUAL 16) + if (${H5_LIBVER_DIR} EQUAL 16 OR ${EXAMPLE_VARNAME}_USE_16_API) add_executable (${EXAMPLE_VARNAME}_${example_name} ${PROJECT_SOURCE_DIR}/16/${example_name}.c) else () add_executable (${EXAMPLE_VARNAME}_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.c) diff --git a/C/H5T/CMakeLists.txt b/C/H5T/CMakeLists.txt index fb5a4e4..8c4084f 100644 --- a/C/H5T/CMakeLists.txt +++ b/C/H5T/CMakeLists.txt @@ -7,7 +7,7 @@ project (HDF5Examples_C_H5T C) include (C_sourcefiles.cmake) foreach (example_name ${common_examples}) - if (${H5_LIBVER_DIR} EQUAL 16) + if (${H5_LIBVER_DIR} EQUAL 16 OR ${EXAMPLE_VARNAME}_USE_16_API) add_executable (${EXAMPLE_VARNAME}_${example_name} ${PROJECT_SOURCE_DIR}/16/${example_name}.c) else () add_executable (${EXAMPLE_VARNAME}_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.c)