From 4d459e1cebb8b4ba3e74054ac5501603dc2698c2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 26 Mar 2021 17:14:24 -0700 Subject: Adds missing utils Makefile.in entries to MANIFEST --- MANIFEST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST b/MANIFEST index bb7c65c..bc8ac15 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3738,3 +3738,5 @@ ./tools/test/misc/Makefile.in ./tools/test/misc/vds/Makefile.in ./tools/test/perform/Makefile.in +./utils/Makefile.in +./utils/mirror_vfd/Makefile.in -- cgit v0.12 From 4402e696e43e4428a37953edbfd67c448ba93ac1 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 5 Apr 2021 15:35:03 -0700 Subject: Normalized high-level library with develop --- hl/c++/examples/ptExampleFL.cpp | 2 +- hl/c++/src/H5PacketTable.h | 4 +- hl/c++/test/ptableTest.cpp | 6 +- hl/examples/ex_ds1.c | 4 +- hl/examples/pal_rgb.h | 298 +++++- hl/fortran/examples/ex_ds1.f90 | 3 +- hl/fortran/src/H5IMcc.c | 12 +- hl/fortran/src/H5IMcc.h | 4 +- hl/fortran/src/H5IMfc.c | 24 +- hl/fortran/src/H5IMff.F90 | 24 +- hl/fortran/src/H5LTf90proto.h | 6 +- hl/fortran/src/H5LTfc.c | 24 +- hl/fortran/src/H5LTff.F90 | 40 +- hl/fortran/src/H5TBfc.c | 18 +- hl/fortran/src/H5TBff.F90 | 18 +- hl/src/H5DOpublic.h | 4 +- hl/src/H5DS.c | 179 ++-- hl/src/H5DSprivate.h | 4 +- hl/src/H5DSpublic.h | 4 +- hl/src/H5HLprivate2.h | 6 +- hl/src/H5IM.c | 39 +- hl/src/H5IMprivate.h | 4 +- hl/src/H5IMpublic.h | 4 +- hl/src/H5LD.c | 4 - hl/src/H5LDprivate.h | 6 +- hl/src/H5LDpublic.h | 6 +- hl/src/H5LT.c | 23 +- hl/src/H5LTanalyze.c | 1945 ++++++++++++++++++++------------------- hl/src/H5LTanalyze.l | 108 +-- hl/src/H5LTparse.c | 1591 ++++++++++++++------------------ hl/src/H5LTparse.h | 157 ++-- hl/src/H5LTprivate.h | 4 +- hl/src/H5LTpublic.h | 4 +- hl/src/H5PT.c | 62 +- hl/src/H5PTprivate.h | 4 +- hl/src/H5PTpublic.h | 4 +- hl/src/H5TB.c | 55 +- hl/src/H5TBprivate.h | 4 +- hl/src/H5TBpublic.h | 4 +- hl/src/hdf5_hl.h | 7 +- hl/test/gen_test_ds.c | 2 - hl/test/h5hltest.h | 8 +- hl/test/pal_rgb.h | 298 +++++- hl/test/test_ds.c | 26 +- hl/test/test_dset_append.c | 4 - hl/test/test_file_image.c | 4 +- hl/test/test_image.c | 4 - hl/test/test_ld.c | 10 +- hl/test/test_lite.c | 36 +- hl/test/test_packet.c | 2 - hl/test/test_table.c | 4 +- hl/tools/gif2h5/gif.h | 6 +- hl/tools/gif2h5/gifread.c | 4 +- hl/tools/gif2h5/h52gifgentst.c | 2 +- hl/tools/gif2h5/hdfgifwr.c | 16 +- hl/tools/h5watch/h5watch.c | 7 +- 56 files changed, 2647 insertions(+), 2505 deletions(-) diff --git a/hl/c++/examples/ptExampleFL.cpp b/hl/c++/examples/ptExampleFL.cpp index 7b508b4..3e4a529 100644 --- a/hl/c++/examples/ptExampleFL.cpp +++ b/hl/c++/examples/ptExampleFL.cpp @@ -73,7 +73,7 @@ main(void) if (err < 0) fprintf(stderr, "Error getting packet count."); - printf("Number of packets in packet table after five appends: %d\n", count); + printf("Number of packets in packet table after five appends: %llu\n", count); /* Initialize packet table's "current record" */ ptable.ResetIndex(); diff --git a/hl/c++/src/H5PacketTable.h b/hl/c++/src/H5PacketTable.h index be13173..a73b4c9 100644 --- a/hl/c++/src/H5PacketTable.h +++ b/hl/c++/src/H5PacketTable.h @@ -166,7 +166,9 @@ class H5_HLCPPDLL FL_PacketTable : virtual public PacketTable { /* Destructor * Cleans up the packet table */ - virtual ~FL_PacketTable(){}; + virtual ~FL_PacketTable() + { + } /* AppendPacket * Adds a single packet to the packet table. Takes a pointer diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index 9550a62..2600367 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -619,11 +619,11 @@ TestHDFFV_9758() s1_t s1[NUM_PACKETS]; for (hsize_t i = 0; i < NUM_PACKETS; i++) { - s1[i].a = i; + s1[i].a = static_cast(i); s1[i].b = 1.f * static_cast(i * i); s1[i].c = 1. / (i + 1); HDsprintf(s1[i].d, "string%d", (int)i); - s1[i].e = 100 + i; + s1[i].e = static_cast(100 + i); } printf("Testing %-62s", "data corruption in packed structs (HDFFV-9758)"); @@ -693,7 +693,7 @@ TestHDFFV_9758() if (s2.a != s1[i].a || s2.e != s1[i].e) goto error; - else if (HDstrcmp(s2.d, s1[i].d)) + else if (HDstrcmp(s2.d, s1[i].d) != 0) goto error; } } // end of ptable block diff --git a/hl/examples/ex_ds1.c b/hl/examples/ex_ds1.c index 73578f1..d6890fa 100644 --- a/hl/examples/ex_ds1.c +++ b/hl/examples/ex_ds1.c @@ -91,9 +91,11 @@ main(void) if (H5DSattach_scale(did, dsid, DIM1) < 0) goto out; - /* close DS id */ + /* close DS ids */ if (H5Dclose(dsid) < 0) goto out; + if (H5Dclose(did) < 0) + goto out; /* close file */ H5Fclose(fid); diff --git a/hl/examples/pal_rgb.h b/hl/examples/pal_rgb.h index 0d0ffcc..a2b17e2 100644 --- a/hl/examples/pal_rgb.h +++ b/hl/examples/pal_rgb.h @@ -11,41 +11,263 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -const unsigned char pal_rgb[256 * 3] = { - 255, 255, 255, 0, 0, 131, 0, 0, 135, 0, 0, 139, 0, 0, 143, 0, 0, 147, 0, 0, 151, - 0, 0, 155, 0, 0, 159, 0, 0, 163, 0, 0, 167, 0, 0, 171, 0, 0, 175, 0, 0, 179, - 0, 0, 183, 0, 0, 187, 0, 0, 191, 0, 0, 195, 0, 0, 199, 0, 0, 203, 0, 0, 207, - 0, 0, 211, 0, 0, 215, 0, 0, 219, 0, 0, 223, 0, 0, 227, 0, 0, 231, 0, 0, 235, - 0, 0, 239, 0, 0, 243, 0, 0, 247, 0, 0, 251, 0, 0, 255, 0, 0, 255, 0, 3, 255, - 0, 7, 255, 0, 11, 255, 0, 15, 255, 0, 19, 255, 0, 23, 255, 0, 27, 255, 0, 31, 255, - 0, 35, 255, 0, 39, 255, 0, 43, 255, 0, 47, 255, 0, 51, 255, 0, 55, 255, 0, 59, 255, - 0, 63, 255, 0, 67, 255, 0, 71, 255, 0, 75, 255, 0, 79, 255, 0, 83, 255, 0, 87, 255, - 0, 91, 255, 0, 95, 255, 0, 99, 255, 0, 103, 255, 0, 107, 255, 0, 111, 255, 0, 115, 255, - 0, 119, 255, 0, 123, 255, 0, 127, 255, 0, 131, 255, 0, 135, 255, 0, 139, 255, 0, 143, 255, - 0, 147, 255, 0, 151, 255, 0, 155, 255, 0, 159, 255, 0, 163, 255, 0, 167, 255, 0, 171, 255, - 0, 175, 255, 0, 179, 255, 0, 183, 255, 0, 187, 255, 0, 191, 255, 0, 195, 255, 0, 199, 255, - 0, 203, 255, 0, 207, 255, 0, 211, 255, 0, 215, 255, 0, 219, 255, 0, 223, 255, 0, 227, 255, - 0, 231, 255, 0, 235, 255, 0, 239, 255, 0, 243, 255, 0, 247, 255, 0, 251, 255, 0, 255, 255, - 0, 255, 255, 3, 255, 251, 7, 255, 247, 11, 255, 243, 15, 255, 239, 19, 255, 235, 23, 255, 231, - 27, 255, 227, 31, 255, 223, 35, 255, 219, 39, 255, 215, 43, 255, 211, 47, 255, 207, 51, 255, 203, - 55, 255, 199, 59, 255, 195, 63, 255, 191, 67, 255, 187, 71, 255, 183, 75, 255, 179, 79, 255, 175, - 83, 255, 171, 87, 255, 167, 91, 255, 163, 95, 255, 159, 99, 255, 155, 103, 255, 151, 107, 255, 147, - 111, 255, 143, 115, 255, 139, 119, 255, 135, 123, 255, 131, 127, 255, 127, 131, 255, 123, 135, 255, 119, - 139, 255, 115, 143, 255, 111, 147, 255, 107, 151, 255, 103, 155, 255, 99, 159, 255, 95, 163, 255, 91, - 167, 255, 87, 171, 255, 83, 175, 255, 79, 179, 255, 75, 183, 255, 71, 187, 255, 67, 191, 255, 63, - 195, 255, 59, 199, 255, 55, 203, 255, 51, 207, 255, 47, 211, 255, 43, 215, 255, 39, 219, 255, 35, - 223, 255, 31, 227, 255, 27, 231, 255, 23, 235, 255, 19, 239, 255, 15, 243, 255, 11, 247, 255, 7, - 251, 255, 3, 255, 255, 0, 255, 251, 0, 255, 247, 0, 255, 243, 0, 255, 239, 0, 255, 235, 0, - 255, 231, 0, 255, 227, 0, 255, 223, 0, 255, 219, 0, 255, 215, 0, 255, 211, 0, 255, 207, 0, - 255, 203, 0, 255, 199, 0, 255, 195, 0, 255, 191, 0, 255, 187, 0, 255, 183, 0, 255, 179, 0, - 255, 175, 0, 255, 171, 0, 255, 167, 0, 255, 163, 0, 255, 159, 0, 255, 155, 0, 255, 151, 0, - 255, 147, 0, 255, 143, 0, 255, 139, 0, 255, 135, 0, 255, 131, 0, 255, 127, 0, 255, 123, 0, - 255, 119, 0, 255, 115, 0, 255, 111, 0, 255, 107, 0, 255, 103, 0, 255, 99, 0, 255, 95, 0, - 255, 91, 0, 255, 87, 0, 255, 83, 0, 255, 79, 0, 255, 75, 0, 255, 71, 0, 255, 67, 0, - 255, 63, 0, 255, 59, 0, 255, 55, 0, 255, 51, 0, 255, 47, 0, 255, 43, 0, 255, 39, 0, - 255, 35, 0, 255, 31, 0, 255, 27, 0, 255, 23, 0, 255, 19, 0, 255, 15, 0, 255, 11, 0, - 255, 7, 0, 255, 3, 0, 255, 0, 0, 250, 0, 0, 246, 0, 0, 241, 0, 0, 237, 0, 0, - 233, 0, 0, 228, 0, 0, 224, 0, 0, 219, 0, 0, 215, 0, 0, 211, 0, 0, 206, 0, 0, - 202, 0, 0, 197, 0, 0, 193, 0, 0, 189, 0, 0, 184, 0, 0, 180, 0, 0, 175, 0, 0, - 171, 0, 0, 167, 0, 0, 162, 0, 0, 158, 0, 0, 153, 0, 0, 149, 0, 0, 145, 0, 0, - 140, 0, 0, 136, 0, 0, 131, 0, 0, 127, 0, 0}; +/* clang-format off */ +const unsigned char pal_rgb[256*3] = { + 255,255,255, + 0,0,131, + 0,0,135, + 0,0,139, + 0,0,143, + 0,0,147, + 0,0,151, + 0,0,155, + 0,0,159, + 0,0,163, + 0,0,167, + 0,0,171, + 0,0,175, + 0,0,179, + 0,0,183, + 0,0,187, + 0,0,191, + 0,0,195, + 0,0,199, + 0,0,203, + 0,0,207, + 0,0,211, + 0,0,215, + 0,0,219, + 0,0,223, + 0,0,227, + 0,0,231, + 0,0,235, + 0,0,239, + 0,0,243, + 0,0,247, + 0,0,251, + 0,0,255, + 0,0,255, + 0,3,255, + 0,7,255, + 0,11,255, + 0,15,255, + 0,19,255, + 0,23,255, + 0,27,255, + 0,31,255, + 0,35,255, + 0,39,255, + 0,43,255, + 0,47,255, + 0,51,255, + 0,55,255, + 0,59,255, + 0,63,255, + 0,67,255, + 0,71,255, + 0,75,255, + 0,79,255, + 0,83,255, + 0,87,255, + 0,91,255, + 0,95,255, + 0,99,255, + 0,103,255, + 0,107,255, + 0,111,255, + 0,115,255, + 0,119,255, + 0,123,255, + 0,127,255, + 0,131,255, + 0,135,255, + 0,139,255, + 0,143,255, + 0,147,255, + 0,151,255, + 0,155,255, + 0,159,255, + 0,163,255, + 0,167,255, + 0,171,255, + 0,175,255, + 0,179,255, + 0,183,255, + 0,187,255, + 0,191,255, + 0,195,255, + 0,199,255, + 0,203,255, + 0,207,255, + 0,211,255, + 0,215,255, + 0,219,255, + 0,223,255, + 0,227,255, + 0,231,255, + 0,235,255, + 0,239,255, + 0,243,255, + 0,247,255, + 0,251,255, + 0,255,255, + 0,255,255, + 3,255,251, + 7,255,247, + 11,255,243, + 15,255,239, + 19,255,235, + 23,255,231, + 27,255,227, + 31,255,223, + 35,255,219, + 39,255,215, + 43,255,211, + 47,255,207, + 51,255,203, + 55,255,199, + 59,255,195, + 63,255,191, + 67,255,187, + 71,255,183, + 75,255,179, + 79,255,175, + 83,255,171, + 87,255,167, + 91,255,163, + 95,255,159, + 99,255,155, + 103,255,151, + 107,255,147, + 111,255,143, + 115,255,139, + 119,255,135, + 123,255,131, + 127,255,127, + 131,255,123, + 135,255,119, + 139,255,115, + 143,255,111, + 147,255,107, + 151,255,103, + 155,255,99, + 159,255,95, + 163,255,91, + 167,255,87, + 171,255,83, + 175,255,79, + 179,255,75, + 183,255,71, + 187,255,67, + 191,255,63, + 195,255,59, + 199,255,55, + 203,255,51, + 207,255,47, + 211,255,43, + 215,255,39, + 219,255,35, + 223,255,31, + 227,255,27, + 231,255,23, + 235,255,19, + 239,255,15, + 243,255,11, + 247,255,7, + 251,255,3, + 255,255,0, + 255,251,0, + 255,247,0, + 255,243,0, + 255,239,0, + 255,235,0, + 255,231,0, + 255,227,0, + 255,223,0, + 255,219,0, + 255,215,0, + 255,211,0, + 255,207,0, + 255,203,0, + 255,199,0, + 255,195,0, + 255,191,0, + 255,187,0, + 255,183,0, + 255,179,0, + 255,175,0, + 255,171,0, + 255,167,0, + 255,163,0, + 255,159,0, + 255,155,0, + 255,151,0, + 255,147,0, + 255,143,0, + 255,139,0, + 255,135,0, + 255,131,0, + 255,127,0, + 255,123,0, + 255,119,0, + 255,115,0, + 255,111,0, + 255,107,0, + 255,103,0, + 255,99,0, + 255,95,0, + 255,91,0, + 255,87,0, + 255,83,0, + 255,79,0, + 255,75,0, + 255,71,0, + 255,67,0, + 255,63,0, + 255,59,0, + 255,55,0, + 255,51,0, + 255,47,0, + 255,43,0, + 255,39,0, + 255,35,0, + 255,31,0, + 255,27,0, + 255,23,0, + 255,19,0, + 255,15,0, + 255,11,0, + 255,7,0, + 255,3,0, + 255,0,0, + 250,0,0, + 246,0,0, + 241,0,0, + 237,0,0, + 233,0,0, + 228,0,0, + 224,0,0, + 219,0,0, + 215,0,0, + 211,0,0, + 206,0,0, + 202,0,0, + 197,0,0, + 193,0,0, + 189,0,0, + 184,0,0, + 180,0,0, + 175,0,0, + 171,0,0, + 167,0,0, + 162,0,0, + 158,0,0, + 153,0,0, + 149,0,0, + 145,0,0, + 140,0,0, + 136,0,0, + 131,0,0, + 127,0,0 +}; +/* clang-format on */ diff --git a/hl/fortran/examples/ex_ds1.f90 b/hl/fortran/examples/ex_ds1.f90 index 7040950..d1ff678 100644 --- a/hl/fortran/examples/ex_ds1.f90 +++ b/hl/fortran/examples/ex_ds1.f90 @@ -180,8 +180,9 @@ PROGRAM example_ds WRITE(*,'(/,5X,A,I0,2A,/)') 'Dimension Scale Label for dimension ', DIM2, ' is ... ', label(1:label_len) - ! close DS id + ! close DS ids CALL H5Dclose_f(dsid, err) + CALL H5Dclose_f(did, err) ! close file CALL H5Fclose_f(fid, err) diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index 23223f4..9eb52ef 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -29,7 +29,7 @@ herr_t H5IM_get_palette(hid_t loc_id, const char *image_name, int pal_number, hi * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -121,7 +121,7 @@ H5IMmake_image_8bitf(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -236,7 +236,7 @@ H5IMmake_image_24bitf(hid_t loc_id, const char *dset_name, hsize_t width, hsize_ * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -292,7 +292,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -385,7 +385,7 @@ H5IMmake_palettef(hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, i * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -421,7 +421,7 @@ H5IMget_palettef(hid_t loc_id, const char *image_name, int pal_number, int_f *pa * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * diff --git a/hl/fortran/src/H5IMcc.h b/hl/fortran/src/H5IMcc.h index 0527a39..7473c00 100644 --- a/hl/fortran/src/H5IMcc.h +++ b/hl/fortran/src/H5IMcc.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5IMCC_H -#define _H5IMCC_H +#ifndef H5IMCC_H +#define H5IMCC_H #include "H5LTprivate.h" #include "H5IMprivate.h" diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index 2e16c8b..b8897cc 100644 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -24,7 +24,7 @@ * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -79,7 +79,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -129,7 +129,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -192,7 +192,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -269,7 +269,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -315,7 +315,7 @@ h5imis_image_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -365,7 +365,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -425,7 +425,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -485,7 +485,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 06 2004 * @@ -541,7 +541,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 06 2004 * @@ -600,7 +600,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 06 2004 * @@ -653,7 +653,7 @@ done: * * Return: true, false, fail * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 06, 2004 * diff --git a/hl/fortran/src/H5IMff.F90 b/hl/fortran/src/H5IMff.F90 index 69cfd27..9709032 100644 --- a/hl/fortran/src/H5IMff.F90 +++ b/hl/fortran/src/H5IMff.F90 @@ -41,7 +41,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -95,7 +95,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -142,7 +142,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -204,7 +204,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -267,7 +267,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -313,7 +313,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -364,7 +364,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -416,7 +416,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -467,7 +467,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -516,7 +516,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -567,7 +567,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -619,7 +619,7 @@ CONTAINS ! ! Return: true, false, fail ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index a912d0b..8847c01 100644 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5LTf90proto_H -#define _H5LTf90proto_H +#ifndef H5LTf90proto_H +#define H5LTf90proto_H #include "H5public.h" #include "H5f90i.h" @@ -206,4 +206,4 @@ int_f h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_ size_t_f *field_sizes, size_t_f *field_offsets, size_t_f *type_size, size_t_f *namelen2, size_t_f *lenmax, _fcd field_names, size_t_f *maxlen_out); -#endif /* _H5LTf90proto_H */ +#endif /* H5LTf90proto_H */ diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index be036ff..e87a9d3 100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -24,7 +24,7 @@ * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -88,7 +88,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -143,7 +143,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -203,7 +203,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -256,7 +256,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -358,7 +358,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -442,7 +442,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -512,7 +512,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -567,7 +567,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -613,7 +613,7 @@ h5ltfind_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -686,7 +686,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -749,7 +749,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: September 09, 2004 * diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 index f4e4cdf..ba4b770 100644 --- a/hl/fortran/src/H5LTff.F90 +++ b/hl/fortran/src/H5LTff.F90 @@ -164,7 +164,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 1, 2004 ! @@ -385,7 +385,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -426,7 +426,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -595,7 +595,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -770,7 +770,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -933,7 +933,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -983,7 +983,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -1092,7 +1092,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1143,7 +1143,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1193,7 +1193,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1245,7 +1245,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1350,7 +1350,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1397,7 +1397,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1443,7 +1443,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1490,7 +1490,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1551,7 +1551,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 30, 2004 ! @@ -1600,7 +1600,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1644,7 +1644,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 30, 2004 ! @@ -1703,7 +1703,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1757,7 +1757,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 30, 2004 ! diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index 857cbac..23e3377 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -26,7 +26,7 @@ * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -296,7 +296,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -344,7 +344,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -392,7 +392,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -436,7 +436,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -480,7 +480,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 13, 2004 * @@ -527,7 +527,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 13, 2004 * @@ -572,7 +572,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -617,7 +617,7 @@ done: * * Return: Success: 0, Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: October 13, 2004 * diff --git a/hl/fortran/src/H5TBff.F90 b/hl/fortran/src/H5TBff.F90 index d9e65ad..35a88b8 100644 --- a/hl/fortran/src/H5TBff.F90 +++ b/hl/fortran/src/H5TBff.F90 @@ -172,7 +172,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -424,7 +424,7 @@ CONTAINS ! ! Purpose: Writes one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -505,7 +505,7 @@ CONTAINS ! ! Purpose: Reads one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -586,7 +586,7 @@ CONTAINS ! ! Purpose: Writes one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -661,7 +661,7 @@ CONTAINS ! ! Purpose: Reads one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -734,7 +734,7 @@ CONTAINS ! ! Purpose: Inserts one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! @@ -807,7 +807,7 @@ CONTAINS ! ! Purpose: Inserts one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! @@ -858,7 +858,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! @@ -909,7 +909,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! diff --git a/hl/src/H5DOpublic.h b/hl/src/H5DOpublic.h index 50d58f5..88616a3 100644 --- a/hl/src/H5DOpublic.h +++ b/hl/src/H5DOpublic.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5DOpublic_H -#define _H5DOpublic_H +#ifndef H5DOpublic_H +#define H5DOpublic_H #ifdef __cplusplus extern "C" { diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 1419736..2bd4046 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include #include "H5DSprivate.h" #include "H5LTprivate.h" #include "H5IMprivate.h" @@ -34,17 +31,12 @@ static hid_t H5DS_get_REFLIST_type(void); * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 04, 2005 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5DSset_scale(hid_t dsid, const char *dimname) { @@ -105,17 +97,12 @@ H5DSset_scale(hid_t dsid, const char *dimname) * If DSID is not a Dimension Scale * If DID is a Dimension Scale (A Dimension Scale cannot have scales) * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: December 20, 2004 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) { @@ -558,19 +545,12 @@ out: * Note that a scale may be associated with more than dimension of the same dataset. * If so, the detach operation only deletes one of the associations, for DID. * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: December 20, 2004 * - * Comments: - * - * Modifications: Function didn't delete DIMENSION_LIST attribute, when - * all dimension scales were detached from a dataset; added. - * 2010/05/13 EIP - * *------------------------------------------------------------------------- */ - herr_t H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx) { @@ -944,17 +924,12 @@ out: * If DSID is not a Dimension Scale * If DID is a Dimension Scale (A Dimension Scale cannot have scales) * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: February 18, 2005 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ - htri_t H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx) { @@ -1263,17 +1238,12 @@ out: * C. Negative causes the iterator to immediately return that value, * indicating failure. * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 31, 2005 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visitor, void *visitor_data) { @@ -1433,17 +1403,12 @@ out: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 11, 2005 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) { @@ -1459,6 +1424,9 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label) char ** buf; /* discarding the 'const' qualifier in the free */ char const **const_buf; /* buf calls */ } u; + + HDmemset(&u, 0, sizeof(u)); + /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- @@ -1638,16 +1606,10 @@ out: * * Return: 0 if no label found, size of label if found, Failure: FAIL * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 11, 2005 * - * Comments: - * - * Modifications: - * JIRA HDFFV-7673: Added a check to see if the label name exists, - * if not then returns zero. July 30, 2011. MSB - * *------------------------------------------------------------------------- */ ssize_t @@ -1793,19 +1755,12 @@ out: * * Return: size of name if found, zero if not found, Failure: FAIL * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 04, 2005 * - * Comments: - * - * Modifications: - * The size of the name returned should not include the NULL termination - * in its value so as to be consistent with other HDF5 APIs. - * *------------------------------------------------------------------------- */ - ssize_t H5DSget_scale_name(hid_t did, char *name, size_t size) { @@ -1917,46 +1872,44 @@ out: * * Return: 1, is, 0, not, FAIL, error * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 04, 2005 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ - htri_t H5DSis_scale(hid_t did) { - hid_t tid = -1; /* attribute type ID */ - hid_t aid = -1; /* attribute ID */ - herr_t has_class; /* has the "CLASS" attribute */ - htri_t is_ds; /* boolean return value */ - H5I_type_t it; /* ID type */ - char * buf; /* Name of attribute */ - hsize_t storage_size; /* Size of storage for attribute */ - - /*------------------------------------------------------------------------- + hid_t tid = -1; /* attribute type ID */ + hid_t aid = -1; /* attribute ID */ + herr_t attr_class; /* has the "CLASS" attribute */ + htri_t is_ds = -1; /* set to "not a dimension scale" */ + H5I_type_t it; /* type of identifier */ + char * buf = NULL; /* buffer to read name of attribute */ + size_t string_size; /* size of storage for the attribute */ + H5T_class_t type_class; + H5T_str_t strpad; + + /*------------------------------------------------------------------------ * parameter checking *------------------------------------------------------------------------- */ /* get ID type */ if ((it = H5Iget_type(did)) < 0) - return FAIL; + goto out; if (H5I_DATASET != it) - return FAIL; + goto out; /* try to find the attribute "CLASS" on the dataset */ - if ((has_class = H5LT_find_attribute(did, "CLASS")) < 0) - return FAIL; + if ((attr_class = H5LT_find_attribute(did, "CLASS")) < 0) + goto out; - if (has_class == 0) + if (attr_class == 0) { is_ds = 0; - + goto out; + } else { if ((aid = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0) goto out; @@ -1964,19 +1917,33 @@ H5DSis_scale(hid_t did) if ((tid = H5Aget_type(aid)) < 0) goto out; - /* check to make sure attribute is a string */ - if (H5T_STRING != H5Tget_class(tid)) + /* check to make sure attribute is a string; + if not, then it is not dimension scale */ + if ((type_class = H5Tget_class(tid)) < 0) goto out; - - /* check to make sure string is null-terminated */ - if (H5T_STR_NULLTERM != H5Tget_strpad(tid)) + if (H5T_STRING != type_class) { + is_ds = 0; + goto out; + } + /* check to make sure string is null-terminated; + if not, then it is not dimension scale */ + if ((strpad = H5Tget_strpad(tid)) < 0) + goto out; + if (H5T_STR_NULLTERM != strpad) { + is_ds = 0; goto out; + } - /* allocate buffer large enough to hold string */ - if ((storage_size = H5Aget_storage_size(aid)) == 0) + /* According to Spec string is ASCII and its size should be 16 to hold + "DIMENSION_SCALE" string */ + if ((string_size = H5Tget_size(tid)) == 0) + goto out; + if (string_size != 16) { + is_ds = 0; goto out; + } - buf = (char *)HDmalloc((size_t)storage_size * sizeof(char) + 1); + buf = (char *)HDmalloc((size_t)string_size * sizeof(char)); if (buf == NULL) goto out; @@ -1987,8 +1954,6 @@ H5DSis_scale(hid_t did) /* compare strings */ if (HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS), HDstrlen(buf))) == 0) is_ds = 1; - else - is_ds = 0; HDfree(buf); @@ -1998,18 +1963,17 @@ H5DSis_scale(hid_t did) if (H5Aclose(aid) < 0) goto out; } - - return is_ds; - - /* error zone */ out: - H5E_BEGIN_TRY - { - H5Aclose(aid); - H5Tclose(tid); + if (is_ds < 0) { + HDfree(buf); + H5E_BEGIN_TRY + { + H5Aclose(aid); + H5Tclose(tid); + } + H5E_END_TRY; } - H5E_END_TRY; - return FAIL; + return is_ds; } /*------------------------------------------------------------------------- @@ -2021,17 +1985,12 @@ out: * Success: number of scales * Failure: FAIL * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 13, 2005 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ - int H5DSget_num_scales(hid_t did, unsigned int idx) { @@ -2144,17 +2103,12 @@ out: * * Return: true, false, fail * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: March 19, 2005 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ - static herr_t H5DS_is_reserved(hid_t did) { @@ -2235,17 +2189,12 @@ out: * * Return: Type identifier on success and negative on failure * - * Programmer: epourmal@hdfgroup.org + * Programmer: Elena Pourmal * * Date: May 22, 2010 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ - static hid_t H5DS_get_REFLIST_type(void) { diff --git a/hl/src/H5DSprivate.h b/hl/src/H5DSprivate.h index 42dd6bf..0403a4c 100644 --- a/hl/src/H5DSprivate.h +++ b/hl/src/H5DSprivate.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5DSprivate_H -#define _H5DSprivate_H +#ifndef H5DSprivate_H +#define H5DSprivate_H /* High-level library internal header file */ #include "H5HLprivate2.h" diff --git a/hl/src/H5DSpublic.h b/hl/src/H5DSpublic.h index ca7ad3b..7306cbc 100644 --- a/hl/src/H5DSpublic.h +++ b/hl/src/H5DSpublic.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5DSpublic_H -#define _H5DSpublic_H +#ifndef H5DSpublic_H +#define H5DSpublic_H #define DIMENSION_SCALE_CLASS "DIMENSION_SCALE" #define DIMENSION_LIST "DIMENSION_LIST" diff --git a/hl/src/H5HLprivate2.h b/hl/src/H5HLprivate2.h index 1202f00..c696b77 100644 --- a/hl/src/H5HLprivate2.h +++ b/hl/src/H5HLprivate2.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5HLprivate2_H -#define _H5HLprivate2_H +#ifndef H5HLprivate2_H +#define H5HLprivate2_H /* Public HDF5 header */ #include "hdf5.h" @@ -23,4 +23,4 @@ /* HDF5 private functions */ #include "H5private.h" -#endif /* _H5HLprivate2_H */ +#endif /* H5HLprivate2_H */ diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index ca7eb49..ff10d57 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -13,8 +13,6 @@ #include "H5IMprivate.h" #include "H5LTprivate.h" -#include -#include /*------------------------------------------------------------------------- * Function: H5IMmake_image_8bit @@ -23,7 +21,7 @@ * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: June 13, 2001 * @@ -75,7 +73,7 @@ H5IMmake_image_8bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: June 13, 2001 * @@ -151,7 +149,7 @@ H5IMmake_image_24bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t * * Return: * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 28, 2001 * @@ -162,7 +160,8 @@ H5IMmake_image_24bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t *------------------------------------------------------------------------- */ static herr_t -find_palette(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_data) +find_palette(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const H5A_info_t *ainfo, + H5_ATTR_UNUSED void *op_data) { int ret = H5_ITER_CONT; @@ -171,9 +170,9 @@ find_palette(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_d return -1; /* Shut compiler up */ - loc_id = loc_id; - ainfo = ainfo; - op_data = op_data; + (void)loc_id; + (void)ainfo; + (void)op_data; /* Define a positive value for return value if the attribute was found. This will * cause the iterator to immediately return that positive value, @@ -192,7 +191,7 @@ find_palette(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_d * * Return: Success: 1, Failure: 0 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 11, 2001 * @@ -218,7 +217,7 @@ H5IM_find_palette(hid_t loc_id) * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: July 25, 2001 * @@ -386,7 +385,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: June 13, 2001 * @@ -433,7 +432,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 01, 2001 * @@ -485,7 +484,7 @@ H5IMmake_palette(hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, co * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 01, 2001 * @@ -655,7 +654,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: September 10, 2001 * @@ -752,7 +751,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: July 22, 2001 * @@ -837,7 +836,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: July 22, 2001 * @@ -946,7 +945,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: August 30, 2001 * @@ -1048,7 +1047,7 @@ out: * * Return: true, false, fail * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: August 30, 2001 * @@ -1148,7 +1147,7 @@ out: * * Return: true, false, fail * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: August 30, 2001 * diff --git a/hl/src/H5IMprivate.h b/hl/src/H5IMprivate.h index 8803a4c..3570ea3 100644 --- a/hl/src/H5IMprivate.h +++ b/hl/src/H5IMprivate.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5IMprivate_H -#define _H5IMprivate_H +#ifndef H5IMprivate_H +#define H5IMprivate_H /* High-level library internal header file */ #include "H5HLprivate2.h" diff --git a/hl/src/H5IMpublic.h b/hl/src/H5IMpublic.h index fae4902..2843942 100644 --- a/hl/src/H5IMpublic.h +++ b/hl/src/H5IMpublic.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5IMpublic_H -#define _H5IMpublic_H +#ifndef H5IMpublic_H +#define H5IMpublic_H #ifdef __cplusplus extern "C" { diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c index 7edeac8..8bfd0d6 100644 --- a/hl/src/H5LD.c +++ b/hl/src/H5LD.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include -#include #include "H5LDprivate.h" /*------------------------------------------------------------------------- diff --git a/hl/src/H5LDprivate.h b/hl/src/H5LDprivate.h index 2728f8b..862e5b7 100644 --- a/hl/src/H5LDprivate.h +++ b/hl/src/H5LDprivate.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5LDprivate_H -#define _H5LDprivate_H +#ifndef H5LDprivate_H +#define H5LDprivate_H /* High-level library internal header file */ #include "H5HLprivate2.h" @@ -50,4 +50,4 @@ H5_HLDLL int H5LD_construct_vector(char *fields, H5LD_memb_t *listv[], hid_t pa } #endif -#endif /* end _H5LDprivate_H */ +#endif /* end H5LDprivate_H */ diff --git a/hl/src/H5LDpublic.h b/hl/src/H5LDpublic.h index a19f8d0..011b208 100644 --- a/hl/src/H5LDpublic.h +++ b/hl/src/H5LDpublic.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5LDpublic_H -#define _H5LDpublic_H +#ifndef H5LDpublic_H +#define H5LDpublic_H #ifdef __cplusplus extern "C" { @@ -27,4 +27,4 @@ H5_HLDLL herr_t H5LDget_dset_elmts(hid_t did, const hsize_t *prev_dims, const hs } #endif -#endif /* _H5LDpublic_H */ +#endif /* H5LDpublic_H */ diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index a359c7d..fbd2be0 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -11,11 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include -#include - #include "H5LTprivate.h" /* For Lex and Yacc */ @@ -1305,7 +1300,8 @@ out: */ static herr_t -find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_data) +find_dataset(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const H5L_info2_t *linfo, + void *op_data) { /* Define a default zero value for return. This will cause the iterator to continue if * the dataset is not found yet. @@ -1317,8 +1313,8 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_ return ret; /* Shut the compiler up */ - loc_id = loc_id; - linfo = linfo; + (void)loc_id; + (void)linfo; /* Define a positive value for return value if the dataset was found. This will * cause the iterator to immediately return that positive value, @@ -1379,7 +1375,7 @@ H5_GCC_DIAG_ON("cast-qual") * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: July 23, 2001 * @@ -1471,7 +1467,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: July 25, 2001 * @@ -1849,7 +1845,8 @@ H5LTset_attribute_double(hid_t loc_id, const char *obj_name, const char *attr_na *------------------------------------------------------------------------- */ static herr_t -find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_data) +find_attr(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const H5A_info_t *ainfo, + void *op_data) { int ret = H5_ITER_CONT; @@ -1858,8 +1855,8 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_data return H5_ITER_CONT; /* Shut compiler up */ - loc_id = loc_id; - ainfo = ainfo; + (void)loc_id; + (void)ainfo; /* Define a positive value for return value if the attribute was found. This will * cause the iterator to immediately return that positive value, diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 1812cc9..65da9d0 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -1,28 +1,36 @@ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wnested-externs" -#pragma GCC diagnostic ignored "-Wold-style-definition" -#pragma GCC diagnostic ignored "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wsign-compare" -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wstrict-overflow" -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#pragma GCC diagnostic ignored "-Wswitch-default" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-macros" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#elif defined __SUNPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif -#line 2 "hl/src/H5LTanalyze.c" - -#line 4 "hl/src/H5LTanalyze.c" +#if defined (__GNUC__) +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wredundant-decls" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-overflow" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#if !defined (__clang__) +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#endif +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 600 +#pragma GCC diagnostic ignored "-Wnull-dereference" +#endif +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif +#line 1 "hl/src/H5LTanalyze.c" + +#line 3 "hl/src/H5LTanalyze.c" #define YY_INT_ALIGNED short int @@ -30,11 +38,17 @@ #define yy_create_buffer H5LTyy_create_buffer #define yy_delete_buffer H5LTyy_delete_buffer -#define yy_flex_debug H5LTyy_flex_debug +#define yy_scan_buffer H5LTyy_scan_buffer +#define yy_scan_string H5LTyy_scan_string +#define yy_scan_bytes H5LTyy_scan_bytes #define yy_init_buffer H5LTyy_init_buffer #define yy_flush_buffer H5LTyy_flush_buffer #define yy_load_buffer_state H5LTyy_load_buffer_state #define yy_switch_to_buffer H5LTyy_switch_to_buffer +#define yypush_buffer_state H5LTyypush_buffer_state +#define yypop_buffer_state H5LTyypop_buffer_state +#define yyensure_buffer_stack H5LTyyensure_buffer_stack +#define yy_flex_debug H5LTyy_flex_debug #define yyin H5LTyyin #define yyleng H5LTyyleng #define yylex H5LTyylex @@ -49,12 +63,246 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define H5LTyy_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer H5LTyy_create_buffer +#endif + +#ifdef yy_delete_buffer +#define H5LTyy_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer H5LTyy_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define H5LTyy_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer H5LTyy_scan_buffer +#endif + +#ifdef yy_scan_string +#define H5LTyy_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string H5LTyy_scan_string +#endif + +#ifdef yy_scan_bytes +#define H5LTyy_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes H5LTyy_scan_bytes +#endif + +#ifdef yy_init_buffer +#define H5LTyy_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer H5LTyy_init_buffer +#endif + +#ifdef yy_flush_buffer +#define H5LTyy_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer H5LTyy_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define H5LTyy_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state H5LTyy_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define H5LTyy_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer H5LTyy_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define H5LTyypush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state H5LTyypush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define H5LTyypop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state H5LTyypop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define H5LTyyensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack H5LTyyensure_buffer_stack +#endif + +#ifdef yylex +#define H5LTyylex_ALREADY_DEFINED +#else +#define yylex H5LTyylex +#endif + +#ifdef yyrestart +#define H5LTyyrestart_ALREADY_DEFINED +#else +#define yyrestart H5LTyyrestart +#endif + +#ifdef yylex_init +#define H5LTyylex_init_ALREADY_DEFINED +#else +#define yylex_init H5LTyylex_init +#endif + +#ifdef yylex_init_extra +#define H5LTyylex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra H5LTyylex_init_extra +#endif + +#ifdef yylex_destroy +#define H5LTyylex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy H5LTyylex_destroy +#endif + +#ifdef yyget_debug +#define H5LTyyget_debug_ALREADY_DEFINED +#else +#define yyget_debug H5LTyyget_debug +#endif + +#ifdef yyset_debug +#define H5LTyyset_debug_ALREADY_DEFINED +#else +#define yyset_debug H5LTyyset_debug +#endif + +#ifdef yyget_extra +#define H5LTyyget_extra_ALREADY_DEFINED +#else +#define yyget_extra H5LTyyget_extra +#endif + +#ifdef yyset_extra +#define H5LTyyset_extra_ALREADY_DEFINED +#else +#define yyset_extra H5LTyyset_extra +#endif + +#ifdef yyget_in +#define H5LTyyget_in_ALREADY_DEFINED +#else +#define yyget_in H5LTyyget_in +#endif + +#ifdef yyset_in +#define H5LTyyset_in_ALREADY_DEFINED +#else +#define yyset_in H5LTyyset_in +#endif + +#ifdef yyget_out +#define H5LTyyget_out_ALREADY_DEFINED +#else +#define yyget_out H5LTyyget_out +#endif + +#ifdef yyset_out +#define H5LTyyset_out_ALREADY_DEFINED +#else +#define yyset_out H5LTyyset_out +#endif + +#ifdef yyget_leng +#define H5LTyyget_leng_ALREADY_DEFINED +#else +#define yyget_leng H5LTyyget_leng +#endif + +#ifdef yyget_text +#define H5LTyyget_text_ALREADY_DEFINED +#else +#define yyget_text H5LTyyget_text +#endif + +#ifdef yyget_lineno +#define H5LTyyget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno H5LTyyget_lineno +#endif + +#ifdef yyset_lineno +#define H5LTyyset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno H5LTyyset_lineno +#endif + +#ifdef yywrap +#define H5LTyywrap_ALREADY_DEFINED +#else +#define yywrap H5LTyywrap +#endif + +#ifdef yyalloc +#define H5LTyyalloc_ALREADY_DEFINED +#else +#define yyalloc H5LTyyalloc +#endif + +#ifdef yyrealloc +#define H5LTyyrealloc_ALREADY_DEFINED +#else +#define yyrealloc H5LTyyrealloc +#endif + +#ifdef yyfree +#define H5LTyyfree_ALREADY_DEFINED +#else +#define yyfree H5LTyyfree +#endif + +#ifdef yytext +#define H5LTyytext_ALREADY_DEFINED +#else +#define yytext H5LTyytext +#endif + +#ifdef yyleng +#define H5LTyyleng_ALREADY_DEFINED +#else +#define yyleng H5LTyyleng +#endif + +#ifdef yyin +#define H5LTyyin_ALREADY_DEFINED +#else +#define yyin H5LTyyin +#endif + +#ifdef yyout +#define H5LTyyout_ALREADY_DEFINED +#else +#define yyout H5LTyyout +#endif + +#ifdef yy_flex_debug +#define H5LTyy_flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug H5LTyy_flex_debug +#endif + +#ifdef yylineno +#define H5LTyylineno_ALREADY_DEFINED +#else +#define yylineno H5LTyylineno +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -75,7 +323,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -92,7 +340,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -125,65 +373,61 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +/* begin standard C++ headers. */ -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE H5LTyyrestart(H5LTyyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -200,30 +444,30 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t H5LTyyleng; +extern int yyleng; -extern FILE *H5LTyyin, *H5LTyyout; +extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ - /* Undo effects of setting up H5LTyytext. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up H5LTyytext again */ \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -238,12 +482,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -283,8 +527,8 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via H5LTyyrestart()), so that the user can continue scanning by - * just pointing H5LTyyin at a new input file. + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -294,7 +538,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -305,105 +549,100 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when H5LTyytext is formed. */ +/* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t H5LTyyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ -/* Flag which is used to allow H5LTyywrap()'s to do buffer switches - * instead of setting up a fresh H5LTyyin. A bit of a hack ... +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void H5LTyyrestart (FILE *input_file ); -void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE H5LTyy_create_buffer (FILE *file,int size ); -void H5LTyy_delete_buffer (YY_BUFFER_STATE b ); -void H5LTyy_flush_buffer (YY_BUFFER_STATE b ); -void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void H5LTyypop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -static void H5LTyyensure_buffer_stack (void ); -static void H5LTyy_load_buffer_state (void ); -static void H5LTyy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER H5LTyy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE H5LTyy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE H5LTyy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *H5LTyyalloc (yy_size_t ); -void *H5LTyyrealloc (void *,yy_size_t ); -void H5LTyyfree (void * ); - -#define yy_new_buffer H5LTyy_create_buffer +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - H5LTyyensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - H5LTyyensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *H5LTyyin = (FILE *) 0, *H5LTyyout = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; -extern int H5LTyylineno; - -int H5LTyylineno = 1; +extern int yylineno; +int yylineno = 1; -extern char *H5LTyytext; -#define yytext_ptr H5LTyytext +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the - * corresponding action - sets up H5LTyytext. + * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - H5LTyyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 66 -#define YY_END_OF_BUFFER 67 +#define YY_NUM_RULES 64 +#define YY_END_OF_BUFFER 65 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -411,138 +650,56 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_acclist[437] = +static const flex_int16_t yy_accept[275] = { 0, - 64, 64, 64, 64, 67, 66, 64, 66, 64, 65, - 66, 56, 66, 55, 66, 62, 66, 63, 66, 66, - 66, 66, 66, 60, 66, 61, 66, 58, 66, 59, - 66, 57, 66, 57, 64, 66, 57, 64, 65, 66, - 55, 57, 66, 57, 62, 66, 57, 63, 66, 57, - 66, 57, 66, 57, 66, 57, 66, 57, 60, 66, - 57, 61, 66, 57, 58, 66, 57, 59, 66, 64, - 55, 57, 57, 64, 55, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 38, 38, 57, 57, - 57, 57, 57, 57, 39, 39, 57, 57, 57, 57, - - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 37, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 37, 57, 57, 54, 36, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 54, 57, 36, 57, 45, 49, - 51, 53, 57, 57, 57, 45, 57, 49, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 51, 57, 53, - 57, 50, 50, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 52, 35, 57, 57, - 57, 57, 57, 57, 52, 57, 57, 57, 57, 57, - - 57, 57, 57, 57, 35, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 48, - 1, 2, 9, 10, 47, 48, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 1, 57, 2, 57, 57, - 57, 57, 57, 57, 57, 9, 57, 10, 57, 57, - 57, 47, 57, 44, 3, 4, 5, 6, 7, 8, - 11, 12, 13, 14, 15, 16, 57, 44, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - - 57, 57, 57, 57, 57, 57, 57, 3, 57, 4, - 57, 5, 57, 6, 57, 7, 57, 8, 57, 11, - 57, 12, 57, 13, 57, 14, 57, 15, 57, 16, - 57, 57, 57, 57, 43, 46, 28, 29, 30, 31, - 22, 43, 57, 46, 57, 28, 57, 29, 57, 30, - 57, 31, 57, 57, 57, 57, 22, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 17, 24, 23, 41, 17, 57, 57, 57, 57, - 57, 24, 57, 57, 57, 57, 23, 57, 57, 57, - 57, 41, 57, 57, 57, 32, 26, 18, 20, 19, - - 25, 40, 42, 57, 32, 57, 57, 26, 57, 18, - 57, 20, 57, 19, 57, 57, 25, 57, 57, 40, - 57, 42, 57, 33, 27, 21, 33, 57, 57, 27, - 57, 21, 57, 34, 34, 57 + 63, 63, 65, 64, 63, 64, 55, 61, 62, 64, + 64, 64, 64, 59, 60, 57, 58, 63, 0, 55, + 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, + 0, 38, 0, 0, 0, 0, 0, 39, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 54, 36, 0, 0, 0, 45, 49, 0, 0, + 0, 0, 0, 0, 0, 0, 51, 53, 50, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, + 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 2, 0, 0, 0, 0, 0, 0, 9, 10, 0, + 0, 47, 0, 44, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 3, 4, 5, 6, 7, 8, 11, 12, + 13, 14, 15, 16, 0, 0, 0, 43, 46, 28, + 29, 30, 31, 0, 0, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 24, 0, 0, 0, 23, + 0, 0, 0, 41, 0, 0, 0, 32, 0, 26, + 18, 20, 19, 0, 25, 0, 40, 42, 33, 0, + 27, 21, 34, 0 } ; -static yyconst flex_int16_t yy_accept[546] = +static const YY_CHAR yy_ec[256] = { 0, - 1, 2, 3, 4, 5, 6, 7, 9, 12, 14, - 16, 18, 20, 21, 22, 23, 24, 26, 28, 30, - 32, 34, 37, 41, 44, 47, 50, 52, 54, 56, - 58, 61, 64, 67, 70, 71, 72, 72, 72, 72, - 72, 72, 73, 75, 77, 78, 79, 80, 81, 82, - 82, 82, 82, 82, 82, 83, 84, 85, 86, 87, - 88, 88, 88, 88, 88, 88, 90, 91, 92, 93, - 94, 95, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 96, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 112, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 147, 149, 149, 149, 149, 150, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 152, 153, 154, - 155, 156, 158, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 170, 172, 173, 173, 173, 173, 173, 173, - - 173, 173, 173, 173, 173, 173, 173, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 187, 187, 187, 187, 187, 187, 188, 188, 188, 188, - 188, 188, 188, 188, 188, 189, 189, 189, 189, 190, - 191, 192, 193, 194, 195, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 207, 208, 209, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 231, - - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 232, 233, 233, - 233, 233, 233, 233, 233, 234, 235, 235, 235, 236, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 258, - 260, 261, 262, 263, 264, 265, 266, 268, 270, 271, - 272, 274, 274, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 287, 287, 287, 288, 290, 291, - - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 310, 312, 314, - 316, 318, 320, 322, 324, 326, 328, 330, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 341, 341, - 341, 342, 342, 342, 342, 342, 342, 342, 342, 342, - 342, 342, 342, 342, 342, 344, 346, 348, 350, 352, - 354, 355, 356, 357, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 373, - 373, 373, 373, 374, 374, 374, 374, 375, 375, 375, - 375, 376, 376, 376, 378, 379, 380, 381, 382, 384, - - 385, 386, 387, 389, 390, 391, 392, 394, 395, 396, - 396, 397, 397, 398, 399, 400, 401, 401, 402, 402, - 403, 404, 405, 407, 408, 410, 412, 414, 416, 417, - 419, 420, 422, 424, 425, 425, 426, 427, 429, 430, - 432, 434, 435, 437, 437 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 5, 6, 7, - 8, 9, 10, 11, 5, 12, 5, 13, 14, 1, - 1, 1, 1, 1, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 1, 1, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 1, 1, 35, 36, - 37, 1, 38, 1, 39, 1, 1, 1, 1, 1, + 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, + 7, 8, 9, 10, 4, 11, 4, 12, 13, 1, + 1, 1, 1, 1, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 1, 1, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 1, 1, 34, 35, + 36, 1, 37, 1, 38, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 40, 1, 41, 1, 1, 1, 1, 1, + 1, 1, 39, 1, 40, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -559,313 +716,178 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[42] = +static const YY_CHAR yy_meta[41] = { 0, - 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, - 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[547] = +static const flex_int16_t yy_base[277] = { 0, - 0, 0, 41, 0, 610, 611, 81, 83, 611, 0, - 611, 611, 56, 599, 580, 575, 611, 611, 611, 611, - 0, 87, 89, 88, 0, 0, 70, 596, 577, 572, - 0, 0, 0, 0, 101, 0, 584, 567, 569, 571, - 569, 0, 103, 0, 579, 562, 564, 566, 564, 561, - 564, 552, 551, 79, 557, 560, 548, 547, 80, 611, - 566, 97, 87, 569, 560, 0, 563, 117, 90, 566, - 557, 611, 549, 99, 552, 550, 557, 560, 546, 541, - 118, 549, 556, 552, 533, 0, 538, 108, 541, 539, - 546, 549, 535, 530, 126, 538, 545, 541, 522, 527, - - 531, 536, 523, 520, 522, 532, 518, 534, 95, 518, - 528, 510, 524, 611, 525, 513, 517, 522, 509, 506, - 508, 518, 504, 520, 97, 504, 514, 496, 510, 0, - 511, 514, 500, 495, 520, 500, 492, 504, 499, 492, - 481, 106, 496, 492, 498, 611, 611, 501, 487, 482, - 507, 487, 479, 491, 486, 479, 468, 123, 483, 479, - 485, 0, 0, 468, 475, 462, 611, 611, 470, 460, - 464, 464, 126, 470, 126, 480, 611, 611, 459, 466, - 453, 0, 0, 461, 451, 455, 455, 130, 461, 129, - 471, 0, 0, 611, 452, 139, 469, 463, 463, 462, - - 158, 165, 459, 446, 450, 461, 0, 443, 141, 460, - 454, 454, 453, 172, 179, 450, 437, 441, 452, 441, - 435, 433, 438, 150, 424, 611, 451, 454, 451, 151, - 448, 451, 448, 165, 611, 432, 440, 430, 427, 421, - 419, 424, 157, 410, 0, 437, 440, 437, 170, 434, - 437, 434, 172, 0, 418, 426, 416, 421, 421, 417, - 397, 428, 425, 180, 177, 183, 186, 414, 413, 190, - 192, 193, 412, 411, 405, 411, 408, 408, 408, 404, - 384, 415, 412, 201, 196, 199, 206, 401, 400, 211, - 212, 213, 399, 398, 392, 398, 395, 611, 390, 400, - - 380, 215, 217, 388, 382, 384, 381, 220, 223, 225, - 387, 386, 385, 384, 383, 382, 611, 611, 381, 380, - 379, 378, 377, 376, 611, 611, 218, 375, 611, 0, - 370, 380, 360, 227, 236, 368, 362, 364, 361, 235, - 241, 244, 367, 366, 365, 364, 363, 362, 0, 0, - 361, 360, 359, 358, 357, 356, 0, 0, 237, 355, - 0, 350, 611, 366, 352, 351, 350, 349, 352, 333, - 338, 332, 336, 335, 335, 338, 332, 336, 331, 155, - 334, 611, 611, 611, 611, 611, 611, 611, 611, 611, - 611, 611, 611, 340, 335, 325, 329, 0, 345, 331, - - 330, 329, 328, 331, 312, 317, 311, 315, 314, 314, - 317, 311, 315, 310, 168, 313, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 319, 314, - 304, 611, 611, 611, 611, 611, 611, 301, 314, 314, - 611, 295, 301, 305, 310, 294, 308, 290, 294, 294, - 292, 300, 287, 301, 0, 0, 0, 0, 0, 0, - 285, 298, 298, 0, 279, 285, 289, 294, 278, 292, - 274, 278, 278, 276, 284, 271, 285, 611, 275, 266, - 281, 275, 611, 265, 262, 263, 611, 266, 270, 260, - 611, 264, 270, 0, 263, 254, 269, 263, 0, 253, - - 250, 251, 0, 254, 258, 247, 0, 249, 255, 253, - 611, 247, 611, 611, 611, 611, 249, 611, 234, 611, - 611, 245, 0, 233, 0, 0, 0, 0, 234, 0, - 222, 0, 0, 611, 207, 611, 611, 0, 186, 0, - 0, 611, 0, 611, 106, 275 + 0, 0, 299, 300, 296, 0, 0, 300, 300, 11, + 288, 269, 264, 300, 300, 300, 300, 292, 290, 0, + 274, 257, 259, 261, 259, 300, 256, 259, 247, 246, + 16, 300, 265, 33, 14, 268, 259, 300, 251, 24, + 254, 252, 259, 262, 248, 243, 34, 251, 258, 254, + 235, 240, 244, 249, 236, 233, 235, 245, 231, 247, + 36, 231, 241, 223, 237, 300, 238, 241, 227, 222, + 247, 227, 219, 231, 226, 219, 208, 34, 223, 219, + 225, 300, 300, 208, 215, 202, 300, 300, 210, 200, + 204, 204, 38, 210, 39, 220, 300, 300, 300, 201, + + 47, 218, 212, 212, 211, 66, 73, 208, 195, 199, + 210, 199, 193, 191, 196, 75, 182, 300, 209, 212, + 209, 52, 206, 209, 206, 66, 300, 190, 198, 188, + 193, 193, 189, 169, 200, 197, 74, 71, 72, 77, + 186, 185, 84, 86, 87, 184, 183, 177, 183, 180, + 300, 175, 185, 165, 88, 90, 173, 167, 169, 166, + 91, 99, 96, 172, 171, 170, 169, 168, 167, 300, + 300, 166, 165, 164, 163, 162, 161, 300, 300, 94, + 160, 300, 155, 300, 171, 157, 156, 155, 154, 157, + 138, 143, 137, 141, 140, 140, 143, 137, 141, 136, + + 101, 139, 300, 300, 300, 300, 300, 300, 300, 300, + 300, 300, 300, 300, 145, 140, 130, 300, 300, 300, + 300, 300, 300, 127, 140, 140, 300, 121, 127, 131, + 136, 120, 134, 116, 120, 120, 118, 126, 113, 127, + 300, 117, 108, 123, 117, 300, 107, 104, 105, 300, + 108, 112, 102, 300, 105, 106, 104, 300, 93, 300, + 300, 300, 300, 78, 300, 57, 300, 300, 300, 56, + 300, 300, 300, 300, 127, 65 } ; -static yyconst flex_int16_t yy_def[547] = +static const flex_int16_t yy_def[277] = { 0, - 544, 1, 544, 3, 544, 544, 544, 544, 544, 545, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 544, 545, 544, 544, 544, 544, - 544, 546, 546, 24, 546, 546, 546, 546, 546, 544, - 544, 544, 544, 544, 546, 546, 546, 546, 546, 544, - 544, 544, 544, 544, 544, 546, 546, 546, 546, 546, - 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 544, - - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 544, 544, 544, 544, 544, 544, 544, - - 544, 544, 544, 544, 544, 544, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 544, 544, 544, - - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 546, 546, 546, 546, - - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 546, 546, 546, 546, 546, 546, 546, - - 546, 546, 546, 546, 546, 546, 546, 546, 546, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 544, 544, 544, 544, 546, 546, 546, - 546, 544, 546, 0, 544, 544 + 274, 1, 274, 274, 274, 275, 276, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 275, 276, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 0, 274, 274 } ; -static yyconst flex_int16_t yy_nxt[653] = +static const flex_int16_t yy_nxt[341] = { 0, - 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 12, 6, 6, 13, 6, 6, 6, - 6, 14, 6, 6, 6, 6, 15, 6, 6, 6, - 16, 6, 6, 6, 6, 6, 17, 18, 6, 19, - 20, 21, 22, 23, 9, 24, 24, 24, 24, 24, - 24, 24, 24, 25, 26, 21, 21, 27, 21, 21, - 21, 21, 28, 21, 21, 21, 21, 29, 21, 21, - 21, 30, 21, 21, 21, 21, 21, 31, 32, 21, - 33, 34, 35, 35, 35, 35, 37, 38, 43, 43, - 43, 43, 44, 44, 44, 44, 44, 44, 44, 44, - - 45, 46, 35, 35, 43, 43, 64, 70, 36, 65, - 71, 73, 141, 74, 157, 75, 76, 82, 83, 77, - 96, 97, 78, 79, 142, 101, 158, 80, 174, 102, - 81, 87, 110, 88, 117, 89, 90, 103, 118, 91, - 126, 111, 92, 93, 175, 189, 119, 94, 201, 127, - 95, 204, 214, 221, 217, 240, 205, 262, 202, 218, - 263, 190, 215, 227, 282, 228, 268, 283, 229, 230, - 231, 222, 232, 241, 269, 233, 234, 246, 449, 247, - 273, 450, 248, 249, 250, 288, 251, 293, 274, 252, - 253, 472, 311, 289, 473, 294, 304, 305, 313, 306, - - 312, 315, 307, 308, 543, 319, 314, 321, 323, 316, - 309, 343, 310, 320, 345, 322, 324, 336, 337, 344, - 338, 347, 346, 339, 340, 542, 351, 353, 355, 348, - 365, 341, 367, 342, 352, 354, 356, 373, 366, 376, - 368, 378, 400, 374, 377, 394, 375, 379, 380, 395, - 401, 402, 408, 541, 540, 381, 539, 411, 409, 403, - 413, 410, 412, 538, 429, 537, 414, 415, 430, 536, - 535, 534, 533, 532, 416, 42, 531, 42, 530, 529, - 528, 527, 526, 525, 524, 523, 522, 521, 520, 519, - 518, 517, 516, 515, 514, 513, 512, 511, 510, 509, - - 508, 507, 506, 505, 504, 503, 502, 501, 500, 499, - 498, 497, 496, 495, 494, 493, 492, 491, 490, 489, - 488, 487, 486, 485, 484, 483, 482, 481, 480, 479, - 478, 477, 476, 475, 474, 471, 470, 469, 468, 467, - 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, - 456, 455, 454, 453, 452, 451, 448, 447, 446, 445, - 444, 443, 442, 441, 440, 439, 438, 437, 436, 435, - 434, 433, 432, 431, 428, 427, 426, 425, 424, 423, - 422, 421, 420, 419, 418, 417, 407, 406, 405, 404, - 399, 398, 397, 396, 393, 392, 391, 390, 389, 388, - - 387, 386, 385, 384, 383, 382, 372, 371, 370, 369, - 364, 363, 362, 361, 360, 359, 358, 357, 350, 349, - 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, - 325, 318, 317, 303, 302, 301, 300, 299, 298, 297, - 296, 295, 292, 291, 290, 287, 286, 285, 284, 281, - 280, 279, 278, 277, 276, 275, 272, 271, 270, 267, - 266, 265, 264, 261, 260, 259, 258, 257, 256, 255, - 254, 245, 244, 243, 242, 239, 238, 237, 236, 235, - 226, 225, 224, 223, 220, 219, 216, 213, 212, 211, - 210, 209, 208, 207, 206, 203, 200, 199, 198, 197, - - 196, 195, 194, 193, 192, 191, 188, 187, 186, 185, - 184, 183, 182, 181, 180, 179, 178, 177, 176, 173, - 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, - 162, 161, 160, 159, 156, 155, 154, 153, 152, 151, - 150, 149, 148, 147, 146, 145, 144, 143, 140, 139, - 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, - 128, 125, 124, 123, 122, 121, 120, 116, 115, 114, - 113, 112, 109, 108, 107, 106, 105, 104, 100, 99, - 98, 86, 85, 84, 72, 69, 68, 67, 66, 63, - 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, - - 52, 51, 50, 49, 48, 47, 41, 40, 39, 544, - 5, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544 + 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, + 7, 8, 9, 4, 4, 10, 4, 4, 4, 4, + 11, 4, 4, 4, 4, 12, 4, 4, 4, 13, + 4, 4, 4, 4, 4, 14, 15, 4, 16, 17, + 21, 22, 36, 48, 49, 37, 39, 62, 40, 53, + 41, 42, 77, 54, 43, 94, 63, 44, 45, 106, + 113, 55, 46, 109, 78, 47, 141, 20, 110, 107, + 119, 95, 120, 273, 142, 121, 122, 123, 114, 124, + 146, 135, 125, 126, 136, 164, 166, 272, 147, 157, + 158, 168, 159, 165, 167, 160, 161, 271, 172, 169, + + 174, 176, 186, 162, 188, 163, 173, 194, 175, 177, + 187, 199, 189, 195, 197, 270, 196, 200, 201, 198, + 215, 269, 268, 235, 216, 202, 236, 19, 267, 19, + 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, + 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, + 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, + 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, + 224, 223, 222, 221, 220, 219, 218, 217, 214, 213, + 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, + 193, 192, 191, 190, 185, 184, 183, 182, 181, 180, + + 179, 178, 171, 170, 156, 155, 154, 153, 152, 151, + 150, 149, 148, 145, 144, 143, 140, 139, 138, 137, + 134, 133, 132, 131, 130, 129, 128, 127, 118, 117, + 116, 115, 112, 111, 108, 105, 104, 103, 102, 101, + 100, 99, 98, 97, 96, 93, 92, 91, 90, 89, + 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, + 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, + 66, 65, 64, 61, 60, 59, 58, 57, 56, 52, + 51, 50, 38, 35, 34, 33, 32, 31, 30, 29, + 28, 27, 26, 18, 25, 24, 23, 18, 274, 3, + + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274 } ; -static yyconst flex_int16_t yy_chk[653] = +static const flex_int16_t yy_chk[341] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 7, 7, 8, 8, 13, 13, 22, 22, - 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, - - 27, 27, 35, 35, 43, 43, 54, 59, 545, 54, - 59, 62, 109, 62, 125, 62, 62, 63, 63, 62, - 69, 69, 62, 62, 109, 74, 125, 62, 142, 74, - 62, 68, 81, 68, 88, 68, 68, 74, 88, 68, - 95, 81, 68, 68, 142, 158, 88, 68, 173, 95, - 68, 175, 188, 196, 190, 209, 175, 224, 173, 190, - 224, 158, 188, 201, 243, 201, 230, 243, 201, 201, - 202, 196, 202, 209, 230, 202, 202, 214, 380, 214, - 234, 380, 214, 214, 215, 249, 215, 253, 234, 215, - 215, 415, 265, 249, 415, 253, 264, 264, 266, 264, - - 265, 267, 264, 264, 539, 270, 266, 271, 272, 267, - 264, 285, 264, 270, 286, 271, 272, 284, 284, 285, - 284, 287, 286, 284, 284, 535, 290, 291, 292, 287, - 302, 284, 303, 284, 290, 291, 292, 308, 302, 309, - 303, 310, 334, 308, 309, 327, 308, 310, 310, 327, - 334, 335, 340, 531, 529, 310, 524, 341, 340, 335, - 342, 340, 341, 522, 359, 519, 342, 342, 359, 517, - 512, 510, 509, 508, 342, 546, 506, 546, 505, 504, - 502, 501, 500, 498, 497, 496, 495, 493, 492, 490, - 489, 488, 486, 485, 484, 482, 481, 480, 479, 477, - - 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, - 466, 465, 463, 462, 461, 454, 453, 452, 451, 450, - 449, 448, 447, 446, 445, 444, 443, 442, 440, 439, - 438, 431, 430, 429, 416, 414, 413, 412, 411, 410, - 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, - 399, 397, 396, 395, 394, 381, 379, 378, 377, 376, - 375, 374, 373, 372, 371, 370, 369, 368, 367, 366, - 365, 364, 362, 360, 356, 355, 354, 353, 352, 351, - 348, 347, 346, 345, 344, 343, 339, 338, 337, 336, - 333, 332, 331, 328, 324, 323, 322, 321, 320, 319, - - 316, 315, 314, 313, 312, 311, 307, 306, 305, 304, - 301, 300, 299, 297, 296, 295, 294, 293, 289, 288, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 269, 268, 263, 262, 261, 260, 259, 258, 257, - 256, 255, 252, 251, 250, 248, 247, 246, 244, 242, - 241, 240, 239, 238, 237, 236, 233, 232, 231, 229, - 228, 227, 225, 223, 222, 221, 220, 219, 218, 217, - 216, 213, 212, 211, 210, 208, 206, 205, 204, 203, - 200, 199, 198, 197, 195, 191, 189, 187, 186, 185, - 184, 181, 180, 179, 176, 174, 172, 171, 170, 169, - - 166, 165, 164, 161, 160, 159, 157, 156, 155, 154, - 153, 152, 151, 150, 149, 148, 145, 144, 143, 141, - 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, - 129, 128, 127, 126, 124, 123, 122, 121, 120, 119, - 118, 117, 116, 115, 113, 112, 111, 110, 108, 107, - 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, - 96, 94, 93, 92, 91, 90, 89, 87, 85, 84, - 83, 82, 80, 79, 78, 77, 76, 75, 73, 71, - 70, 67, 65, 64, 61, 58, 57, 56, 55, 53, - 52, 51, 50, 49, 48, 47, 46, 45, 41, 40, - - 39, 38, 37, 30, 29, 28, 16, 15, 14, 5, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544 + 10, 10, 31, 35, 35, 31, 34, 47, 34, 40, + 34, 34, 61, 40, 34, 78, 47, 34, 34, 93, + 101, 40, 34, 95, 61, 34, 122, 276, 95, 93, + 106, 78, 106, 270, 122, 106, 106, 107, 101, 107, + 126, 116, 107, 107, 116, 138, 139, 266, 126, 137, + 137, 140, 137, 138, 139, 137, 137, 264, 143, 140, + + 144, 145, 155, 137, 156, 137, 143, 161, 144, 145, + 155, 163, 156, 161, 162, 259, 161, 163, 163, 162, + 180, 257, 256, 201, 180, 163, 201, 275, 255, 275, + 253, 252, 251, 249, 248, 247, 245, 244, 243, 242, + 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, + 230, 229, 228, 226, 225, 224, 217, 216, 215, 202, + 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, + 190, 189, 188, 187, 186, 185, 183, 181, 177, 176, + 175, 174, 173, 172, 169, 168, 167, 166, 165, 164, + 160, 159, 158, 157, 154, 153, 152, 150, 149, 148, + + 147, 146, 142, 141, 136, 135, 134, 133, 132, 131, + 130, 129, 128, 125, 124, 123, 121, 120, 119, 117, + 115, 114, 113, 112, 111, 110, 109, 108, 105, 104, + 103, 102, 100, 96, 94, 92, 91, 90, 89, 86, + 85, 84, 81, 80, 79, 77, 76, 75, 74, 73, + 72, 71, 70, 69, 68, 67, 65, 64, 63, 62, + 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, + 50, 49, 48, 46, 45, 44, 43, 42, 41, 39, + 37, 36, 33, 30, 29, 28, 27, 25, 24, 23, + 22, 21, 19, 18, 13, 12, 11, 5, 3, 274, + + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274 } ; -extern int H5LTyy_flex_debug; -int H5LTyy_flex_debug = 0; - -static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = (yy_hold_char); /* undo effects of setting up H5LTyytext */ \ -yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ -++(yy_lp); \ -goto find_rule; \ -} +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; +extern int yy_flex_debug; +int yy_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *H5LTyytext; +char *yytext; #line 1 "hl/src/H5LTanalyze.l" /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * @@ -885,16 +907,15 @@ char *H5LTyytext; * recreate the output files. */ #line 21 "hl/src/H5LTanalyze.l" +#include #include #include #include -#include "H5LTparse.h" -/* Turn off suggest const & malloc attribute warnings in gcc */ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" -#endif +#include "H5private.h" +#include "H5LTparse.h" +static char *trim_quotes(const char *); int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) @@ -909,79 +930,45 @@ int my_yyinput(char *, int); extern char *myinput; extern size_t input_len; -#define STACK_SIZE 16 - -/*variables for compound type*/ -struct cmpd_info { - hid_t id; - hbool_t is_field; - hbool_t first_memb; -}; -extern struct cmpd_info cmpd_stack[STACK_SIZE]; -extern int csindex; - -/*variables for array type*/ -struct arr_info { - hsize_t dims[H5S_MAX_RANK]; - int ndim; - hbool_t is_dim; -}; -extern struct arr_info arr_stack[STACK_SIZE]; -extern int asindex; - -/*variables for enumerate type*/ -extern hbool_t is_enum; -extern hbool_t is_enum_memb; - -/*variables for string type*/ -extern hbool_t is_str_size; - -/*variables for opaque type*/ -extern hbool_t is_opq_size; -extern hbool_t is_opq_tag; - -hbool_t first_quote = 1; - - -#line 925 "hl/src/H5LTanalyze.c" +#line 903 "hl/src/H5LTanalyze.c" +#line 904 "hl/src/H5LTanalyze.c" #define INITIAL 0 -#define TAG_STRING 1 #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int H5LTyylex_destroy (void ); +int yylex_destroy ( void ); -int H5LTyyget_debug (void ); +int yyget_debug ( void ); -void H5LTyyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE H5LTyyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void H5LTyyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *H5LTyyget_in (void ); +FILE *yyget_in ( void ); -void H5LTyyset_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *H5LTyyget_out (void ); +FILE *yyget_out ( void ); -void H5LTyyset_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -yy_size_t H5LTyyget_leng (void ); + int yyget_leng ( void ); -char *H5LTyyget_text (void ); +char *yyget_text ( void ); -int H5LTyyget_lineno (void ); +int yyget_lineno ( void ); -void H5LTyyset_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -989,35 +976,43 @@ void H5LTyyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int H5LTyywrap (void ); +extern "C" int yywrap ( void ); #else -extern int H5LTyywrap (void ); +extern int yywrap ( void ); #endif #endif - static void yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr ); + +#endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1025,7 +1020,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( H5LTyytext, H5LTyyleng, 1, H5LTyyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1036,20 +1031,20 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ - (c = getc( H5LTyyin )) != EOF && c != '\n'; ++n ) \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ - if ( c == EOF && ferror( H5LTyyin ) ) \ + if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, H5LTyyin))==0 && ferror(H5LTyyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1057,7 +1052,7 @@ static int input (void ); break; \ } \ errno=0; \ - clearerr(H5LTyyin); \ + clearerr(yyin); \ } \ }\ \ @@ -1090,12 +1085,12 @@ static int input (void ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int H5LTyylex (void); +extern int yylex (void); -#define YY_DECL int H5LTyylex (void) +#define YY_DECL int yylex (void) #endif /* !YY_DECL */ -/* Code executed at the beginning of each rule, after H5LTyytext and H5LTyyleng +/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION @@ -1104,7 +1099,7 @@ extern int H5LTyylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1114,15 +1109,10 @@ extern int H5LTyylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 82 "hl/src/H5LTanalyze.l" - - -#line 1103 "hl/src/H5LTanalyze.c" - + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) { (yy_init) = 1; @@ -1131,35 +1121,35 @@ YY_DECL YY_USER_INIT; #endif - /* Create the reject buffer large enough to save one state per allowed character. */ - if ( ! (yy_state_buf) ) - (yy_state_buf) = (yy_state_type *)H5LTyyalloc(YY_STATE_BUF_SIZE ); - if ( ! (yy_state_buf) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyylex()" ); - if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ - if ( ! H5LTyyin ) - H5LTyyin = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! H5LTyyout ) - H5LTyyout = stdout; + if ( ! yyout ) + yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 46 "hl/src/H5LTanalyze.l" + + +#line 1116 "hl/src/H5LTanalyze.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); - /* Support of H5LTyytext. */ + /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of @@ -1168,43 +1158,33 @@ YY_DECL yy_bp = yy_cp; yy_current_state = (yy_start); - - (yy_state_ptr) = (yy_state_buf); - *(yy_state_ptr)++ = yy_current_state; - yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 545 ) - yy_c = yy_meta[(unsigned int) yy_c]; + if ( yy_current_state >= 275 ) + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *(yy_state_ptr)++ = yy_current_state; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 611 ); + while ( yy_base[yy_current_state] != 300 ); yy_find_action: - yy_current_state = *--(yy_state_ptr); - (yy_lp) = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[(yy_lp)]; - { - (yy_full_match) = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--(yy_state_ptr); - (yy_lp) = yy_accept[yy_current_state]; + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; @@ -1213,368 +1193,344 @@ do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + case 1: YY_RULE_SETUP -#line 84 "hl/src/H5LTanalyze.l" +#line 48 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 85 "hl/src/H5LTanalyze.l" +#line 49 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 86 "hl/src/H5LTanalyze.l" +#line 50 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 87 "hl/src/H5LTanalyze.l" +#line 51 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 88 "hl/src/H5LTanalyze.l" +#line 52 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 89 "hl/src/H5LTanalyze.l" +#line 53 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 90 "hl/src/H5LTanalyze.l" +#line 54 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 91 "hl/src/H5LTanalyze.l" +#line 55 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 93 "hl/src/H5LTanalyze.l" +#line 57 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 94 "hl/src/H5LTanalyze.l" +#line 58 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 95 "hl/src/H5LTanalyze.l" +#line 59 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 96 "hl/src/H5LTanalyze.l" +#line 60 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 97 "hl/src/H5LTanalyze.l" +#line 61 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 98 "hl/src/H5LTanalyze.l" +#line 62 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 99 "hl/src/H5LTanalyze.l" +#line 63 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 100 "hl/src/H5LTanalyze.l" +#line 64 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 102 "hl/src/H5LTanalyze.l" +#line 66 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 103 "hl/src/H5LTanalyze.l" +#line 67 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 104 "hl/src/H5LTanalyze.l" +#line 68 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 105 "hl/src/H5LTanalyze.l" +#line 69 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 106 "hl/src/H5LTanalyze.l" +#line 70 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 107 "hl/src/H5LTanalyze.l" +#line 71 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 108 "hl/src/H5LTanalyze.l" +#line 72 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 109 "hl/src/H5LTanalyze.l" +#line 73 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 110 "hl/src/H5LTanalyze.l" +#line 74 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 111 "hl/src/H5LTanalyze.l" +#line 75 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 112 "hl/src/H5LTanalyze.l" +#line 76 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 114 "hl/src/H5LTanalyze.l" +#line 78 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 115 "hl/src/H5LTanalyze.l" +#line 79 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 116 "hl/src/H5LTanalyze.l" +#line 80 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 117 "hl/src/H5LTanalyze.l" +#line 81 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 118 "hl/src/H5LTanalyze.l" +#line 82 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 119 "hl/src/H5LTanalyze.l" +#line 83 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 120 "hl/src/H5LTanalyze.l" +#line 84 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 122 "hl/src/H5LTanalyze.l" +#line 86 "hl/src/H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 123 "hl/src/H5LTanalyze.l" +#line 87 "hl/src/H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 124 "hl/src/H5LTanalyze.l" +#line 88 "hl/src/H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 125 "hl/src/H5LTanalyze.l" +#line 89 "hl/src/H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 126 "hl/src/H5LTanalyze.l" +#line 90 "hl/src/H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 127 "hl/src/H5LTanalyze.l" +#line 91 "hl/src/H5LTanalyze.l" {return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 128 "hl/src/H5LTanalyze.l" +#line 92 "hl/src/H5LTanalyze.l" {return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 129 "hl/src/H5LTanalyze.l" +#line 93 "hl/src/H5LTanalyze.l" {return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 130 "hl/src/H5LTanalyze.l" +#line 94 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 131 "hl/src/H5LTanalyze.l" +#line 95 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 132 "hl/src/H5LTanalyze.l" +#line 96 "hl/src/H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 133 "hl/src/H5LTanalyze.l" +#line 97 "hl/src/H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 134 "hl/src/H5LTanalyze.l" +#line 98 "hl/src/H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 136 "hl/src/H5LTanalyze.l" +#line 100 "hl/src/H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 137 "hl/src/H5LTanalyze.l" +#line 101 "hl/src/H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 138 "hl/src/H5LTanalyze.l" +#line 102 "hl/src/H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 139 "hl/src/H5LTanalyze.l" +#line 103 "hl/src/H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 141 "hl/src/H5LTanalyze.l" +#line 105 "hl/src/H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 142 "hl/src/H5LTanalyze.l" +#line 106 "hl/src/H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 143 "hl/src/H5LTanalyze.l" +#line 107 "hl/src/H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 145 "hl/src/H5LTanalyze.l" +#line 109 "hl/src/H5LTanalyze.l" { - if( is_str_size || (is_enum && is_enum_memb) || - is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || - (csindex>-1 && cmpd_stack[csindex].is_field) ) { - H5LTyylval.ival = atoi(H5LTyytext); - return NUMBER; - } else - REJECT; + H5LTyylval.ival = HDatoi(yytext); + return NUMBER; } YY_BREAK case 56: +/* rule 56 can match eol */ YY_RULE_SETUP -#line 155 "hl/src/H5LTanalyze.l" -{ - /*if it's first quote, and is a compound field name or an enum symbol*/ - if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) - && first_quote) { - first_quote = 0; - BEGIN TAG_STRING; - } else /*if it's second quote*/ - first_quote = 1; - return token('"'); - } - YY_BREAK -case 57: -/* rule 57 can match eol */ -YY_RULE_SETUP -#line 165 "hl/src/H5LTanalyze.l" +#line 114 "hl/src/H5LTanalyze.l" { -#ifdef H5_HAVE_WIN32_API - H5LTyylval.sval = _strdup(H5LTyytext); -#else /* H5_HAVE_WIN32_API */ - H5LTyylval.sval = strdup(H5LTyytext); -#endif /* H5_HAVE_WIN32_API */ - BEGIN INITIAL; + H5LTyylval.sval = trim_quotes(yytext); return STRING; } YY_BREAK -case 58: +case 57: YY_RULE_SETUP -#line 175 "hl/src/H5LTanalyze.l" +#line 119 "hl/src/H5LTanalyze.l" {return token('{');} YY_BREAK -case 59: +case 58: YY_RULE_SETUP -#line 176 "hl/src/H5LTanalyze.l" +#line 120 "hl/src/H5LTanalyze.l" {return token('}');} YY_BREAK -case 60: +case 59: YY_RULE_SETUP -#line 177 "hl/src/H5LTanalyze.l" +#line 121 "hl/src/H5LTanalyze.l" {return token('[');} YY_BREAK -case 61: +case 60: YY_RULE_SETUP -#line 178 "hl/src/H5LTanalyze.l" +#line 122 "hl/src/H5LTanalyze.l" {return token(']');} YY_BREAK -case 62: +case 61: YY_RULE_SETUP -#line 179 "hl/src/H5LTanalyze.l" +#line 123 "hl/src/H5LTanalyze.l" {return token(':');} YY_BREAK -case 63: +case 62: YY_RULE_SETUP -#line 180 "hl/src/H5LTanalyze.l" +#line 124 "hl/src/H5LTanalyze.l" {return token(';');} YY_BREAK -case 64: -/* rule 64 can match eol */ +case 63: +/* rule 63 can match eol */ YY_RULE_SETUP -#line 181 "hl/src/H5LTanalyze.l" +#line 125 "hl/src/H5LTanalyze.l" ; YY_BREAK -case 65: -/* rule 65 can match eol */ -YY_RULE_SETUP -#line 182 "hl/src/H5LTanalyze.l" -{ return 0; } - YY_BREAK -case 66: +case 64: YY_RULE_SETUP -#line 184 "hl/src/H5LTanalyze.l" +#line 127 "hl/src/H5LTanalyze.l" ECHO; YY_BREAK -#line 1553 "hl/src/H5LTanalyze.c" - case YY_STATE_EOF(INITIAL): - case YY_STATE_EOF(TAG_STRING): - yyterminate(); +#line 1501 "hl/src/H5LTanalyze.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); case YY_END_OF_BUFFER: { @@ -1589,15 +1545,15 @@ ECHO; { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed H5LTyyin at a new source and called - * H5LTyylex(). If so, then we have to assure + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = H5LTyyin; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -1650,11 +1606,11 @@ ECHO; { (yy_did_buffer_switch_on_eof) = 0; - if ( H5LTyywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * H5LTyytext, we can now set up + * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the @@ -1703,7 +1659,8 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of H5LTyylex */ + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1714,9 +1671,9 @@ ECHO; */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1745,7 +1702,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1758,14 +1715,44 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -1784,7 +1771,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - H5LTyyrestart(H5LTyyin ); + yyrestart( yyin ); } else @@ -1798,12 +1785,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) H5LTyyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1819,25 +1809,26 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - + yy_state_type yy_current_state; + char *yy_cp; + yy_current_state = (yy_start); - (yy_state_ptr) = (yy_state_buf); - *(yy_state_ptr)++ = yy_current_state; - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 545 ) - yy_c = yy_meta[(unsigned int) yy_c]; + if ( yy_current_state >= 275 ) + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *(yy_state_ptr)++ = yy_current_state; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1850,39 +1841,45 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 545 ) - yy_c = yy_meta[(unsigned int) yy_c]; + if ( yy_current_state >= 275 ) + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 544); - if ( ! yy_is_jam ) - *(yy_state_ptr)++ = yy_current_state; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 274); return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; +#ifndef YY_NO_UNPUT + static void yyunput (int c, char * yy_bp ) +{ + char *yy_cp; + yy_cp = (yy_c_buf_p); - /* undo effects of setting up H5LTyytext */ + /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + int number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1891,7 +1888,7 @@ static int yy_get_next_buffer (void) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1904,6 +1901,8 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1913,7 +1912,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1928,7 +1927,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1945,14 +1944,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - H5LTyyrestart(H5LTyyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( H5LTyywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1971,7 +1970,7 @@ static int yy_get_next_buffer (void) } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve H5LTyytext */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; @@ -1980,35 +1979,35 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ - void H5LTyyrestart (FILE * input_file ) + void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - H5LTyy_init_buffer(YY_CURRENT_BUFFER,input_file ); - H5LTyy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ - void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with - * H5LTyypop_buffer_state(); - * H5LTyypush_buffer_state(new_buffer); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -2021,61 +2020,61 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during - * EOF (H5LTyywrap()) processing, but the only time this flag - * is looked at is after H5LTyywrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } -static void H5LTyy_load_buffer_state (void) +static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - H5LTyyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ - YY_BUFFER_STATE H5LTyy_create_buffer (FILE * file, int size ) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) H5LTyyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - H5LTyy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } /** Destroy the buffer. - * @param b a buffer created with H5LTyy_create_buffer() - * + * @param b a buffer created with yy_create_buffer() + * */ - void H5LTyy_delete_buffer (YY_BUFFER_STATE b ) + void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2083,27 +2082,27 @@ static void H5LTyy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - H5LTyyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - H5LTyyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a H5LTyyrestart() or at EOF. + * such as during a yyrestart() or at EOF. */ - static void H5LTyy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; - - H5LTyy_flush_buffer(b ); + + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then H5LTyy_init_buffer was _probably_ - * called from H5LTyyrestart() or through yy_get_next_buffer. + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ @@ -2112,15 +2111,15 @@ static void H5LTyy_load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ - void H5LTyy_flush_buffer (YY_BUFFER_STATE b ) + void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -2140,23 +2139,23 @@ static void H5LTyy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ -void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; - H5LTyyensure_buffer_stack(); + yyensure_buffer_stack(); - /* This block is copied from H5LTyy_switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -2170,27 +2169,27 @@ void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from H5LTyy_switch_to_buffer. */ - H5LTyy_load_buffer_state( ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ -void H5LTyypop_buffer_state (void) +void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; - H5LTyy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -2198,22 +2197,22 @@ void H5LTyypop_buffer_state (void) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void H5LTyyensure_buffer_stack (void) +static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyalloc + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -2225,15 +2224,15 @@ static void H5LTyyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyrealloc + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -2244,80 +2243,80 @@ static void H5LTyyensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE H5LTyy_scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - H5LTyy_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } -/** Setup the input buffer state to scan a string. The next call to H5LTyylex() will +/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * H5LTyy_scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE H5LTyy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - - return H5LTyy_scan_bytes(yystr,strlen(yystr) ); + + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } -/** Setup the input buffer state to scan the given bytes. The next call to H5LTyylex() will +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) H5LTyyalloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = H5LTyy_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in H5LTyy_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -2331,9 +2330,9 @@ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_ #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2343,150 +2342,142 @@ static void yy_fatal_error (yyconst char* msg ) #define yyless(n) \ do \ { \ - /* Undo effects of setting up H5LTyytext. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - H5LTyytext[H5LTyyleng] = (yy_hold_char); \ - (yy_c_buf_p) = H5LTyytext + yyless_macro_arg; \ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ - H5LTyyleng = yyless_macro_arg; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ -int H5LTyyget_lineno (void) +int yyget_lineno (void) { - - return H5LTyylineno; + + return yylineno; } /** Get the input stream. - * + * */ -FILE *H5LTyyget_in (void) +FILE *yyget_in (void) { - return H5LTyyin; + return yyin; } /** Get the output stream. - * + * */ -FILE *H5LTyyget_out (void) +FILE *yyget_out (void) { - return H5LTyyout; + return yyout; } /** Get the length of the current token. - * + * */ -yy_size_t H5LTyyget_leng (void) +int yyget_leng (void) { - return H5LTyyleng; + return yyleng; } /** Get the current token. - * + * */ -char *H5LTyyget_text (void) +char *yyget_text (void) { - return H5LTyytext; + return yytext; } /** Set the current line number. - * @param line_number - * + * @param _line_number line number + * */ -void H5LTyyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - - H5LTyylineno = line_number; + + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. - * - * @see H5LTyy_switch_to_buffer + * @param _in_str A readable stream. + * + * @see yy_switch_to_buffer */ -void H5LTyyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - H5LTyyin = in_str ; + yyin = _in_str ; } -void H5LTyyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - H5LTyyout = out_str ; + yyout = _out_str ; } -int H5LTyyget_debug (void) +int yyget_debug (void) { - return H5LTyy_flex_debug; + return yy_flex_debug; } -void H5LTyyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - H5LTyy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. - * This function is called from H5LTyylex_destroy(), so don't allocate here. + * This function is called from yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; - (yy_state_buf) = 0; - (yy_state_ptr) = 0; - (yy_full_match) = 0; - (yy_lp) = 0; - /* Defined in main.c */ #ifdef YY_STDINIT - H5LTyyin = stdin; - H5LTyyout = stdout; + yyin = stdin; + yyout = stdout; #else - H5LTyyin = (FILE *) 0; - H5LTyyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by - * H5LTyylex_init() + * yylex_init() */ return 0; } -/* H5LTyylex_destroy is for both reentrant and non-reentrant scanners. */ -int H5LTyylex_destroy (void) +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - H5LTyy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; - H5LTyypop_buffer_state(); + yypop_buffer_state(); } /* Destroy the stack itself. */ - H5LTyyfree((yy_buffer_stack) ); + yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; - H5LTyyfree ( (yy_state_buf) ); - (yy_state_buf) = NULL; - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * H5LTyylex() is called, initialization will occur. */ + * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; @@ -2497,18 +2488,19 @@ int H5LTyylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2516,13 +2508,14 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *H5LTyyalloc (yy_size_t size ) +void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } -void *H5LTyyrealloc (void * ptr, yy_size_t size ) +void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2530,35 +2523,53 @@ void *H5LTyyrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void H5LTyyfree (void * ptr ) +void yyfree (void * ptr ) { - free( (char *) ptr ); /* see H5LTyyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 184 "hl/src/H5LTanalyze.l" +#line 127 "hl/src/H5LTanalyze.l" + + +/* Allocate a copy of `quoted` with the double quote character at + * the beginning and the one at the end both removed. The caller is + * responsible for free()ing the copy. + */ +static char * +trim_quotes(const char *quoted) +{ + size_t len = HDstrlen(quoted); + char *trimmed; + + HDassert(quoted[0] == '"' && quoted[len - 1] == '"'); + trimmed = HDstrdup(quoted + 1); + trimmed[len - 2] = '\0'; + + return trimmed; +} int my_yyinput(char *buf, int max_size) { int ret; - memcpy(buf, myinput, input_len); + HDmemcpy(buf, myinput, input_len); ret = (int)input_len; return ret; } int H5LTyyerror(const char *msg) { - printf("ERROR: %s before \"%s\".\n", msg, H5LTyytext); + HDprintf("ERROR: %s before \"%s\".\n", msg, yytext); return 0; } -int H5LTyywrap() +int yywrap() { return(1); } diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 660b1f7..fd1cbe5 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -18,16 +18,15 @@ */ %{ +#include #include #include #include -#include "H5LTparse.h" -/* Turn off suggest const & malloc attribute warnings in gcc */ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" -#endif +#include "H5private.h" +#include "H5LTparse.h" +static char *trim_quotes(const char *); int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) @@ -42,43 +41,8 @@ int my_yyinput(char *, int); extern char *myinput; extern size_t input_len; -#define STACK_SIZE 16 - -/*variables for compound type*/ -struct cmpd_info { - hid_t id; - hbool_t is_field; - hbool_t first_memb; -}; -extern struct cmpd_info cmpd_stack[STACK_SIZE]; -extern int csindex; - -/*variables for array type*/ -struct arr_info { - hsize_t dims[H5S_MAX_RANK]; - int ndim; - hbool_t is_dim; -}; -extern struct arr_info arr_stack[STACK_SIZE]; -extern int asindex; - -/*variables for enumerate type*/ -extern hbool_t is_enum; -extern hbool_t is_enum_memb; - -/*variables for string type*/ -extern hbool_t is_str_size; - -/*variables for opaque type*/ -extern hbool_t is_opq_size; -extern hbool_t is_opq_tag; - -hbool_t first_quote = 1; - %} -%s TAG_STRING - %% H5T_STD_I8BE {return hid(H5T_STD_I8BE_TOKEN);} @@ -124,9 +88,9 @@ STRSIZE {return token(STRSIZE_TOKEN);} STRPAD {return token(STRPAD_TOKEN);} CSET {return token(CSET_TOKEN);} CTYPE {return token(CTYPE_TOKEN);} -H5T_STR_NULLTERM {return token(H5T_STR_NULLTERM_TOKEN);} -H5T_STR_NULLPAD {return token(H5T_STR_NULLPAD_TOKEN);} -H5T_STR_SPACEPAD {return token(H5T_STR_SPACEPAD_TOKEN);} +H5T_STR_NULLTERM {return token(H5T_STR_NULLTERM_TOKEN);} +H5T_STR_NULLPAD {return token(H5T_STR_NULLPAD_TOKEN);} +H5T_STR_SPACEPAD {return token(H5T_STR_SPACEPAD_TOKEN);} H5T_CSET_ASCII {return token(H5T_CSET_ASCII_TOKEN);} H5T_CSET_UTF8 {return token(H5T_CSET_UTF8_TOKEN);} H5T_C_S1 {return token(H5T_C_S1_TOKEN);} @@ -142,36 +106,16 @@ H5T_OPAQUE {return token(H5T_OPAQUE_TOKEN);} OPQ_SIZE {return token(OPQ_SIZE_TOKEN);} OPQ_TAG {return token(OPQ_TAG_TOKEN);} -[0-9]+ { - if( is_str_size || (is_enum && is_enum_memb) || - is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || - (csindex>-1 && cmpd_stack[csindex].is_field) ) { - H5LTyylval.ival = atoi(yytext); - return NUMBER; - } else - REJECT; +[0-9]+ { + H5LTyylval.ival = HDatoi(yytext); + return NUMBER; } -"\"" { - /*if it's first quote, and is a compound field name or an enum symbol*/ - if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) - && first_quote) { - first_quote = 0; - BEGIN TAG_STRING; - } else /*if it's second quote*/ - first_quote = 1; - return token('"'); - } -[^\"]+ { -#ifdef H5_HAVE_WIN32_API - H5LTyylval.sval = _strdup(yytext); -#else /* H5_HAVE_WIN32_API */ - H5LTyylval.sval = strdup(yytext); -#endif /* H5_HAVE_WIN32_API */ - BEGIN INITIAL; +["][^\"]+["] { + H5LTyylval.sval = trim_quotes(yytext); return STRING; } - + "{" {return token('{');} "}" {return token('}');} "[" {return token('[');} @@ -179,21 +123,39 @@ OPQ_TAG {return token(OPQ_TAG_TOKEN);} ":" {return token(':');} ";" {return token(';');} [ \t\n]* ; -"\n" { return 0; } %% + +/* Allocate a copy of `quoted` with the double quote character at + * the beginning and the one at the end both removed. The caller is + * responsible for free()ing the copy. + */ +static char * +trim_quotes(const char *quoted) +{ + size_t len = HDstrlen(quoted); + char *trimmed; + + HDassert(quoted[0] == '"' && quoted[len - 1] == '"'); + + trimmed = HDstrdup(quoted + 1); + trimmed[len - 2] = '\0'; + + return trimmed; +} + int my_yyinput(char *buf, int max_size) { int ret; - - memcpy(buf, myinput, input_len); + + HDmemcpy(buf, myinput, input_len); ret = (int)input_len; return ret; } int H5LTyyerror(const char *msg) { - printf("ERROR: %s before \"%s\".\n", msg, yytext); + HDprintf("ERROR: %s before \"%s\".\n", msg, yytext); return 0; } diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index d8661a7..7f552d8 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1,30 +1,38 @@ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wnested-externs" -#pragma GCC diagnostic ignored "-Wold-style-definition" -#pragma GCC diagnostic ignored "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wsign-compare" -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wstrict-overflow" -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#pragma GCC diagnostic ignored "-Wswitch-default" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-macros" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#elif defined __SUNPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif -/* A Bison parser, made by GNU Bison 2.7. */ +#if defined (__GNUC__) +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wredundant-decls" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-overflow" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#if !defined (__clang__) +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#endif +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 600 +#pragma GCC diagnostic ignored "-Wnull-dereference" +#endif +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -66,7 +74,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -85,20 +93,22 @@ #define yyparse H5LTyyparse #define yylex H5LTyylex #define yyerror H5LTyyerror -#define yylval H5LTyylval -#define yychar H5LTyychar #define yydebug H5LTyydebug #define yynerrs H5LTyynerrs +#define yylval H5LTyylval +#define yychar H5LTyychar + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 20 "hl/src/H5LTparse.y" +#line 20 "hl/src/H5LTparse.y" /* yacc.c:339 */ #include #include #include -extern int yylex(); +#include "H5private.h" + +extern int yylex(void); extern int yyerror(const char *); #define STACK_SIZE 16 @@ -111,13 +121,13 @@ struct cmpd_info { }; /*stack for nested compound type*/ -struct cmpd_info cmpd_stack[STACK_SIZE] = { +static struct cmpd_info cmpd_stack[STACK_SIZE] = { {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1} }; -int csindex = -1; /*pointer to the top of compound stack*/ +static int csindex = -1; /*pointer to the top of compound stack*/ /*structure for array type information*/ struct arr_info { @@ -126,33 +136,27 @@ struct arr_info { hbool_t is_dim; /*flag to lexer for dimension*/ }; /*stack for nested array type*/ -struct arr_info arr_stack[STACK_SIZE]; -int asindex = -1; /*pointer to the top of array stack*/ - -hbool_t is_str_size = 0; /*flag to lexer for string size*/ -hbool_t is_str_pad = 0; /*flag to lexer for string padding*/ -H5T_str_t str_pad; /*variable for string padding*/ -H5T_cset_t str_cset; /*variable for string character set*/ -hbool_t is_variable = 0; /*variable for variable-length string*/ -size_t str_size; /*variable for string size*/ +static struct arr_info arr_stack[STACK_SIZE]; +static int asindex = -1; /*pointer to the top of array stack*/ -hid_t enum_id; /*type ID*/ -hbool_t is_enum = 0; /*flag to lexer for enum type*/ -hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ -char* enum_memb_symbol; /*enum member symbol string*/ +static H5T_str_t str_pad; /*variable for string padding*/ +static H5T_cset_t str_cset; /*variable for string character set*/ +static hbool_t is_variable = 0; /*variable for variable-length string*/ +static size_t str_size; /*variable for string size*/ + +static hid_t enum_id; /*type ID*/ +static hbool_t is_enum = 0; /*flag to lexer for enum type*/ +static hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ +static char* enum_memb_symbol; /*enum member symbol string*/ -hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/ -hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ +#line 124 "hl/src/H5LTparse.c" /* yacc.c:339 */ -/* Line 371 of yacc.c */ -#line 128 "hl/src/H5LTparse.c" - -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -168,7 +172,7 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ by #include "H5LTparse.h". */ #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -176,113 +180,99 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ extern int H5LTyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - H5T_STD_I8BE_TOKEN = 258, - H5T_STD_I8LE_TOKEN = 259, - H5T_STD_I16BE_TOKEN = 260, - H5T_STD_I16LE_TOKEN = 261, - H5T_STD_I32BE_TOKEN = 262, - H5T_STD_I32LE_TOKEN = 263, - H5T_STD_I64BE_TOKEN = 264, - H5T_STD_I64LE_TOKEN = 265, - H5T_STD_U8BE_TOKEN = 266, - H5T_STD_U8LE_TOKEN = 267, - H5T_STD_U16BE_TOKEN = 268, - H5T_STD_U16LE_TOKEN = 269, - H5T_STD_U32BE_TOKEN = 270, - H5T_STD_U32LE_TOKEN = 271, - H5T_STD_U64BE_TOKEN = 272, - H5T_STD_U64LE_TOKEN = 273, - H5T_NATIVE_CHAR_TOKEN = 274, - H5T_NATIVE_SCHAR_TOKEN = 275, - H5T_NATIVE_UCHAR_TOKEN = 276, - H5T_NATIVE_SHORT_TOKEN = 277, - H5T_NATIVE_USHORT_TOKEN = 278, - H5T_NATIVE_INT_TOKEN = 279, - H5T_NATIVE_UINT_TOKEN = 280, - H5T_NATIVE_LONG_TOKEN = 281, - H5T_NATIVE_ULONG_TOKEN = 282, - H5T_NATIVE_LLONG_TOKEN = 283, - H5T_NATIVE_ULLONG_TOKEN = 284, - H5T_IEEE_F32BE_TOKEN = 285, - H5T_IEEE_F32LE_TOKEN = 286, - H5T_IEEE_F64BE_TOKEN = 287, - H5T_IEEE_F64LE_TOKEN = 288, - H5T_NATIVE_FLOAT_TOKEN = 289, - H5T_NATIVE_DOUBLE_TOKEN = 290, - H5T_NATIVE_LDOUBLE_TOKEN = 291, - H5T_STRING_TOKEN = 292, - STRSIZE_TOKEN = 293, - STRPAD_TOKEN = 294, - CSET_TOKEN = 295, - CTYPE_TOKEN = 296, - H5T_VARIABLE_TOKEN = 297, - H5T_STR_NULLTERM_TOKEN = 298, - H5T_STR_NULLPAD_TOKEN = 299, - H5T_STR_SPACEPAD_TOKEN = 300, - H5T_CSET_ASCII_TOKEN = 301, - H5T_CSET_UTF8_TOKEN = 302, - H5T_C_S1_TOKEN = 303, - H5T_FORTRAN_S1_TOKEN = 304, - H5T_OPAQUE_TOKEN = 305, - OPQ_SIZE_TOKEN = 306, - OPQ_TAG_TOKEN = 307, - H5T_COMPOUND_TOKEN = 308, - H5T_ENUM_TOKEN = 309, - H5T_ARRAY_TOKEN = 310, - H5T_VLEN_TOKEN = 311, - STRING = 312, - NUMBER = 313 - }; + enum yytokentype + { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 72 "hl/src/H5LTparse.y" +#line 69 "hl/src/H5LTparse.y" /* yacc.c:355 */ int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ +#line 229 "hl/src/H5LTparse.c" /* yacc.c:355 */ +}; -/* Line 387 of yacc.c */ -#line 236 "hl/src/H5LTparse.c" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE H5LTyylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -hid_t H5LTyyparse (void *YYPARSE_PARAM); -#else -hid_t H5LTyyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus hid_t H5LTyyparse (void); -#else -hid_t H5LTyyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 264 "hl/src/H5LTparse.c" +#line 246 "hl/src/H5LTparse.c" /* yacc.c:358 */ #ifdef short # undef short @@ -296,11 +286,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -320,8 +307,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -343,6 +329,33 @@ typedef short int yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -350,23 +363,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -385,8 +400,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -398,8 +412,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -415,7 +429,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -423,15 +437,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -441,7 +453,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -466,16 +478,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -494,7 +506,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -502,33 +514,35 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 58 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 203 +#define YYLAST 197 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 66 +#define YYNTOKENS 65 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 46 +#define YYNNTS 43 /* YYNRULES -- Number of rules. */ -#define YYNRULES 95 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 143 +#define YYNRULES 92 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 134 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 313 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 63, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 64, 65, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 63, 64, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -558,64 +572,19 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 6, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, - 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, - 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, - 78, 80, 82, 84, 86, 88, 90, 92, 93, 99, - 100, 103, 104, 112, 114, 115, 118, 120, 121, 128, - 129, 132, 133, 134, 140, 142, 147, 148, 149, 150, - 151, 167, 169, 171, 172, 173, 174, 175, 176, 197, - 199, 201, 203, 205, 207, 209, 211, 213, 215, 216, - 224, 225, 228, 229, 236, 238 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 67, 0, -1, -1, 68, -1, 69, -1, 72, -1, - 80, -1, 87, -1, 70, -1, 71, -1, 95, -1, - 105, -1, 88, -1, 3, -1, 4, -1, 5, -1, - 6, -1, 7, -1, 8, -1, 9, -1, 10, -1, - 11, -1, 12, -1, 13, -1, 14, -1, 15, -1, - 16, -1, 17, -1, 18, -1, 19, -1, 20, -1, - 21, -1, 22, -1, 23, -1, 24, -1, 25, -1, - 26, -1, 27, -1, 28, -1, 29, -1, 30, -1, - 31, -1, 32, -1, 33, -1, 34, -1, 35, -1, - 36, -1, -1, 53, 73, 59, 74, 60, -1, -1, - 74, 75, -1, -1, 68, 76, 63, 77, 63, 78, - 65, -1, 57, -1, -1, 64, 79, -1, 58, -1, - -1, 55, 81, 59, 82, 68, 60, -1, -1, 82, - 83, -1, -1, -1, 61, 84, 86, 85, 62, -1, - 58, -1, 56, 59, 68, 60, -1, -1, -1, -1, - -1, 50, 59, 51, 89, 93, 65, 90, 52, 91, - 63, 94, 63, 65, 92, 60, -1, 58, -1, 57, - -1, -1, -1, -1, -1, -1, 37, 59, 38, 96, - 101, 65, 97, 39, 102, 65, 98, 40, 103, 65, - 99, 41, 104, 65, 100, 60, -1, 42, -1, 58, - -1, 43, -1, 44, -1, 45, -1, 46, -1, 47, - -1, 48, -1, 49, -1, -1, 54, 59, 70, 65, - 106, 107, 60, -1, -1, 107, 108, -1, -1, 63, - 110, 63, 109, 111, 65, -1, 57, -1, 58, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 105, 105, 106, 108, 109, 110, 111, 113, 114, - 115, 116, 117, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 149, 150, 151, 152, 153, 154, 155, 159, 158, 167, - 168, 170, 170, 207, 215, 216, 219, 221, 221, 230, - 231, 233, 234, 233, 241, 244, 250, 251, 256, 257, - 248, 265, 267, 271, 272, 280, 289, 296, 269, 320, - 321, 323, 324, 325, 327, 328, 330, 331, 335, 334, - 339, 340, 342, 342, 396, 398 + 0, 102, 102, 103, 105, 106, 107, 108, 110, 111, + 112, 113, 114, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 146, 147, 148, 149, 150, 151, 152, 156, 155, 164, + 165, 167, 167, 204, 212, 213, 216, 218, 218, 227, + 228, 230, 231, 230, 238, 241, 248, 253, 245, 260, + 262, 267, 274, 283, 290, 264, 314, 315, 317, 318, + 319, 321, 322, 324, 325, 329, 328, 333, 334, 336, + 336, 386, 388 }; #endif @@ -645,20 +614,20 @@ static const char *const yytname[] = "H5T_C_S1_TOKEN", "H5T_FORTRAN_S1_TOKEN", "H5T_OPAQUE_TOKEN", "OPQ_SIZE_TOKEN", "OPQ_TAG_TOKEN", "H5T_COMPOUND_TOKEN", "H5T_ENUM_TOKEN", "H5T_ARRAY_TOKEN", "H5T_VLEN_TOKEN", "STRING", - "NUMBER", "'{'", "'}'", "'['", "']'", "'\"'", "':'", "';'", "$accept", - "start", "ddl_type", "atomic_type", "integer_type", "fp_type", - "compound_type", "$@1", "memb_list", "memb_def", "$@2", "field_name", - "field_offset", "offset", "array_type", "$@3", "dim_list", "dim", "$@4", - "$@5", "dimsize", "vlen_type", "opaque_type", "$@6", "@7", "$@8", "$@9", - "opaque_size", "opaque_tag", "string_type", "$@10", "$@11", "$@12", - "$@13", "@14", "strsize", "strpad", "cset", "ctype", "enum_type", "$@15", - "enum_list", "enum_def", "$@16", "enum_symbol", "enum_val", YY_NULL + "NUMBER", "'{'", "'}'", "'['", "']'", "':'", "';'", "$accept", "start", + "ddl_type", "atomic_type", "integer_type", "fp_type", "compound_type", + "$@1", "memb_list", "memb_def", "$@2", "field_name", "field_offset", + "offset", "array_type", "$@3", "dim_list", "dim", "$@4", "$@5", + "dimsize", "vlen_type", "opaque_type", "@6", "$@7", "opaque_size", + "opaque_tag", "string_type", "$@8", "$@9", "$@10", "@11", "strsize", + "strpad", "cset", "ctype", "enum_type", "$@12", "enum_list", "enum_def", + "$@13", "enum_symbol", "enum_val", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -667,43 +636,43 @@ static const yytype_uint16 yytoknum[] = 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 123, - 125, 91, 93, 34, 58, 59 + 125, 91, 93, 58, 59 }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 66, 67, 67, 68, 68, 68, 68, 69, 69, - 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 71, 71, 71, 71, 71, 71, 71, 73, 72, 74, - 74, 76, 75, 77, 78, 78, 79, 81, 80, 82, - 82, 84, 85, 83, 86, 87, 89, 90, 91, 92, - 88, 93, 94, 96, 97, 98, 99, 100, 95, 101, - 101, 102, 102, 102, 103, 103, 104, 104, 106, 105, - 107, 107, 109, 108, 110, 111 -}; +#define YYPACT_NINF -25 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-25))) + +#define YYTABLE_NINF -1 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = { - 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, - 2, 0, 7, 1, 0, 2, 1, 0, 6, 0, - 2, 0, 0, 5, 1, 4, 0, 0, 0, 0, - 15, 1, 1, 0, 0, 0, 0, 0, 20, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 7, - 0, 2, 0, 6, 1, 1 + 114, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -24, -22, -25, -13, -25, + -11, 49, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, 18, 45, 38, 168, 39, 114, -25, -4, + 41, -25, 36, -25, 42, -25, -25, 37, -25, 40, + 56, -25, -3, -25, -25, -25, -25, -25, -25, -25, + -25, 43, -25, 66, 55, 51, -21, 57, -25, 0, + 95, -25, 50, -25, -25, -25, -25, -25, -25, -25, + -25, -25, 89, -25, 90, 97, 92, 99, 52, -25, + -25, -25, -25, -25, -25, 94, -25, 119, 100, -25, + -6, -25, -25, -25, 98, -25, 120, 46, -25, -25, + 101, -25, 103, -25 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 13, 14, 15, 16, 17, 18, 19, 20, 21, @@ -711,165 +680,148 @@ static const yytype_uint8 yydefact[] = 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 0, 0, 47, 0, 57, 0, 0, 3, 4, 8, 9, 5, 6, 7, 12, - 10, 11, 0, 0, 0, 0, 0, 0, 1, 73, - 66, 49, 0, 59, 0, 0, 0, 0, 88, 0, - 65, 79, 80, 0, 71, 0, 48, 51, 50, 90, - 61, 0, 60, 74, 67, 0, 0, 0, 58, 0, - 0, 0, 89, 0, 91, 64, 62, 0, 68, 53, - 0, 94, 0, 0, 81, 82, 83, 0, 0, 54, - 92, 63, 75, 0, 0, 0, 0, 0, 72, 0, - 56, 55, 52, 95, 0, 0, 0, 93, 84, 85, - 0, 69, 76, 0, 0, 70, 0, 86, 87, 0, - 77, 0, 78 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 41, 42, 43, 44, 45, 46, 54, 67, 78, - 85, 100, 115, 121, 47, 56, 69, 82, 87, 103, - 96, 48, 49, 66, 90, 108, 133, 75, 119, 50, - 65, 89, 117, 134, 141, 73, 107, 130, 139, 51, - 79, 86, 94, 116, 102, 124 + 10, 11, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 49, 0, 59, 0, 76, 77, 0, 69, 0, + 0, 85, 0, 65, 71, 66, 48, 51, 50, 87, + 61, 0, 60, 0, 0, 0, 0, 0, 58, 0, + 0, 53, 54, 91, 86, 88, 89, 64, 62, 78, + 79, 80, 0, 70, 0, 0, 0, 0, 0, 72, + 67, 56, 55, 52, 92, 0, 63, 0, 0, 90, + 0, 68, 81, 82, 0, 73, 0, 0, 83, 84, + 0, 74, 0, 75 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -25 -static const yytype_int16 yypact[] = + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = { - 114, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -15, -25, 111, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -24, -20, -25, -15, -25, - -14, 49, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, 19, 45, 38, 168, 39, 114, -25, -25, - -25, -25, 34, -25, 40, -4, 43, 56, -25, -3, - -25, -25, -25, 37, -25, 42, -25, -25, -25, -25, - -25, 44, -25, -25, -25, 50, -23, 47, -25, 64, - 62, 51, -25, 58, -25, -25, -25, -2, -25, -25, - 89, -25, 90, 92, -25, -25, -25, 91, 94, 95, - -25, -25, -25, 98, 100, 96, 102, 122, -25, 103, - -25, -25, -25, -25, 133, 9, 134, -25, -25, -25, - 135, -25, -25, 105, 160, -25, 46, -25, -25, 137, - -25, 143, -25 + -25, -25, -25 }; -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { - -25, -25, -21, -25, 108, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25 + -1, 41, 42, 43, 44, 45, 46, 54, 70, 78, + 85, 92, 106, 112, 47, 56, 72, 82, 87, 108, + 98, 48, 49, 84, 118, 69, 104, 50, 83, 117, + 126, 132, 67, 102, 124, 130, 51, 79, 86, 95, + 107, 96, 115 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 52, 64, 92, 71, 53, - 93, 104, 105, 106, 55, 57, 77, 36, 81, 58, - 37, 38, 39, 40, 72, 128, 129, 59, 80, 1, + 31, 32, 33, 34, 35, 52, 93, 53, 65, 94, + 122, 123, 64, 99, 100, 101, 55, 36, 57, 58, + 37, 38, 39, 40, 66, 77, 59, 81, 80, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 137, 138, 60, 61, 63, 68, - 70, 74, 83, 97, 88, 95, 36, 84, 99, 37, - 38, 39, 40, 91, 98, 101, 76, 1, 2, 3, + 32, 33, 34, 35, 128, 129, 60, 61, 63, 68, + 71, 74, 73, 88, 75, 89, 36, 90, 91, 37, + 38, 39, 40, 105, 116, 97, 76, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 109, 110, 111, 118, 112, 113, 120, 114, - 123, 122, 125, 62, 36, 135, 126, 37, 38, 39, + 34, 35, 103, 109, 110, 111, 113, 114, 119, 120, + 121, 127, 125, 133, 36, 131, 62, 37, 38, 39, 40, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 127, 131, - 132, 136, 140, 142 + 20, 21, 22, 23, 24, 25, 26, 27 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-25))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_uint8 yycheck[] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 59, 57, 60, 42, 59, - 63, 43, 44, 45, 59, 59, 67, 50, 69, 0, - 53, 54, 55, 56, 58, 46, 47, 38, 61, 3, + 33, 34, 35, 36, 37, 59, 57, 59, 42, 60, + 46, 47, 57, 43, 44, 45, 59, 50, 59, 0, + 53, 54, 55, 56, 58, 70, 38, 72, 61, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 48, 49, 51, 59, 59, 65, - 60, 58, 65, 39, 60, 58, 50, 65, 57, 53, - 54, 55, 56, 63, 52, 57, 60, 3, 4, 5, + 34, 35, 36, 37, 48, 49, 51, 59, 59, 58, + 64, 64, 60, 60, 64, 39, 50, 52, 57, 53, + 54, 55, 56, 63, 62, 58, 60, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 63, 63, 62, 57, 65, 63, 58, 64, - 58, 65, 40, 55, 50, 60, 63, 53, 54, 55, + 36, 37, 57, 64, 64, 58, 64, 58, 64, 40, + 60, 41, 64, 60, 50, 64, 55, 53, 54, 55, 56, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 65, 65, - 65, 41, 65, 60 + 22, 23, 24, 25, 26, 27, 28, 29 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 50, 53, 54, 55, - 56, 67, 68, 69, 70, 71, 72, 80, 87, 88, - 95, 105, 59, 59, 73, 59, 81, 59, 0, 38, - 51, 59, 70, 59, 68, 96, 89, 74, 65, 82, - 60, 42, 58, 101, 58, 93, 60, 68, 75, 106, - 61, 68, 83, 65, 65, 76, 107, 84, 60, 97, - 90, 63, 60, 63, 108, 58, 86, 39, 52, 57, - 77, 57, 110, 85, 43, 44, 45, 102, 91, 63, - 63, 62, 65, 63, 64, 78, 109, 98, 57, 94, - 58, 79, 65, 58, 111, 40, 63, 65, 46, 47, - 103, 65, 65, 92, 99, 60, 41, 48, 49, 104, - 65, 100, 60 + 56, 66, 67, 68, 69, 70, 71, 79, 86, 87, + 92, 101, 59, 59, 72, 59, 80, 59, 0, 38, + 51, 59, 69, 59, 67, 42, 58, 97, 58, 90, + 73, 64, 81, 60, 64, 64, 60, 67, 74, 102, + 61, 67, 82, 93, 88, 75, 103, 83, 60, 39, + 52, 57, 76, 57, 60, 104, 106, 58, 85, 43, + 44, 45, 98, 57, 91, 63, 77, 105, 84, 64, + 64, 58, 78, 64, 58, 107, 62, 94, 89, 64, + 40, 60, 46, 47, 99, 64, 95, 41, 48, 49, + 100, 64, 96, 60 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 65, 66, 66, 67, 67, 67, 67, 68, 68, + 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, + 70, 70, 70, 70, 70, 70, 70, 72, 71, 73, + 73, 75, 74, 76, 77, 77, 78, 80, 79, 81, + 81, 83, 84, 82, 85, 86, 88, 89, 87, 90, + 91, 93, 94, 95, 96, 92, 97, 97, 98, 98, + 98, 99, 99, 100, 100, 102, 101, 103, 103, 105, + 104, 106, 107 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, + 2, 0, 5, 1, 0, 2, 1, 0, 6, 0, + 2, 0, 0, 5, 1, 4, 0, 0, 11, 1, + 1, 0, 0, 0, 0, 19, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 7, 0, 2, 0, + 4, 1, 1 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + #define YYRECOVERING() (!!yyerrstatus) @@ -886,27 +838,15 @@ do \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -916,40 +856,36 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); @@ -958,14 +894,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -973,22 +903,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -999,16 +918,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1019,49 +930,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1075,7 +979,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1098,15 +1002,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1122,16 +1019,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1161,27 +1050,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1204,11 +1093,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1216,10 +1105,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1269,7 +1154,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1336,31 +1221,17 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif { YYUSE (yyvaluep); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1369,18 +1240,8 @@ yydestruct (yymsg, yytype, yyvaluep) /* The lookahead symbol. */ int yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; @@ -1389,35 +1250,16 @@ int yynerrs; | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -hid_t -yyparse (void *YYPARSE_PARAM) -#else -hid_t -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) hid_t yyparse (void) -#else -hid_t -yyparse () - -#endif -#endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1485,23 +1327,23 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1509,22 +1351,22 @@ yyparse () # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1533,10 +1375,10 @@ yyparse () yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1565,7 +1407,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -1630,7 +1472,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1644,440 +1486,418 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ -#line 105 "hl/src/H5LTparse.y" +#line 102 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } +#line 1462 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 3: -/* Line 1792 of yacc.c */ -#line 106 "hl/src/H5LTparse.y" +#line 103 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { return (yyval.hid);} +#line 1468 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 13: -/* Line 1792 of yacc.c */ -#line 120 "hl/src/H5LTparse.y" +#line 117 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } +#line 1474 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 14: -/* Line 1792 of yacc.c */ -#line 121 "hl/src/H5LTparse.y" +#line 118 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } +#line 1480 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 15: -/* Line 1792 of yacc.c */ -#line 122 "hl/src/H5LTparse.y" +#line 119 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } +#line 1486 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 16: -/* Line 1792 of yacc.c */ -#line 123 "hl/src/H5LTparse.y" +#line 120 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } +#line 1492 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 17: -/* Line 1792 of yacc.c */ -#line 124 "hl/src/H5LTparse.y" +#line 121 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } +#line 1498 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 18: -/* Line 1792 of yacc.c */ -#line 125 "hl/src/H5LTparse.y" +#line 122 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } +#line 1504 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 19: -/* Line 1792 of yacc.c */ -#line 126 "hl/src/H5LTparse.y" +#line 123 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } +#line 1510 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 20: -/* Line 1792 of yacc.c */ -#line 127 "hl/src/H5LTparse.y" +#line 124 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } +#line 1516 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 21: -/* Line 1792 of yacc.c */ -#line 128 "hl/src/H5LTparse.y" +#line 125 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } +#line 1522 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 22: -/* Line 1792 of yacc.c */ -#line 129 "hl/src/H5LTparse.y" +#line 126 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } +#line 1528 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 23: -/* Line 1792 of yacc.c */ -#line 130 "hl/src/H5LTparse.y" +#line 127 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } +#line 1534 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 24: -/* Line 1792 of yacc.c */ -#line 131 "hl/src/H5LTparse.y" +#line 128 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } +#line 1540 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 25: -/* Line 1792 of yacc.c */ -#line 132 "hl/src/H5LTparse.y" +#line 129 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } +#line 1546 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 26: -/* Line 1792 of yacc.c */ -#line 133 "hl/src/H5LTparse.y" +#line 130 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } +#line 1552 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 27: -/* Line 1792 of yacc.c */ -#line 134 "hl/src/H5LTparse.y" +#line 131 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } +#line 1558 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 28: -/* Line 1792 of yacc.c */ -#line 135 "hl/src/H5LTparse.y" +#line 132 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } +#line 1564 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 29: -/* Line 1792 of yacc.c */ -#line 136 "hl/src/H5LTparse.y" +#line 133 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } +#line 1570 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 30: -/* Line 1792 of yacc.c */ -#line 137 "hl/src/H5LTparse.y" +#line 134 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } +#line 1576 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 31: -/* Line 1792 of yacc.c */ -#line 138 "hl/src/H5LTparse.y" +#line 135 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } +#line 1582 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 32: -/* Line 1792 of yacc.c */ -#line 139 "hl/src/H5LTparse.y" +#line 136 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } +#line 1588 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 33: -/* Line 1792 of yacc.c */ -#line 140 "hl/src/H5LTparse.y" +#line 137 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } +#line 1594 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 34: -/* Line 1792 of yacc.c */ -#line 141 "hl/src/H5LTparse.y" +#line 138 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } +#line 1600 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 35: -/* Line 1792 of yacc.c */ -#line 142 "hl/src/H5LTparse.y" +#line 139 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } +#line 1606 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 36: -/* Line 1792 of yacc.c */ -#line 143 "hl/src/H5LTparse.y" +#line 140 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } +#line 1612 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 37: -/* Line 1792 of yacc.c */ -#line 144 "hl/src/H5LTparse.y" +#line 141 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } +#line 1618 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 38: -/* Line 1792 of yacc.c */ -#line 145 "hl/src/H5LTparse.y" +#line 142 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } +#line 1624 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 39: -/* Line 1792 of yacc.c */ -#line 146 "hl/src/H5LTparse.y" +#line 143 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } +#line 1630 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 40: -/* Line 1792 of yacc.c */ -#line 149 "hl/src/H5LTparse.y" +#line 146 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } +#line 1636 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 41: -/* Line 1792 of yacc.c */ -#line 150 "hl/src/H5LTparse.y" +#line 147 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } +#line 1642 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 42: -/* Line 1792 of yacc.c */ -#line 151 "hl/src/H5LTparse.y" +#line 148 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } +#line 1648 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 43: -/* Line 1792 of yacc.c */ -#line 152 "hl/src/H5LTparse.y" +#line 149 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } +#line 1654 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 44: -/* Line 1792 of yacc.c */ -#line 153 "hl/src/H5LTparse.y" +#line 150 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } +#line 1660 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 45: -/* Line 1792 of yacc.c */ -#line 154 "hl/src/H5LTparse.y" +#line 151 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } +#line 1666 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 46: -/* Line 1792 of yacc.c */ -#line 155 "hl/src/H5LTparse.y" +#line 152 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } +#line 1672 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 47: -/* Line 1792 of yacc.c */ -#line 159 "hl/src/H5LTparse.y" +#line 156 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } +#line 1678 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 48: -/* Line 1792 of yacc.c */ -#line 161 "hl/src/H5LTparse.y" - { (yyval.hid) = cmpd_stack[csindex].id; +#line 158 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; - cmpd_stack[csindex].first_memb = 1; + cmpd_stack[csindex].first_memb = 1; csindex--; } +#line 1688 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 51: -/* Line 1792 of yacc.c */ -#line 170 "hl/src/H5LTparse.y" +#line 167 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } +#line 1694 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 52: -/* Line 1792 of yacc.c */ -#line 172 "hl/src/H5LTparse.y" - { +#line 169 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; /*Adjust size and insert member, consider both member size and offset.*/ if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/ - new_size = H5Tget_size((yyvsp[(1) - (7)].hid)) + (yyvsp[(6) - (7)].ival); + new_size = H5Tget_size((yyvsp[-4].hid)) + (yyvsp[-1].ival); H5Tset_size(dtype_id, new_size); /*member name is saved in yylval.sval by lexer*/ - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); + H5Tinsert(dtype_id, (yyvsp[-2].sval), (yyvsp[-1].ival), (yyvsp[-4].hid)); cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); - - if((yyvsp[(6) - (7)].ival) == 0) { - new_size = origin_size + H5Tget_size((yyvsp[(1) - (7)].hid)); + + if((yyvsp[-1].ival) == 0) { + new_size = origin_size + H5Tget_size((yyvsp[-4].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), origin_size, (yyvsp[(1) - (7)].hid)); + H5Tinsert(dtype_id, (yyvsp[-2].sval), origin_size, (yyvsp[-4].hid)); } else { - new_size = (yyvsp[(6) - (7)].ival) + H5Tget_size((yyvsp[(1) - (7)].hid)); + new_size = (yyvsp[-1].ival) + H5Tget_size((yyvsp[-4].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); + H5Tinsert(dtype_id, (yyvsp[-2].sval), (yyvsp[-1].ival), (yyvsp[-4].hid)); } } - if((yyvsp[(4) - (7)].sval)) { - free((yyvsp[(4) - (7)].sval)); - (yyvsp[(4) - (7)].sval) = NULL; + if((yyvsp[-2].sval)) { + HDfree((yyvsp[-2].sval)); + (yyvsp[-2].sval) = NULL; } cmpd_stack[csindex].is_field = 0; - H5Tclose((yyvsp[(1) - (7)].hid)); - + H5Tclose((yyvsp[-4].hid)); + new_size = H5Tget_size(dtype_id); } +#line 1733 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 53: -/* Line 1792 of yacc.c */ -#line 208 "hl/src/H5LTparse.y" +#line 205 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - (yyval.sval) = strdup(yylval.sval); - free(yylval.sval); + (yyval.sval) = HDstrdup(yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; } +#line 1743 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 54: -/* Line 1792 of yacc.c */ -#line 215 "hl/src/H5LTparse.y" +#line 212 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } +#line 1749 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 55: -/* Line 1792 of yacc.c */ -#line 217 "hl/src/H5LTparse.y" +#line 214 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.ival) = yylval.ival; } +#line 1755 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 57: -/* Line 1792 of yacc.c */ -#line 221 "hl/src/H5LTparse.y" +#line 218 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { asindex++; /*pushd onto the stack*/ } +#line 1761 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 58: -/* Line 1792 of yacc.c */ -#line 223 "hl/src/H5LTparse.y" - { - (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); +#line 220 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + (yyval.hid) = H5Tarray_create2((yyvsp[-1].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; - H5Tclose((yyvsp[(5) - (6)].hid)); + H5Tclose((yyvsp[-1].hid)); } +#line 1772 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 61: -/* Line 1792 of yacc.c */ -#line 233 "hl/src/H5LTparse.y" +#line 230 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } +#line 1778 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 62: -/* Line 1792 of yacc.c */ -#line 234 "hl/src/H5LTparse.y" +#line 231 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { unsigned ndims = arr_stack[asindex].ndims; - arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; + arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; - arr_stack[asindex].is_dim = 0; + arr_stack[asindex].is_dim = 0; } +#line 1788 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 65: -/* Line 1792 of yacc.c */ -#line 245 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } +#line 242 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } +#line 1794 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 66: -/* Line 1792 of yacc.c */ -#line 250 "hl/src/H5LTparse.y" - { is_opq_size = 1; } - break; - - case 67: -/* Line 1792 of yacc.c */ -#line 251 "hl/src/H5LTparse.y" - { +#line 248 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); - is_opq_size = 0; } +#line 1803 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 68: -/* Line 1792 of yacc.c */ -#line 256 "hl/src/H5LTparse.y" - { is_opq_tag = 1; } - break; - - case 69: -/* Line 1792 of yacc.c */ -#line 257 "hl/src/H5LTparse.y" - { - H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); - free(yylval.sval); + case 67: +#line 253 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + H5Tset_tag((yyvsp[-3].hid), yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; - is_opq_tag = 0; } +#line 1813 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 70: -/* Line 1792 of yacc.c */ -#line 263 "hl/src/H5LTparse.y" - { (yyval.hid) = (yyvsp[(7) - (15)].hid); } - break; - - case 73: -/* Line 1792 of yacc.c */ -#line 271 "hl/src/H5LTparse.y" - { is_str_size = 1; } + case 68: +#line 258 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = (yyvsp[-5].hid); } +#line 1819 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 74: -/* Line 1792 of yacc.c */ -#line 272 "hl/src/H5LTparse.y" - { - if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) + case 71: +#line 267 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + if((yyvsp[-1].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; - else + else str_size = yylval.ival; - is_str_size = 0; } +#line 1830 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 75: -/* Line 1792 of yacc.c */ -#line 280 "hl/src/H5LTparse.y" + case 72: +#line 274 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) + if((yyvsp[-1].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; - else if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLPAD_TOKEN) + else if((yyvsp[-1].ival) == H5T_STR_NULLPAD_TOKEN) str_pad = H5T_STR_NULLPAD; - else if((yyvsp[(9) - (10)].ival) == H5T_STR_SPACEPAD_TOKEN) + else if((yyvsp[-1].ival) == H5T_STR_SPACEPAD_TOKEN) str_pad = H5T_STR_SPACEPAD; } +#line 1843 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 76: -/* Line 1792 of yacc.c */ -#line 289 "hl/src/H5LTparse.y" - { - if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) + case 73: +#line 283 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + if((yyvsp[-1].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; - else if((yyvsp[(13) - (14)].ival) == H5T_CSET_UTF8_TOKEN) + else if((yyvsp[-1].ival) == H5T_CSET_UTF8_TOKEN) str_cset = H5T_CSET_UTF8; } +#line 1854 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 77: -/* Line 1792 of yacc.c */ -#line 296 "hl/src/H5LTparse.y" + case 74: +#line 290 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) + if((yyvsp[-1].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); - else if((yyvsp[(17) - (18)].hid) == H5T_FORTRAN_S1_TOKEN) + else if((yyvsp[-1].hid) == H5T_FORTRAN_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_FORTRAN_S1); } +#line 1865 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 78: -/* Line 1792 of yacc.c */ -#line 303 "hl/src/H5LTparse.y" - { - hid_t str_id = (yyvsp[(19) - (20)].hid); + case 75: +#line 297 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + hid_t str_id = (yyvsp[-1].hid); /*set string size*/ if(is_variable) { @@ -2085,93 +1905,89 @@ yyreduce: is_variable = 0; } else H5Tset_size(str_id, str_size); - + /*set string padding and character set*/ H5Tset_strpad(str_id, str_pad); H5Tset_cset(str_id, str_cset); - (yyval.hid) = str_id; + (yyval.hid) = str_id; } +#line 1886 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 79: -/* Line 1792 of yacc.c */ -#line 320 "hl/src/H5LTparse.y" + case 76: +#line 314 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_VARIABLE_TOKEN;} +#line 1892 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 81: -/* Line 1792 of yacc.c */ -#line 323 "hl/src/H5LTparse.y" + case 78: +#line 317 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} +#line 1898 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 82: -/* Line 1792 of yacc.c */ -#line 324 "hl/src/H5LTparse.y" + case 79: +#line 318 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} +#line 1904 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 83: -/* Line 1792 of yacc.c */ -#line 325 "hl/src/H5LTparse.y" + case 80: +#line 319 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} +#line 1910 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 84: -/* Line 1792 of yacc.c */ -#line 327 "hl/src/H5LTparse.y" + case 81: +#line 321 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} +#line 1916 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 85: -/* Line 1792 of yacc.c */ -#line 328 "hl/src/H5LTparse.y" + case 82: +#line 322 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} +#line 1922 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 86: -/* Line 1792 of yacc.c */ -#line 330 "hl/src/H5LTparse.y" + case 83: +#line 324 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.hid) = H5T_C_S1_TOKEN;} +#line 1928 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 87: -/* Line 1792 of yacc.c */ -#line 331 "hl/src/H5LTparse.y" + case 84: +#line 325 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} +#line 1934 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 88: -/* Line 1792 of yacc.c */ -#line 335 "hl/src/H5LTparse.y" - { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } + case 85: +#line 329 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } +#line 1940 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 89: -/* Line 1792 of yacc.c */ -#line 337 "hl/src/H5LTparse.y" + case 86: +#line 331 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } +#line 1946 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 92: -/* Line 1792 of yacc.c */ -#line 342 "hl/src/H5LTparse.y" + case 89: +#line 336 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_enum_memb = 1; /*indicate member of enum*/ -#ifdef H5_HAVE_WIN32_API - enum_memb_symbol = _strdup(yylval.sval); -#else /* H5_HAVE_WIN32_API */ - enum_memb_symbol = strdup(yylval.sval); -#endif /* H5_HAVE_WIN32_API */ - free(yylval.sval); + enum_memb_symbol = HDstrdup(yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; } +#line 1957 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; - case 93: -/* Line 1792 of yacc.c */ -#line 353 "hl/src/H5LTparse.y" + case 90: +#line 343 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -2182,43 +1998,43 @@ yyreduce: hid_t native = H5Tget_native_type(super, H5T_DIR_ASCEND); H5T_order_t super_order = H5Tget_order(super); H5T_order_t native_order = H5Tget_order(native); - + if(is_enum && is_enum_memb) { /*if it's an enum member*/ /*To handle machines of different endianness*/ if(H5Tequal(native, H5T_NATIVE_SCHAR) || H5Tequal(native, H5T_NATIVE_UCHAR)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &char_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &char_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &char_val); } else if(H5Tequal(native, H5T_NATIVE_SHORT) || H5Tequal(native, H5T_NATIVE_USHORT)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &short_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &short_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &short_val); } else if(H5Tequal(native, H5T_NATIVE_INT) || H5Tequal(native, H5T_NATIVE_UINT)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &int_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &int_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &int_val); } else if(H5Tequal(native, H5T_NATIVE_LONG) || H5Tequal(native, H5T_NATIVE_ULONG)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &long_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &long_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &long_val); } else if(H5Tequal(native, H5T_NATIVE_LLONG) || H5Tequal(native, H5T_NATIVE_ULLONG)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &llong_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &llong_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &llong_val); } - is_enum_memb = 0; - if(enum_memb_symbol) free(enum_memb_symbol); + is_enum_memb = 0; + if(enum_memb_symbol) HDfree(enum_memb_symbol); } H5Tclose(super); H5Tclose(native); } +#line 2004 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; -/* Line 1792 of yacc.c */ -#line 2200 "hl/src/H5LTparse.c" +#line 2008 "hl/src/H5LTparse.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2240,7 +2056,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2255,9 +2071,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2308,20 +2124,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2340,7 +2156,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2353,29 +2169,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2426,14 +2242,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2444,8 +2260,5 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 0ecd15d..9dd2fba 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,105 +40,92 @@ extern int H5LTyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - H5T_STD_I8BE_TOKEN = 258, - H5T_STD_I8LE_TOKEN = 259, - H5T_STD_I16BE_TOKEN = 260, - H5T_STD_I16LE_TOKEN = 261, - H5T_STD_I32BE_TOKEN = 262, - H5T_STD_I32LE_TOKEN = 263, - H5T_STD_I64BE_TOKEN = 264, - H5T_STD_I64LE_TOKEN = 265, - H5T_STD_U8BE_TOKEN = 266, - H5T_STD_U8LE_TOKEN = 267, - H5T_STD_U16BE_TOKEN = 268, - H5T_STD_U16LE_TOKEN = 269, - H5T_STD_U32BE_TOKEN = 270, - H5T_STD_U32LE_TOKEN = 271, - H5T_STD_U64BE_TOKEN = 272, - H5T_STD_U64LE_TOKEN = 273, - H5T_NATIVE_CHAR_TOKEN = 274, - H5T_NATIVE_SCHAR_TOKEN = 275, - H5T_NATIVE_UCHAR_TOKEN = 276, - H5T_NATIVE_SHORT_TOKEN = 277, - H5T_NATIVE_USHORT_TOKEN = 278, - H5T_NATIVE_INT_TOKEN = 279, - H5T_NATIVE_UINT_TOKEN = 280, - H5T_NATIVE_LONG_TOKEN = 281, - H5T_NATIVE_ULONG_TOKEN = 282, - H5T_NATIVE_LLONG_TOKEN = 283, - H5T_NATIVE_ULLONG_TOKEN = 284, - H5T_IEEE_F32BE_TOKEN = 285, - H5T_IEEE_F32LE_TOKEN = 286, - H5T_IEEE_F64BE_TOKEN = 287, - H5T_IEEE_F64LE_TOKEN = 288, - H5T_NATIVE_FLOAT_TOKEN = 289, - H5T_NATIVE_DOUBLE_TOKEN = 290, - H5T_NATIVE_LDOUBLE_TOKEN = 291, - H5T_STRING_TOKEN = 292, - STRSIZE_TOKEN = 293, - STRPAD_TOKEN = 294, - CSET_TOKEN = 295, - CTYPE_TOKEN = 296, - H5T_VARIABLE_TOKEN = 297, - H5T_STR_NULLTERM_TOKEN = 298, - H5T_STR_NULLPAD_TOKEN = 299, - H5T_STR_SPACEPAD_TOKEN = 300, - H5T_CSET_ASCII_TOKEN = 301, - H5T_CSET_UTF8_TOKEN = 302, - H5T_C_S1_TOKEN = 303, - H5T_FORTRAN_S1_TOKEN = 304, - H5T_OPAQUE_TOKEN = 305, - OPQ_SIZE_TOKEN = 306, - OPQ_TAG_TOKEN = 307, - H5T_COMPOUND_TOKEN = 308, - H5T_ENUM_TOKEN = 309, - H5T_ARRAY_TOKEN = 310, - H5T_VLEN_TOKEN = 311, - STRING = 312, - NUMBER = 313 - }; + enum yytokentype + { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 2058 of yacc.c */ -#line 72 "hl/src/H5LTparse.y" +#line 69 "hl/src/H5LTparse.y" /* yacc.c:1909 */ int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ +#line 119 "hl/src/H5LTparse.h" /* yacc.c:1909 */ +}; -/* Line 2058 of yacc.c */ -#line 122 "hl/src/H5LTparse.h" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE H5LTyylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int H5LTyyparse (void *YYPARSE_PARAM); -#else -int H5LTyyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int H5LTyyparse (void); -#else -int H5LTyyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ +hid_t H5LTyyparse (void); #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ diff --git a/hl/src/H5LTprivate.h b/hl/src/H5LTprivate.h index ddcbbbf..5a97d9c 100644 --- a/hl/src/H5LTprivate.h +++ b/hl/src/H5LTprivate.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5LTprivate_H -#define _H5LTprivate_H +#ifndef H5LTprivate_H +#define H5LTprivate_H /* High-level library internal header file */ #include "H5HLprivate2.h" diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h index 417fce8..2af9b07 100644 --- a/hl/src/H5LTpublic.h +++ b/hl/src/H5LTpublic.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5LTpublic_H -#define _H5LTpublic_H +#ifndef H5LTpublic_H +#define H5LTpublic_H /* Flag definitions for H5LTopen_file_image() */ #define H5LT_FILE_IMAGE_OPEN_RW 0x0001 /* Open image for read-write */ diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index 1c6a816..f5fb99f 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include - #include "H5PTprivate.h" #include "H5TBprivate.h" @@ -31,7 +29,7 @@ static H5I_type_t H5PT_ptable_id_type = H5I_UNINIT; #define H5PT_HASH_TABLE_SIZE 64 /* Packet Table private functions */ -static herr_t H5PT_free_id(void *id); +static herr_t H5PT_free_id(void *id, void **_ctx); static herr_t H5PT_close(htbl_t *table); static herr_t H5PT_create_index(htbl_t *table_id); static herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index); @@ -52,8 +50,8 @@ static herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index); * * Return: Success: table ID, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu (Author of H5PTcreate_fl) - * James Laird, jlaird@ncsa.uiuc.edu (Author of H5PTcreate_fl) + * Programmer: Nat Furrer (Author of H5PTcreate_fl) + * James Laird (Author of H5PTcreate_fl) * * Date: March 12, 2004 * @@ -177,8 +175,8 @@ error: * * Return: Success: table ID, Failure: Negative * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -293,8 +291,8 @@ error: * * Return: Success: table ID, Failure: Negative * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 10, 2004 * @@ -404,7 +402,7 @@ error: *------------------------------------------------------------------------- */ static herr_t -H5PT_free_id(void *id) +H5PT_free_id(void *id, void H5_ATTR_UNUSED **_ctx) { HDfree(id); return SUCCEED; @@ -418,8 +416,8 @@ H5PT_free_id(void *id) * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 10, 2004 * @@ -466,8 +464,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 21, 2004 * @@ -520,8 +518,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -570,8 +568,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 10, 2004 * @@ -614,8 +612,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -663,8 +661,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -716,8 +714,8 @@ H5PT_get_index(htbl_t *table, hsize_t *pt_index) * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 23, 2004 * @@ -777,8 +775,8 @@ H5PTget_index(hid_t table_id, hsize_t *pt_index) * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -814,8 +812,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -844,8 +842,8 @@ H5PTis_valid(hid_t table_id) * * Return: True: 1, False: 0, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 14, 2004 * @@ -894,8 +892,8 @@ error: * Return: Success: SUCCEED, Failure: FAIL * -2 if memory was reclaimed but another error occurred * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 12, 2004 * diff --git a/hl/src/H5PTprivate.h b/hl/src/H5PTprivate.h index 7277dd2..9ca7676 100644 --- a/hl/src/H5PTprivate.h +++ b/hl/src/H5PTprivate.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5PTprivate_H -#define _H5PTprivate_H +#ifndef H5PTprivate_H +#define H5PTprivate_H /* High-level library internal header file */ #include "H5HLprivate2.h" diff --git a/hl/src/H5PTpublic.h b/hl/src/H5PTpublic.h index ec744f8..d74baa5 100644 --- a/hl/src/H5PTpublic.h +++ b/hl/src/H5PTpublic.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5PTpublic_H -#define _H5PTpublic_H +#ifndef H5PTpublic_H +#define H5PTpublic_H #ifdef __cplusplus extern "C" { diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 796f128..1ac162f 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include - #include "H5LTprivate.h" #include "H5TBprivate.h" @@ -46,7 +43,7 @@ static hid_t H5TB_create_type(hid_t loc_id, const char *dset_name, size_t type_s * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * Quincey Koziol * * Date: January 17, 2001 @@ -257,7 +254,7 @@ out: * Return: Success: 0, Failure: -1 * * Programmers: - * Pedro Vicente, pvn@ncsa.uiuc.edu + * Pedro Vicente * Quincey Koziol * * Date: November 19, 2001 @@ -323,7 +320,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -415,7 +412,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 21, 2001 * @@ -573,7 +570,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 21, 2001 * @@ -738,7 +735,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 20, 2001 * @@ -811,7 +808,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -877,7 +874,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -1034,7 +1031,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -1192,7 +1189,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 26, 2001 * @@ -1352,7 +1349,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 26, 2001 * @@ -1504,7 +1501,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: December 5, 2001 * @@ -1633,7 +1630,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: December 10, 2001 * @@ -1989,7 +1986,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 30, 2002 * @@ -2406,7 +2403,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 30, 2002 * @@ -2858,7 +2855,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 30, 2001 * @@ -2884,7 +2881,7 @@ H5TBAget_title(hid_t loc_id, char *table_title) * * Return: Success: TRUE/FALSE, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: January 30, 2002 * @@ -2954,7 +2951,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -3039,7 +3036,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -3156,7 +3153,7 @@ out: * * Return: Success: TRUE/FALSE, Failure: N/A * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -3197,7 +3194,7 @@ H5TB_find_field(const char *field, const char *field_list) * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: December 6, 2001 * @@ -3258,7 +3255,7 @@ out: * * Return: Success: the memory type ID, Failure: -1 * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: March 31, 2004 * @@ -3354,8 +3351,8 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 8, 2004 * @@ -3419,8 +3416,8 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 8, 2004 * diff --git a/hl/src/H5TBprivate.h b/hl/src/H5TBprivate.h index abe43c4..95b58e6 100644 --- a/hl/src/H5TBprivate.h +++ b/hl/src/H5TBprivate.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5TBprivate_H -#define _H5TBprivate_H +#ifndef H5TBprivate_H +#define H5TBprivate_H /* High-level library internal header file */ #include "H5HLprivate2.h" diff --git a/hl/src/H5TBpublic.h b/hl/src/H5TBpublic.h index 1324fbd..1750490 100644 --- a/hl/src/H5TBpublic.h +++ b/hl/src/H5TBpublic.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5TBpublic_H -#define _H5TBpublic_H +#ifndef H5TBpublic_H +#define H5TBpublic_H #ifdef __cplusplus extern "C" { diff --git a/hl/src/hdf5_hl.h b/hl/src/hdf5_hl.h index 580c09a..9960b97 100644 --- a/hl/src/hdf5_hl.h +++ b/hl/src/hdf5_hl.h @@ -17,8 +17,9 @@ * fill this file with lots of gunk... */ -#ifndef _HDF5_HL_H -#define _HDF5_HL_H +#ifndef HDF5_HL_H +#define HDF5_HL_H + #include "hdf5.h" /* hdf5 main library */ #include "H5DOpublic.h" /* dataset optimization */ #include "H5DSpublic.h" /* dimension scales */ @@ -28,4 +29,4 @@ #include "H5PTpublic.h" /* packet table */ #include "H5LDpublic.h" /* lite dataset */ -#endif /*H5_INCLUDE_HL*/ +#endif /*HDF5_HL_H*/ diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c index c3fc7ff..368c083 100644 --- a/hl/test/gen_test_ds.c +++ b/hl/test/gen_test_ds.c @@ -23,8 +23,6 @@ * in test_ds.c will read them. */ -#include -#include #include "h5hltest.h" #include "H5DSpublic.h" #include "H5LTpublic.h" diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h index d286c00..14f3e14 100644 --- a/hl/test/h5hltest.h +++ b/hl/test/h5hltest.h @@ -12,14 +12,14 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, April 28, 2006 * * Purpose: Test support stuff. */ -#ifndef _H5HLTEST_H -#define _H5HLTEST_H +#ifndef H5HLTEST_H +#define H5HLTEST_H /* Get the HDF5 test header */ #include "h5test.h" @@ -48,4 +48,4 @@ int test_packet_table_with_varlen(void); -#endif /* _H5HLTEST_H */ +#endif /* H5HLTEST_H */ diff --git a/hl/test/pal_rgb.h b/hl/test/pal_rgb.h index 0d0ffcc..a2b17e2 100644 --- a/hl/test/pal_rgb.h +++ b/hl/test/pal_rgb.h @@ -11,41 +11,263 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -const unsigned char pal_rgb[256 * 3] = { - 255, 255, 255, 0, 0, 131, 0, 0, 135, 0, 0, 139, 0, 0, 143, 0, 0, 147, 0, 0, 151, - 0, 0, 155, 0, 0, 159, 0, 0, 163, 0, 0, 167, 0, 0, 171, 0, 0, 175, 0, 0, 179, - 0, 0, 183, 0, 0, 187, 0, 0, 191, 0, 0, 195, 0, 0, 199, 0, 0, 203, 0, 0, 207, - 0, 0, 211, 0, 0, 215, 0, 0, 219, 0, 0, 223, 0, 0, 227, 0, 0, 231, 0, 0, 235, - 0, 0, 239, 0, 0, 243, 0, 0, 247, 0, 0, 251, 0, 0, 255, 0, 0, 255, 0, 3, 255, - 0, 7, 255, 0, 11, 255, 0, 15, 255, 0, 19, 255, 0, 23, 255, 0, 27, 255, 0, 31, 255, - 0, 35, 255, 0, 39, 255, 0, 43, 255, 0, 47, 255, 0, 51, 255, 0, 55, 255, 0, 59, 255, - 0, 63, 255, 0, 67, 255, 0, 71, 255, 0, 75, 255, 0, 79, 255, 0, 83, 255, 0, 87, 255, - 0, 91, 255, 0, 95, 255, 0, 99, 255, 0, 103, 255, 0, 107, 255, 0, 111, 255, 0, 115, 255, - 0, 119, 255, 0, 123, 255, 0, 127, 255, 0, 131, 255, 0, 135, 255, 0, 139, 255, 0, 143, 255, - 0, 147, 255, 0, 151, 255, 0, 155, 255, 0, 159, 255, 0, 163, 255, 0, 167, 255, 0, 171, 255, - 0, 175, 255, 0, 179, 255, 0, 183, 255, 0, 187, 255, 0, 191, 255, 0, 195, 255, 0, 199, 255, - 0, 203, 255, 0, 207, 255, 0, 211, 255, 0, 215, 255, 0, 219, 255, 0, 223, 255, 0, 227, 255, - 0, 231, 255, 0, 235, 255, 0, 239, 255, 0, 243, 255, 0, 247, 255, 0, 251, 255, 0, 255, 255, - 0, 255, 255, 3, 255, 251, 7, 255, 247, 11, 255, 243, 15, 255, 239, 19, 255, 235, 23, 255, 231, - 27, 255, 227, 31, 255, 223, 35, 255, 219, 39, 255, 215, 43, 255, 211, 47, 255, 207, 51, 255, 203, - 55, 255, 199, 59, 255, 195, 63, 255, 191, 67, 255, 187, 71, 255, 183, 75, 255, 179, 79, 255, 175, - 83, 255, 171, 87, 255, 167, 91, 255, 163, 95, 255, 159, 99, 255, 155, 103, 255, 151, 107, 255, 147, - 111, 255, 143, 115, 255, 139, 119, 255, 135, 123, 255, 131, 127, 255, 127, 131, 255, 123, 135, 255, 119, - 139, 255, 115, 143, 255, 111, 147, 255, 107, 151, 255, 103, 155, 255, 99, 159, 255, 95, 163, 255, 91, - 167, 255, 87, 171, 255, 83, 175, 255, 79, 179, 255, 75, 183, 255, 71, 187, 255, 67, 191, 255, 63, - 195, 255, 59, 199, 255, 55, 203, 255, 51, 207, 255, 47, 211, 255, 43, 215, 255, 39, 219, 255, 35, - 223, 255, 31, 227, 255, 27, 231, 255, 23, 235, 255, 19, 239, 255, 15, 243, 255, 11, 247, 255, 7, - 251, 255, 3, 255, 255, 0, 255, 251, 0, 255, 247, 0, 255, 243, 0, 255, 239, 0, 255, 235, 0, - 255, 231, 0, 255, 227, 0, 255, 223, 0, 255, 219, 0, 255, 215, 0, 255, 211, 0, 255, 207, 0, - 255, 203, 0, 255, 199, 0, 255, 195, 0, 255, 191, 0, 255, 187, 0, 255, 183, 0, 255, 179, 0, - 255, 175, 0, 255, 171, 0, 255, 167, 0, 255, 163, 0, 255, 159, 0, 255, 155, 0, 255, 151, 0, - 255, 147, 0, 255, 143, 0, 255, 139, 0, 255, 135, 0, 255, 131, 0, 255, 127, 0, 255, 123, 0, - 255, 119, 0, 255, 115, 0, 255, 111, 0, 255, 107, 0, 255, 103, 0, 255, 99, 0, 255, 95, 0, - 255, 91, 0, 255, 87, 0, 255, 83, 0, 255, 79, 0, 255, 75, 0, 255, 71, 0, 255, 67, 0, - 255, 63, 0, 255, 59, 0, 255, 55, 0, 255, 51, 0, 255, 47, 0, 255, 43, 0, 255, 39, 0, - 255, 35, 0, 255, 31, 0, 255, 27, 0, 255, 23, 0, 255, 19, 0, 255, 15, 0, 255, 11, 0, - 255, 7, 0, 255, 3, 0, 255, 0, 0, 250, 0, 0, 246, 0, 0, 241, 0, 0, 237, 0, 0, - 233, 0, 0, 228, 0, 0, 224, 0, 0, 219, 0, 0, 215, 0, 0, 211, 0, 0, 206, 0, 0, - 202, 0, 0, 197, 0, 0, 193, 0, 0, 189, 0, 0, 184, 0, 0, 180, 0, 0, 175, 0, 0, - 171, 0, 0, 167, 0, 0, 162, 0, 0, 158, 0, 0, 153, 0, 0, 149, 0, 0, 145, 0, 0, - 140, 0, 0, 136, 0, 0, 131, 0, 0, 127, 0, 0}; +/* clang-format off */ +const unsigned char pal_rgb[256*3] = { + 255,255,255, + 0,0,131, + 0,0,135, + 0,0,139, + 0,0,143, + 0,0,147, + 0,0,151, + 0,0,155, + 0,0,159, + 0,0,163, + 0,0,167, + 0,0,171, + 0,0,175, + 0,0,179, + 0,0,183, + 0,0,187, + 0,0,191, + 0,0,195, + 0,0,199, + 0,0,203, + 0,0,207, + 0,0,211, + 0,0,215, + 0,0,219, + 0,0,223, + 0,0,227, + 0,0,231, + 0,0,235, + 0,0,239, + 0,0,243, + 0,0,247, + 0,0,251, + 0,0,255, + 0,0,255, + 0,3,255, + 0,7,255, + 0,11,255, + 0,15,255, + 0,19,255, + 0,23,255, + 0,27,255, + 0,31,255, + 0,35,255, + 0,39,255, + 0,43,255, + 0,47,255, + 0,51,255, + 0,55,255, + 0,59,255, + 0,63,255, + 0,67,255, + 0,71,255, + 0,75,255, + 0,79,255, + 0,83,255, + 0,87,255, + 0,91,255, + 0,95,255, + 0,99,255, + 0,103,255, + 0,107,255, + 0,111,255, + 0,115,255, + 0,119,255, + 0,123,255, + 0,127,255, + 0,131,255, + 0,135,255, + 0,139,255, + 0,143,255, + 0,147,255, + 0,151,255, + 0,155,255, + 0,159,255, + 0,163,255, + 0,167,255, + 0,171,255, + 0,175,255, + 0,179,255, + 0,183,255, + 0,187,255, + 0,191,255, + 0,195,255, + 0,199,255, + 0,203,255, + 0,207,255, + 0,211,255, + 0,215,255, + 0,219,255, + 0,223,255, + 0,227,255, + 0,231,255, + 0,235,255, + 0,239,255, + 0,243,255, + 0,247,255, + 0,251,255, + 0,255,255, + 0,255,255, + 3,255,251, + 7,255,247, + 11,255,243, + 15,255,239, + 19,255,235, + 23,255,231, + 27,255,227, + 31,255,223, + 35,255,219, + 39,255,215, + 43,255,211, + 47,255,207, + 51,255,203, + 55,255,199, + 59,255,195, + 63,255,191, + 67,255,187, + 71,255,183, + 75,255,179, + 79,255,175, + 83,255,171, + 87,255,167, + 91,255,163, + 95,255,159, + 99,255,155, + 103,255,151, + 107,255,147, + 111,255,143, + 115,255,139, + 119,255,135, + 123,255,131, + 127,255,127, + 131,255,123, + 135,255,119, + 139,255,115, + 143,255,111, + 147,255,107, + 151,255,103, + 155,255,99, + 159,255,95, + 163,255,91, + 167,255,87, + 171,255,83, + 175,255,79, + 179,255,75, + 183,255,71, + 187,255,67, + 191,255,63, + 195,255,59, + 199,255,55, + 203,255,51, + 207,255,47, + 211,255,43, + 215,255,39, + 219,255,35, + 223,255,31, + 227,255,27, + 231,255,23, + 235,255,19, + 239,255,15, + 243,255,11, + 247,255,7, + 251,255,3, + 255,255,0, + 255,251,0, + 255,247,0, + 255,243,0, + 255,239,0, + 255,235,0, + 255,231,0, + 255,227,0, + 255,223,0, + 255,219,0, + 255,215,0, + 255,211,0, + 255,207,0, + 255,203,0, + 255,199,0, + 255,195,0, + 255,191,0, + 255,187,0, + 255,183,0, + 255,179,0, + 255,175,0, + 255,171,0, + 255,167,0, + 255,163,0, + 255,159,0, + 255,155,0, + 255,151,0, + 255,147,0, + 255,143,0, + 255,139,0, + 255,135,0, + 255,131,0, + 255,127,0, + 255,123,0, + 255,119,0, + 255,115,0, + 255,111,0, + 255,107,0, + 255,103,0, + 255,99,0, + 255,95,0, + 255,91,0, + 255,87,0, + 255,83,0, + 255,79,0, + 255,75,0, + 255,71,0, + 255,67,0, + 255,63,0, + 255,59,0, + 255,55,0, + 255,51,0, + 255,47,0, + 255,43,0, + 255,39,0, + 255,35,0, + 255,31,0, + 255,27,0, + 255,23,0, + 255,19,0, + 255,15,0, + 255,11,0, + 255,7,0, + 255,3,0, + 255,0,0, + 250,0,0, + 246,0,0, + 241,0,0, + 237,0,0, + 233,0,0, + 228,0,0, + 224,0,0, + 219,0,0, + 215,0,0, + 211,0,0, + 206,0,0, + 202,0,0, + 197,0,0, + 193,0,0, + 189,0,0, + 184,0,0, + 180,0,0, + 175,0,0, + 171,0,0, + 167,0,0, + 162,0,0, + 158,0,0, + 153,0,0, + 149,0,0, + 145,0,0, + 140,0,0, + 136,0,0, + 131,0,0, + 127,0,0 +}; +/* clang-format on */ diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 47fd02d..ead5c65 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5DSpublic.h" @@ -3556,9 +3554,9 @@ verify_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) int ret = 0; /* unused */ - dset = dset; - dim = dim; - visitor_data = visitor_data; + (void)dset; + (void)dim; + (void)visitor_data; /* define a positive value for return value. This will cause the iterator to immediately return that positive value, indicating short-circuit success @@ -3604,8 +3602,8 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) char * data = (char *)visitor_data; /* unused */ - dset = dset; - dim = dim; + (void)dset; + (void)dim; /* get space */ if ((sid = H5Dget_space(scale_id)) < 0) @@ -3693,7 +3691,7 @@ match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor_data) hsize_t storage_size; /* Stop compiler from whining about "unused parameters" */ - visitor_data = visitor_data; + (void)visitor_data; /*------------------------------------------------------------------------- * get DID (dataset) space info @@ -3771,9 +3769,9 @@ static herr_t op_continue(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) { /* Stop compiler from whining about "unused parameters" */ - dset = dset; - dim = dim; - scale_id = scale_id; + (void)dset; + (void)dim; + (void)scale_id; if (visitor_data != NULL) { (*(int *)visitor_data)++; @@ -3804,9 +3802,9 @@ static herr_t op_stop(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data) { /* Stop compiler from whining about "unused parameters" */ - dset = dset; - dim = dim; - scale_id = scale_id; + (void)dset; + (void)dim; + (void)scale_id; if (visitor_data != NULL) { (*(int *)visitor_data)++; diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index 53bd4b0..3b11c2b 100644 --- a/hl/test/test_dset_append.c +++ b/hl/test/test_dset_append.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "h5hltest.h" #include "H5DOpublic.h" diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c index 11b9d39..b397a81 100644 --- a/hl/test/test_file_image.c +++ b/hl/test/test_file_image.c @@ -51,7 +51,7 @@ *------------------------------------------------------------------------- */ static int -test_file_image(size_t open_images, size_t nflags, unsigned *flags) +test_file_image(size_t open_images, size_t nflags, const unsigned *flags) { hid_t * file_id, *dset_id, file_space, plist; /* HDF5 ids */ hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */ @@ -509,6 +509,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags) } /* end for */ /* release temporary working buffers */ + for (i = 0; i < open_images; i++) + HDfree(filename[i]); HDfree(filename); HDfree(file_id); HDfree(dset_id); diff --git a/hl/test/test_image.c b/hl/test/test_image.c index f6967b3..0c7d511 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index 880e78e..dc5755c 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -11,11 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5LDpublic.h" @@ -162,7 +157,8 @@ static herr_t test_LD_elmts_invalid(const char *file); static herr_t test_LD_elmts_one(const char *file, const char *dname, const char *fields); static herr_t test_LD_elmts_two(const char *file, const char *dname, const char *fields); -static herr_t verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf); +static herr_t verify_elmts_two(int type, const hsize_t *ext_dims, const hsize_t *prev_dims, void *_ldbuf, + void *_buf); /* data structures for compound data type */ typedef struct sub22_t { @@ -1152,7 +1148,7 @@ error: ************************************************************************************** */ static herr_t -verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf) +verify_elmts_two(int type, const hsize_t *ext_dims, const hsize_t *prev_dims, void *_ldbuf, void *_buf) { int k, m; /* Local index variable */ diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 02316c9..cae91ff 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" @@ -1056,7 +1054,7 @@ test_integers(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_STD_I8BE")) { + if (HDstrcmp(dt_str, "H5T_STD_I8BE") != 0) { HDfree(dt_str); goto out; } @@ -1114,7 +1112,7 @@ test_fps(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_IEEE_F32BE")) { + if (HDstrcmp(dt_str, "H5T_IEEE_F32BE") != 0) { HDfree(dt_str); goto out; } @@ -1186,7 +1184,7 @@ test_strings(void) goto out; } if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET " - "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1221,7 +1219,7 @@ test_strings(void) goto out; } if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n " - "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1240,7 +1238,7 @@ test_strings(void) if (HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len - 1)) { + str_len - 1) != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1263,7 +1261,7 @@ test_strings(void) if (HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len)) { + str_len) != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1324,7 +1322,8 @@ test_opaques(void) } if (HDstrcmp( dt_str, - "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) { + "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") != + 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1378,7 +1377,7 @@ test_enums(void) if (H5Tenum_nameof(dtype, &value1, name1, size) < 0) goto out; - if (HDstrcmp(name1, "BLUE")) + if (HDstrcmp(name1, "BLUE") != 0) goto out; if (H5Tenum_valueof(dtype, name2, &value2) < 0) @@ -1401,8 +1400,9 @@ test_enums(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " - " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { + if (HDstrcmp(dt_str, + "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " + " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); @@ -1464,7 +1464,7 @@ test_variables(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) { + if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1528,7 +1528,7 @@ test_arrays(void) } if (HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n " " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE " - "\"arr_compound_2\" : 1;\n }\n }\n }")) { + "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1588,7 +1588,7 @@ test_compounds(void) goto out; } if (HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE " - "\"two_field\" : 6;\n }")) { + "\"two_field\" : 6;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1607,7 +1607,7 @@ test_compounds(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if (HDstrcmp(memb_name, "i16_field")) { + if (HDstrcmp(memb_name, "i16_field") != 0) { H5free_memory(memb_name); goto out; } @@ -1685,7 +1685,7 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 2)) == NULL) goto out; - if (HDstrcmp(memb_name, "sub")) { + if (HDstrcmp(memb_name, "sub") != 0) { H5free_memory(memb_name); goto out; } @@ -1722,7 +1722,7 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; if (HDstrcmp(memb_name, "desc____________________________________________________________________________" - "_____________")) { + "_____________") != 0) { H5free_memory(memb_name); goto out; } diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 6ff70dc..1d3a569 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5PTpublic.h" #include "H5TBpublic.h" diff --git a/hl/test/test_table.c b/hl/test/test_table.c index b462ec1..0d4a72a 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5TBpublic.h" @@ -1274,7 +1272,7 @@ test_table(hid_t fid, int do_write) /* write the new longitude and latitude information to all the records */ nfields = 2; start = 0; - nrecords = NRECORDS; + nrecords = NRECORDS_ADD; if (H5TBwrite_fields_index(fid, "table12", nfields, field_index_pos, start, nrecords, sizeof(position_t), field_offset_pos, field_sizes_pos, position_in) < 0) goto out; diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h index 2b4a344..1a8cfe4 100644 --- a/hl/tools/gif2h5/gif.h +++ b/hl/tools/gif2h5/gif.h @@ -157,8 +157,8 @@ int ReadGifApplication(GIFAPPLICATION *, GIFBYTE **); int ReadGifComment(GIFCOMMENT *, GIFBYTE **); /* HDFGIFWR.C */ -int hdfWriteGIF(FILE *fp, GIFBYTE *pic, int ptype, int w, int h, GIFBYTE *rmap, GIFBYTE *gmap, GIFBYTE *bmap, - GIFBYTE *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel); +int hdfWriteGIF(FILE *fp, GIFBYTE *pic, int ptype, int w, int h, const GIFBYTE *rmap, const GIFBYTE *gmap, + const GIFBYTE *bmap, const GIFBYTE *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel); /* WRITEHDF.C */ int WriteHDF(GIFTOMEM, GIFCHAR *); @@ -176,7 +176,7 @@ int ReadHDF(GIFBYTE **data, GIFBYTE palette[256][3], hsize_t *image_size, GIFCHA GIFCHAR *dset_name, GIFCHAR *pal_name); GIFBYTE *Decompress(GIFIMAGEDESC *, GIFHEAD *); -GIFBYTE GetByte(GIFBYTE *); +GIFBYTE GetByte(const GIFBYTE *); GIFWORD GetWord(GIFBYTE *); void cleanup(GIFBYTE *); diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c index 6cfcdea..dd9e5be 100644 --- a/hl/tools/gif2h5/gifread.c +++ b/hl/tools/gif2h5/gifread.c @@ -38,7 +38,7 @@ GetWord(GIFBYTE *MemGif) } GIFBYTE -GetByte(GIFBYTE *MemGif) +GetByte(const GIFBYTE *MemGif) { return *MemGif; } @@ -65,7 +65,7 @@ ReadGifHeader(GIFHEAD * GifHead, /* Pointer to GIF header structure */ GifHead->HeaderDump[i] = *(*MemGif2)++; } - if (strncmp((const char *)GifHead->HeaderDump, "GIF", (size_t)3)) { + if (strncmp((const char *)GifHead->HeaderDump, "GIF", (size_t)3) != 0) { printf("The file does not appear to be a valid GIF file.\n"); exit(EXIT_FAILURE); } diff --git a/hl/tools/gif2h5/h52gifgentst.c b/hl/tools/gif2h5/h52gifgentst.c index 62dbd71..ba2e4f5 100644 --- a/hl/tools/gif2h5/h52gifgentst.c +++ b/hl/tools/gif2h5/h52gifgentst.c @@ -22,7 +22,7 @@ * * Purpose: generate files for h52gif testing * - * Programmer: Pedro Vicente, pvn@hdfgroup.org + * Programmer: Pedro Vicente * * Date: March 15, 2007 * diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c index 333c808..21b14d1 100644 --- a/hl/tools/gif2h5/hdfgifwr.c +++ b/hl/tools/gif2h5/hdfgifwr.c @@ -135,8 +135,8 @@ static int EOFCode; /*************************************************************/ int -hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, byte *gmap, byte *bmap, byte *pc2ncmap, - int numcols, int colorstyle, int BitsPerPixel) +hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, const byte *rmap, const byte *gmap, + const byte *bmap, const byte *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel) { int InitCodeSize; int i; @@ -152,12 +152,12 @@ hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, byte *gmap } /* Shut compiler up... */ - ptype = ptype; - rmap = rmap; - gmap = gmap; - bmap = bmap; - numcols = numcols; - colorstyle = colorstyle; + (void)ptype; + (void)rmap; + (void)gmap; + (void)bmap; + (void)numcols; + (void)colorstyle; for (i = 0; i < 256; i++) { pc2nc[i] = pc2ncmap[i]; diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index d5aa878..a5e82ca 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -43,7 +43,7 @@ static unsigned g_retry = DEFAULT_RETRY; /* # of times to try opening the file static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */ static hbool_t g_user_interrupt = FALSE; /* Flag to indicate that user interrupted execution */ -static herr_t doprint(hid_t did, hsize_t *start, hsize_t *block, int rank); +static herr_t doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank); static herr_t slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, hsize_t *start, hsize_t *block, int rank, int subrank); static herr_t monitor_dataset(hid_t fid, char *dsetname); @@ -95,7 +95,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no *------------------------------------------------------------------------- */ static herr_t -doprint(hid_t did, hsize_t *start, hsize_t *block, int rank) +doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank) { h5tools_context_t ctx; /* print context */ h5tool_format_t info; /* Format info for the tools library */ @@ -340,7 +340,8 @@ monitor_dataset(hid_t fid, char *dsetname) if (i != ndims) { /* Printing changes in dimension sizes */ for (u = 0; u < ndims; u++) { - HDfprintf(stdout, "dimension %u: %Hu->%Hu", (unsigned)u, prev_dims[u], cur_dims[u]); + HDfprintf(stdout, "dimension %d: %" PRIuHSIZE "->%" PRIuHSIZE "", u, prev_dims[u], + cur_dims[u]); if (cur_dims[u] > prev_dims[u]) HDfprintf(stdout, " (increases)\n"); else if (cur_dims[u] < prev_dims[u]) -- cgit v0.12 From 0c6ff43fbccaf78196165db6660a30d37944ea78 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 5 Apr 2021 15:59:36 -0700 Subject: Normalizes C++ with develop --- c++/examples/chunks.cpp | 4 --- c++/examples/compound.cpp | 4 --- c++/examples/create.cpp | 4 --- c++/examples/extend_ds.cpp | 4 --- c++/examples/h5group.cpp | 4 --- c++/examples/readdata.cpp | 4 --- c++/examples/testh5c++.sh.in | 36 +++++--------------------- c++/examples/writedata.cpp | 4 --- c++/src/H5AbstractDs.h | 6 ++--- c++/src/H5ArrayType.h | 6 ++--- c++/src/H5AtomType.h | 6 ++--- c++/src/H5Attribute.cpp | 8 ++---- c++/src/H5Attribute.h | 6 ++--- c++/src/H5Classes.h | 6 ++--- c++/src/H5CommonFG.h | 6 ++--- c++/src/H5CompType.h | 6 ++--- c++/src/H5Cpp.h | 6 ++--- c++/src/H5CppDoc.h | 6 ++--- c++/src/H5DaccProp.cpp | 3 +-- c++/src/H5DaccProp.h | 6 ++--- c++/src/H5DataSet.cpp | 4 --- c++/src/H5DataSet.h | 6 ++--- c++/src/H5DataSpace.cpp | 7 +----- c++/src/H5DataSpace.h | 14 +++++------ c++/src/H5DataType.cpp | 4 --- c++/src/H5DataType.h | 6 ++--- c++/src/H5DcreatProp.cpp | 7 +++--- c++/src/H5DcreatProp.h | 8 +++--- c++/src/H5DxferProp.cpp | 5 ++-- c++/src/H5DxferProp.h | 6 ++--- c++/src/H5EnumType.h | 6 ++--- c++/src/H5Exception.cpp | 2 +- c++/src/H5Exception.h | 34 +++++++++++-------------- c++/src/H5FaccProp.cpp | 53 +++++++++++++++++++++++++++++++++----- c++/src/H5FaccProp.h | 12 ++++++--- c++/src/H5FcreatProp.cpp | 3 +-- c++/src/H5FcreatProp.h | 6 ++--- c++/src/H5File.cpp | 6 +---- c++/src/H5File.h | 18 ++++++------- c++/src/H5FloatType.h | 6 ++--- c++/src/H5Group.cpp | 4 --- c++/src/H5Group.h | 20 +++++++-------- c++/src/H5IdComponent.h | 6 ++--- c++/src/H5Include.h | 20 ++++++--------- c++/src/H5IntType.h | 6 ++--- c++/src/H5LaccProp.cpp | 3 +-- c++/src/H5LaccProp.h | 6 ++--- c++/src/H5LcreatProp.cpp | 3 +-- c++/src/H5LcreatProp.h | 6 ++--- c++/src/H5Library.h | 6 ++--- c++/src/H5Location.cpp | 11 ++++---- c++/src/H5Location.h | 6 ++--- c++/src/H5Object.cpp | 16 ++++++++---- c++/src/H5Object.h | 12 ++++----- c++/src/H5OcreatProp.cpp | 3 +-- c++/src/H5OcreatProp.h | 6 ++--- c++/src/H5PredType.cpp | 3 ++- c++/src/H5PredType.h | 8 +++--- c++/src/H5PropList.cpp | 7 +----- c++/src/H5PropList.h | 6 ++--- c++/src/H5StrType.cpp | 3 ++- c++/src/H5StrType.h | 6 ++--- c++/src/H5VarLenType.h | 6 ++--- c++/test/dsets.cpp | 56 +++++++++++++++-------------------------- c++/test/h5cpputil.cpp | 8 ++---- c++/test/h5cpputil.h | 8 +++--- c++/test/tarray.cpp | 31 +++++++++++------------ c++/test/tattr.cpp | 60 +++++++++++++++++++++----------------------- c++/test/tcompound.cpp | 18 ++++--------- c++/test/tdspl.cpp | 4 --- c++/test/testhdf5.cpp | 4 --- c++/test/tfile.cpp | 16 +++++------- c++/test/tfilter.cpp | 40 +++++++++++++---------------- c++/test/th5s.cpp | 6 +---- c++/test/titerate.cpp | 4 --- c++/test/tlinks.cpp | 6 +---- c++/test/tobject.cpp | 4 --- c++/test/trefer.cpp | 13 +++------- c++/test/ttypes.cpp | 7 +----- c++/test/tvlstr.cpp | 14 +++-------- 80 files changed, 346 insertions(+), 474 deletions(-) diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 365a7da..3717fcb 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -16,11 +16,7 @@ * We will read from the file created by extend.cpp */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index 31a572a..8975845 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -17,11 +17,7 @@ * and read back fields' subsets. */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index ef2de36..e55230f 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -15,11 +15,7 @@ * This example writes a dataset to a new HDF5 file. */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Cpp.h" diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index e69c1c0..24f5f3e 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -18,11 +18,7 @@ * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include using std::cout; diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index 793ff8f..f9ec176 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -20,11 +20,7 @@ * the C version is used in this example. */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 7441420..e247a8e 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -17,11 +17,7 @@ // information about the dataset in the SDS.h5 file is obtained. // -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/examples/testh5c++.sh.in b/c++/examples/testh5c++.sh.in index 46fe5eb..44dc9e7 100644 --- a/c++/examples/testh5c++.sh.in +++ b/c++/examples/testh5c++.sh.in @@ -67,11 +67,7 @@ temp_FILES="a.out $applib" cat > $appmain < -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include "H5Cpp.h" @@ -95,19 +91,11 @@ EOF # generate prog1 cat > $prog1 < -#else - #include -#endif +#include #include -#ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD -#endif +using std::cout; +using std::endl; int sub1(void) { cout << "in sub1" << endl; @@ -117,19 +105,11 @@ EOF # generate prog2 cat > $prog2 < -#else - #include -#endif +#include #include -#ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD -#endif +using std::cout; +using std::endl; int sub2(void) { cout << "in sub2" << endl; @@ -142,11 +122,7 @@ EOF cat > $hdf5main < -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include "H5Cpp.h" diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index ddd3460..f2b715a 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -20,11 +20,7 @@ * file is closed. Program reopens the file and reads and displays the result. */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index fe6e033c..b84867b 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __AbstractDs_H -#define __AbstractDs_H +#ifndef H5AbstractDs_H +#define H5AbstractDs_H namespace H5 { @@ -81,4 +81,4 @@ class H5_DLLCPP AbstractDs { }; // end of AbstractDs } // namespace H5 -#endif // __AbstractDs_H +#endif // H5AbstractDs_H diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index c2a6493..4302352 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5ArrayType_H -#define __H5ArrayType_H +#ifndef H5ArrayType_H +#define H5ArrayType_H namespace H5 { @@ -69,4 +69,4 @@ class H5_DLLCPP ArrayType : public DataType { }; // end of ArrayType } // namespace H5 -#endif // __H5ArrayType_H +#endif // H5ArrayType_H diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index f5664b8..84da5e9 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5AtomType_H -#define __H5AtomType_H +#ifndef H5AtomType_H +#define H5AtomType_H namespace H5 { @@ -83,4 +83,4 @@ class H5_DLLCPP AtomType : public DataType { }; // end of AtomType } // namespace H5 -#endif // __H5AtomType_H +#endif // H5AtomType_H diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 3ce94a1..0e37c2b 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5private.h" // for HDfree @@ -41,7 +37,7 @@ namespace H5 { using std::cerr; using std::endl; -class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate +class H5Object; // forward declaration for UserData4Aiterate //-------------------------------------------------------------------------- // Function: Attribute default constructor @@ -314,7 +310,7 @@ Attribute::getName(char *attr_name, size_t buf_size) const H5std_string Attribute::getName() const { - H5std_string attr_name(""); // attribute name to return + H5std_string attr_name; // attribute name to return // Preliminary call to get the size of the attribute name ssize_t name_size = H5Aget_name(id, static_cast(0), NULL); diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 5a13c2e..41e5a31 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5Attribute_H -#define __H5Attribute_H +#ifndef H5Attribute_H +#define H5Attribute_H namespace H5 { @@ -104,4 +104,4 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { }; // end of Attribute } // namespace H5 -#endif // __H5Attribute_H +#endif // H5Attribute_H diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h index 42e3d69..7820ce2 100644 --- a/c++/src/H5Classes.h +++ b/c++/src/H5Classes.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5Classes_H -#define __H5Classes_H +#ifndef H5Classes_H +#define H5Classes_H namespace H5 { class Exception; @@ -43,4 +43,4 @@ class H5File; class Attribute; class H5Library; } // namespace H5 -#endif // __H5Classes_H +#endif // H5Classes_H diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 2e5ccf3..d87f9ca 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __CommonFG_H -#define __CommonFG_H +#ifndef H5CommonFG_H +#define H5CommonFG_H namespace H5 { @@ -83,7 +83,7 @@ class H5_DLLCPP CommonFG { }; // end of CommonFG } // namespace H5 -#endif // __CommonFG_H +#endif // H5CommonFG_H /*************************************************************************** Design Note diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 6d2ce7e..6a4c093 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5CompType_H -#define __H5CompType_H +#ifndef H5CompType_H +#define H5CompType_H namespace H5 { @@ -124,4 +124,4 @@ class H5_DLLCPP CompType : public DataType { }; // end of CompType } // namespace H5 -#endif // __H5CompType_H +#endif // H5CompType_H diff --git a/c++/src/H5Cpp.h b/c++/src/H5Cpp.h index 8fea1f9..9272bdb 100644 --- a/c++/src/H5Cpp.h +++ b/c++/src/H5Cpp.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5Cpp_H -#define __H5Cpp_H +#ifndef H5Cpp_H +#define H5Cpp_H #include "H5Include.h" #include "H5Exception.h" @@ -58,4 +58,4 @@ #define HOFFSET(TYPE, MEMBER) ((size_t) & ((TYPE *)0)->MEMBER) #endif -#endif // __H5Cpp_H +#endif // H5Cpp_H diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index 29f3afc..4337a6f 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5CppDoc_H -#define __H5CppDoc_H +#ifndef H5CppDoc_H +#define H5CppDoc_H //------------------------------------------------------------------------- // The following section will be used to generate the 'Mainpage' @@ -92,4 +92,4 @@ /// This example shows how to work with groups. ///\example h5group.cpp -#endif // __H5CppDoc_H +#endif // H5CppDoc_H diff --git a/c++/src/H5DaccProp.cpp b/c++/src/H5DaccProp.cpp index 35c071a..1905f27 100644 --- a/c++/src/H5DaccProp.cpp +++ b/c++/src/H5DaccProp.cpp @@ -72,8 +72,7 @@ DSetAccPropList::getConstant() void DSetAccPropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- diff --git a/c++/src/H5DaccProp.h b/c++/src/H5DaccProp.h index 627c4a4..7d6b250 100644 --- a/c++/src/H5DaccProp.h +++ b/c++/src/H5DaccProp.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5DSetAccPropList_H -#define __H5DSetAccPropList_H +#ifndef H5DSetAccPropList_H +#define H5DSetAccPropList_H namespace H5 { @@ -69,4 +69,4 @@ class H5_DLLCPP DSetAccPropList : public LinkAccPropList { }; // end of DSetAccPropList } // namespace H5 -#endif // __H5DSetAccPropList_H +#endif // H5DSetAccPropList_H diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index b080e9e..3a14975 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5private.h" // for HDfree diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index c07aad5..c745470 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5DataSet_H -#define __H5DataSet_H +#ifndef H5DataSet_H +#define H5DataSet_H namespace H5 { @@ -153,4 +153,4 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { }; // end of DataSet } // namespace H5 -#endif // __H5DataSet_H +#endif // H5DataSet_H diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 9c997d1..c20a88c 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Include.h" @@ -73,8 +69,7 @@ DataSpace::getConstant() void DataSpace::deleteConstants() { - if (ALL_ != 0) - delete ALL_; + delete ALL_; } //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 14d030f..470de74 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5DataSpace_H -#define __H5DataSpace_H +#ifndef H5DataSpace_H +#define H5DataSpace_H namespace H5 { @@ -43,7 +43,7 @@ class H5_DLLCPP DataSpace : public IdComponent { DataSpace &operator=(const DataSpace &rhs); // Closes this dataspace. - virtual void close(); + virtual void close() H5_OVERRIDE; // Makes copy of an existing dataspace. void copy(const DataSpace &like_space); @@ -115,13 +115,13 @@ class H5_DLLCPP DataSpace : public IdComponent { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("DataSpace"); } // Gets the dataspace id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // Deletes the global constant static void deleteConstants(); @@ -133,7 +133,7 @@ class H5_DLLCPP DataSpace : public IdComponent { protected: // Sets the dataspace id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -155,4 +155,4 @@ class H5_DLLCPP DataSpace : public IdComponent { }; // end of DataSpace } // namespace H5 -#endif // __H5DataSpace_H +#endif // H5DataSpace_H diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 9db2732..3228dcb 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Include.h" diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index f97f806..49f5348 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5DataType_H -#define __H5DataType_H +#ifndef H5DataType_H +#define H5DataType_H namespace H5 { @@ -183,4 +183,4 @@ class H5_DLLCPP DataType : public H5Object { }; // end of DataType } // namespace H5 -#endif // __H5DataType_H +#endif // H5DataType_H diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 4c71d5e..34be7ba 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -78,8 +78,7 @@ DSetCreatPropList::getConstant() void DSetCreatPropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- @@ -775,8 +774,8 @@ DSetCreatPropList::setVirtual(const DataSpace &vspace, const char *src_fname, co // Programmer Binh-Minh Ribler - Mar, 2017 //-------------------------------------------------------------------------- void -DSetCreatPropList::setVirtual(const DataSpace &vspace, const H5std_string src_fname, - const H5std_string src_dsname, const DataSpace &sspace) const +DSetCreatPropList::setVirtual(const DataSpace &vspace, const H5std_string &src_fname, + const H5std_string &src_dsname, const DataSpace &sspace) const { setVirtual(vspace, src_fname.c_str(), src_dsname.c_str(), sspace); } diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 74c4be0..820c0d1 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5DSCreatPropList_H -#define __H5DSCreatPropList_H +#ifndef H5DSCreatPropList_H +#define H5DSCreatPropList_H namespace H5 { @@ -123,7 +123,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { // Maps elements of a virtual dataset to elements of the source dataset. void setVirtual(const DataSpace &vspace, const char *src_fname, const char *src_dsname, const DataSpace &sspace) const; - void setVirtual(const DataSpace &vspace, const H5std_string src_fname, const H5std_string src_dsname, + void setVirtual(const DataSpace &vspace, const H5std_string &src_fname, const H5std_string &src_dsname, const DataSpace &sspace) const; ///\brief Returns this class name. @@ -159,4 +159,4 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { }; // end of DSetCreatPropList } // namespace H5 -#endif // __H5DSCreatPropList_H +#endif // H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 7f123a7..43ea6f4 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -72,8 +72,7 @@ DSetMemXferPropList::getConstant() void DSetMemXferPropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- @@ -312,7 +311,7 @@ DSetMemXferPropList::getDataTransform() const { // Initialize string to "", so that if there is no expression, the returned // string will be empty - H5std_string expression(""); + H5std_string expression; // Preliminary call to get the expression's length ssize_t exp_len = H5Pget_data_transform(id, NULL, (size_t)0); diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index daeb83e..1e4d668 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5DSetMemXferPropList_H -#define __H5DSetMemXferPropList_H +#ifndef H5DSetMemXferPropList_H +#define H5DSetMemXferPropList_H namespace H5 { @@ -131,4 +131,4 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { }; // end of DSetMemXferPropList } // namespace H5 -#endif // __H5DSetMemXferPropList_H +#endif // H5DSetMemXferPropList_H diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index b228d31..484405a 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5EnumType_H -#define __H5EnumType_H +#ifndef H5EnumType_H +#define H5EnumType_H namespace H5 { @@ -87,4 +87,4 @@ class H5_DLLCPP EnumType : public DataType { }; // end of EnumType } // namespace H5 -#endif // __H5EnumType_H +#endif // H5EnumType_H diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index f6f33e0..6769439 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -25,7 +25,7 @@ const char Exception::DEFAULT_MSG[] = "No detailed information provided"; ///\brief Default constructor. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Exception::Exception() : detail_message(""), func_name("") +Exception::Exception() { } diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index c7b117b..9970d22 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -12,17 +12,13 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5Exception_H -#define __H5Exception_H +#ifndef H5Exception_H +#define H5Exception_H #include namespace H5 { -#ifdef H5_NO_STD -#define H5std_string ::string -#else #define H5std_string std::string -#endif /*! \class Exception \brief Exception provides wrappers of HDF5 error handling functions. @@ -94,86 +90,86 @@ class H5_DLLCPP FileIException : public Exception { public: FileIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); FileIException(); - virtual ~FileIException() throw(); + virtual ~FileIException() throw() H5_OVERRIDE; }; class H5_DLLCPP GroupIException : public Exception { public: GroupIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); GroupIException(); - virtual ~GroupIException() throw(); + virtual ~GroupIException() throw() H5_OVERRIDE; }; class H5_DLLCPP DataSpaceIException : public Exception { public: DataSpaceIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); DataSpaceIException(); - virtual ~DataSpaceIException() throw(); + virtual ~DataSpaceIException() throw() H5_OVERRIDE; }; class H5_DLLCPP DataTypeIException : public Exception { public: DataTypeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); DataTypeIException(); - virtual ~DataTypeIException() throw(); + virtual ~DataTypeIException() throw() H5_OVERRIDE; }; class H5_DLLCPP ObjHeaderIException : public Exception { public: ObjHeaderIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); ObjHeaderIException(); - virtual ~ObjHeaderIException() throw(); + virtual ~ObjHeaderIException() throw() H5_OVERRIDE; }; class H5_DLLCPP PropListIException : public Exception { public: PropListIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); PropListIException(); - virtual ~PropListIException() throw(); + virtual ~PropListIException() throw() H5_OVERRIDE; }; class H5_DLLCPP DataSetIException : public Exception { public: DataSetIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); DataSetIException(); - virtual ~DataSetIException() throw(); + virtual ~DataSetIException() throw() H5_OVERRIDE; }; class H5_DLLCPP AttributeIException : public Exception { public: AttributeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); AttributeIException(); - virtual ~AttributeIException() throw(); + virtual ~AttributeIException() throw() H5_OVERRIDE; }; class H5_DLLCPP ReferenceException : public Exception { public: ReferenceException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); ReferenceException(); - virtual ~ReferenceException() throw(); + virtual ~ReferenceException() throw() H5_OVERRIDE; }; class H5_DLLCPP LibraryIException : public Exception { public: LibraryIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); LibraryIException(); - virtual ~LibraryIException() throw(); + virtual ~LibraryIException() throw() H5_OVERRIDE; }; class H5_DLLCPP LocationException : public Exception { public: LocationException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); LocationException(); - virtual ~LocationException() throw(); + virtual ~LocationException() throw() H5_OVERRIDE; }; class H5_DLLCPP IdComponentException : public Exception { public: IdComponentException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); IdComponentException(); - virtual ~IdComponentException() throw(); + virtual ~IdComponentException() throw() H5_OVERRIDE; }; // end of IdComponentException } // namespace H5 -#endif // __H5Exception_H +#endif // H5Exception_H diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index f81c1f9..a79ada3 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include using std::cerr; @@ -80,8 +76,7 @@ FileAccPropList::getConstant() void FileAccPropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- @@ -697,6 +692,52 @@ FileAccPropList::getGcReferences() const } //-------------------------------------------------------------------------- +// Function: FileAccPropList::setFileLocking +///\brief Sets file locking flags. +///\param use_file_locking - IN: Flag that determines if file locks should +// be used or not. +///\param ignore_when_disabled - IN: Flag that determines if file locks +// should be be used when disabled on the file system or not. +///\exception H5::PropListIException +///\par Description +/// For information, please refer to the H5Pset_file_locking API in +/// the HDF5 C Reference Manual. +// Programmer Dana Robinson - 2020 +//-------------------------------------------------------------------------- +void +FileAccPropList::setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const +{ + herr_t ret_value = H5Pset_file_locking(id, use_file_locking, ignore_when_disabled); + + if (ret_value < 0) { + throw PropListIException("FileAccPropList::setFileLocking", "H5Pset_file_locking failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: FileAccPropList::getFileLocking +///\brief Gets file locking flags. +///\param use_file_locking - OUT: Flag that determines if file locks +// should be used or not. +///\param ignore_when_disabled - OUT: Flag that determines if file locks +// should be be used when disabled on the file system or not. +///\exception H5::PropListIException +///\par Description +/// For information, please refer to the H5Pget_file_locking API in +/// the HDF5 C Reference Manual. +// Programmer Dana Robinson - 2020 +//-------------------------------------------------------------------------- +void +FileAccPropList::getFileLocking(hbool_t &use_file_locking, hbool_t &ignore_when_disabled) const +{ + herr_t ret_value = H5Pget_file_locking(id, &use_file_locking, &ignore_when_disabled); + + if (ret_value < 0) { + throw PropListIException("FileAccPropList::getFileLocking", "H5Pget_file_locking failed"); + } +} + +//-------------------------------------------------------------------------- // Function: FileAccPropList::setLibverBounds ///\brief Sets bounds on versions of library format to be used when creating /// or writing objects. diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 69e2727..998f870 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5FileAccPropList_H -#define __H5FileAccPropList_H +#ifndef H5FileAccPropList_H +#define H5FileAccPropList_H namespace H5 { @@ -122,6 +122,12 @@ class H5_DLLCPP FileAccPropList : public PropList { // Returns garbage collecting references setting. unsigned getGcReferences() const; + // Sets file locking parameters. + void setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const; + + // Gets file locking parameters. + void getFileLocking(hbool_t &use_file_locking, hbool_t &ignore_when_disabled) const; + // Sets bounds on versions of library format to be used when creating // or writing objects. void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; @@ -162,4 +168,4 @@ class H5_DLLCPP FileAccPropList : public PropList { }; // end of FileAccPropList } // namespace H5 -#endif // __H5FileAccPropList_H +#endif // H5FileAccPropList_H diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index b9be563..b51ba10 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -68,8 +68,7 @@ FileCreatPropList::getConstant() void FileCreatPropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 2b3f46f..00ae0b1 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5FileCreatPropList_H -#define __H5FileCreatPropList_H +#ifndef H5FileCreatPropList_H +#define H5FileCreatPropList_H namespace H5 { @@ -109,4 +109,4 @@ class H5_DLLCPP FileCreatPropList : public PropList { }; // end of FileCreatPropList } // namespace H5 -#endif // __H5FileCreatPropList_H +#endif // H5FileCreatPropList_H diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 4c866de..9a6f191 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Include.h" @@ -184,7 +180,7 @@ H5File::H5File(hid_t existing_id) : Group() ///\param original - IN: H5File instance to copy // December 2000 //-------------------------------------------------------------------------- -H5File::H5File(const H5File &original) : Group() +H5File::H5File(const H5File &original) : Group(original) { id = original.getId(); incRefCount(); // increment number of references to this id diff --git a/c++/src/H5File.h b/c++/src/H5File.h index b3f4f2c..6126eec 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5File_H -#define __H5File_H +#ifndef H5File_H +#define H5File_H namespace H5 { @@ -39,7 +39,7 @@ class H5_DLLCPP H5File : public Group { const FileAccPropList &access_plist = FileAccPropList::DEFAULT); // Close this file. - virtual void close(); + virtual void close() H5_OVERRIDE; // Gets a copy of the access property list of this file. FileAccPropList getAccessPlist() const; @@ -96,16 +96,16 @@ class H5_DLLCPP H5File : public Group { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("H5File"); } // Throw file exception. - virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const; + virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const H5_OVERRIDE; // For CommonFG to get the file id. - virtual hid_t getLocId() const; + virtual hid_t getLocId() const H5_OVERRIDE; // Default constructor H5File(); @@ -114,7 +114,7 @@ class H5_DLLCPP H5File : public Group { H5File(const H5File &original); // Gets the HDF5 file id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // H5File destructor. virtual ~H5File(); @@ -122,7 +122,7 @@ class H5_DLLCPP H5File : public Group { protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS // Sets the HDF5 file id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS private: @@ -136,4 +136,4 @@ class H5_DLLCPP H5File : public Group { }; // end of H5File } // namespace H5 -#endif // __H5File_H +#endif // H5File_H diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index e254646..c76be95 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5FloatType_H -#define __H5FloatType_H +#ifndef H5FloatType_H +#define H5FloatType_H namespace H5 { @@ -84,4 +84,4 @@ class H5_DLLCPP FloatType : public AtomType { }; // end of FloatType } // namespace H5 -#endif // __H5FloatType_H +#endif // H5FloatType_H diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 8086fc3..fe791da 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Include.h" diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index ae5bb4a..b5f7e51 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __Group_H -#define __Group_H +#ifndef H5Group_H +#define H5Group_H namespace H5 { @@ -24,20 +24,20 @@ namespace H5 { class H5_DLLCPP Group : public H5Object, public CommonFG { public: // Close this group. - virtual void close(); + virtual void close() H5_OVERRIDE; ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("Group"); } // Throw group exception. - virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const; + virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const H5_OVERRIDE; // for CommonFG to get the file id. - virtual hid_t getLocId() const; + virtual hid_t getLocId() const H5_OVERRIDE; // Creates a group by way of dereference. Group(const H5Location &loc, const void *ref, H5R_type_t ref_type = H5R_OBJECT, @@ -63,10 +63,10 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { Group(const Group &original); // Gets the group id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // Destructor - virtual ~Group(); + virtual ~Group() H5_OVERRIDE; // Creates a copy of an existing group using its id. Group(const hid_t group_id); @@ -74,7 +74,7 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS // Sets the group id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS private: @@ -83,4 +83,4 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { }; // end of Group } // namespace H5 -#endif // __Group_H +#endif // H5Group_H diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index b756a3d..383d42d 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __IdComponent_H -#define __IdComponent_H +#ifndef H5IdComponent_H +#define H5IdComponent_H namespace H5 { @@ -113,4 +113,4 @@ class H5_DLLCPP IdComponent { }; // end class IdComponent } // namespace H5 -#endif // __IdComponent_H +#endif // H5IdComponent_H diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h index 1f03150..0dc930d 100644 --- a/c++/src/H5Include.h +++ b/c++/src/H5Include.h @@ -14,19 +14,6 @@ #include -// Define bool type for platforms that don't support bool yet -#ifdef BOOL_NOTDEFINED -#ifdef false -#undef false -#endif -#ifdef true -#undef true -#endif -typedef int bool; -const bool false = 0; -const bool true = 1; -#endif - // These are defined in H5Opkg.h, which should not be included in the C++ API, // so re-define them here for now. @@ -37,3 +24,10 @@ const bool true = 1; * magic number as prefix and checksum as suffix for all chunks. */ #define H5O_VERSION_2 2 + +// Define H5_OVERRIDE to override for C++11. +#if defined(__cplusplus) && (201103L <= __cplusplus) +#define H5_OVERRIDE override +#else +#define H5_OVERRIDE +#endif diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 7841518..185c8f0 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5IntType_H -#define __H5IntType_H +#ifndef H5IntType_H +#define H5IntType_H namespace H5 { @@ -66,4 +66,4 @@ class H5_DLLCPP IntType : public AtomType { }; // end of IntType } // namespace H5 -#endif // __H5IntType_H +#endif // H5IntType_H diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp index feaa555..acdaa13 100644 --- a/c++/src/H5LaccProp.cpp +++ b/c++/src/H5LaccProp.cpp @@ -70,8 +70,7 @@ LinkAccPropList::getConstant() void LinkAccPropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index e6cf888..4fa516c 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5LinkAccPropList_H -#define __H5LinkAccPropList_H +#ifndef H5LinkAccPropList_H +#define H5LinkAccPropList_H namespace H5 { @@ -70,4 +70,4 @@ class H5_DLLCPP LinkAccPropList : public PropList { }; // end of LinkAccPropList } // namespace H5 -#endif // __H5LinkAccPropList_H +#endif // H5LinkAccPropList_H diff --git a/c++/src/H5LcreatProp.cpp b/c++/src/H5LcreatProp.cpp index 29721c1..63fe861 100644 --- a/c++/src/H5LcreatProp.cpp +++ b/c++/src/H5LcreatProp.cpp @@ -70,8 +70,7 @@ LinkCreatPropList::getConstant() void LinkCreatPropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h index e5a9d7a..aea38e7 100644 --- a/c++/src/H5LcreatProp.h +++ b/c++/src/H5LcreatProp.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5LinkCreatPropList_H -#define __H5LinkCreatPropList_H +#ifndef H5LinkCreatPropList_H +#define H5LinkCreatPropList_H namespace H5 { @@ -77,4 +77,4 @@ class H5_DLLCPP LinkCreatPropList : public PropList { }; // end of LinkCreatPropList } // namespace H5 -#endif // __H5LinkCreatPropList_H +#endif // H5LinkCreatPropList_H diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 9a73eee..3df8d56 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5Library_H -#define __H5Library_H +#ifndef H5Library_H +#define H5Library_H namespace H5 { @@ -69,4 +69,4 @@ class H5_DLLCPP H5Library { }; // end of H5Library } // namespace H5 -#endif // __H5Library_H +#endif // H5Library_H diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 4ded68e..46f47bb 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -348,7 +348,7 @@ H5Location::getComment(const char *name, size_t buf_size) const { // Initialize string to "", so that if there is no comment, the returned // string will be empty - H5std_string comment(""); + H5std_string comment; // Preliminary call to get the comment's length ssize_t comment_len = H5Oget_comment_by_name(getId(), name, NULL, (size_t)0, H5P_DEFAULT); @@ -400,6 +400,7 @@ H5Location::getComment(const H5std_string &name, size_t buf_size) const { return (getComment(name.c_str(), buf_size)); } + #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- @@ -648,6 +649,7 @@ H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const return (obj_type); } #endif // DOXYGEN_SHOULD_SKIP_THIS + #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- @@ -706,6 +708,7 @@ H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const } return (obj_type); } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Location::getRegion @@ -1818,7 +1821,7 @@ H5Location::getLinkval(const char *name, size_t size) const H5L_info2_t linkinfo; char * value_C; // value in C string size_t val_size = size; - H5std_string value = ""; + H5std_string value; herr_t ret_value; // if user doesn't provide buffer size, determine it @@ -2294,7 +2297,6 @@ H5Location::childObjVersion(const H5std_string &objname) const } #ifndef H5_NO_DEPRECATED_SYMBOLS -#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Location::getObjTypeByIdx ///\brief Returns the type of an object in this group, given the @@ -2372,7 +2374,6 @@ H5Location::getObjTypeByIdx(hsize_t idx, H5std_string &type_name) const return (obj_type); } -#endif // DOXYGEN_SHOULD_SKIP_THIS #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- @@ -2435,6 +2436,4 @@ H5Location::~H5Location() { } -#endif // DOXYGEN_SHOULD_SKIP_THIS - } // namespace H5 diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 9f61f20..740d0ce 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5Location_H -#define __H5Location_H +#ifndef H5Location_H +#define H5Location_H #include "H5Classes.h" // constains forward class declarations @@ -339,4 +339,4 @@ class H5_DLLCPP H5Location : public IdComponent { }; // end of H5Location } // namespace H5 -#endif // __H5Location_H +#endif // H5Location_H diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 8532089..71109d3 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -42,8 +42,11 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS // userAttrOpWrpr interfaces between the user's function and the // C library function H5Aiterate2 -extern "C" herr_t -userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data) +extern "C" { + +static herr_t +userAttrOpWrpr(H5_ATTR_UNUSED hid_t loc_id, const char *attr_name, H5_ATTR_UNUSED const H5A_info_t *ainfo, + void *op_data) { H5std_string s_attr_name = H5std_string(attr_name); UserData4Aiterate *myData = reinterpret_cast(op_data); @@ -53,8 +56,9 @@ userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, voi // userVisitOpWrpr interfaces between the user's function and the // C library function H5Ovisit3 -extern "C" herr_t -userVisitOpWrpr(hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info, void *op_data) +static herr_t +userVisitOpWrpr(H5_ATTR_UNUSED hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info, + void *op_data) { H5std_string s_attr_name = H5std_string(attr_name); UserData4Visit *myData = reinterpret_cast(op_data); @@ -62,6 +66,8 @@ userVisitOpWrpr(hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info return status; } +} // extern "C" + //-------------------------------------------------------------------------- // Function: H5Object default constructor (protected) // Programmer Binh-Minh Ribler - 2000 @@ -473,7 +479,7 @@ H5Object::getObjName(char *obj_name, size_t buf_size) const H5std_string H5Object::getObjName() const { - H5std_string obj_name(""); // object name to return + H5std_string obj_name; // object name to return // Preliminary call to get the size of the object name ssize_t name_size = H5Iget_name(getId(), NULL, static_cast(0)); diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 7ba57ed..bc2f14a 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5Object_H -#define __H5Object_H +#ifndef H5Object_H +#define H5Object_H namespace H5 { @@ -106,7 +106,7 @@ class H5_DLLCPP H5Object : public H5Location { void removeAttr(const H5std_string &name) const; // Returns an identifier. - virtual hid_t getId() const = 0; + virtual hid_t getId() const H5_OVERRIDE = 0; // Gets the name of this HDF5 object, i.e., Group, DataSet, or // DataType. @@ -122,14 +122,14 @@ class H5_DLLCPP H5Object : public H5Location { // Sets the identifier of this object to a new value. - this one // doesn't increment reference count - virtual void p_setId(const hid_t new_id) = 0; + virtual void p_setId(const hid_t new_id) H5_OVERRIDE = 0; // Noop destructor. - virtual ~H5Object(); + virtual ~H5Object() H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS }; // end of H5Object } // namespace H5 -#endif // __H5Object_H +#endif // H5Object_H diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 81dae31..dffdeb1 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -70,8 +70,7 @@ ObjCreatPropList::getConstant() void ObjCreatPropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index ec6e9c8..7f6d411 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5ObjCreatPropList_H -#define __H5ObjCreatPropList_H +#ifndef H5ObjCreatPropList_H +#define H5ObjCreatPropList_H namespace H5 { @@ -75,4 +75,4 @@ class H5_DLLCPP ObjCreatPropList : public PropList { }; // end of ObjCreatPropList } // namespace H5 -#endif // __H5ObjCreatPropList_H +#endif // H5ObjCreatPropList_H diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index b97a2b8..9e67968 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -27,6 +27,7 @@ #include "H5DataType.h" #include "H5AtomType.h" #include "H5PredType.h" +#include "H5private.h" namespace H5 { @@ -89,7 +90,7 @@ PredType::operator=(const PredType &rhs) // These dummy functions do not inherit from DataType - they'll // throw an DataTypeIException if invoked. void -PredType::commit(H5Location &loc, const char *name) +PredType::commit(H5_ATTR_UNUSED H5Location &loc, H5_ATTR_UNUSED const char *name) { throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!"); diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 19d8798..b40d2b3 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5PredType_H -#define __H5PredType_H +#ifndef H5PredType_H +#define H5PredType_H namespace H5 { @@ -435,11 +435,11 @@ class H5_DLLCPP PredType : public AtomType { #if H5_SIZEOF_UINT_FAST64_T != 0 static PredType *NATIVE_UINT_FAST64_; #endif /* H5_SIZEOF_UINT_FAST64_T */ - // End of Declaration of pointers + // End of Declaration of pointers #endif // DOXYGEN_SHOULD_SKIP_THIS }; // end of PredType } // namespace H5 -#endif // __H5PredType_H +#endif // H5PredType_H diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index c32f852..2c80255 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include @@ -75,8 +71,7 @@ PropList::getConstant() void PropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index cdd9619..12c8b4b 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5PropList_H -#define __H5PropList_H +#ifndef H5PropList_H +#define H5PropList_H namespace H5 { @@ -144,4 +144,4 @@ class H5_DLLCPP PropList : public IdComponent { }; // end of PropList } // namespace H5 -#endif // __H5PropList_H +#endif // H5PropList_H diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 32f336f..5df48f3 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -32,6 +32,7 @@ #include "H5StrType.h" #include "H5DataSet.h" #include "H5PredType.h" +#include "H5private.h" namespace H5 { @@ -104,7 +105,7 @@ StrType::StrType(const PredType &pred_type, const size_t &size) : AtomType() // This constructor replaced the previous one. // Programmer Binh-Minh Ribler - Nov 28, 2005 //-------------------------------------------------------------------------- -StrType::StrType(const int dummy, const size_t &size) : AtomType() +StrType::StrType(H5_ATTR_UNUSED const int dummy, const size_t &size) : AtomType() { // use DataType::copy to make a copy of the string predefined type // then set its length diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index b24cbef..d272c53 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5StrType_H -#define __H5StrType_H +#ifndef H5StrType_H +#define H5StrType_H namespace H5 { @@ -78,4 +78,4 @@ class H5_DLLCPP StrType : public AtomType { }; // end of StrType } // namespace H5 -#endif // __H5StrType_H +#endif // H5StrType_H diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 674b49d..f767e0e 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -12,8 +12,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef __H5VarLenType_H -#define __H5VarLenType_H +#ifndef H5VarLenType_H +#define H5VarLenType_H namespace H5 { @@ -61,4 +61,4 @@ class H5_DLLCPP VarLenType : public DataType { }; // end of VarLenType } // namespace H5 -#endif // __H5VarLenType_H +#endif // H5VarLenType_H diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 65949b6..356112e 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -23,11 +23,7 @@ ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -163,8 +159,7 @@ test_create(H5File &file) cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; // clean up and return with failure - if (dataset != NULL) - delete dataset; + delete dataset; return -1; } // catch all other exceptions @@ -172,8 +167,7 @@ test_create(H5File &file) issue_fail_msg("test_create", __LINE__, __FILE__); // clean up and return with failure - if (dataset != NULL) - delete dataset; + delete dataset; return -1; } } // test_create @@ -253,8 +247,7 @@ test_simple_io(H5File &file) cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; // clean up and return with failure - if (tconv_buf) - delete[] tconv_buf; + delete[] tconv_buf; return -1; } } // test_simple_io @@ -398,13 +391,13 @@ test_tconv(H5File &file) /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encode and decode enabled */ - "bogus", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)filter_bogus, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encode and decode enabled */ + "bogus", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- @@ -696,10 +689,8 @@ test_compression(H5File &file) cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; // clean up and return with failure - if (dataset != NULL) - delete dataset; - if (tconv_buf) - delete[] tconv_buf; + delete dataset; + delete[] tconv_buf; return -1; } } // test_compression @@ -889,8 +880,7 @@ test_multiopen(H5File &file) cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; // clean up and return with failure - if (space != NULL) - delete space; + delete space; return -1; } } // test_multiopen @@ -968,8 +958,7 @@ test_types(H5File &file) cerr << " <<< " << "bitfield_1: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; + delete dset; return -1; } @@ -1000,8 +989,7 @@ test_types(H5File &file) cerr << " <<< " << "bitfield_2: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; + delete dset; throw E; // propagate the exception } @@ -1035,10 +1023,8 @@ test_types(H5File &file) cerr << " <<< " << "opaque_1: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - if (optype != NULL) - delete optype; + delete dset; + delete optype; throw E; // propagate the exception } @@ -1071,10 +1057,8 @@ test_types(H5File &file) cerr << " <<< " << "opaque_2: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl << endl; - if (dset != NULL) - delete dset; - if (optype != NULL) - delete optype; + delete dset; + delete optype; throw E; // propagate the exception } @@ -1161,7 +1145,7 @@ const int RANK1 = 1; const H5std_string FILE_ACCPLIST("test_accplist.h5"); static herr_t -test_chunk_cache(FileAccPropList fapl) +test_chunk_cache(const FileAccPropList &fapl) { SUBTEST("DSetAccPropList::set/getChunkCache"); diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index e212aa3..78169b2 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -19,11 +19,7 @@ ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -218,7 +214,7 @@ InvalidActionException::InvalidActionException() : Exception() // func - IN: Name of the function where failure should occur // message - IN: Message //-------------------------------------------------------------------------- -InvalidActionException::InvalidActionException(const H5std_string func, const H5std_string message) +InvalidActionException::InvalidActionException(const H5std_string &func, const H5std_string &message) : Exception(func, message) { } @@ -247,7 +243,7 @@ TestFailedException::TestFailedException() : Exception() // func - IN: Name of the function where failure should occur // message - IN: Message //-------------------------------------------------------------------------- -TestFailedException::TestFailedException(const H5std_string func, const H5std_string message) +TestFailedException::TestFailedException(const H5std_string &func, const H5std_string &message) : Exception(func, message) { } diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 6a9187a..444bc68 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -19,8 +19,8 @@ ***************************************************************************/ -#ifndef _h5cpputil_h -#define _h5cpputil_h +#ifndef H5cpputil_H +#define H5cpputil_H #include "h5test.h" @@ -48,14 +48,14 @@ void issue_fail_msg(const char *where, int line, const char *file_name, const ch class InvalidActionException : public Exception { public: - InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + InvalidActionException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); InvalidActionException(); virtual ~InvalidActionException() throw(); }; class TestFailedException : public Exception { public: - TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + TestFailedException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); TestFailedException(); virtual ~TestFailedException() throw(); }; diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index ba71da8..7525c5f 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -16,11 +16,7 @@ tarray.cpp - HDF5 C++ testing the array datatype functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -85,7 +81,7 @@ test_array_compound_array() // Initialize array data to write for (idxi = 0; idxi < SPACE1_DIM1; idxi++) for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { - wdata[idxi][idxj].i = idxi * 10 + idxj; + wdata[idxi][idxj].i = static_cast(idxi * 10 + idxj); for (idxk = 0; idxk < ARRAY1_DIM1; idxk++) { float temp = idxi * 10.0 + idxj * 2.5 + idxk; wdata[idxi][idxj].f[idxk] = temp; @@ -182,8 +178,9 @@ test_array_compound_array() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=z%d\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%lld, tdims1[%d]=%lld\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -200,8 +197,9 @@ test_array_compound_array() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=%zd\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%lld, tdims1[%d]=%lld\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -250,8 +248,9 @@ test_array_compound_array() // Check the array dimensions for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { - TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=%zd\n", - ii, rdims1[ii], ii, tdims1[ii]); + TestErrPrintf( + "Array dimension information doesn't match!, rdims1[%d]=%lld, tdims1[%d]=%lld\n", ii, + rdims1[ii], ii, tdims1[ii]); continue; } // end if @@ -266,9 +265,9 @@ test_array_compound_array() for (idxi = 0; idxi < SPACE1_DIM1; idxi++) { for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { if (wdata[idxi][idxj].i != rdata[idxi][idxj].i) { - TestErrPrintf( - "Array data information doesn't match!, wdata[%d][%d].i=%d, rdata[%d][%d].i=%d\n", - idxi, idxj, wdata[idxi][idxj].i, idxi, idxj, rdata[idxi][idxj].i); + TestErrPrintf("Array data information doesn't match!, wdata[%lld][%lld].i=%d, " + "rdata[%lld][%lld].i=%d\n", + idxi, idxj, wdata[idxi][idxj].i, idxi, idxj, rdata[idxi][idxj].i); continue; } // end if } // end for @@ -387,7 +386,7 @@ test_array_info() // Initialize array data to write for (idxi = 0; idxi < SPACE1_DIM1; idxi++) for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) { - wdata[idxi][idxj].i = idxi * 10 + idxj; + wdata[idxi][idxj].i = static_cast(idxi * 10 + idxj); for (idxk = 0; idxk < ARRAY1_DIM1; idxk++) { float temp = idxi * 10.0 + idxj * 2.5 + idxk; wdata[idxi][idxj].f[idxk] = temp; @@ -459,7 +458,7 @@ test_array_info() for (ii = 0; ii < ndims; ii++) if (rdims1[ii] != tdims1[ii]) { TestErrPrintf( - "Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=z%d\n", ii, + "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=z%llu\n", ii, rdims1[ii], ii, tdims1[ii]); continue; } // end if diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index e308a3a..adaa237 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -17,11 +17,7 @@ C attribute interface (H5A) ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -173,8 +169,8 @@ test_attr_basic_write() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d,read_data1[%d]=%d\n", __LINE__, - i, attr_data1[i], i, read_data1[i]); + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu]=%d\n", + __LINE__, i, attr_data1[i], i, read_data1[i]); // Create two more attributes for this dataset, but only write to one. Attribute ds_attr2 = dataset.createAttribute(ATTR2_NAME, PredType::NATIVE_INT, att_space); @@ -189,7 +185,7 @@ test_attr_basic_write() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1a[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1a[%d]=%d,read_data1[%d]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close both attributes @@ -452,8 +448,8 @@ test_attr_rename() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d,read_data1[%d]=%d\n", __LINE__, - i, attr_data1[i], i, read_data1[i]); + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu%d\n", + __LINE__, i, attr_data1[i], i, read_data1[i]); // Close attribute attr1.close(); @@ -476,7 +472,7 @@ test_attr_rename() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1a[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1a[%d]=%d,read_data1[%d]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1a[%llu]=%d,read_data1[%llu]=%d\n", __LINE__, i, attr_data1a[i], i, read_data1[i]); // Close attribute @@ -541,7 +537,7 @@ test_attr_basic_read() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d, read_data1[%d]=%d\n", + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d, read_data1[%llu]=%d\n", __LINE__, i, attr_data1[i], i, read_data1[i]); /* @@ -572,9 +568,9 @@ test_attr_basic_read() for (i = 0; i < ATTR2_DIM1; i++) for (j = 0; j < ATTR2_DIM2; j++) if (attr_data2[i][j] != read_data2[i][j]) { - TestErrPrintf( - "%d: attribute data different: attr_data2[%d][%d]=%d, read_data2[%d][%d]=%d\n", - __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); + TestErrPrintf("%d: attribute data different: attr_data2[%llu][%llu]=%d, " + "read_data2[%llu][%llu]=%d\n", + __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); } PASSED(); } // end try block @@ -775,16 +771,16 @@ test_attr_compound_read() hsize_t ii, jj; for (ii = 0; ii < ATTR4_DIM1; ii++) for (jj = 0; jj < ATTR4_DIM2; jj++) - if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct))) { - TestErrPrintf( - "%d:attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", - __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i); - TestErrPrintf( - "%d:attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", - __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d); - TestErrPrintf( - "%d:attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", - __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c); + if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct)) != 0) { + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].i=%d, " + "read_data4[%llu][%llu].i=%d\n", + __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i); + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].d=%f, " + "read_data4[%llu][%llu].d=%f\n", + __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d); + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].c=%c, " + "read_data4[%llu][%llu].c=%c\n", + __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c); } /* end if */ // Verify name @@ -1048,7 +1044,7 @@ test_attr_mult_read() hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions int ndims = space.getSimpleExtentDims(dims); if ((long)dims[0] != (long)ATTR1_DIM1) - TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n", __LINE__, + TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %llu\n", __LINE__, (int)dims[0], ATTR1_DIM1); /* Verify Datatype */ @@ -1076,8 +1072,8 @@ test_attr_mult_read() // Verify values read in for (i = 0; i < ATTR1_DIM1; i++) if (attr_data1[i] != read_data1[i]) - TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d,read_data1[%d]=%d\n", __LINE__, - i, attr_data1[i], i, read_data1[i]); + TestErrPrintf("%d: attribute data different: attr_data1[%llu]=%d,read_data1[%llu]=%d\n", + __LINE__, i, attr_data1[i], i, read_data1[i]); // Verify Name H5std_string attr_name = attr.getName(); @@ -1131,9 +1127,9 @@ test_attr_mult_read() for (i = 0; i < ATTR2_DIM1; i++) for (j = 0; j < ATTR2_DIM2; j++) if (attr_data2[i][j] != read_data2[i][j]) - TestErrPrintf( - "%d: attribute data different: attr_data2[%d][%d]=%d, read_data2[%d][%d]=%d\n", - __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); + TestErrPrintf("%d: attribute data different: attr_data2[%llu][%llu]=%d, " + "read_data2[%llu][%llu]=%d\n", + __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]); // Verify Name attr_name = attr.getName(); @@ -1186,8 +1182,8 @@ test_attr_mult_read() for (j = 0; j < ATTR3_DIM2; j++) for (k = 0; k < ATTR3_DIM3; k++) if (attr_data3[i][j][k] != read_data3[i][j][k]) - TestErrPrintf("%d: attribute data different: attr_data3[%d][%d][%d]=%f, " - "read_data3[%d][%d][%d]=%f\n", + TestErrPrintf("%d: attribute data different: attr_data3[%llu][%llu][%llu]=%f, " + "read_data3[%llu][%llu][%llu]=%f\n", __LINE__, i, j, k, attr_data3[i][j][k], i, j, k, read_data3[i][j][k]); // Verify Name diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 641002e..2170a9d 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -16,11 +16,7 @@ tcompound.cpp - HDF5 C++ testing the compound data type functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -180,8 +176,7 @@ test_compound_2() issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } - if (array_dt) - delete array_dt; + delete array_dt; } // test_compound_2() /*------------------------------------------------------------------------- @@ -291,8 +286,7 @@ test_compound_3() issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } - if (array_dt) - delete array_dt; + delete array_dt; } // test_compound_3() /*------------------------------------------------------------------------- @@ -411,8 +405,7 @@ test_compound_4() issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } - if (array_dt) - delete array_dt; + delete array_dt; } // test_compound_4() /*------------------------------------------------------------------------- @@ -491,7 +484,7 @@ test_compound_5() int_array.close(); /* Check results */ - if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim != dst[1].tdim || + if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) != 0 || src[1].tdim != dst[1].tdim || src[1].coll_ids[0] != dst[1].coll_ids[0] || src[1].coll_ids[1] != dst[1].coll_ids[1] || src[1].coll_ids[2] != dst[1].coll_ids[2] || src[1].coll_ids[3] != dst[1].coll_ids[3]) { H5_FAILED(); @@ -508,8 +501,7 @@ test_compound_5() issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } - if (array_dt) - delete array_dt; + delete array_dt; } // test_compound_5() /*------------------------------------------------------------------------- diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index fc73a6a..257233e 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -17,11 +17,7 @@ list functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index da5e2a4..71428ce 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -38,11 +38,7 @@ GetTestNumErrs() -- Retrieve the number of testing errors ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index b082f0a..255fc30 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -20,11 +20,7 @@ h5_fileaccess() -- in h5test.c, returns a file access template ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -179,14 +175,14 @@ test_file_create() catch (InvalidActionException &E) { cerr << " *FAILED*" << endl; cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; - if (file1 != NULL) // clean up - delete file1; + // clean up + delete file1; } // catch all other exceptions catch (Exception &E) { issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); - if (file1 != NULL) // clean up - delete file1; + // clean up + delete file1; } // Setting this to NULL for cleaning up in failure situations @@ -264,8 +260,8 @@ test_file_create() // catch all exceptions catch (Exception &E) { issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg()); - if (tmpl1 != NULL) // clean up - delete tmpl1; + // clean up + delete tmpl1; } } // test_file_create() diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 1ded033..e89838c 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -16,11 +16,7 @@ tfilter.cpp - HDF5 C++ testing various filters and their combination. ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -49,20 +45,18 @@ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, /* Temporary filter IDs used for testing */ const int H5Z_FILTER_BOGUS = 305; -#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead -static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); -#endif -static size_t filter_bogus(size_t nbytes); +static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf); + /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "bogus", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)filter_bogus, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "bogus", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- @@ -79,13 +73,15 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ *------------------------------------------------------------------------- */ static size_t -#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead -filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, - const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, - size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) -#endif -filter_bogus(size_t nbytes) +filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) { + (void)flags; + (void)cd_nelmts; + (void)cd_values; + (void)buf_size; + (void)buf; + return nbytes; } diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index e57ac04..9952e68 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -19,11 +19,7 @@ EXTERNAL ROUTINES/VARIABLES: ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -516,7 +512,7 @@ test_h5s_compound_scalar_read() dataset.read(&rdata, type); // Verify read data - if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct))) { + if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct)) != 0) { cerr << "scalar data different: space4_data.c1=" << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; cerr << "scalar data different: space4_data.u=" << space4_data.u << ", read_data4.u=" << rdata.u diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index 1fb2f57..17620ca 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -16,11 +16,7 @@ titerate.cpp - HDF5 C++ testing iterate related functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 231bff2..e8dad5b 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -16,11 +16,7 @@ C link interface (H5L) ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -593,7 +589,7 @@ visit_obj_cb(H5Object &obj, const H5std_string name, const H5O_info2_t *oinfo, v ovisit_ud_t *op_data = static_cast(_op_data); // Check for correct object information - if (strcmp(op_data->info[op_data->idx].path, name.c_str())) + if (strcmp(op_data->info[op_data->idx].path, name.c_str()) != 0) return (H5_ITER_ERROR); if (op_data->info[op_data->idx].type != oinfo->type) return (H5_ITER_ERROR); diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index 87abd43..5892f39 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -16,11 +16,7 @@ tobject.cpp - HDF5 C++ testing object related functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Cpp.h" // C++ API header file diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 5ec04cd..604ccc0 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -17,11 +17,7 @@ Reference interface (H5R) ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -183,8 +179,7 @@ test_reference_params() issue_fail_msg("test_reference_param()", __LINE__, __FILE__, E.getCFuncName(), E.getCDetailMsg()); } - if (file1) - delete file1; + delete file1; } /* test_reference_param() */ /*------------------------------------------------------------------------- @@ -378,8 +373,7 @@ test_reference_obj() issue_fail_msg("test_reference_obj()", __LINE__, __FILE__, E.getCFuncName(), E.getCDetailMsg()); } - if (file1) - delete file1; + delete file1; } // test_reference_obj() /*------------------------------------------------------------------------- @@ -522,8 +516,7 @@ test_reference_group() issue_fail_msg("test_reference_group()", __LINE__, __FILE__, E.getCFuncName(), E.getCDetailMsg()); } - if (file1) - delete file1; + delete file1; } /* test_reference_group() */ /*------------------------------------------------------------------------- diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index cf32b2b..b633740 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -16,11 +16,7 @@ ttypes.cpp - HDF5 C++ testing the general datatype functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -806,8 +802,7 @@ test_named() issue_fail_msg("test_named", __LINE__, __FILE__, E.getCDetailMsg()); } - if (ds_type) - delete ds_type; + delete ds_type; } // test_named /*------------------------------------------------------------------------- diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index cf43371..9c0f78a 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -18,11 +18,7 @@ EXTERNAL ROUTINES/VARIABLES: ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; @@ -187,7 +183,7 @@ test_vlstring_dataset() // Test scalar type dataset with 1 value. dset1 = root.createDataSet("test_scalar_small", vlst, ds_space); - dynstring_ds_write = (char *)HDcalloc(1, sizeof(char)); + dynstring_ds_write = (char *)HDcalloc(2, sizeof(char)); HDmemset(dynstring_ds_write, 'A', 1); // Write data to the dataset, then read it back. @@ -317,8 +313,7 @@ test_vlstring_array_dataset() issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg()); } - if (file1) - delete file1; + delete file1; } // end test_vlstring_array_dataset() /*------------------------------------------------------------------------- @@ -531,8 +526,7 @@ test_vlstring_type() issue_fail_msg("test_vlstring_type()", __LINE__, __FILE__, E.getCDetailMsg()); } - if (file1) - delete file1; + delete file1; } // end test_vlstring_type() /*------------------------------------------------------------------------- @@ -865,7 +859,7 @@ read_scalar_dset(H5File &file, DataType &type, DataSpace &space, char *name, cha dset.read(&data_read, type, space, space); dset.close(); - if (HDstrcmp(data, data_read)) + if (HDstrcmp(data, data_read) != 0) TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read); HDfree(data_read); -- cgit v0.12 From 72aad5ebdf4665a5e278520d714fc10613660872 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 5 Apr 2021 16:18:08 -0700 Subject: Normalized Fortran with develop --- examples/h5_attribute.c | 5 +- examples/h5_cmprss.c | 2 +- examples/h5_dtransform.c | 40 ++++++--------- examples/h5_extlink.c | 5 ++ examples/h5_group.c | 10 ++-- examples/h5_ref_compat.c | 4 +- examples/h5_ref_extern.c | 4 +- examples/h5_vds.c | 11 ++-- examples/testh5cc.sh.in | 6 +++ fortran/src/H5Pf.c | 87 ++++++++++++++++--------------- fortran/src/H5Pff.F90 | 102 +++++++++++++++++++++++++++++++++++++ fortran/src/H5f90.h | 6 +-- fortran/src/H5f90i.h | 6 +-- fortran/src/H5f90proto.h | 6 +-- fortran/src/H5match_types.c | 4 +- fortran/src/Makefile.am | 2 +- fortran/src/hdf5_fortrandll.def.in | 2 + fortran/test/fortranlib_test.F90 | 6 ++- fortran/test/tH5P.F90 | 73 ++++++++++++++++++++++++++ 19 files changed, 288 insertions(+), 93 deletions(-) diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index 5d90d91..97be7f5 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -184,6 +184,8 @@ main(void) printf("The value of the attribute \"Integer attribute\" is %d \n", point_out); ret = H5Aclose(attr); + //! [H5Oget_info3_snip] + /* * Find string attribute by iterating through all attributes */ @@ -203,6 +205,7 @@ main(void) ret = H5Tclose(atype); } + //! [H5Oget_info3_snip] /* * Get attribute info using iteration function. */ @@ -232,7 +235,7 @@ attr_info(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *opdata) float * float_array; /* Pointer to the array attribute. */ /* avoid warnings */ - opdata = opdata; + (void)opdata; /* * Open the attribute using its name. diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index 59a59f5..d8848e2 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -99,7 +99,7 @@ main() for (i = 0; i < numfilt; i++) { nelmts = 0; - filter_type = H5Pget_filter2(plist_id, 0, &flags, &nelmts, NULL, 0, NULL, &filter_info); + filter_type = H5Pget_filter2(plist_id, i, &flags, &nelmts, NULL, 0, NULL, &filter_info); printf("Filter Type: "); switch (filter_type) { case H5Z_FILTER_DEFLATE: diff --git a/examples/h5_dtransform.c b/examples/h5_dtransform.c index 289c102..a364ec1 100644 --- a/examples/h5_dtransform.c +++ b/examples/h5_dtransform.c @@ -36,30 +36,22 @@ #define ROWS 12 #define COLS 18 -const float windchillF[ROWS][COLS] = {{36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, - -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0}, - {34.0, 27.0, 21.0, 15.0, 9.0, 3.0, -4.0, -10.0, -16.0, -22.0, -28.0, - -35.0, -41.0, -47.0, -53.0, -59.0, -66.0, -72.0}, - {32.0, 25.0, 19.0, 13.0, 6.0, 0.0, -7.0, -13.0, -19.0, -26.0, -32.0, - -39.0, -45.0, -51.0, -58.0, -64.0, -71.0, -77.0}, - {30.0, 24.0, 17.0, 11.0, 4.0, -2.0, -9.0, -15.0, -22.0, -29.0, -35.0, - -42.0, -48.0, -55.0, -61.0, -68.0, -74.0, -81.0}, - {29.0, 23.0, 16.0, 9.0, 3.0, -4.0, -11.0, -17.0, -24.0, -31.0, -37.0, - -44.0, -51.0, -58.0, -64.0, -71.0, -78.0, -84.0}, - {28.0, 22.0, 15.0, 8.0, 1.0, -5.0, -12.0, -19.0, -26.0, -33.0, -39.0, - -46.0, -53.0, -60.0, -67.0, -73.0, -80.0, -87.0}, - {28.0, 21.0, 14.0, 7.0, 0.0, -7.0, -14.0, -21.0, -27.0, -34.0, -41.0, - -48.0, -55.0, -62.0, -69.0, -76.0, -82.0, -89.0}, - {27.0, 20.0, 13.0, 6.0, -1.0, -8.0, -15.0, -22.0, -29.0, -36.0, -43.0, - -50.0, -57.0, -64.0, -71.0, -78.0, -84.0, -91.0}, - {26.0, 19.0, 12.0, 5.0, -2.0, -9.0, -16.0, -23.0, -30.0, -37.0, -44.0, - -51.0, -58.0, -65.0, -72.0, -79.0, -86.0, -93.0}, - {26.0, 19.0, 12.0, 4.0, -3.0, -10.0, -17.0, -24.0, -31.0, -38.0, -45.0, - -52.0, -60.0, -67.0, -74.0, -81.0, -88.0, -95.0}, - {25.0, 18.0, 11.0, 4.0, -3.0, -11.0, -18.0, -25.0, -32.0, -39.0, -46.0, - -54.0, -61.0, -68.0, -75.0, -82.0, -89.0, -97.0}, - {25.0, 17.0, 10.0, 3.0, -4.0, -11.0, -19.0, -26.0, -33.0, -40.0, -48.0, - -55.0, -62.0, -69.0, -76.0, -84.0, -91.0, -98.0}}; +/* clang-format off */ +const float windchillF[ROWS][COLS] = + { {36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0}, + {34.0, 27.0, 21.0, 15.0, 9.0, 3.0, -4.0, -10.0, -16.0, -22.0, -28.0, -35.0, -41.0, -47.0, -53.0, -59.0, -66.0, -72.0}, + {32.0, 25.0, 19.0, 13.0, 6.0, 0.0, -7.0, -13.0, -19.0, -26.0, -32.0, -39.0, -45.0, -51.0, -58.0, -64.0, -71.0, -77.0}, + {30.0, 24.0, 17.0, 11.0, 4.0, -2.0, -9.0, -15.0, -22.0, -29.0, -35.0, -42.0, -48.0, -55.0, -61.0, -68.0, -74.0, -81.0}, + {29.0, 23.0, 16.0, 9.0, 3.0, -4.0, -11.0, -17.0, -24.0, -31.0, -37.0, -44.0, -51.0, -58.0, -64.0, -71.0, -78.0, -84.0}, + {28.0, 22.0, 15.0, 8.0, 1.0, -5.0, -12.0, -19.0, -26.0, -33.0, -39.0, -46.0, -53.0, -60.0, -67.0, -73.0, -80.0, -87.0}, + {28.0, 21.0, 14.0, 7.0, 0.0, -7.0, -14.0, -21.0, -27.0, -34.0, -41.0, -48.0, -55.0, -62.0, -69.0, -76.0, -82.0, -89.0}, + {27.0, 20.0, 13.0, 6.0, -1.0, -8.0, -15.0, -22.0, -29.0, -36.0, -43.0, -50.0, -57.0, -64.0, -71.0, -78.0, -84.0, -91.0}, + {26.0, 19.0, 12.0, 5.0, -2.0, -9.0, -16.0, -23.0, -30.0, -37.0, -44.0, -51.0, -58.0, -65.0, -72.0, -79.0, -86.0, -93.0}, + {26.0, 19.0, 12.0, 4.0, -3.0, -10.0, -17.0, -24.0, -31.0, -38.0, -45.0, -52.0, -60.0, -67.0, -74.0, -81.0, -88.0, -95.0}, + {25.0, 18.0, 11.0, 4.0, -3.0, -11.0, -18.0, -25.0, -32.0, -39.0, -46.0, -54.0, -61.0, -68.0, -75.0, -82.0, -89.0, -97.0}, + {25.0, 17.0, 10.0, 3.0, -4.0, -11.0, -19.0, -26.0, -33.0, -40.0, -48.0, -55.0, -62.0, -69.0, -76.0, -84.0, -91.0, -98.0} + }; +/* clang-format on */ #define PRINT(array) \ { \ diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c index 44ff2da..f9d4046 100644 --- a/examples/h5_extlink.c +++ b/examples/h5_extlink.c @@ -414,10 +414,15 @@ UD_hard_create(const char *link_name, hid_t loc_group, const void *udata, size_t token = *((H5O_token_t *)udata); + //! [H5Open_by_token_snip] + /* Open the object this link points to so that we can increment * its reference count. This also ensures that the token passed * in points to a real object (although this check is not perfect!) */ target_obj = H5Oopen_by_token(loc_group, token); + + //! [H5Open_by_token_snip] + if (target_obj < 0) { ret_value = -1; goto done; diff --git a/examples/h5_group.c b/examples/h5_group.c index 4b489f0..40acafe 100644 --- a/examples/h5_group.c +++ b/examples/h5_group.c @@ -171,9 +171,9 @@ static herr_t file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdata) { /* avoid compiler warnings */ - loc_id = loc_id; - opdata = opdata; - linfo = linfo; + (void)loc_id; + (void)opdata; + (void)linfo; /* * Display group name. The name is passed to the function by @@ -198,8 +198,8 @@ group_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdat int rank_chunk; /* avoid warnings */ - opdata = opdata; - linfo = linfo; + (void)opdata; + (void)linfo; /* * Open the datasets using their names. 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]); diff --git a/examples/h5_vds.c b/examples/h5_vds.c index 6bef06f..e036204 100644 --- a/examples/h5_vds.c +++ b/examples/h5_vds.c @@ -60,7 +60,7 @@ main(void) 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 */ - i, j, k, l; + i, j, k, l, block_inc; int fill_value = -1; /* Fill value for VDS */ H5D_layout_t layout; /* Storage layout */ size_t num_map; /* Number of mappings */ @@ -178,13 +178,14 @@ main(void) buf = (hsize_t *)malloc(sizeof(hsize_t) * 2 * RANK2 * nblocks); status = H5Sget_select_hyper_blocklist(vspace, (hsize_t)0, nblocks, buf); for (l = 0; l < nblocks; l++) { + block_inc = 2 * RANK2 * l; printf("("); for (k = 0; k < RANK2 - 1; k++) - printf("%d,", (int)buf[k]); - printf("%d ) - (", (int)buf[k]); + printf("%d,", (int)buf[block_inc + k]); + printf("%d) - (", (int)buf[block_inc + k]); for (k = 0; k < RANK2 - 1; k++) - printf("%d,", (int)buf[RANK2 + k]); - printf("%d)\n", (int)buf[RANK2 + k]); + printf("%d,", (int)buf[block_inc + RANK2 + k]); + printf("%d)\n", (int)buf[block_inc + RANK2 + k]); } /* We also can use new APIs to get start, stride, count and block */ if (H5Sis_regular_hyperslab(vspace)) { diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index 0c122c7..ba80f2d 100644 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -91,6 +91,8 @@ temp_FILES="a.out $applib" cat > $appmain < $prog1 < +void sub1(void) { printf("in sub1\n"); @@ -123,6 +127,8 @@ EOF # generate prog2 cat > $prog2 < +void sub2(void) { printf("in sub2\n"); diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 864a8d2..1f74955 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -2110,10 +2110,10 @@ h5pget_btree_ratios_c(hid_t_f *prp_id, real_f *left, real_f *middle, real_f *rig * OUTPUTS * * degree - possible values are: - * H5F_CLOSE_DEFAULT - * H5F_CLOSE_WEAK - * H5F_CLOSE_SEMI - * H5F_CLOSE_STRONG + * H5F_CLOSE_DEFAULT + * H5F_CLOSE_WEAK + * H5F_CLOSE_SEMI + * H5F_CLOSE_STRONG * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -2149,10 +2149,10 @@ h5pget_fclose_degree_c(hid_t_f *fapl_id, int_f *degree) * INPUTS * fapl_id - file access identifier * degree - possible values are: - * H5F_CLOSE_DEFAULT - * H5F_CLOSE_WEAK - * H5F_CLOSE_SEMI - * H5F_CLOSE_STRONG + * H5F_CLOSE_DEFAULT + * H5F_CLOSE_WEAK + * H5F_CLOSE_SEMI + * H5F_CLOSE_STRONG * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -3525,8 +3525,10 @@ h5pset_family_offset_c(hid_t_f *prp_id, hsize_t_f *offset) */ int_f -/*h5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, - int_f *lenmax, haddr_t_f *memb_addr, int_f *flag) */ +/* + * h5pset_fapl_multi_c(hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, + * int_f *len, int_f *lenmax, haddr_t_f *memb_addr, int_f *flag) + */ h5pset_fapl_multi_c(hid_t_f *prp_id, int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag) /******/ @@ -3976,9 +3978,10 @@ DONE: * Calls H5Pget_attr_phase_change * * INPUTS - * ocpl_id - Object (dataset or group) creation property list identifier - * Outputs max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage + * ocpl_id - Object (dataset or group) creation property list identifier + * OUTPUTS + * max_compact - Maximum number of attributes to be stored in compact storage + * min_dense - Minimum number of attributes to be stored in dense storage * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -4018,8 +4021,9 @@ h5pget_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dens * Calls H5Ppset_attr_creation_order * * INPUTS - * ocpl_id - Object (dataset or group) creation property list identifier - * Outputs crt_order_flags - Flags specifying whether to track and index attribute creation order + * ocpl_id - Object (dataset or group) creation property list identifier + * OUTPUTS + * crt_order_flags - Flags specifying whether to track and index attribute creation order * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -4185,7 +4189,7 @@ h5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags) * Calls H5Pset_link_creation_order * * INPUTS - * gcpl_id - Group creation property list identifier + * gcpl_id - Group creation property list identifier * crt_order_flags - Creation order flag(s) * OUTPUTS * @@ -4222,9 +4226,10 @@ h5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags) * Calls H5Pget_link_phase_change * * INPUTS - * gcpl_id - Group creation property list identifier - * Outputs max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage + * gcpl_id - Group creation property list identifier + * OUTPUTS + * max_compact - Maximum number of attributes to be stored in compact storage + * min_dense - Minimum number of attributes to be stored in dense storage * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -4348,10 +4353,10 @@ h5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag) * * INPUTS * - * lcpl_id - Link creation property list identifier + * lcpl_id - Link creation property list identifier * crt_intermed_group - crt_intermed_group specifying whether - * to create intermediate groups upon the - * creation of an object + * to create intermediate groups upon the + * creation of an object * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -4434,8 +4439,8 @@ h5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags) * * plist_id - Property list identifier * encoding - String encoding character set: - * H5T_CSET_ASCII_F -> US ASCII - * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding + * H5T_CSET_ASCII_F -> US ASCII + * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding * OUTPUTS * NONE * @@ -4478,8 +4483,8 @@ h5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding) * OUTPUTS * * encoding - Encoding character set: - * H5T_CSET_ASCII_F -> US ASCII - * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding + * H5T_CSET_ASCII_F -> US ASCII + * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding * * RETURNS * 0 on success, -1 on failure @@ -4610,7 +4615,7 @@ h5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4672,7 +4677,7 @@ done: * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4721,7 +4726,7 @@ done: * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4764,7 +4769,7 @@ h5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4810,7 +4815,7 @@ h5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4851,7 +4856,7 @@ h5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4923,7 +4928,7 @@ h5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dens * * INPUTS * - * fapl_id - File access property list identifier + * fapl_id - File access property list identifier * alignment - Required memory alignment boundary * block_size - File system block size * cbuf_size - Copy buffer size @@ -4971,7 +4976,7 @@ h5pset_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *a * * INPUTS * - * fapl_id - File access property list identifier + * fapl_id - File access property list identifier * OUTPUTS * * alignment - Required memory alignment boundary @@ -5025,9 +5030,9 @@ h5pget_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *a * Calls H5Pset_attr_phase_change * * INPUTS - * ocpl_id - Object (dataset or group) creation property list identifier - * max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage + * ocpl_id - Object (dataset or group) creation property list identifier + * max_compact - Maximum number of attributes to be stored in compact storage + * min_dense - Minimum number of attributes to be stored in dense storage * OUTPUTS * * RETURNS @@ -5212,7 +5217,7 @@ h5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) * * INPUTS * - * lcpl_id - Link creation property list identifier + * lcpl_id - Link creation property list identifier * crt_intermed_group - Specifying whether to create intermediate groups upon * the creation of an object * RETURNS @@ -5249,7 +5254,8 @@ h5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) * Name: h5pset_chunk_cache_c * Purpose: Calls H5Pset_chunk_cache * - * Inputs: dapl_id - Link creation property list identifier + * Inputs: + * dapl_id - Link creation property list identifier * rdcc_nslots - * rdcc_nbytes - * rdcc_w0 - @@ -5280,7 +5286,8 @@ h5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nby * Name: h5pget_chunk_cache_c * Purpose: Calls H5Pget_chunk_cache * - * Inputs: dapl_id - Link creation property list identifier + * Inputs: + * dapl_id - Link creation property list identifier * Outputs: * rdcc_nslots - * rdcc_nbytes - diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 7237558..a7f2366 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -8263,5 +8263,107 @@ END SUBROUTINE h5pget_virtual_dsetname_f END SUBROUTINE h5pget_vol_id_f +!****s* H5P (F03)/h5pget_file_locking_f_F03 +! +! NAME +! h5pget_file_locking_f +! +! PURPOSE +! Gets the file locking properties. File locking is mainly used to help +! enforce SWMR semantics. +! +! INPUTS +! fapl_id - Target file access property list identifier. +! +! OUTPUTS +! use_file_locking - Whether or not to use file locks. +! ignore_disabled_locks - Whether or not to ignore file locks when locking +! is disabled on a file system. +! hdferr - error code: +! 0 on success and -1 on failure +! +! AUTHOR +! Dana Robinson +! Summer 2020 +! +! Fortran2003 Interface: + SUBROUTINE h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: fapl_id + LOGICAL , INTENT(OUT) :: use_file_locking + LOGICAL , INTENT(OUT) :: ignore_disabled_locks + INTEGER , INTENT(OUT) :: hdferr +!***** + LOGICAL(C_BOOL) :: c_use_flag + LOGICAL(C_BOOL) :: c_ignore_flag + + INTERFACE + INTEGER FUNCTION h5pget_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pget_file_locking') + IMPORT :: HID_T, C_BOOL + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id + LOGICAL(C_BOOL), INTENT(OUT) :: use_file_locking + LOGICAL(C_BOOL), INTENT(OUT) :: ignore_disabled_locks + END FUNCTION h5pget_file_locking + END INTERFACE + + hdferr = INT(h5pget_file_locking(fapl_id, c_use_flag, c_ignore_flag)) + + ! Transfer value of C C_BOOL type to Fortran LOGICAL + use_file_locking = c_use_flag + ignore_disabled_locks = c_ignore_flag + + END SUBROUTINE h5pget_file_locking_f + +!****s* H5P (F03)/h5pset_file_locking_f_F03 +! +! NAME +! h5pset_file_locking_f +! +! PURPOSE +! Sets the file locking properties. File locking is mainly used to help +! enforce SWMR semantics. +! +! INPUTS +! fapl_id - Target file access property list identifier. +! use_file_locking - Whether or not to use file locks. +! ignore_disabled_locks - Whether or not to ignore file locks when locking +! is disabled on a file system. +! hdferr - error code: +! 0 on success and -1 on failure +! +! AUTHOR +! Dana Robinson +! Summer 2020 +! +! Fortran2003 Interface: + SUBROUTINE h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: fapl_id + LOGICAL , INTENT(IN) :: use_file_locking + LOGICAL , INTENT(IN) :: ignore_disabled_locks + INTEGER , INTENT(OUT) :: hdferr +!***** + LOGICAL(C_BOOL) :: c_use_flag + LOGICAL(C_BOOL) :: c_ignore_flag + + INTERFACE + INTEGER FUNCTION h5pset_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pset_file_locking') + IMPORT :: HID_T, C_BOOL + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id + LOGICAL(C_BOOL), INTENT(IN), VALUE :: use_file_locking + LOGICAL(C_BOOL), INTENT(IN), VALUE :: ignore_disabled_locks + END FUNCTION h5pset_file_locking + END INTERFACE + + ! Transfer value of Fortran LOGICAL to C C_BOOL type + c_use_flag = use_file_locking + c_ignore_flag = ignore_disabled_locks + + hdferr = INT(h5pset_file_locking(fapl_id, c_use_flag, c_ignore_flag)) + + END SUBROUTINE h5pset_file_locking_f + END MODULE H5P diff --git a/fortran/src/H5f90.h b/fortran/src/H5f90.h index e8655e4..3cc617f 100644 --- a/fortran/src/H5f90.h +++ b/fortran/src/H5f90.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5f90_H -#define _H5f90_H +#ifndef H5f90_H +#define H5f90_H #include "hdf5.h" #include "H5private.h" @@ -27,4 +27,4 @@ #define H5_MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif /* _H5f90_H */ +#endif /* H5f90_H */ diff --git a/fortran/src/H5f90i.h b/fortran/src/H5f90i.h index 37e563b..dbb6a16 100644 --- a/fortran/src/H5f90i.h +++ b/fortran/src/H5f90i.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5f90i_H -#define _H5f90i_H +#ifndef H5f90i_H +#define H5f90i_H /* * Include generated header. This header defines integer types, @@ -36,4 +36,4 @@ typedef char *_fcd; #endif -#endif /* _H5f90i_H */ +#endif /* H5f90i_H */ diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index bed9ba9..fbbf7c2 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5f90proto_H -#define _H5f90proto_H +#ifndef H5f90proto_H +#define H5f90proto_H #include "H5public.h" #include "H5f90.h" @@ -643,4 +643,4 @@ H5_FCDLL int_f h5literate_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namele int_f *order, hsize_t_f *idx, H5L_iterate2_t op, void *op_data, hid_t_f *lapl_id); -#endif /* _H5f90proto_H */ +#endif /* H5f90proto_H */ diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index 10d873e..017bab4 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -70,8 +70,8 @@ initCfile(void) * help@hdfgroup.org. *\n\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\ \n\n\ -#ifndef _H5f90i_gen_H\n\ -#define _H5f90i_gen_H\n\ +#ifndef H5f90i_gen_H\n\ +#define H5f90i_gen_H\n\ \n\ /* This file is automatically generated by H5match_types.c at build time. */\n\ \n\ diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 5168eb6..65ffa0c 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -155,7 +155,7 @@ H5Pff.lo: $(srcdir)/H5Pff.F90 H5f90global.lo H5fortkit.lo H5Rff.lo: $(srcdir)/H5Rff.F90 H5f90global.lo H5Sff.lo: $(srcdir)/H5Sff.F90 H5f90global.lo H5Tff.lo: $(srcdir)/H5Tff.F90 H5f90global.lo -H5VLff.lo: $(srcdir)/H5VLff.F90 H5f90global.lo +H5VLff.lo: $(srcdir)/H5VLff.F90 H5f90global.lo H5fortkit.lo H5Zff.lo: $(srcdir)/H5Zff.F90 H5f90global.lo H5_gen.lo: H5_gen.F90 H5f90global.lo H5Aff.lo H5Dff.lo H5Pff.lo HDF5.lo: $(srcdir)/HDF5.F90 H5f90global.lo H5_ff.lo H5Aff.lo \ diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 9c69e5a..4207239 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -339,6 +339,8 @@ H5P_mp_H5PGET_DSET_NO_ATTRS_HINT_F H5P_mp_H5PSET_DSET_NO_ATTRS_HINT_F H5P_mp_H5PSET_VOL_F H5P_mp_H5PGET_VOL_ID_F +H5P_mp_H5PSET_FILE_LOCKING_F +H5P_mp_H5PGET_FILE_LOCKING_F ; Parallel @H5_NOPAREXP@H5P_mp_H5PSET_FAPL_MPIO_F @H5_NOPAREXP@H5P_mp_H5PGET_FAPL_MPIO_F diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 index 90f0e01..eff4657 100644 --- a/fortran/test/fortranlib_test.F90 +++ b/fortran/test/fortranlib_test.F90 @@ -183,9 +183,13 @@ PROGRAM fortranlibtest CALL write_test_status(ret_total_error, ' Multi file driver test', total_error) ret_total_error = 0 - CALL test_chunk_cache (cleanup, ret_total_error) + CALL test_chunk_cache(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Dataset chunk cache configuration', total_error) + ret_total_error = 0 + CALL test_misc_properties(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Miscellaneous properties', total_error) + ! ! '=========================================' ! 'Testing ATTRIBUTE interface ' diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90 index f45d18a..1d1208c 100644 --- a/fortran/test/tH5P.F90 +++ b/fortran/test/tH5P.F90 @@ -724,4 +724,77 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) END SUBROUTINE test_chunk_cache +!------------------------------------------------------------------------- +! Function: test_misc_properties +! +! Purpose: Tests setting and getting of miscellaneous properties. Does +! not test the underlying functionality as that is done in +! the C library tests. +! +! Tests APIs: +! H5P_GET/SET_FILE_LOCKING_F +! +! Return: Success: 0 +! Failure: -1 +! +!------------------------------------------------------------------------- +! +SUBROUTINE test_misc_properties(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(hid_t) :: fapl_id = -1 ! Local fapl + LOGICAL :: use_file_locking ! (H5Pset/get_file_locking_f) + LOGICAL :: ignore_disabled_locks ! (H5Pset/get_file_locking_f) + INTEGER :: error + + ! Create a default fapl + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_id, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Test H5Pset/get_file_locking_f + ! true values + use_file_locking = .TRUE. + ignore_disabled_locks = .TRUE. + CALL h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pset_set_file_locking_f", error, total_error) + use_file_locking = .FALSE. + ignore_disabled_locks = .FALSE. + CALL h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pget_set_file_locking_f", error, total_error) + if(use_file_locking .neqv. .TRUE.) then + total_error = total_error + 1 + write(*,*) "Got wrong use_file_locking flag from h5pget_file_locking_f" + endif + if(ignore_disabled_locks .neqv. .TRUE.) then + total_error = total_error + 1 + write(*,*) "Got wrong ignore_disabled_locks flag from h5pget_file_locking_f" + endif + + ! false values + use_file_locking = .FALSE. + ignore_disabled_locks = .FALSE. + CALL h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pset_set_file_locking_f", error, total_error) + use_file_locking = .TRUE. + ignore_disabled_locks = .TRUE. + CALL h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pget_set_file_locking_f", error, total_error) + if(use_file_locking .neqv. .FALSE.) then + total_error = total_error + 1 + write(*,*) "Got wrong use_file_locking flag from h5pget_file_locking_f" + endif + if(ignore_disabled_locks .neqv. .FALSE.) then + total_error = total_error + 1 + write(*,*) "Got wrong ignore_disabled_locks flag from h5pget_file_locking_f" + endif + + ! Close the fapl + CALL H5Pclose_f(fapl_id, error) + CALL check("H5Pclose_f", error, total_error) + +END SUBROUTINE test_misc_properties + END MODULE TH5P -- cgit v0.12 From 32e6c3dcae77e67f8649d61ece4be3c203b7f497 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 5 Apr 2021 16:54:50 -0700 Subject: Brings include guard changes from develop --- src/H5CXprivate.h | 4 ++-- src/H5Epublic.h | 6 +++--- src/H5FDmulti.c | 2 +- src/H5FDstdio.c | 2 +- src/H5Fpublic.h | 12 ++++++------ src/H5Ppublic.h | 6 +++--- src/H5Tpublic.h | 6 +++--- src/H5private.h | 8 ++++---- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index 53d49a9..36d8c1c 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -61,10 +61,10 @@ typedef struct H5CX_state_t { /***************************************/ /* Library private routines */ -#ifndef _H5private_H +#ifndef H5private_H H5_DLL herr_t H5CX_push(void); H5_DLL herr_t H5CX_pop(void); -#endif /* _H5private_H */ +#endif /* H5private_H */ H5_DLL void H5CX_push_special(void); H5_DLL hbool_t H5CX_is_def_dxpl(void); diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 403bee7..bec92d6 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -42,11 +42,11 @@ typedef struct H5E_error2_t { /* When this header is included from a private header, don't make calls to H5open() */ #undef H5OPEN -#ifndef _H5private_H +#ifndef H5private_H #define H5OPEN H5open(), -#else /* _H5private_H */ +#else /* H5private_H */ #define H5OPEN -#endif /* _H5private_H */ +#endif /* H5private_H */ /* HDF5 error class */ #define H5E_ERR_CLS (H5OPEN H5E_ERR_CLS_g) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index a5a38a6..e71f450 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -2011,7 +2011,7 @@ open_members(H5FD_multi_t *file) } H5_GCC_DIAG_ON("format-nonliteral") -#ifdef _H5private_H +#ifdef H5private_H /* * This is not related to the functionality of the driver code. * It is added here to trigger warning if HDF5 private definitions are included diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index aaa84ee..230f5e1 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -1201,7 +1201,7 @@ H5FD_stdio_unlock(H5FD_t *_file) return 0; } /* end H5FD_stdio_unlock() */ -#ifdef _H5private_H +#ifdef H5private_H /* * This is not related to the functionality of the driver code. * It is added here to trigger warning if HDF5 private definitions are included diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 139ab89..86b8170 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -24,19 +24,19 @@ /* When this header is included from a private header, don't make calls to H5check() */ #undef H5CHECK -#ifndef _H5private_H +#ifndef H5private_H #define H5CHECK H5check(), -#else /* _H5private_H */ +#else /* H5private_H */ #define H5CHECK -#endif /* _H5private_H */ +#endif /* H5private_H */ /* When this header is included from a private HDF5 header, don't make calls to H5open() */ #undef H5OPEN -#ifndef _H5private_H +#ifndef H5private_H #define H5OPEN H5open(), -#else /* _H5private_H */ +#else /* H5private_H */ #define H5OPEN -#endif /* _H5private_H */ +#endif /* H5private_H */ /* * These are the bits that can be passed to the `flags' argument of diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 9524dca..f2c3830 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -39,11 +39,11 @@ /* When this header is included from a private HDF5 header, don't make calls to H5open() */ #undef H5OPEN -#ifndef _H5private_H +#ifndef H5private_H #define H5OPEN H5open(), -#else /* _H5private_H */ +#else /* H5private_H */ #define H5OPEN -#endif /* _H5private_H */ +#endif /* H5private_H */ /* * The library's property list classes diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 9f77f62..931aec8 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -217,11 +217,11 @@ typedef H5T_conv_ret_t (*H5T_conv_except_func_t)(H5T_conv_except_t except_type, /* When this header is included from a private header, don't make calls to H5open() */ #undef H5OPEN -#ifndef _H5private_H +#ifndef H5private_H #define H5OPEN H5open(), -#else /* _H5private_H */ +#else /* H5private_H */ #define H5OPEN -#endif /* _H5private_H */ +#endif /* H5private_H */ /* * The IEEE floating point types in various byte orders. diff --git a/src/H5private.h b/src/H5private.h index 49ffbcb..683781b 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, October 30, 1998 * * Purpose: This file is included by all HDF5 library source files to @@ -21,8 +21,8 @@ * */ -#ifndef _H5private_H -#define _H5private_H +#ifndef H5private_H +#define H5private_H #include "H5public.h" /* Include Public Definitions */ @@ -2912,4 +2912,4 @@ H5_DLL herr_t H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_b H5_DLL herr_t H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, const uint8_t *marker, size_t buf_offset, size_t buf_size); -#endif /* _H5private_H */ +#endif /* H5private_H */ -- cgit v0.12 From f0d1a03aa18843b8260c234cd535978a2145941e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 5 Apr 2021 18:34:37 -0700 Subject: Brings the rest of the header changes from develop --- src/H5ACpkg.h | 6 ++-- src/H5ACprivate.h | 6 ++-- src/H5ACpublic.h | 8 ++--- src/H5Amodule.h | 25 ++++++++++--- src/H5Apkg.h | 6 ++-- src/H5Aprivate.h | 6 ++-- src/H5Apublic.h | 6 ++-- src/H5B2module.h | 8 ++--- src/H5B2pkg.h | 6 ++-- src/H5B2private.h | 6 ++-- src/H5Bmodule.h | 6 ++-- src/H5Bpkg.h | 6 ++-- src/H5Bprivate.h | 6 ++-- src/H5CSprivate.h | 6 ++-- src/H5CXmodule.h | 6 ++-- src/H5CXprivate.h | 6 ++-- src/H5Clog.h | 6 ++-- src/H5Cmodule.h | 8 ++--- src/H5Cpkg.h | 10 ++++-- src/H5Cprivate.h | 18 +++++----- src/H5Cpublic.h | 6 ++-- src/H5Dmodule.h | 17 +++++++-- src/H5Dpkg.h | 6 ++-- src/H5Dprivate.h | 6 ++-- src/H5Dpublic.h | 6 ++-- src/H5EAmodule.h | 6 ++-- src/H5EApkg.h | 6 ++-- src/H5EAprivate.h | 6 ++-- src/H5ESpublic.h | 10 ++++-- src/H5Emodule.h | 8 ++--- src/H5Epkg.h | 8 ++--- src/H5Eprivate.h | 6 ++-- src/H5Epublic.h | 6 ++-- src/H5FAmodule.h | 8 ++--- src/H5FApkg.h | 6 ++-- src/H5FAprivate.h | 6 ++-- src/H5FDcore.h | 2 +- src/H5FDdirect.h | 4 +-- src/H5FDdrvr_module.h | 8 ++--- src/H5FDfamily.h | 2 +- src/H5FDhdfs.h | 2 +- src/H5FDlog.h | 2 +- src/H5FDmodule.h | 8 ++--- src/H5FDmpi.h | 2 +- src/H5FDmpio.h | 4 +-- src/H5FDmulti.h | 2 +- src/H5FDprivate.h | 8 ++--- src/H5FDsec2.h | 2 +- src/H5FDstdio.h | 2 +- src/H5FDwindows.h | 4 +-- src/H5FLmodule.h | 8 ++--- src/H5FLprivate.h | 8 ++--- src/H5FOprivate.h | 6 ++-- src/H5FSmodule.h | 8 ++--- src/H5FSpkg.h | 8 ++--- src/H5FSprivate.h | 8 ++--- src/H5Fmodule.h | 21 ++++++++--- src/H5Fpublic.h | 6 ++-- src/H5Gmodule.h | 15 +++++--- src/H5Gpkg.h | 8 ++--- src/H5Gprivate.h | 8 ++--- src/H5Gpublic.h | 8 ++--- src/H5HFmodule.h | 8 ++--- src/H5HFpkg.h | 8 ++--- src/H5HFprivate.h | 8 ++--- src/H5HGmodule.h | 8 ++--- src/H5HGpkg.h | 8 ++--- src/H5HGprivate.h | 8 ++--- src/H5HLmodule.h | 6 ++-- src/H5HLpkg.h | 6 ++-- src/H5HLprivate.h | 4 +-- src/H5HPprivate.h | 6 ++-- src/H5Imodule.h | 23 +++++++----- src/H5Ipkg.h | 14 ++++---- src/H5Iprivate.h | 6 ++-- src/H5Ipublic.h | 6 ++-- src/H5Lmodule.h | 16 ++++++--- src/H5Lpkg.h | 8 ++--- src/H5Lprivate.h | 6 ++-- src/H5Lpublic.h | 6 ++-- src/H5MFmodule.h | 8 ++--- src/H5MFpkg.h | 8 ++--- src/H5MFprivate.h | 8 ++--- src/H5MMprivate.h | 8 ++--- src/H5MMpublic.h | 12 +++---- src/H5MPmodule.h | 8 ++--- src/H5MPpkg.h | 8 ++--- src/H5MPprivate.h | 8 ++--- src/H5Mmodule.h | 6 ++-- src/H5Mpkg.h | 6 ++-- src/H5Mprivate.h | 6 ++-- src/H5Mpublic.h | 6 ++-- src/H5Omodule.h | 14 +++++--- src/H5Opkg.h | 6 ++-- src/H5Oprivate.h | 8 ++--- src/H5Opublic.h | 8 ++--- src/H5Oshared.h | 2 +- src/H5PBmodule.h | 8 ++--- src/H5PBpkg.h | 6 ++-- src/H5PBprivate.h | 6 ++-- src/H5PLextern.h | 6 ++-- src/H5PLmodule.h | 11 ++++-- src/H5PLpkg.h | 6 ++-- src/H5PLprivate.h | 10 +++--- src/H5PLpublic.h | 6 ++-- src/H5Pmodule.h | 51 ++++++++++++++++++++++++--- src/H5Ppkg.h | 8 ++--- src/H5Pprivate.h | 6 ++-- src/H5Ppublic.h | 6 ++-- src/H5RSprivate.h | 6 ++-- src/H5Rmodule.h | 13 +++++-- src/H5Rpkg.h | 6 ++-- src/H5Rprivate.h | 6 ++-- src/H5Rpublic.h | 6 ++-- src/H5SLmodule.h | 8 ++--- src/H5SLprivate.h | 6 ++-- src/H5SMmodule.h | 8 ++--- src/H5SMpkg.h | 8 ++--- src/H5SMprivate.h | 8 ++--- src/H5Smodule.h | 35 +++++++++++++++--- src/H5Spkg.h | 16 ++++----- src/H5Sprivate.h | 6 ++-- src/H5Spublic.h | 6 ++-- src/H5TSprivate.h | 2 -- src/H5Tmodule.h | 84 +++++++++++++++++++++++++++++++++++++++++--- src/H5Tpkg.h | 8 ++--- src/H5Tprivate.h | 6 ++-- src/H5Tpublic.h | 6 ++-- src/H5UCprivate.h | 6 ++-- src/H5VLconnector.h | 6 ++-- src/H5VLconnector_passthru.h | 6 ++-- src/H5VLmodule.h | 21 +++++++++-- src/H5VLnative.h | 6 ++-- src/H5VLnative_private.h | 6 ++-- src/H5VLpassthru.h | 6 ++-- src/H5VLpkg.h | 6 ++-- src/H5VLprivate.h | 6 ++-- src/H5VLpublic.h | 6 ++-- src/H5VMprivate.h | 2 +- src/H5WBprivate.h | 8 ++--- src/H5Zmodule.h | 75 ++++++++++++++++++++++++++++++++++++--- src/H5Zpkg.h | 6 ++-- src/H5Zprivate.h | 6 ++-- src/H5Zpublic.h | 6 ++-- src/H5public.h | 6 ++-- src/hdf5.h | 4 +-- 146 files changed, 796 insertions(+), 493 deletions(-) diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index ce4306f..7da46a0 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -30,8 +30,8 @@ #error "Do not include this file outside the H5AC package!" #endif -#ifndef _H5ACpkg_H -#define _H5ACpkg_H +#ifndef H5ACpkg_H +#define H5ACpkg_H /* Get package's private header */ #include "H5ACprivate.h" /* Metadata cache */ @@ -423,4 +423,4 @@ H5_DLL herr_t H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, H5_DLL herr_t H5AC__set_write_done_callback(H5C_t *cache_ptr, void (*write_done)(void)); #endif /* H5_HAVE_PARALLEL */ -#endif /* _H5ACpkg_H */ +#endif /* H5ACpkg_H */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 47e70fc..66f590f 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -23,8 +23,8 @@ *------------------------------------------------------------------------- */ -#ifndef _H5ACprivate_H -#define _H5ACprivate_H +#ifndef H5ACprivate_H +#define H5ACprivate_H #include "H5ACpublic.h" /*public prototypes */ @@ -448,4 +448,4 @@ H5_DLL hbool_t H5AC_get_serialization_in_progress(H5F_t *f); H5_DLL hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring); #endif /* NDEBUG */ /* end debugging functions */ -#endif /* !_H5ACprivate_H */ +#endif /* H5ACprivate_H */ diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index ec1296b..e6cebff 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -15,16 +15,14 @@ * * Created: H5ACpublic.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public include file for cache functions. * - * Modifications: - * *------------------------------------------------------------------------- */ -#ifndef _H5ACpublic_H -#define _H5ACpublic_H +#ifndef H5ACpublic_H +#define H5ACpublic_H /* Public headers needed by this file */ #include "H5public.h" diff --git a/src/H5Amodule.h b/src/H5Amodule.h index 8a745b2..45172bf 100644 --- a/src/H5Amodule.h +++ b/src/H5Amodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5A package. Including this header means that the source file * is part of the H5A package. */ -#ifndef _H5Amodule_H -#define _H5Amodule_H +#ifndef H5Amodule_H +#define H5Amodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,21 @@ #define H5_MY_PKG_ERR H5E_ATTR #define H5_MY_PKG_INIT YES -#endif /* _H5Amodule_H */ +/**\defgroup H5A H5A + * \brief Attribute Interface + * + * \details The Attribute Interface, H5A, provides a mechanism for attaching + * additional information to a dataset, group, or named datatype. + * + * Attributes are accessed by opening the object that they are + * attached to and are not independent objects. Typically an + * attribute is small in size and contains user metadata about the + * object that it is attached to. + * + * Attributes look similar to HDF5 datasets in that they have a + * datatype and dataspace. However, they do not support partial + * I/O operations and cannot be compressed or extended. + * + */ + +#endif /* H5Amodule_H */ diff --git a/src/H5Apkg.h b/src/H5Apkg.h index a1abf28..da6eb0a 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5A package!" #endif -#ifndef _H5Apkg_H -#define _H5Apkg_H +#ifndef H5Apkg_H +#define H5Apkg_H /* * Define this to enable debugging. @@ -266,4 +266,4 @@ H5_DLL htri_t H5A__is_shared_test(hid_t aid); H5_DLL herr_t H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count); #endif /* H5A_TESTING */ -#endif /* _H5Apkg_H */ +#endif /* H5Apkg_H */ diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index a627138..3ed0239 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5D module */ -#ifndef _H5Aprivate_H -#define _H5Aprivate_H +#ifndef H5Aprivate_H +#define H5Aprivate_H /* Include package's public header */ #include "H5Apublic.h" @@ -78,4 +78,4 @@ H5_DLL herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, H5_index H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data); -#endif /* _H5Aprivate_H */ +#endif /* H5Aprivate_H */ diff --git a/src/H5Apublic.h b/src/H5Apublic.h index 4e2f0d1..28a0e85 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -14,8 +14,8 @@ /* * This file contains public declarations for the H5A module. */ -#ifndef _H5Apublic_H -#define _H5Apublic_H +#ifndef H5Apublic_H +#define H5Apublic_H /* Public headers needed by this file */ #include "H5Ipublic.h" /* IDs */ @@ -112,4 +112,4 @@ H5_DLL herr_t H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, } #endif -#endif /* _H5Apublic_H */ +#endif /* H5Apublic_H */ diff --git a/src/H5B2module.h b/src/H5B2module.h index f51d21c..aa0e163 100644 --- a/src/H5B2module.h +++ b/src/H5B2module.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5B2 package. Including this header means that the source file * is part of the H5B2 package. */ -#ifndef _H5B2module_H -#define _H5B2module_H +#ifndef H5B2module_H +#define H5B2module_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_BTREE #define H5_MY_PKG_INIT NO -#endif /* _H5B2module_H */ +#endif /* H5B2module_H */ diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 9efac2f..8d620cc 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5B2 package!" #endif -#ifndef _H5B2pkg_H -#define _H5B2pkg_H +#ifndef H5B2pkg_H +#define H5B2pkg_H /* Get package's private header */ #include "H5B2private.h" @@ -453,4 +453,4 @@ H5_DLL int H5B2__get_node_depth_test(H5B2_t *bt2, void *udata); H5_DLL herr_t H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo); #endif /* H5B2_TESTING */ -#endif /* _H5B2pkg_H */ +#endif /* H5B2pkg_H */ diff --git a/src/H5B2private.h b/src/H5B2private.h index ced3992..21ea823 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -22,8 +22,8 @@ *------------------------------------------------------------------------- */ -#ifndef _H5B2private_H -#define _H5B2private_H +#ifndef H5B2private_H +#define H5B2private_H /* Private headers needed by this file */ #include "H5ACprivate.h" /* Metadata cache */ @@ -149,4 +149,4 @@ H5_DLL herr_t H5B2_patch_file(H5B2_t *fa, H5F_t *f); /* Statistics routines */ H5_DLL herr_t H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info); -#endif /* _H5B2private_H */ +#endif /* H5B2private_H */ diff --git a/src/H5Bmodule.h b/src/H5Bmodule.h index 9a1bc13..cfd3d53 100644 --- a/src/H5Bmodule.h +++ b/src/H5Bmodule.h @@ -18,8 +18,8 @@ * H5B package. Including this header means that the source file * is part of the H5B package. */ -#ifndef _H5Bmodule_H -#define _H5Bmodule_H +#ifndef H5Bmodule_H +#define H5Bmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_BTREE #define H5_MY_PKG_INIT NO -#endif /* _H5Bmodule_H */ +#endif /* H5Bmodule_H */ diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index a226f6b..0f61461 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5B package!" #endif -#ifndef _H5Bpkg_H -#define _H5Bpkg_H +#ifndef H5Bpkg_H +#define H5Bpkg_H /* Get package's private header */ #include "H5Bprivate.h" @@ -86,4 +86,4 @@ H5_DLL herr_t H5B__node_dest(H5B_t *bt); herr_t H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata); #endif -#endif /*_H5Bpkg_H*/ +#endif /*H5Bpkg_H*/ diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index 1fb25ef..265b6c6 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -22,8 +22,8 @@ *------------------------------------------------------------------------- */ -#ifndef _H5Bprivate_H -#define _H5Bprivate_H +#ifndef H5Bprivate_H +#define H5Bprivate_H /* Private headers needed by this file */ #include "H5private.h" /* Generic Functions */ @@ -157,4 +157,4 @@ H5_DLL herr_t H5B_shared_free(void *_shared); H5_DLL herr_t H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B_class_t *type, void *udata); H5_DLL htri_t H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr); -#endif /* _H5Bprivate_H */ +#endif /* H5Bprivate_H */ diff --git a/src/H5CSprivate.h b/src/H5CSprivate.h index 5fe2a56..a238ec7 100644 --- a/src/H5CSprivate.h +++ b/src/H5CSprivate.h @@ -14,8 +14,8 @@ /* * Header file for function stacks, etc. */ -#ifndef _H5CSprivate_H -#define _H5CSprivate_H +#ifndef H5CSprivate_H +#define H5CSprivate_H #ifdef NOT_YET #include "H5CSpublic.h" @@ -32,4 +32,4 @@ H5_DLL herr_t H5CS_print_stack(const struct H5CS_t *stack, FILE *stream) H5_DLL struct H5CS_t *H5CS_copy_stack(void); H5_DLL herr_t H5CS_close_stack(struct H5CS_t *stack); -#endif /* _H5CSprivate_H */ +#endif /* H5CSprivate_H */ diff --git a/src/H5CXmodule.h b/src/H5CXmodule.h index 7d51b46..9fbaab4 100644 --- a/src/H5CXmodule.h +++ b/src/H5CXmodule.h @@ -18,8 +18,8 @@ * H5CX package. Including this header means that the source file * is part of the H5CX package. */ -#ifndef _H5CXmodule_H -#define _H5CXmodule_H +#ifndef H5CXmodule_H +#define H5CXmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_CONTEXT #define H5_MY_PKG_INIT YES -#endif /* _H5CXmodule_H */ +#endif /* H5CXmodule_H */ diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index 36d8c1c..f9289cb 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -13,8 +13,8 @@ /* * Header file for API contexts, etc. */ -#ifndef _H5CXprivate_H -#define _H5CXprivate_H +#ifndef H5CXprivate_H +#define H5CXprivate_H /* Include package's public header */ #ifdef NOT_YET @@ -177,4 +177,4 @@ H5_DLL herr_t H5CX_test_set_mpio_coll_rank0_bcast(hbool_t rank0_bcast); #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ -#endif /* _H5CXprivate_H */ +#endif /* H5CXprivate_H */ diff --git a/src/H5Clog.h b/src/H5Clog.h index 1703b53..bd5c413 100644 --- a/src/H5Clog.h +++ b/src/H5Clog.h @@ -15,8 +15,8 @@ * Purpose: Cache logging header file */ -#ifndef _H5Clog_H -#define _H5Clog_H +#ifndef H5Clog_H +#define H5Clog_H /* Get package's private header */ #include "H5Cprivate.h" /* Cache */ @@ -136,4 +136,4 @@ H5_DLL herr_t H5C_log_write_remove_entry_msg(H5C_t *cache, const H5C_cache_entry H5_DLL herr_t H5C_log_json_set_up(H5C_log_info_t *log_info, const char log_location[], int mpi_rank); H5_DLL herr_t H5C_log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int mpi_rank); -#endif /* _H5Clog_H */ +#endif /* H5Clog_H */ diff --git a/src/H5Cmodule.h b/src/H5Cmodule.h index 2f4c252..26216ec 100644 --- a/src/H5Cmodule.h +++ b/src/H5Cmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5C package. Including this header means that the source file * is part of the H5C package. */ -#ifndef _H5Cmodule_H -#define _H5Cmodule_H +#ifndef H5Cmodule_H +#define H5Cmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_CACHE #define H5_MY_PKG_INIT NO -#endif /* _H5Cmodule_H */ +#endif /* H5Cmodule_H */ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 0991be3..5c3549f 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -26,12 +26,15 @@ * reason why this file was created. */ +/* clang-format off */ +/* Maintain current format by disabling format for this file */ + #if !(defined H5C_FRIEND || defined H5C_MODULE) #error "Do not include this file outside the H5C package!" #endif -#ifndef _H5Cpkg_H -#define _H5Cpkg_H +#ifndef H5Cpkg_H +#define H5Cpkg_H /* Get package's private header */ #include "H5Cprivate.h" @@ -4681,4 +4684,5 @@ H5_DLL herr_t H5C__verify_cork_tag_test(hid_t fid, H5O_token_t tag_token, hbool_ H5_DLL void H5C_set_curr_io_type_splitable(H5C_t *cache_ptr, hbool_t set_splitable); #endif /* H5C_TESTING */ -#endif /* _H5Cpkg_H */ +#endif /* H5Cpkg_H */ +/* clang-format on */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 10ba2a2..a640c6a 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -13,20 +13,18 @@ /*------------------------------------------------------------------------- * - * Created: H5Cprivate.h - * 6/3/04 - * John Mainzer + * Created: H5Cprivate.h + * 6/3/04 + * John Mainzer * - * Purpose: Constants and typedefs available to the rest of the - * library. - * - * Modifications: + * Purpose: Constants and typedefs available to the rest of the + * library. * *------------------------------------------------------------------------- */ -#ifndef _H5Cprivate_H -#define _H5Cprivate_H +#ifndef H5Cprivate_H +#define H5Cprivate_H #include "H5Cpublic.h" /* public prototypes */ @@ -2470,4 +2468,4 @@ H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_cl H5_DLL herr_t H5C_validate_index_list(H5C_t *cache_ptr); #endif /* NDEBUG */ -#endif /* !_H5Cprivate_H */ +#endif /* H5Cprivate_H */ diff --git a/src/H5Cpublic.h b/src/H5Cpublic.h index 56bfdb2..0e6fb84 100644 --- a/src/H5Cpublic.h +++ b/src/H5Cpublic.h @@ -19,12 +19,10 @@ * * Purpose: Public include file for cache functions. * - * Modifications: - * *------------------------------------------------------------------------- */ -#ifndef _H5Cpublic_H -#define _H5Cpublic_H +#ifndef H5Cpublic_H +#define H5Cpublic_H /* Public headers needed by this file */ #include "H5public.h" diff --git a/src/H5Dmodule.h b/src/H5Dmodule.h index 44044d8..292b624 100644 --- a/src/H5Dmodule.h +++ b/src/H5Dmodule.h @@ -18,8 +18,8 @@ * H5D package. Including this header means that the source file * is part of the H5D package. */ -#ifndef _H5Dmodule_H -#define _H5Dmodule_H +#ifndef H5Dmodule_H +#define H5Dmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,15 @@ #define H5_MY_PKG_ERR H5E_DATASET #define H5_MY_PKG_INIT YES -#endif /* _H5Dmodule_H */ +/** + * \defgroup H5D H5D + * \brief Group Interface + * \details The HDF5 Dataset Interface, H5D, provides a mechanism for managing + * HDF5 datasets, including the transfer of data between memory and + * disk and the description of dataset properties. + * + * A Dataset is used by other HDF5 APIs, either by name or by a handle, + * which is obtained by either creating or opening the dataset. + */ + +#endif /* H5Dmodule_H */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index fd75bb5..0627aef 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5D package!" #endif -#ifndef _H5Dpkg_H -#define _H5Dpkg_H +#ifndef H5Dpkg_H +#define H5Dpkg_H /* Get package's private header */ #include "H5Dprivate.h" @@ -741,4 +741,4 @@ H5_DLL herr_t H5D__layout_type_test(hid_t did, H5D_layout_t *layout_type); H5_DLL herr_t H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused); #endif /* H5D_TESTING */ -#endif /*_H5Dpkg_H*/ +#endif /*H5Dpkg_H*/ diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index d55ba03..f9ef772 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5D module */ -#ifndef _H5Dprivate_H -#define _H5Dprivate_H +#ifndef H5Dprivate_H +#define H5Dprivate_H /* Include package's public header */ #include "H5Dpublic.h" @@ -186,4 +186,4 @@ H5_DLL herr_t H5D_virtual_free_parsed_name(H5O_storage_virtual_name_seg_t *name_ H5_DLL herr_t H5D_btree_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, unsigned ndims, const uint32_t *dim); -#endif /* _H5Dprivate_H */ +#endif /* H5Dprivate_H */ diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 5623e13..3c1a2de 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -14,8 +14,8 @@ /* * This file contains public declarations for the H5D module. */ -#ifndef _H5Dpublic_H -#define _H5Dpublic_H +#ifndef H5Dpublic_H +#define H5Dpublic_H /* System headers needed by this file */ @@ -204,4 +204,4 @@ H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, voi #ifdef __cplusplus } #endif -#endif /* _H5Dpublic_H */ +#endif /* H5Dpublic_H */ diff --git a/src/H5EAmodule.h b/src/H5EAmodule.h index 9067028..1833e40 100644 --- a/src/H5EAmodule.h +++ b/src/H5EAmodule.h @@ -18,8 +18,8 @@ * H5EA package. Including this header means that the source file * is part of the H5EA package. */ -#ifndef _H5EAmodule_H -#define _H5EAmodule_H +#ifndef H5EAmodule_H +#define H5EAmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_EARRAY #define H5_MY_PKG_INIT NO -#endif /* _H5EAmodule_H */ +#endif /* H5EAmodule_H */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 4a3966a..bfa8588 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5EA package!" #endif -#ifndef _H5EApkg_H -#define _H5EApkg_H +#ifndef H5EApkg_H +#define H5EApkg_H /* Get package's private header */ #include "H5EAprivate.h" @@ -461,4 +461,4 @@ H5_DLL herr_t H5EA__get_cparam_test(const H5EA_t *ea, H5EA_create_t *cparam); H5_DLL int H5EA__cmp_cparam_test(const H5EA_create_t *cparam1, const H5EA_create_t *cparam2); #endif /* H5EA_TESTING */ -#endif /* _H5EApkg_H */ +#endif /* H5EApkg_H */ diff --git a/src/H5EAprivate.h b/src/H5EAprivate.h index 3b1d7b8..19dabd9 100644 --- a/src/H5EAprivate.h +++ b/src/H5EAprivate.h @@ -23,8 +23,8 @@ *------------------------------------------------------------------------- */ -#ifndef _H5EAprivate_H -#define _H5EAprivate_H +#ifndef H5EAprivate_H +#define H5EAprivate_H /* Include package's public header */ #ifdef NOT_YET @@ -155,4 +155,4 @@ H5_DLL herr_t H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats); #ifdef H5EA_DEBUGGING #endif /* H5EA_DEBUGGING */ -#endif /* _H5EAprivate_H */ +#endif /* H5EAprivate_H */ diff --git a/src/H5ESpublic.h b/src/H5ESpublic.h index 7408868..28b41fa 100644 --- a/src/H5ESpublic.h +++ b/src/H5ESpublic.h @@ -10,8 +10,12 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5ESpublic_H -#define _H5ESpublic_H +/* + * This file contains public declarations for the H5ES (event set) module. + */ + +#ifndef H5ESpublic_H +#define H5ESpublic_H /* Public headers needed by this file */ #include "H5public.h" /* Generic Functions */ @@ -48,4 +52,4 @@ extern "C" { } #endif -#endif /* _H5ESpublic_H */ +#endif /* H5ESpublic_H */ diff --git a/src/H5Emodule.h b/src/H5Emodule.h index 2277881..1670c03 100644 --- a/src/H5Emodule.h +++ b/src/H5Emodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5E package. Including this header means that the source file * is part of the H5E package. */ -#ifndef _H5Emodule_H -#define _H5Emodule_H +#ifndef H5Emodule_H +#define H5Emodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_ERROR #define H5_MY_PKG_INIT YES -#endif /* _H5Emodule_H */ +#endif /* H5Emodule_H */ diff --git a/src/H5Epkg.h b/src/H5Epkg.h index 641df7c..30ff084 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, April 11, 2007 * * Purpose: This file contains declarations which are visible only within @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5E package!" #endif -#ifndef _H5Epkg_H -#define _H5Epkg_H +#ifndef H5Epkg_H +#define H5Epkg_H /* Get package's private header */ #include "H5Eprivate.h" @@ -140,4 +140,4 @@ H5_DLL herr_t H5E__get_auto(const H5E_t *estack, H5E_auto_op_t *op, void **clie H5_DLL herr_t H5E__set_auto(H5E_t *estack, const H5E_auto_op_t *op, void *client_data); H5_DLL herr_t H5E__pop(H5E_t *err_stack, size_t count); -#endif /* _H5Epkg_H */ +#endif /* H5Epkg_H */ diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index b9f8692..c3c440f 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -14,8 +14,8 @@ /* * Header file for error values, etc. */ -#ifndef _H5Eprivate_H -#define _H5Eprivate_H +#ifndef H5Eprivate_H +#define H5Eprivate_H #include "H5Epublic.h" @@ -239,4 +239,4 @@ H5_DLL herr_t H5E_printf_stack(H5E_t *estack, const char *file, const char *func H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(hbool_t is_api); -#endif /* _H5Eprivate_H */ +#endif /* H5Eprivate_H */ diff --git a/src/H5Epublic.h b/src/H5Epublic.h index bec92d6..685665a 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -14,8 +14,8 @@ /* * This file contains public declarations for the H5E module. */ -#ifndef _H5Epublic_H -#define _H5Epublic_H +#ifndef H5Epublic_H +#define H5Epublic_H #include /*FILE arg of H5Eprint() */ @@ -218,4 +218,4 @@ H5_DLL char * H5Eget_minor(H5E_minor_t min); } #endif -#endif /* end _H5Epublic_H */ +#endif /* end H5Epublic_H */ diff --git a/src/H5FAmodule.h b/src/H5FAmodule.h index 5e12462..ef814ae 100644 --- a/src/H5FAmodule.h +++ b/src/H5FAmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5FA package. Including this header means that the source file * is part of the H5FA package. */ -#ifndef _H5FAmodule_H -#define _H5FAmodule_H +#ifndef H5FAmodule_H +#define H5FAmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_FARRAY #define H5_MY_PKG_INIT NO -#endif /* _H5FAmodule_H */ +#endif /* H5FAmodule_H */ diff --git a/src/H5FApkg.h b/src/H5FApkg.h index e66be59..c4bf934 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -22,8 +22,8 @@ #error "Do not include this file outside the H5FA package!" #endif -#ifndef _H5FApkg_H -#define _H5FApkg_H +#ifndef H5FApkg_H +#define H5FApkg_H /* Get package's private header */ #include "H5FAprivate.h" @@ -299,4 +299,4 @@ H5_DLL herr_t H5FA__get_cparam_test(const H5FA_t *ea, H5FA_create_t *cparam); H5_DLL int H5FA__cmp_cparam_test(const H5FA_create_t *cparam1, const H5FA_create_t *cparam2); #endif /* H5FA_TESTING */ -#endif /* _H5FApkg_H */ +#endif /* H5FApkg_H */ diff --git a/src/H5FAprivate.h b/src/H5FAprivate.h index f945273..26057bf 100644 --- a/src/H5FAprivate.h +++ b/src/H5FAprivate.h @@ -21,8 +21,8 @@ *------------------------------------------------------------------------- */ -#ifndef _H5FAprivate_H -#define _H5FAprivate_H +#ifndef H5FAprivate_H +#define H5FAprivate_H /* Include package's public header */ #ifdef NOT_YET @@ -137,4 +137,4 @@ H5_DLL herr_t H5FA_get_stats(const H5FA_t *ea, H5FA_stat_t *stats); #ifdef H5FA_DEBUGGING #endif /* H5FA_DEBUGGING */ -#endif /* _H5FAprivate_H */ +#endif /* H5FAprivate_H */ diff --git a/src/H5FDcore.h b/src/H5FDcore.h index 4ccad9a..f8a516a 100644 --- a/src/H5FDcore.h +++ b/src/H5FDcore.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the core driver. diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h index 4d7a796..eec10de 100644 --- a/src/H5FDdirect.h +++ b/src/H5FDdirect.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Purpose: The public header file for the direct driver. @@ -23,7 +23,7 @@ #ifdef H5_HAVE_DIRECT #define H5FD_DIRECT (H5FD_direct_init()) #else -#define H5FD_DIRECT (-1) +#define H5FD_DIRECT (H5I_INVALID_HID) #endif /* H5_HAVE_DIRECT */ #ifdef H5_HAVE_DIRECT diff --git a/src/H5FDdrvr_module.h b/src/H5FDdrvr_module.h index b8b7e04..1d20fce 100644 --- a/src/H5FDdrvr_module.h +++ b/src/H5FDdrvr_module.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5FD driver package. Including this header means that the source file * is part of the H5FD driver package. */ -#ifndef _H5FDdrvr_module_H -#define _H5FDdrvr_module_H +#ifndef H5FDdrvr_module_H +#define H5FDdrvr_module_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_INIT YES #define H5_PKG_SINGLE_SOURCE -#endif /* _H5FDdrvr_module_H */ +#endif /* H5FDdrvr_module_H */ diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h index 0127176..f00836f 100644 --- a/src/H5FDfamily.h +++ b/src/H5FDfamily.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 4, 1999 * * Purpose: The public header file for the family driver. diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h index 2f1085a..e746499 100644 --- a/src/H5FDhdfs.h +++ b/src/H5FDhdfs.h @@ -16,7 +16,7 @@ * Programmer: Jacob Smith * 2018-04-23 * - * Purpose: The public header file for the hdfs driver. + * Purpose: The public header file for the hdfs driver. */ #ifndef H5FDhdfs_H diff --git a/src/H5FDlog.h b/src/H5FDlog.h index deb3e18..aa1f3cb 100644 --- a/src/H5FDlog.h +++ b/src/H5FDlog.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2000 * * Purpose: The public header file for the log driver. diff --git a/src/H5FDmodule.h b/src/H5FDmodule.h index f3ec69e..0b92b27 100644 --- a/src/H5FDmodule.h +++ b/src/H5FDmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5FD package. Including this header means that the source file * is part of the H5FD package. */ -#ifndef _H5FDmodule_H -#define _H5FDmodule_H +#ifndef H5FDmodule_H +#define H5FDmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_VFL #define H5_MY_PKG_INIT YES -#endif /* _H5FDmodule_H */ +#endif /* H5FDmodule_H */ diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h index 3f5aa92..3af5e41 100644 --- a/src/H5FDmpi.h +++ b/src/H5FDmpi.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 30, 2004 * * Purpose: The public header file for common items for all MPI VFL drivers diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index 791ab2a..79b52c7 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the mpio driver. @@ -25,7 +25,7 @@ #ifdef H5_HAVE_PARALLEL #define H5FD_MPIO (H5FD_mpio_init()) #else -#define H5FD_MPIO (-1) +#define H5FD_MPIO (H5I_INVALID_HID) #endif /* H5_HAVE_PARALLEL */ #ifdef H5_HAVE_PARALLEL diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h index a2fa1d1..9e04d8d 100644 --- a/src/H5FDmulti.h +++ b/src/H5FDmulti.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the "multi" driver. diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 53f2b2f..1e405d2 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -12,11 +12,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 26, 1999 */ -#ifndef _H5FDprivate_H -#define _H5FDprivate_H +#ifndef H5FDprivate_H +#define H5FDprivate_H /* Include package's public header */ #include "H5FDpublic.h" @@ -380,4 +380,4 @@ H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file); H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void **file_info); #endif /* H5_HAVE_PARALLEL */ -#endif /* !_H5FDprivate_H */ +#endif /* H5FDprivate_H */ diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h index 0ac75cd..541ac71 100644 --- a/src/H5FDsec2.h +++ b/src/H5FDsec2.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the sec2 driver. diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h index 397db39..b3e06bb 100644 --- a/src/H5FDstdio.h +++ b/src/H5FDstdio.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the sec2 driver. diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h index 1648af6..c1c4654 100644 --- a/src/H5FDwindows.h +++ b/src/H5FDwindows.h @@ -12,8 +12,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Scott Wegner - * Based on code by Robb Matzke + * Programmer: Scott Wegner + * Based on code by Robb Matzke * Thursday, May 24 2007 * * Purpose: The public header file for the windows driver. diff --git a/src/H5FLmodule.h b/src/H5FLmodule.h index 5904f05..95c0b49 100644 --- a/src/H5FLmodule.h +++ b/src/H5FLmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5FL package. Including this header means that the source file * is part of the H5FL package. */ -#ifndef _H5FLmodule_H -#define _H5FLmodule_H +#ifndef H5FLmodule_H +#define H5FLmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_RESOURCE #define H5_MY_PKG_INIT NO -#endif /* _H5FLmodule_H */ +#endif /* H5FLmodule_H */ diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index a1dea67..42581ac 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -15,16 +15,14 @@ * * Created: H5FLprivate.h * Mar 23 2000 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private non-prototype header. * - * Modifications: - * *------------------------------------------------------------------------- */ -#ifndef _H5FLprivate_H -#define _H5FLprivate_H +#ifndef H5FLprivate_H +#define H5FLprivate_H /* Public headers needed by this file */ #ifdef LATER diff --git a/src/H5FOprivate.h b/src/H5FOprivate.h index b4b18aa..7b51266 100644 --- a/src/H5FOprivate.h +++ b/src/H5FOprivate.h @@ -14,8 +14,8 @@ /* * This file contains library private information about the H5FO module */ -#ifndef _H5FOprivate_H -#define _H5FOprivate_H +#ifndef H5FOprivate_H +#define H5FOprivate_H #ifdef LATER #include "H5FOpublic.h" @@ -47,4 +47,4 @@ H5_DLL herr_t H5FO_top_decr(const H5F_t *f, haddr_t addr); H5_DLL hsize_t H5FO_top_count(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5FO_top_dest(H5F_t *f); -#endif /* _H5FOprivate_H */ +#endif /* H5FOprivate_H */ diff --git a/src/H5FSmodule.h b/src/H5FSmodule.h index a6a4abc..a40c103 100644 --- a/src/H5FSmodule.h +++ b/src/H5FSmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5FS package. Including this header means that the source file * is part of the H5FS package. */ -#ifndef _H5FSmodule_H -#define _H5FSmodule_H +#ifndef H5FSmodule_H +#define H5FSmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_FSPACE #define H5_MY_PKG_INIT NO -#endif /* _H5FSmodule_H */ +#endif /* H5FSmodule_H */ diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index 0f83d48..ba2cf03 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 2, 2006 * * Purpose: This file contains declarations which are visible only within @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5FS package!" #endif -#ifndef _H5FSpkg_H -#define _H5FSpkg_H +#ifndef H5FSpkg_H +#define H5FSpkg_H /* Uncomment this macro to enable debugging output for free space manager */ /* #define H5FS_DEBUG */ @@ -240,4 +240,4 @@ H5_DLL herr_t H5FS__get_cparam_test(const H5FS_t *fh, H5FS_create_t *cparam); H5_DLL int H5FS__cmp_cparam_test(const H5FS_create_t *cparam1, const H5FS_create_t *cparam2); #endif /* H5FS_TESTING */ -#endif /* _H5FSpkg_H */ +#endif /* H5FSpkg_H */ diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index db126f4..67983d3 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -15,15 +15,15 @@ * * Created: H5FSprivate.h * May 2 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible file free space routines. * *------------------------------------------------------------------------- */ -#ifndef _H5FSprivate_H -#define _H5FSprivate_H +#ifndef H5FSprivate_H +#define H5FSprivate_H /* Private headers needed by this file */ #include "H5Fprivate.h" /* File access */ @@ -231,4 +231,4 @@ H5_DLL herr_t H5FS_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, H5_DLL herr_t H5FS_sect_debug(const H5FS_t *fspace, const H5FS_section_info_t *sect, FILE *stream, int indent, int fwidth); -#endif /* _H5FSprivate_H */ +#endif /* H5FSprivate_H */ diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index face1bc..33c302a 100644 --- a/src/H5Fmodule.h +++ b/src/H5Fmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5F package. Including this header means that the source file * is part of the H5F package. */ -#ifndef _H5Fmodule_H -#define _H5Fmodule_H +#ifndef H5Fmodule_H +#define H5Fmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,17 @@ #define H5_MY_PKG_ERR H5E_FILE #define H5_MY_PKG_INIT YES -#endif /* _H5Fmodule_H */ +/** + * \defgroup H5F H5F + * \brief File Interface + * \todo Describe concisely what the functions in this module are about. + * + * \defgroup MDC Metadata Cache + * \ingroup H5F + * \defgroup PH5F Parallel + * \ingroup H5F + * \defgroup SWMR Single Writer Multiple Readers + * \ingroup H5F + */ + +#endif /* H5Fmodule_H */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 86b8170..1350382 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -14,8 +14,8 @@ /* * This file contains public declarations for the H5F module. */ -#ifndef _H5Fpublic_H -#define _H5Fpublic_H +#ifndef H5Fpublic_H +#define H5Fpublic_H /* Public header files needed by this file */ #include "H5public.h" @@ -408,4 +408,4 @@ H5_DLL htri_t H5Fis_hdf5(const char *filename); #ifdef __cplusplus } #endif -#endif /* _H5Fpublic_H */ +#endif /* H5Fpublic_H */ diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h index 93bd56e..219342d 100644 --- a/src/H5Gmodule.h +++ b/src/H5Gmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5G package. Including this header means that the source file * is part of the H5G package. */ -#ifndef _H5Gmodule_H -#define _H5Gmodule_H +#ifndef H5Gmodule_H +#define H5Gmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,11 @@ #define H5_MY_PKG_ERR H5E_SYM #define H5_MY_PKG_INIT YES -#endif /* _H5Gmodule_H */ +/** + * \defgroup H5G H5G + * \brief Group Interface + * \details The HDF5 Group Interface, H5G, provides a mechanism for managing + * HDF5 groups and their members, which are other HDF5 objects. + */ + +#endif /* H5Gmodule_H */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 1b21ef8..38fb603 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, September 18, 1997 * * Purpose: This file contains declarations which are visible @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5G package!" #endif -#ifndef _H5Gpkg_H -#define _H5Gpkg_H +#ifndef H5Gpkg_H +#define H5Gpkg_H /* Get package's private header */ #include "H5Gprivate.h" @@ -480,4 +480,4 @@ H5_DLL herr_t H5G__verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent H5_DLL herr_t H5G__verify_cached_stabs_test(hid_t gid); #endif /* H5G_TESTING */ -#endif /* _H5Gpkg_H */ +#endif /* H5Gpkg_H */ diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 970db8a..f2d38d5 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -15,15 +15,15 @@ * * Created: H5Gprivate.h * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Library-visible declarations. * *------------------------------------------------------------------------- */ -#ifndef _H5Gprivate_H -#define _H5Gprivate_H +#ifndef H5Gprivate_H +#define H5Gprivate_H /* Include package's public header */ #include "H5Gpublic.h" @@ -283,4 +283,4 @@ H5_DLL herr_t H5G_root_loc(H5F_t *f, H5G_loc_t *loc); H5_DLL herr_t H5G_root_free(H5G_t *grp); H5_DLL H5G_t *H5G_rootof(H5F_t *f); -#endif /* _H5Gprivate_H */ +#endif /* H5Gprivate_H */ diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index 523e7ad..99134f8 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -15,14 +15,14 @@ * * Created: H5Gpublic.h * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public declarations for the H5G package * *------------------------------------------------------------------------- */ -#ifndef _H5Gpublic_H -#define _H5Gpublic_H +#ifndef H5Gpublic_H +#define H5Gpublic_H /* System headers needed by this file */ #include @@ -161,4 +161,4 @@ H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx); #ifdef __cplusplus } #endif -#endif /* _H5Gpublic_H */ +#endif /* H5Gpublic_H */ diff --git a/src/H5HFmodule.h b/src/H5HFmodule.h index 2b79e3f..7fab611 100644 --- a/src/H5HFmodule.h +++ b/src/H5HFmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5HF package. Including this header means that the source file * is part of the H5HF package. */ -#ifndef _H5HFmodule_H -#define _H5HFmodule_H +#ifndef H5HFmodule_H +#define H5HFmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_HEAP #define H5_MY_PKG_INIT NO -#endif /* _H5HFmodule_H */ +#endif /* H5HFmodule_H */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 0654b7a..a18d101 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 24, 2006 * * Purpose: This file contains declarations which are visible only within @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5HF package!" #endif -#ifndef _H5HFpkg_H -#define _H5HFpkg_H +#ifndef H5HFpkg_H +#define H5HFpkg_H /* Get package's private header */ #include "H5HFprivate.h" @@ -794,4 +794,4 @@ H5_DLL herr_t H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, hbool H5_DLL herr_t H5HF_get_huge_info_test(const H5HF_t *fh, hsize_t *next_id, hbool_t *ids_direct); #endif /* H5HF_TESTING */ -#endif /* _H5HFpkg_H */ +#endif /* H5HFpkg_H */ diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index cd52796..ed7cddd 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -15,15 +15,15 @@ * * Created: H5HFprivate.h * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible fractal heap routines. * *------------------------------------------------------------------------- */ -#ifndef _H5HFprivate_H -#define _H5HFprivate_H +#ifndef H5HFprivate_H +#define H5HFprivate_H /* Private headers needed by this file */ #include "H5Fprivate.h" /* File access */ @@ -125,4 +125,4 @@ H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, int indent H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); #endif /* H5HF_DEBUGGING */ -#endif /* _H5HFprivate_H */ +#endif /* H5HFprivate_H */ diff --git a/src/H5HGmodule.h b/src/H5HGmodule.h index ab27f13..a75dea5 100644 --- a/src/H5HGmodule.h +++ b/src/H5HGmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5HG package. Including this header means that the source file * is part of the H5HG package. */ -#ifndef _H5HGmodule_H -#define _H5HGmodule_H +#ifndef H5HGmodule_H +#define H5HGmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_HEAP #define H5_MY_PKG_INIT NO -#endif /* _H5HGmodule_H */ +#endif /* H5HGmodule_H */ diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index c025d71..5c0fbe8 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: This file contains declarations which are visible @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5HG package!" #endif -#ifndef _H5HGpkg_H -#define _H5HGpkg_H +#ifndef H5HGpkg_H +#define H5HGpkg_H /* Get package's private header */ #include "H5HGprivate.h" @@ -136,4 +136,4 @@ struct H5HG_heap_t { H5_DLL herr_t H5HG__free(H5HG_heap_t *heap); H5_DLL H5HG_heap_t *H5HG__protect(H5F_t *f, haddr_t addr, unsigned flags); -#endif /* _H5HGpkg_H */ +#endif /* H5HGpkg_H */ diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index e6d6894..6811ea8 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -12,11 +12,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, March 27, 1998 */ -#ifndef _H5HGprivate_H -#define _H5HGprivate_H +#ifndef H5HGprivate_H +#define H5HGprivate_H /* Private headers needed by this file. */ #include "H5Fprivate.h" /* File access */ @@ -72,4 +72,4 @@ H5_DLL herr_t H5HG_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int f bool H5HG_trap(const char *); -#endif /* _H5HGprivate_H */ +#endif /* H5HGprivate_H */ diff --git a/src/H5HLmodule.h b/src/H5HLmodule.h index afc609a..3004809 100644 --- a/src/H5HLmodule.h +++ b/src/H5HLmodule.h @@ -18,8 +18,8 @@ * H5HL package. Including this header means that the source file * is part of the H5HL package. */ -#ifndef _H5HLmodule_H -#define _H5HLmodule_H +#ifndef H5HLmodule_H +#define H5HLmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_HEAP #define H5_MY_PKG_INIT NO -#endif /* _H5HLmodule_H */ +#endif /* H5HLmodule_H */ diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 42e8649..dbac1b9 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5HL package!" #endif -#ifndef _H5HLpkg_H -#define _H5HLpkg_H +#ifndef H5HLpkg_H +#define H5HLpkg_H /* Get package's private header */ #include "H5HLprivate.h" @@ -145,4 +145,4 @@ H5_DLL H5HL_dblk_t *H5HL__dblk_new(H5HL_t *heap); H5_DLL herr_t H5HL__dblk_dest(H5HL_dblk_t *dblk); H5_DLL herr_t H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size); -#endif /* _H5HLpkg_H */ +#endif /* H5HLpkg_H */ diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 74f3c49..739e761 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -21,8 +21,8 @@ * *------------------------------------------------------------------------- */ -#ifndef _H5HLprivate_H -#define _H5HLprivate_H +#ifndef H5HLprivate_H +#define H5HLprivate_H /* Private headers needed by this file. */ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5HPprivate.h b/src/H5HPprivate.h index 3b68400..50020bc 100644 --- a/src/H5HPprivate.h +++ b/src/H5HPprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5HP module */ -#ifndef _H5HPprivate_H -#define _H5HPprivate_H +#ifndef H5HPprivate_H +#define H5HPprivate_H /**************************************/ /* Public headers needed by this file */ @@ -65,4 +65,4 @@ H5_DLL herr_t H5HP_incr(H5HP_t *heap, unsigned amt, void *obj); H5_DLL herr_t H5HP_decr(H5HP_t *heap, unsigned amt, void *obj); H5_DLL herr_t H5HP_close(H5HP_t *heap); -#endif /* _H5HPprivate_H */ +#endif /* H5HPprivate_H */ diff --git a/src/H5Imodule.h b/src/H5Imodule.h index a20de33..a2174d7 100644 --- a/src/H5Imodule.h +++ b/src/H5Imodule.h @@ -11,22 +11,27 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 * - * Purpose: This file contains declarations which define macros for the - * H5I package. Including this header means that the source file - * is part of the H5I package. + * Purpose: This file contains declarations which define macros for the + * H5I package. Including this header means that the source file + * is part of the H5I package. */ -#ifndef _H5Imodule_H -#define _H5Imodule_H +#ifndef H5Imodule_H +#define H5Imodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error - * reporting macros. + * reporting macros. */ #define H5I_MODULE #define H5_MY_PKG H5I #define H5_MY_PKG_ERR H5E_ATOM #define H5_MY_PKG_INIT NO -#endif /* _H5Imodule_H */ +/**\defgroup H5I H5I + * \brief Identifier Interface + * \todo Describe concisely what the functions in this module are about. + */ + +#endif /* H5Imodule_H */ diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index 98bad4a..5461aa2 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 15, 2003 * * Purpose: This file contains declarations which are visible only within @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5I package!" #endif -#ifndef _H5Ipkg_H -#define _H5Ipkg_H +#ifndef H5Ipkg_H +#define H5Ipkg_H /* Get package's private header */ #include "H5Iprivate.h" @@ -36,7 +36,7 @@ /**************************/ /* - * Number of bits to use for ID Type in each atom. Increase if more types + * Number of bits to use for ID Type in each ID. Increase if more types * are needed (though this will decrease the number of available IDs per * type). This is the only number that must be changed since all other bit * field sizes and masks are calculated from TYPE_BITS. @@ -47,13 +47,13 @@ #define H5I_MAX_NUM_TYPES TYPE_MASK /* - * Number of bits to use for the Atom index in each atom (assumes 8-bit + * Number of bits to use for the ID index in each ID (assumes 8-bit * bytes). We don't use the sign bit. */ #define ID_BITS ((sizeof(hid_t) * 8) - (TYPE_BITS + 1)) #define ID_MASK (((hid_t)1 << ID_BITS) - 1) -/* Map an atom to an ID type number */ +/* Map an ID to an ID type number */ #define H5I_TYPE(a) ((H5I_type_t)(((hid_t)(a) >> ID_BITS) & TYPE_MASK)) /****************************/ @@ -69,4 +69,4 @@ H5_DLL ssize_t H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached); #endif /* H5I_TESTING */ -#endif /*_H5Ipkg_H*/ +#endif /*H5Ipkg_H*/ diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index 2deddf7..78fd84d 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -17,8 +17,8 @@ *---------------------------------------------------------------------------*/ /* avoid re-inclusion */ -#ifndef _H5Iprivate_H -#define _H5Iprivate_H +#ifndef H5Iprivate_H +#define H5Iprivate_H /* Include package's public header */ #include "H5Ipublic.h" @@ -99,4 +99,4 @@ H5_DLL herr_t H5I_register_using_existing_id(H5I_type_t type, void *object, hboo /* Debugging functions */ H5_DLL herr_t H5I_dump_ids_for_type(H5I_type_t type); -#endif /* _H5Iprivate_H */ +#endif /* H5Iprivate_H */ diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 1141340..69aa455 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -15,8 +15,8 @@ * This file contains function prototypes for each exported function in * the H5I module. */ -#ifndef _H5Ipublic_H -#define _H5Ipublic_H +#ifndef H5Ipublic_H +#define H5Ipublic_H /* Public headers needed by this file */ #include "H5public.h" @@ -103,4 +103,4 @@ H5_DLL htri_t H5Iis_valid(hid_t id); #ifdef __cplusplus } #endif -#endif /* _H5Ipublic_H */ +#endif /* H5Ipublic_H */ diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h index e7b8678..54b94a4 100644 --- a/src/H5Lmodule.h +++ b/src/H5Lmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5L package. Including this header means that the source file * is part of the H5L package. */ -#ifndef _H5Lmodule_H -#define _H5Lmodule_H +#ifndef H5Lmodule_H +#define H5Lmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,12 @@ #define H5_MY_PKG_ERR H5E_LINK #define H5_MY_PKG_INIT YES -#endif /* _H5Lmodule_H */ +/**\defgroup H5L H5L + * \brief Link Interface + * \todo Describe concisely what the functions in this module are about. + * + * \defgroup TRAV Link Traversal + * \ingroup H5L + */ + +#endif /* H5Lmodule_H */ diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index 157d313..c97bbf3 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Friday, December 1, 2005 * * Purpose: This file contains declarations which are visible @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5L package!" #endif -#ifndef _H5Lpkg_H -#define _H5Lpkg_H +#ifndef H5Lpkg_H +#define H5Lpkg_H /* Get package's private header */ #include "H5Lprivate.h" @@ -52,4 +52,4 @@ H5_DLL herr_t H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, c H5_DLL herr_t H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, H5O_copy_t *cpy_info); -#endif /* _H5Lpkg_H */ +#endif /* H5Lpkg_H */ diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index 87c99b9..20e064c 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -15,8 +15,8 @@ * This file contains private information about the H5L module * for dealing with links in an HDF5 file. */ -#ifndef _H5Lprivate_H -#define _H5Lprivate_H +#ifndef H5Lprivate_H +#define H5Lprivate_H /* Include package's public header */ #include "H5Lpublic.h" @@ -139,4 +139,4 @@ H5_DLL herr_t H5L_register(const H5L_class_t *cls); H5_DLL herr_t H5L_unregister(H5L_type_t id); H5_DLL const H5L_class_t *H5L_find_class(H5L_type_t id); -#endif /* _H5Lprivate_H */ +#endif /* H5Lprivate_H */ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index b791f13..653e75f 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -21,8 +21,8 @@ * *------------------------------------------------------------------------- */ -#ifndef _H5Lpublic_H -#define _H5Lpublic_H +#ifndef H5Lpublic_H +#define H5Lpublic_H /* Public headers needed by this file */ #include "H5public.h" /* Generic Functions */ @@ -256,4 +256,4 @@ H5_DLL herr_t H5Lvisit_by_name1(hid_t loc_id, const char *group_name, H5_index_t #ifdef __cplusplus } #endif -#endif /* _H5Lpublic_H */ +#endif /* H5Lpublic_H */ diff --git a/src/H5MFmodule.h b/src/H5MFmodule.h index 020d61a..9726cec 100644 --- a/src/H5MFmodule.h +++ b/src/H5MFmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5MF package. Including this header means that the source file * is part of the H5MF package. */ -#ifndef _H5MFmodule_H -#define _H5MFmodule_H +#ifndef H5MFmodule_H +#define H5MFmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_RESOURCE #define H5_MY_PKG_INIT NO -#endif /* _H5MFmodule_H */ +#endif /* H5MFmodule_H */ diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index 71af401..bac9fac 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 8, 2008 * * Purpose: This file contains declarations which are visible only within @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5MF package!" #endif -#ifndef _H5MFpkg_H -#define _H5MFpkg_H +#ifndef H5MFpkg_H +#define H5MFpkg_H /* Get package's private header */ #include "H5MFprivate.h" @@ -206,4 +206,4 @@ H5_DLL herr_t H5MF__sects_dump(H5F_t *f, FILE *stream); #ifdef H5MF_TESTING #endif /* H5MF_TESTING */ -#endif /* _H5MFpkg_H */ +#endif /* H5MFpkg_H */ diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index 5ab797a..084f213 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -15,14 +15,14 @@ * * Created: H5MFprivate.h * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Private header file for file memory management. * *------------------------------------------------------------------------- */ -#ifndef _H5MFprivate_H -#define _H5MFprivate_H +#ifndef H5MFprivate_H +#define H5MFprivate_H /* Private headers needed by this file */ #include "H5Fprivate.h" /* File access */ @@ -84,4 +84,4 @@ H5_DLL herr_t H5MF_tidy_self_referential_fsm_hack(H5F_t *f); H5_DLL herr_t H5MF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); #endif /* H5MF_DEBUGGING */ -#endif /* end _H5MFprivate_H */ +#endif /* end H5MFprivate_H */ diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index a8ade76..bb846f4 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -15,14 +15,14 @@ * * Created: H5MMprivate.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Private header for memory management. * *------------------------------------------------------------------------- */ -#ifndef _H5MMprivate_H -#define _H5MMprivate_H +#ifndef H5MMprivate_H +#define H5MMprivate_H #include "H5MMpublic.h" @@ -53,4 +53,4 @@ H5_DLL void H5MM_sanity_check_all(void); H5_DLL void H5MM_final_sanity_check(void); #endif /* H5_MEMORY_ALLOC_SANITY_CHECK */ -#endif /* _H5MMprivate_H */ +#endif /* H5MMprivate_H */ diff --git a/src/H5MMpublic.h b/src/H5MMpublic.h index aca0b28..ebfb377 100644 --- a/src/H5MMpublic.h +++ b/src/H5MMpublic.h @@ -13,19 +13,17 @@ /*------------------------------------------------------------------------- * - * Created: H5MMproto.h + * Created: H5MMpublic.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public declarations for the H5MM (memory management) * package. * - * Modifications: - * *------------------------------------------------------------------------- */ -#ifndef _H5MMpublic_H -#define _H5MMpublic_H +#ifndef H5MMpublic_H +#define H5MMpublic_H /* Public headers needed by this file */ #include "H5public.h" @@ -41,4 +39,4 @@ extern "C" { #ifdef __cplusplus } #endif -#endif /* _H5MMpublic_H */ +#endif /* H5MMpublic_H */ diff --git a/src/H5MPmodule.h b/src/H5MPmodule.h index 81c2573..8e34598 100644 --- a/src/H5MPmodule.h +++ b/src/H5MPmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5MP package. Including this header means that the source file * is part of the H5MP package. */ -#ifndef _H5MPmodule_H -#define _H5MPmodule_H +#ifndef H5MPmodule_H +#define H5MPmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_RESOURCE #define H5_MY_PKG_INIT NO -#endif /* _H5MPmodule_H */ +#endif /* H5MPmodule_H */ diff --git a/src/H5MPpkg.h b/src/H5MPpkg.h index 51e5007..64c5293 100644 --- a/src/H5MPpkg.h +++ b/src/H5MPpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 2, 2005 * * Purpose: This file contains declarations which are visible only within @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5MP package!" #endif -#ifndef _H5MPpkg_H -#define _H5MPpkg_H +#ifndef H5MPpkg_H +#define H5MPpkg_H /* Get package's private header */ #include "H5MPprivate.h" /* Memory Pools */ @@ -96,4 +96,4 @@ H5_DLL herr_t H5MP_get_page_free_size(const H5MP_page_t *mp, size_t *page); H5_DLL herr_t H5MP_get_page_next_page(const H5MP_page_t *page, H5MP_page_t **next_page); #endif /* H5MP_TESTING */ -#endif /* _H5MPpkg_H */ +#endif /* H5MPpkg_H */ diff --git a/src/H5MPprivate.h b/src/H5MPprivate.h index 4ab952f..2b06650 100644 --- a/src/H5MPprivate.h +++ b/src/H5MPprivate.h @@ -15,15 +15,15 @@ * * Created: H5MPprivate.h * May 2 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for memory pool routines. * *------------------------------------------------------------------------- */ -#ifndef _H5MPprivate_H -#define _H5MPprivate_H +#ifndef H5MPprivate_H +#define H5MPprivate_H /* Include package's public header (not yet) */ /* #include "H5MPpublic.h" */ @@ -54,4 +54,4 @@ H5_DLL void * H5MP_malloc(H5MP_pool_t *mp, size_t request); H5_DLL void * H5MP_free(H5MP_pool_t *mp, void *spc); H5_DLL herr_t H5MP_close(H5MP_pool_t *mp); -#endif /* _H5MPprivate_H */ +#endif /* H5MPprivate_H */ diff --git a/src/H5Mmodule.h b/src/H5Mmodule.h index e8ce23f..8b4f11f 100644 --- a/src/H5Mmodule.h +++ b/src/H5Mmodule.h @@ -15,8 +15,8 @@ * H5M package. Including this header means that the source file * is part of the H5M package. */ -#ifndef _H5Mmodule_H -#define _H5Mmodule_H +#ifndef H5Mmodule_H +#define H5Mmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -26,4 +26,4 @@ #define H5_MY_PKG_ERR H5E_MAP #define H5_MY_PKG_INIT YES -#endif /* _H5Dmodule_H */ +#endif /* H5Dmodule_H */ diff --git a/src/H5Mpkg.h b/src/H5Mpkg.h index f47cf14..be6749b 100644 --- a/src/H5Mpkg.h +++ b/src/H5Mpkg.h @@ -20,8 +20,8 @@ #error "Do not include this file outside the H5M package!" #endif -#ifndef _H5Mpkg_H -#define _H5Mpkg_H +#ifndef H5Mpkg_H +#define H5Mpkg_H /* Get package's private header */ #include "H5Mprivate.h" @@ -44,4 +44,4 @@ /* Package Private Prototypes */ /******************************/ -#endif /*_H5Dpkg_H*/ +#endif /*H5Dpkg_H*/ diff --git a/src/H5Mprivate.h b/src/H5Mprivate.h index bfec01a..1a2524e 100644 --- a/src/H5Mprivate.h +++ b/src/H5Mprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5M module */ -#ifndef _H5Mprivate_H -#define _H5Mprivate_H +#ifndef H5Mprivate_H +#define H5Mprivate_H /* Include package's public header */ #include "H5Mpublic.h" @@ -75,4 +75,4 @@ H5_DLL herr_t H5M_init(void); /* Library Private Prototypes */ /******************************/ -#endif /* _H5Mprivate_H */ +#endif /* H5Mprivate_H */ diff --git a/src/H5Mpublic.h b/src/H5Mpublic.h index 30ec452..004ff05 100644 --- a/src/H5Mpublic.h +++ b/src/H5Mpublic.h @@ -17,8 +17,8 @@ * NOTE: This is an experimental API. Everything in the H5M package * is subject to revision in a future release. */ -#ifndef _H5Mpublic_H -#define _H5Mpublic_H +#ifndef H5Mpublic_H +#define H5Mpublic_H /* System headers needed by this file */ @@ -115,4 +115,4 @@ H5_DLL herr_t H5Mdelete(hid_t map_id, hid_t key_mem_type_id, const void *key, hi } #endif -#endif /* _H5Mpublic_H */ +#endif /* H5Mpublic_H */ diff --git a/src/H5Omodule.h b/src/H5Omodule.h index 13fb815..134aa92 100644 --- a/src/H5Omodule.h +++ b/src/H5Omodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5O package. Including this header means that the source file * is part of the H5O package. */ -#ifndef _H5Omodule_H -#define _H5Omodule_H +#ifndef H5Omodule_H +#define H5Omodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,10 @@ #define H5_MY_PKG_ERR H5E_OHDR #define H5_MY_PKG_INIT YES -#endif /* _H5Omodule_H */ +/**\defgroup H5O H5O + * \brief Object Interface + * + * \todo Describe concisely what the functions in this module are about. + * + */ +#endif /* H5Omodule_H */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index a7200f2..3434baf 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -15,8 +15,8 @@ #error "Do not include this file outside the H5O package!" #endif -#ifndef _H5Opkg_H -#define _H5Opkg_H +#ifndef H5Opkg_H +#define H5Opkg_H /* Get package's private header */ #include "H5Oprivate.h" /* Object headers */ @@ -639,4 +639,4 @@ H5_DLL herr_t H5O__assert(const H5O_t *oh); #endif /* H5O_DEBUG */ H5_DLL herr_t H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth); -#endif /* _H5Opkg_H */ +#endif /* H5Opkg_H */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 1e15943..3325a43 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -15,14 +15,14 @@ * * Created: H5Oprivate.h * Aug 5 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Object header private include file. * *------------------------------------------------------------------------- */ -#ifndef _H5Oprivate_H -#define _H5Oprivate_H +#ifndef H5Oprivate_H +#define H5Oprivate_H /* Early typedefs to avoid circular dependencies */ typedef struct H5O_t H5O_t; @@ -1045,4 +1045,4 @@ H5_DLL herr_t H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline); /* Shared message operators */ H5_DLL herr_t H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src); -#endif /* _H5Oprivate_H */ +#endif /* H5Oprivate_H */ diff --git a/src/H5Opublic.h b/src/H5Opublic.h index 2e67993..901c0fb 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -15,15 +15,15 @@ * * Created: H5Opublic.h * Aug 5 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public declarations for the H5O (object header) * package. * *------------------------------------------------------------------------- */ -#ifndef _H5Opublic_H -#define _H5Opublic_H +#ifndef H5Opublic_H +#define H5Opublic_H /* Public headers needed by this file */ #include "H5public.h" /* Generic Functions */ @@ -303,4 +303,4 @@ H5_DLL herr_t H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t i #ifdef __cplusplus } #endif -#endif /* _H5Opublic_H */ +#endif /* H5Opublic_H */ diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 278f4dd..0e774cf 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 19, 2007 * * Purpose: This file contains inline definitions for "generic" routines diff --git a/src/H5PBmodule.h b/src/H5PBmodule.h index 90a9c67..21294c8 100644 --- a/src/H5PBmodule.h +++ b/src/H5PBmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5PB package. Including this header means that the source file * is part of the H5PB package. */ -#ifndef _H5PBmodule_H -#define _H5PBmodule_H +#ifndef H5PBmodule_H +#define H5PBmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_RESOURCE #define H5_MY_PKG_INIT NO -#endif /* _H5PBmodule_H */ +#endif /* H5PBmodule_H */ diff --git a/src/H5PBpkg.h b/src/H5PBpkg.h index 8dcf29b..e1b06aa 100644 --- a/src/H5PBpkg.h +++ b/src/H5PBpkg.h @@ -15,8 +15,8 @@ #error "Do not include this file outside the H5PB package!" #endif -#ifndef _H5PBpkg_H -#define _H5PBpkg_H +#ifndef H5PBpkg_H +#define H5PBpkg_H /* Get package's private header */ #include "H5PBprivate.h" @@ -1714,4 +1714,4 @@ struct H5PB_entry_t { }; /* H5PB_entry_t */ -#endif /* _H5PBpkg_H */ +#endif /* H5PBpkg_H */ diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h index 920d651..15ee749 100644 --- a/src/H5PBprivate.h +++ b/src/H5PBprivate.h @@ -21,8 +21,8 @@ * Programmer: John Mainzer -- 10/07/18 */ -#ifndef _H5PBprivate_H -#define _H5PBprivate_H +#ifndef H5PBprivate_H +#define H5PBprivate_H /* Include package's public header */ @@ -712,4 +712,4 @@ H5_DLL herr_t H5PB_print_stats(const H5PB_t *); /* test & debug functions */ H5_DLL herr_t H5PB_page_exists(H5F_shared_t *, haddr_t, hbool_t *); -#endif /* !_H5PBprivate_H */ +#endif /* H5PBprivate_H */ diff --git a/src/H5PLextern.h b/src/H5PLextern.h index dbf1058..7f3df5e 100644 --- a/src/H5PLextern.h +++ b/src/H5PLextern.h @@ -14,8 +14,8 @@ * Purpose: Header file for writing external HDF5 plugins. */ -#ifndef _H5PLextern_H -#define _H5PLextern_H +#ifndef H5PLextern_H +#define H5PLextern_H /* Include HDF5 header */ #include "hdf5.h" @@ -40,4 +40,4 @@ H5PLUGIN_DLL const void *H5PLget_plugin_info(void); } #endif -#endif /* _H5PLextern_H */ +#endif /* H5PLextern_H */ diff --git a/src/H5PLmodule.h b/src/H5PLmodule.h index 6ee1468..ab9f1d5 100644 --- a/src/H5PLmodule.h +++ b/src/H5PLmodule.h @@ -16,8 +16,8 @@ * is part of the H5PL package. */ -#ifndef _H5PLmodule_H -#define _H5PLmodule_H +#ifndef H5PLmodule_H +#define H5PLmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -27,4 +27,9 @@ #define H5_MY_PKG_ERR H5E_PLUGIN #define H5_MY_PKG_INIT YES -#endif /* _H5PLmodule_H */ +/**\defgroup H5PL H5PL + * \brief Plugins + * \todo Describe what programmatically controlling dynamically loaded plugins (H5PL) is all about + */ + +#endif /* H5PLmodule_H */ diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index ebe4553..627a5cc 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -21,8 +21,8 @@ #error "Do not include this file outside the H5PL package!" #endif -#ifndef _H5PLpkg_H -#define _H5PLpkg_H +#ifndef H5PLpkg_H +#define H5PLpkg_H /* Include private header file */ #include "H5PLprivate.h" /* Filter functions */ @@ -156,4 +156,4 @@ H5_DLL const char *H5PL__get_path(unsigned int index); H5_DLL herr_t H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool_t *found /*out*/, const void **plugin_info /*out*/); -#endif /* _H5PLpkg_H */ +#endif /* H5PLpkg_H */ diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index 643a780..36b8ba2 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -14,15 +14,15 @@ * This file contains private information about the H5PL module */ -#ifndef _H5PLprivate_H -#define _H5PLprivate_H +#ifndef H5PLprivate_H +#define H5PLprivate_H /* Include package's public header */ #include "H5PLpublic.h" /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5VLprivate.h" /* Virtual Object Layer */ +#include "H5private.h" /* Generic Functions */ +#include "H5VLprivate.h" /* Virtual Object Layer */ /**************************/ /* Library Private Macros */ @@ -55,4 +55,4 @@ typedef union H5PL_key_t { /* Internal API routines */ H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, const H5PL_key_t *key); -#endif /* _H5PLprivate_H */ +#endif /* H5PLprivate_H */ diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 2d0272b..0b8d713 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -14,8 +14,8 @@ * This file contains public declarations for the H5PL module. */ -#ifndef _H5PLpublic_H -#define _H5PLpublic_H +#ifndef H5PLpublic_H +#define H5PLpublic_H /* Public headers needed by this file */ #include "H5public.h" /* Generic Functions */ @@ -60,4 +60,4 @@ H5_DLL herr_t H5PLsize(unsigned int *num_paths /*out*/); } #endif -#endif /* _H5PLpublic_H */ +#endif /* H5PLpublic_H */ diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h index 68dc6a4..130cb90 100644 --- a/src/H5Pmodule.h +++ b/src/H5Pmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5P package. Including this header means that the source file * is part of the H5P package. */ -#ifndef _H5Pmodule_H -#define _H5Pmodule_H +#ifndef H5Pmodule_H +#define H5Pmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,47 @@ #define H5_MY_PKG_ERR H5E_PLIST #define H5_MY_PKG_INIT YES -#endif /* _H5Pmodule_H */ +/**\defgroup H5P H5P + * \brief Property List Interface + * + * \details The HDF5 Property List Interface provides a mechanism to take + * advantage of more powerful or unusual features in HDF5. + * + * HDF5 objects have properties or characteristics associated with + * them, and there are default properties that handle the most + * common needs. These default properties can be modified using the + * HDF5 Property List Interface. For example, the data storage + * layout property of a dataset is contiguous by default. For better + * performance, the layout can be modified to be chunked or chunked + * and compressed. + * + * \todo Describe concisely what the functions in this module are about. + * \todo Clicking on "more" after "Property List Interface" at the top does not work + * + * \defgroup GPLO General Property List Operations + * \ingroup H5P + * \defgroup GPLOA General Property List Operations (Advanced) + * \ingroup H5P + * \defgroup FCPL File Creation Properties + * \ingroup H5P + * \defgroup FAPL File Access Properties + * \ingroup H5P + * \defgroup GCPL Group Creation Properties + * \ingroup H5P + * \defgroup ALCAPL Attribute and Link Creation Properties + * \ingroup H5P + * \defgroup LAPL Link Access Properties + * \ingroup H5P + * \defgroup DCPL Dataset Creation Properties + * \ingroup H5P + * \defgroup DAPL Dataset Access Properties + * \ingroup H5P + * \defgroup DXPL Dataset Transfer Properties + * \ingroup H5P + * \defgroup OCPL Object Creation Properties + * \ingroup H5P + * \defgroup OCPPL Object Copy Properties + * \ingroup H5P + */ + +#endif /* H5Pmodule_H */ diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index b016081..699d5f3 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, November 16, 2001 * * Purpose: This file contains declarations which are visible only within @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5P package!" #endif -#ifndef _H5Ppkg_H -#define _H5Ppkg_H +#ifndef H5Ppkg_H +#define H5Ppkg_H /* Get package's private header */ #include "H5Pprivate.h" @@ -198,4 +198,4 @@ H5_DLL char *H5P__get_class_path_test(hid_t pclass_id); H5_DLL hid_t H5P__open_class_path_test(const char *path); #endif /* H5P_TESTING */ -#endif /* _H5Ppkg_H */ +#endif /* H5Ppkg_H */ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 5d42887..862c74f 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5P module */ -#ifndef _H5Pprivate_H -#define _H5Pprivate_H +#ifndef H5Pprivate_H +#define H5Pprivate_H /* Early typedefs to avoid circular dependencies */ typedef struct H5P_genplist_t H5P_genplist_t; @@ -209,4 +209,4 @@ H5_DLL herr_t H5P_get_fill_value(H5P_genplist_t *plist, const struct H5T_t *type H5_DLL int H5P_ignore_cmp(const void H5_ATTR_UNUSED *val1, const void H5_ATTR_UNUSED *val2, size_t H5_ATTR_UNUSED size); -#endif /* _H5Pprivate_H */ +#endif /* H5Pprivate_H */ diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index f2c3830..862a87f 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -15,8 +15,8 @@ * This file contains function prototypes for each exported function in the * H5P module. */ -#ifndef _H5Ppublic_H -#define _H5Ppublic_H +#ifndef H5Ppublic_H +#define H5Ppublic_H /* System headers needed by this file */ @@ -546,4 +546,4 @@ H5_DLL herr_t H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *str #ifdef __cplusplus } #endif -#endif /* _H5Ppublic_H */ +#endif /* H5Ppublic_H */ diff --git a/src/H5RSprivate.h b/src/H5RSprivate.h index c1f044a..32e1dc6 100644 --- a/src/H5RSprivate.h +++ b/src/H5RSprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5RS module */ -#ifndef _H5RSprivate_H -#define _H5RSprivate_H +#ifndef H5RSprivate_H +#define H5RSprivate_H /**************************************/ /* Public headers needed by this file */ @@ -55,4 +55,4 @@ H5_DLL ssize_t H5RS_len(const H5RS_str_t *rs); H5_DLL char * H5RS_get_str(const H5RS_str_t *rs); H5_DLL unsigned H5RS_get_count(const H5RS_str_t *rs); -#endif /* _H5RSprivate_H */ +#endif /* H5RSprivate_H */ diff --git a/src/H5Rmodule.h b/src/H5Rmodule.h index 0f09b30..2a34d56 100644 --- a/src/H5Rmodule.h +++ b/src/H5Rmodule.h @@ -14,8 +14,8 @@ * H5R package. Including this header means that the source file * is part of the H5R package. */ -#ifndef _H5Rmodule_H -#define _H5Rmodule_H +#ifndef H5Rmodule_H +#define H5Rmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -25,4 +25,11 @@ #define H5_MY_PKG_ERR H5E_REFERENCE #define H5_MY_PKG_INIT YES -#endif /* _H5Rmodule_H */ +/** + * \defgroup H5R H5R + * \brief Reference Interface + * \details The HDF5 Reference Interface, H5R, provides a mechanism for managing + * HDF5 referenced objects. + */ + +#endif /* H5Rmodule_H */ diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index 2efb0d4..4224805 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -19,8 +19,8 @@ #error "Do not include this file outside the H5R package!" #endif -#ifndef _H5Rpkg_H -#define _H5Rpkg_H +#ifndef H5Rpkg_H +#define H5Rpkg_H /* Get package's private header */ #include "H5Rprivate.h" @@ -134,4 +134,4 @@ H5_DLL herr_t H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_t H5_DLL herr_t H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf, size_t *nbytes, H5O_token_t *obj_token, size_t token_size, H5S_t **space_ptr); -#endif /* _H5Rpkg_H */ +#endif /* H5Rpkg_H */ diff --git a/src/H5Rprivate.h b/src/H5Rprivate.h index 032e2b6..6d6fcd5 100644 --- a/src/H5Rprivate.h +++ b/src/H5Rprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5R module */ -#ifndef _H5Rprivate_H -#define _H5Rprivate_H +#ifndef H5Rprivate_H +#define H5Rprivate_H #include "H5Rpublic.h" @@ -39,4 +39,4 @@ /* Library Private Prototypes */ /******************************/ -#endif /* _H5Rprivate_H */ +#endif /* H5Rprivate_H */ diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h index 293a67a..4a82119 100644 --- a/src/H5Rpublic.h +++ b/src/H5Rpublic.h @@ -14,8 +14,8 @@ /* * This file contains public declarations for the H5R module. */ -#ifndef _H5Rpublic_H -#define _H5Rpublic_H +#ifndef H5Rpublic_H +#define H5Rpublic_H /* Public headers needed by this file */ #include "H5public.h" @@ -153,4 +153,4 @@ H5_DLL ssize_t H5Rget_name(hid_t loc_id, H5R_type_t ref_type, const void *ref, c } #endif -#endif /* _H5Rpublic_H */ +#endif /* H5Rpublic_H */ diff --git a/src/H5SLmodule.h b/src/H5SLmodule.h index 3c42d4d..2614f92 100644 --- a/src/H5SLmodule.h +++ b/src/H5SLmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5SL package. Including this header means that the source file * is part of the H5SL package. */ -#ifndef _H5SLmodule_H -#define _H5SLmodule_H +#ifndef H5SLmodule_H +#define H5SLmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_SLIST #define H5_MY_PKG_INIT YES -#endif /* _H5SLmodule_H */ +#endif /* H5SLmodule_H */ diff --git a/src/H5SLprivate.h b/src/H5SLprivate.h index ba23507..c9e1147 100644 --- a/src/H5SLprivate.h +++ b/src/H5SLprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5SL module */ -#ifndef _H5SLprivate_H -#define _H5SLprivate_H +#ifndef H5SLprivate_H +#define H5SLprivate_H /**************************************/ /* Public headers needed by this file */ @@ -91,4 +91,4 @@ H5_DLL herr_t H5SL_close(H5SL_t *slist); H5_DLL herr_t H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data); H5_DLL int H5SL_term_interface(void); -#endif /* _H5SLprivate_H */ +#endif /* H5SLprivate_H */ diff --git a/src/H5SMmodule.h b/src/H5SMmodule.h index a8c4452..6d2abf1 100644 --- a/src/H5SMmodule.h +++ b/src/H5SMmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5SM package. Including this header means that the source file * is part of the H5SM package. */ -#ifndef _H5SMmodule_H -#define _H5SMmodule_H +#ifndef H5SMmodule_H +#define H5SMmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_SOHM #define H5_MY_PKG_INIT NO -#endif /* _H5SMmodule_H */ +#endif /* H5SMmodule_H */ diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 30313f3..abf9a70 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Thursday, March 30, 2006 * * Purpose: This file contains declarations which are visible only within @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5SM package!" #endif -#ifndef _H5SMpkg_H -#define _H5SMpkg_H +#ifndef H5SMpkg_H +#define H5SMpkg_H /* Get package's private header */ #include "H5SMprivate.h" /* Shared Object Header Messages */ @@ -277,4 +277,4 @@ herr_t H5SM_list_free(H5SM_list_t *list); H5_DLL herr_t H5SM__get_mesg_count_test(H5F_t *f, unsigned type_id, size_t *mesg_count); #endif /* H5SM_TESTING */ -#endif /* _H5SMpkg_H */ +#endif /* H5SMpkg_H */ diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index 036f0ec..efe9355 100644 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -12,14 +12,14 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Thursday, March 2, 2006 * * Purpose: This file contains private declarations for the H5SM * shared object header messages module. */ -#ifndef _H5SMprivate_H -#define _H5SMprivate_H +#ifndef H5SMprivate_H +#define H5SMprivate_H #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ @@ -66,4 +66,4 @@ H5_DLL herr_t H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, int i H5_DLL herr_t H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, int indent, int fwidth, haddr_t table_addr); -#endif /*_H5SMprivate_H*/ +#endif /*H5SMprivate_H*/ diff --git a/src/H5Smodule.h b/src/H5Smodule.h index d595ab8..bb33eb8 100644 --- a/src/H5Smodule.h +++ b/src/H5Smodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5S package. Including this header means that the source file * is part of the H5S package. */ -#ifndef _H5Smodule_H -#define _H5Smodule_H +#ifndef H5Smodule_H +#define H5Smodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,31 @@ #define H5_MY_PKG_ERR H5E_DATASPACE #define H5_MY_PKG_INIT YES -#endif /* _H5Smodule_H */ +/**\defgroup H5S H5S + * \brief Dataspace Interface + * + * \details The Dataspace Interface provides functions for creating and + * working with dataspaces. + * + * A dataspace has two roles: + * + * \li It contains the spatial information (logical layout) of a + * dataset stored in a file. + * \li It describes an application’s data buffers and data elements + * participating in I/O. In other words, it can be used to + * select a portion or subset of a dataset. + * + * The spatial information of a dataset in a file includes the + * rank and dimensions of the dataset, which are a permanent part + * of the dataset definition. It can have dimensions that are fixed + * (unchanging) or unlimited, which means they can grow in size + * (or are extendible). + * + * A dataspace can consist of: + * \li no elements (NULL) + * \li a single element (scalar), or + * \li a simple array. + * + */ + +#endif /* H5Smodule_H */ diff --git a/src/H5Spkg.h b/src/H5Spkg.h index ebabe2e..a600c5d 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -12,19 +12,19 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Thursday, September 28, 2000 + * Programmer: Quincey Koziol + * Thursday, September 28, 2000 * - * Purpose: This file contains declarations which are visible only within - * the H5S package. Source files outside the H5S package should - * include H5Sprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5S package. Source files outside the H5S package should + * include H5Sprivate.h instead. */ #if !(defined H5S_FRIEND || defined H5S_MODULE) #error "Do not include this file outside the H5S package!" #endif -#ifndef _H5Spkg_H -#define _H5Spkg_H +#ifndef H5Spkg_H +#define H5Spkg_H /* Get package's private header */ #include "H5Sprivate.h" @@ -412,4 +412,4 @@ H5_DLL herr_t H5S__get_diminfo_status_test(hid_t space_id, H5S_diminfo_valid_t * H5_DLL htri_t H5S__internal_consistency_test(hid_t space_id); #endif /* H5S_TESTING */ -#endif /*_H5Spkg_H*/ +#endif /*H5Spkg_H*/ diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 9b888bd..76ed237 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5S module */ -#ifndef _H5Sprivate_H -#define _H5Sprivate_H +#ifndef H5Sprivate_H +#define H5Sprivate_H /* Include package's public header */ #include "H5Spublic.h" @@ -306,4 +306,4 @@ H5_DLL herr_t H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, hbool_t do_permute, hsize_t **permute_map, hbool_t *is_permuted); #endif /* H5_HAVE_PARALLEL */ -#endif /* _H5Sprivate_H */ +#endif /* H5Sprivate_H */ diff --git a/src/H5Spublic.h b/src/H5Spublic.h index 2c4ae52..6befa55 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -14,8 +14,8 @@ /* * This file contains public declarations for the H5S module. */ -#ifndef _H5Spublic_H -#define _H5Spublic_H +#ifndef H5Spublic_H +#define H5Spublic_H /* Public headers needed by this file */ #include "H5public.h" @@ -187,4 +187,4 @@ H5_DLL herr_t H5Sencode1(hid_t obj_id, void *buf, size_t *nalloc); #ifdef __cplusplus } #endif -#endif /* _H5Spublic_H */ +#endif /* H5Spublic_H */ diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index 2709621..a0cb353 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -19,8 +19,6 @@ * * Purpose: Private non-prototype header. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef H5TSprivate_H_ diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h index a59d545..4f9edde 100644 --- a/src/H5Tmodule.h +++ b/src/H5Tmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5T package. Including this header means that the source file * is part of the H5T package. */ -#ifndef _H5Tmodule_H -#define _H5Tmodule_H +#ifndef H5Tmodule_H +#define H5Tmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,80 @@ #define H5_MY_PKG_ERR H5E_DATATYPE #define H5_MY_PKG_INIT YES -#endif /* _H5Tmodule_H */ +/** + * \defgroup H5T H5T + * \brief Datatype Interface + * \todo Describe concisely what the functions in this module are about. + * + * \defgroup ARRAY Array Datatypes + * \ingroup H5T + * \defgroup ATOM Atomic Datatypes + * \ingroup H5T + * \defgroup COMPOUND Compound Datatypes + * \ingroup H5T + * \defgroup CONV Conversion Function + * \ingroup H5T + * \defgroup ENUM Enumeration Datatypes + * \ingroup H5T + * \defgroup GTO General Datatype Operations + * \ingroup H5T + * \defgroup OPAQUE Opaque Datatypes + * \ingroup H5T + * \defgroup STRING String Datatypes + * \ingroup H5T + * \defgroup VLEN Variable-length Sequence Datatypes + * \ingroup H5T + * + * \defgroup PDT Predefined Datatypes + * \ingroup H5T + * \details What is a predefined HDF5 datatype? + * \todo Fill in the blanks! + * + * \defgroup PDTCPU By CPU + * \ingroup PDT + * \details CPU-specific datatypes + * \defgroup PDTALPHA DEC Alpha + * \ingroup PDTCPU + * \defgroup PDTX86 AMD & INTEL + * \ingroup PDTCPU + * \defgroup PDTMIPS SGI MIPS + * \ingroup PDTCPU + * + * \defgroup PDTIEEE IEEE + * \ingroup PDT + * \details The IEEE floating point types in big- and little-endian byte orders. + * + * \defgroup PDTSTD Standard Datatypes + * \ingroup PDT + * \details These are "standard" types. For instance, signed (2's complement) + * and unsigned integers of various sizes in big- and little-endian + * byte orders. + * + * \defgroup PDTUNIX UNIX-specific Datatypes + * \ingroup PDT + * \details Types which are particular to Unix. + * \todo Fill in the blanks! + * + * \defgroup PDTNAT Native Datatypes + * \ingroup PDT + * \details These are the datatypes detected during library \Emph{compilation} + * by \c H5detect(). Their names differ from other HDF5 datatype names + * as follows: + * \li Instead of a class name, precision and byte order as the last + * component, they have a C-like type name. + * \li If the type begins with \c U then it is the unsigned version of + * the integer type; other integer types are signed. + * \li The datatype \c LLONG corresponds C's \Code{long long} and + * \c LDOUBLE is \Code{long double}. These types might be the same + * as \c LONG and \c DOUBLE, respectively. + * \defgroup PDTC9x C9x Integer Datatypes + * \ingroup PDTNAT + * \details C9x integer types + * \todo Fill in the blanks! + * + * \defgroup PDTS Strings + * \ingroup PDT + * + */ + +#endif /* H5Tmodule_H */ diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index cb029bb..d88a379 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, December 8, 1997 * * Purpose: This file contains declarations which are visible only within @@ -23,8 +23,8 @@ #error "Do not include this file outside the H5T package!" #endif -#ifndef _H5Tpkg_H -#define _H5Tpkg_H +#ifndef H5Tpkg_H +#define H5Tpkg_H /* * Define this to enable debugging. @@ -887,4 +887,4 @@ H5_DLL herr_t H5T__sort_name(const H5T_t *dt, int *map); /* Debugging functions */ H5_DLL herr_t H5T__print_stats(H5T_path_t *path, int *nprint /*in,out*/); -#endif /* _H5Tpkg_H */ +#endif /* H5Tpkg_H */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 71d1904..ecec597 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -14,8 +14,8 @@ /* * This file contains private information about the H5T module */ -#ifndef _H5Tprivate_H -#define _H5Tprivate_H +#ifndef H5Tprivate_H +#define H5Tprivate_H /* Early typedefs to avoid circular dependencies */ typedef struct H5T_t H5T_t; @@ -175,4 +175,4 @@ H5_DLL int H5T_get_offset(const H5T_t *dt); /* Fixed-point functions */ H5_DLL H5T_sign_t H5T_get_sign(H5T_t const *dt); -#endif /* _H5Tprivate_H */ +#endif /* H5Tprivate_H */ diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 931aec8..9855348 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -14,8 +14,8 @@ /* * This file contains public declarations for the H5T module. */ -#ifndef _H5Tpublic_H -#define _H5Tpublic_H +#ifndef H5Tpublic_H +#define H5Tpublic_H /* Public headers needed by this file */ #include "H5public.h" @@ -609,4 +609,4 @@ H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]); #ifdef __cplusplus } #endif -#endif /* _H5Tpublic_H */ +#endif /* H5Tpublic_H */ diff --git a/src/H5UCprivate.h b/src/H5UCprivate.h index a46db5d..9f4f15a 100644 --- a/src/H5UCprivate.h +++ b/src/H5UCprivate.h @@ -17,8 +17,8 @@ * conflicting requirement for the use of H5RC. */ -#ifndef _H5UCprivate_H -#define _H5UCprivate_H +#ifndef H5UCprivate_H +#define H5UCprivate_H /**************************************/ /* Public headers needed by this file */ @@ -59,4 +59,4 @@ typedef struct H5UC_t { H5_DLL H5UC_t *H5UC_create(void *s, H5UC_free_func_t free_func); H5_DLL herr_t H5UC_decr(H5UC_t *rc); -#endif /* _H5RSprivate_H */ +#endif /* H5UCprivate_H */ diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h index 1e58154..dca2864 100644 --- a/src/H5VLconnector.h +++ b/src/H5VLconnector.h @@ -14,8 +14,8 @@ * This file contains public declarations for authoring VOL connectors. */ -#ifndef _H5VLconnector_H -#define _H5VLconnector_H +#ifndef H5VLconnector_H +#define H5VLconnector_H /* Public headers needed by this file */ #include "H5public.h" /* Generic Functions */ @@ -495,4 +495,4 @@ H5_DLL hid_t H5VLpeek_connector_id_by_value(H5VL_class_value_t value); } #endif -#endif /* _H5VLconnector_H */ +#endif /* H5VLconnector_H */ diff --git a/src/H5VLconnector_passthru.h b/src/H5VLconnector_passthru.h index 25dec8f..1b6715b 100644 --- a/src/H5VLconnector_passthru.h +++ b/src/H5VLconnector_passthru.h @@ -23,8 +23,8 @@ * the H5VLconnector.h header easier to understand. */ -#ifndef _H5VLconnector_passthru_H -#define _H5VLconnector_passthru_H +#ifndef H5VLconnector_passthru_H +#define H5VLconnector_passthru_H /* Public headers needed by this file */ #include "H5public.h" /* Generic Functions */ @@ -233,4 +233,4 @@ H5_DLL herr_t H5VLoptional(void *obj, hid_t connector_id, int op_type, hid_t dxp } #endif -#endif /* _H5VLconnector_passthru_H */ +#endif /* H5VLconnector_passthru_H */ diff --git a/src/H5VLmodule.h b/src/H5VLmodule.h index 810406b..78c5986 100644 --- a/src/H5VLmodule.h +++ b/src/H5VLmodule.h @@ -16,8 +16,8 @@ * is part of the H5VL package. */ -#ifndef _H5VLmodule_H -#define _H5VLmodule_H +#ifndef H5VLmodule_H +#define H5VLmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -27,4 +27,19 @@ #define H5_MY_PKG_ERR H5E_VOL #define H5_MY_PKG_INIT YES -#endif /* _H5VLmodule_H */ +/** + * \defgroup H5VL H5VL + * \brief Virtual Object Layer Interface + * \todo Describe concisely what the functions in this module are about. + * + * \defgroup H5VLDEF Definitions + * \ingroup H5VL + * \defgroup H5VLDEV VOL Developer + * \ingroup H5VL + * \defgroup H5VLNAT Native VOL + * \ingroup H5VL + * \defgroup H5VLPT Pass-through VOL + * \ingroup H5VL + */ + +#endif /* H5VLmodule_H */ diff --git a/src/H5VLnative.h b/src/H5VLnative.h index beee8f9..b256518 100644 --- a/src/H5VLnative.h +++ b/src/H5VLnative.h @@ -14,8 +14,8 @@ * Purpose: The public header file for the native VOL connector. */ -#ifndef _H5VLnative_H -#define _H5VLnative_H +#ifndef H5VLnative_H +#define H5VLnative_H /* Public headers needed by this file */ #include "H5VLpublic.h" /* Virtual Object Layer */ @@ -136,4 +136,4 @@ H5_DLL hid_t H5VL_native_register(void); } #endif -#endif /* _H5VLnative_H */ +#endif /* H5VLnative_H */ diff --git a/src/H5VLnative_private.h b/src/H5VLnative_private.h index c52ff3e..126441d 100644 --- a/src/H5VLnative_private.h +++ b/src/H5VLnative_private.h @@ -14,8 +14,8 @@ * Purpose: The private header file for the native VOL connector. */ -#ifndef _H5VLnative_private_H -#define _H5VLnative_private_H +#ifndef H5VLnative_private_H +#define H5VLnative_private_H /* Private headers needed by this file */ #include "H5Fprivate.h" /* Files */ @@ -178,4 +178,4 @@ H5_DLL herr_t H5VL_native_get_file_struct(void *obj, H5I_type_t type, H5F_t **fi } #endif -#endif /* _H5VLnative_private_H */ +#endif /* H5VLnative_private_H */ diff --git a/src/H5VLpassthru.h b/src/H5VLpassthru.h index a48b49e..79caca7 100644 --- a/src/H5VLpassthru.h +++ b/src/H5VLpassthru.h @@ -14,8 +14,8 @@ * Purpose: The public header file for the pass-through VOL connector. */ -#ifndef _H5VLpassthru_H -#define _H5VLpassthru_H +#ifndef H5VLpassthru_H +#define H5VLpassthru_H /* Public headers needed by this file */ #include "H5VLpublic.h" /* Virtual Object Layer */ @@ -44,4 +44,4 @@ H5_DLL hid_t H5VL_pass_through_register(void); } #endif -#endif /* _H5VLpassthru_H */ +#endif /* H5VLpassthru_H */ diff --git a/src/H5VLpkg.h b/src/H5VLpkg.h index 3aeed5b..fa1d37e 100644 --- a/src/H5VLpkg.h +++ b/src/H5VLpkg.h @@ -20,8 +20,8 @@ #error "Do not include this file outside the H5VL package!" #endif -#ifndef _H5VLpkg_H -#define _H5VLpkg_H +#ifndef H5VLpkg_H +#define H5VLpkg_H /* Get package's private header */ #include "H5VLprivate.h" /* Generic Functions */ @@ -56,4 +56,4 @@ H5_DLL hid_t H5VL__peek_connector_id_by_value(H5VL_class_value_t value); H5_DLL herr_t H5VL__connector_str_to_info(const char *str, hid_t connector_id, void **info); H5_DLL ssize_t H5VL__get_connector_name(hid_t id, char *name /*out*/, size_t size); -#endif /* _H5VLpkg_H */ +#endif /* H5VLpkg_H */ diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h index dba9b41..75997df 100644 --- a/src/H5VLprivate.h +++ b/src/H5VLprivate.h @@ -10,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _H5VLprivate_H -#define _H5VLprivate_H +#ifndef H5VLprivate_H +#define H5VLprivate_H /* Include package's public header */ #include "H5VLpublic.h" /* Generic Functions */ @@ -267,4 +267,4 @@ H5_DLL herr_t H5VL_token_from_str(const H5VL_object_t *vol_obj, H5I_type_t obj_t /* Generic functions */ H5_DLL herr_t H5VL_optional(const H5VL_object_t *vol_obj, int op_type, hid_t dxpl_id, void **req, ...); -#endif /* _H5VLprivate_H */ +#endif /* H5VLprivate_H */ diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index 12eaac3..58a8045 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -14,8 +14,8 @@ * This file contains public declarations for the H5VL (VOL) module. */ -#ifndef _H5VLpublic_H -#define _H5VLpublic_H +#ifndef H5VLpublic_H +#define H5VLpublic_H /* Public headers needed by this file */ #include "H5public.h" /* Generic Functions */ @@ -96,4 +96,4 @@ H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_ #include "H5VLconnector_passthru.h" /* Pass-through VOL connector author routines */ #include "H5VLnative.h" /* Native VOL connector macros, for VOL connector authors */ -#endif /* _H5VLpublic_H */ +#endif /* H5VLpublic_H */ diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index ee20332..b7e32a3 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 10, 1997 */ #ifndef H5VMprivate_H diff --git a/src/H5WBprivate.h b/src/H5WBprivate.h index ea36eb3..1092365 100644 --- a/src/H5WBprivate.h +++ b/src/H5WBprivate.h @@ -15,15 +15,15 @@ * * Created: H5WBprivate.h * Jun 26 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible wrapped buffer routines. * *------------------------------------------------------------------------- */ -#ifndef _H5WBprivate_H -#define _H5WBprivate_H +#ifndef H5WBprivate_H +#define H5WBprivate_H /* Include package's public header */ /* #include "H5WBpublic.h" */ @@ -55,4 +55,4 @@ H5_DLL void * H5WB_actual(H5WB_t *wb, size_t need); H5_DLL void * H5WB_actual_clear(H5WB_t *wb, size_t need); H5_DLL herr_t H5WB_unwrap(H5WB_t *wb); -#endif /* _H5WBprivate_H */ +#endif /* H5WBprivate_H */ diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h index 3a583ef..25007b3 100644 --- a/src/H5Zmodule.h +++ b/src/H5Zmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5Z package. Including this header means that the source file * is part of the H5Z package. */ -#ifndef _H5Zmodule_H -#define _H5Zmodule_H +#ifndef H5Zmodule_H +#define H5Zmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,71 @@ #define H5_MY_PKG_ERR H5E_PLINE #define H5_MY_PKG_INIT YES -#endif /* _H5Zmodule_H */ +/** + * \defgroup H5Z H5Z + * + * + * \brief Filter and Compression Interface + * + * \details The functions in this module let you configure filters that process + * data during I/O operation. + * + * HDF5 supports a filter pipeline that provides the capability for + * standard and customized raw data processing during I/O operations. + * HDF5 is distributed with a small set of standard filters such as + * compression (gzip, SZIP, and a shuffling algorithm) and error + * checking (Fletcher32 checksum). For further flexibility, the + * library allows a user application to extend the pipeline through + * the creation and registration of customized filters. + * + * The flexibility of the filter pipeline implementation enables the + * definition of additional filters by a user application. A filter + * \li is associated with a dataset when the dataset is created, + * \li can be used only with chunked data (i.e., datasets stored in + * the #H5D_CHUNKED storage layout), and + * \li is applied independently to each chunk of the dataset. + * + * The HDF5 library does not support filters for contiguous datasets + * because of the difficulty of implementing random access for partial + * I/O. Compact dataset filters are not supported because it would not + * produce significant results. + * + * Filter identifiers for the filters distributed with the HDF5 + * Library are as follows: + * + * + * + * + * + * + * + *
#H5Z_FILTER_DEFLATEThe gzip compression, or + * deflation, filter
#H5Z_FILTER_SZIPThe SZIP compression + * filter
#H5Z_FILTER_NBITThe N-bit compression + * filter
#H5Z_FILTER_SCALEOFFSETThe scale-offset + * compression filter
#H5Z_FILTER_SHUFFLEThe shuffle algorithm + * filter
#H5Z_FILTER_FLETCHER32The Fletcher32 checksum, + * or error checking, filter
+ * Custom filters that have been registered with the library will have + * additional unique identifiers. + * + * See \Emph{HDF5 Dynamically Loaded Filters} for more information on + * how an HDF5 application can apply a filter that is not registered + * with the HDF5 library. + * + * \todo Fix the reference. + * + * \defgroup H5ZPRE Predefined Filters + * \ingroup H5Z + * \defgroup FLETCHER32 Checksum Filter + * \ingroup H5ZPRE + * \defgroup SCALEOFFSET Scale-Offset Filter + * \ingroup H5ZPRE + * \defgroup SHUFFLE Shuffle Filter + * \ingroup H5ZPRE + * \defgroup SZIP Szip Filter + * \ingroup H5ZPRE + * + */ + +#endif /* H5Zmodule_H */ diff --git a/src/H5Zpkg.h b/src/H5Zpkg.h index 41c7ba1..726478a 100644 --- a/src/H5Zpkg.h +++ b/src/H5Zpkg.h @@ -15,8 +15,8 @@ #error "Do not include this file outside the H5Z package!" #endif -#ifndef _H5Zpkg_H -#define _H5Zpkg_H +#ifndef H5Zpkg_H +#define H5Zpkg_H /* Include private header file */ #include "H5Zprivate.h" /* Filter functions */ @@ -54,4 +54,4 @@ H5_DLLVAR H5Z_class2_t H5Z_SZIP[1]; /* Package internal routines */ H5_DLL herr_t H5Z__unregister(H5Z_filter_t filter_id); -#endif /* _H5Zpkg_H */ +#endif /* H5Zpkg_H */ diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index e443260..b90fafb 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -11,12 +11,12 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Thursday, April 16, 1998 */ -#ifndef _H5Zprivate_H -#define _H5Zprivate_H +#ifndef H5Zprivate_H +#define H5Zprivate_H /* Early typedefs to avoid circular dependencies */ typedef struct H5Z_filter_info_t H5Z_filter_info_t; diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index fd5cf1d..e829eb1 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -11,12 +11,12 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Thursday, April 16, 1998 */ -#ifndef _H5Zpublic_H -#define _H5Zpublic_H +#ifndef H5Zpublic_H +#define H5Zpublic_H /* Public headers needed by this file */ #include "H5public.h" diff --git a/src/H5public.h b/src/H5public.h index 41d69bf..206fdc9 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -14,8 +14,8 @@ /* * This file contains public declarations for the HDF5 module. */ -#ifndef _H5public_H -#define _H5public_H +#ifndef H5public_H +#define H5public_H /* Include files for public use... */ /* @@ -387,4 +387,4 @@ H5_DLL void * H5resize_memory(void *mem, size_t size); #ifdef __cplusplus } #endif -#endif /* _H5public_H */ +#endif /* H5public_H */ diff --git a/src/hdf5.h b/src/hdf5.h index c47a0a0..c19e8aa 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -16,8 +16,8 @@ * a particular header file and include that here, don't fill this file with * lots of gunk... */ -#ifndef _HDF5_H -#define _HDF5_H +#ifndef HDF5_H +#define HDF5_H #include "H5public.h" #include "H5Apublic.h" /* Attributes */ -- cgit v0.12 From 847be78dbec1116c5b9be6207dba5253b75da323 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 5 Apr 2021 20:40:06 -0700 Subject: Brings H5RS changes from develop --- MANIFEST | 1 + src/H5Gname.c | 282 ++++++++++------------------- src/H5RS.c | 524 ++++++++++++++++++++++++++++++++++++++++++------------ src/H5RSmodule.h | 32 ++++ src/H5RSprivate.h | 6 +- test/trefstr.c | 246 +++++++++++++++++++++---- 6 files changed, 746 insertions(+), 345 deletions(-) create mode 100644 src/H5RSmodule.h diff --git a/MANIFEST b/MANIFEST index bc8ac15..12ffa30 100644 --- a/MANIFEST +++ b/MANIFEST @@ -949,6 +949,7 @@ ./src/H5UC.c ./src/H5UCprivate.h ./src/H5RS.c +./src/H5RSmodule.h ./src/H5RSprivate.h ./src/H5S.c ./src/H5Sall.c diff --git a/src/H5Gname.c b/src/H5Gname.c index 8020d86..fd63cbb 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -77,22 +77,16 @@ typedef struct H5G_gnba_iter_t { /* Local Prototypes */ /********************/ -static htri_t H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r); -static H5RS_str_t *H5G_build_fullpath(const char *prefix, const char *name); -#ifdef NOT_YET -static H5RS_str_t *H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r); -#endif /* NOT_YET */ -static herr_t H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, - const char *dst_path); -static int H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key); +static htri_t H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r); +static H5RS_str_t *H5G__build_fullpath(const char *prefix, const char *name); +static herr_t H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, + const char *dst_path); +static int H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key); /*********************/ /* Package Variables */ /*********************/ -/* Declare extern the PQ free list for the wrapped strings */ -H5FL_BLK_EXTERN(str_buf); - /*****************************/ /* Library Private Variables */ /*****************************/ @@ -197,7 +191,7 @@ done: } /* end H5G_normalize() */ /*------------------------------------------------------------------------- - * Function: H5G_common_path + * Function: H5G__common_path * * Purpose: Determine if one path is a valid prefix of another path * @@ -211,14 +205,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) +H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) { const char *fullpath; /* Pointer to actual fullpath string */ const char *prefix; /* Pointer to actual prefix string */ size_t nchars1, nchars2; /* Number of characters in components */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get component of each name */ fullpath = H5RS_get_str(fullpath_r); @@ -259,10 +253,10 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_common_path() */ +} /* end H5G__common_path() */ /*------------------------------------------------------------------------- - * Function: H5G_build_fullpath + * Function: H5G__build_fullpath * * Purpose: Build a full path from a prefix & base pair of strings * @@ -275,51 +269,26 @@ done: *------------------------------------------------------------------------- */ static H5RS_str_t * -H5G_build_fullpath(const char *prefix, const char *name) +H5G__build_fullpath(const char *prefix, const char *name) { - char * full_path; /* Full user path built */ - size_t orig_path_len; /* Original length of the path */ - size_t path_len; /* Length of the path */ - size_t name_len; /* Length of the name */ - unsigned need_sep; /* Flag to indicate if separator is needed */ H5RS_str_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(prefix); HDassert(name); - /* Get the length of the prefix */ - orig_path_len = path_len = HDstrlen(prefix); - - /* Determine if there is a trailing separator in the name */ - if (prefix[path_len - 1] == '/') - need_sep = 0; - else - need_sep = 1; - - /* Add in the length needed for the '/' separator and the relative path */ - name_len = HDstrlen(name); - path_len += name_len + need_sep; - - /* Allocate space for the path */ - if (NULL == (full_path = (char *)H5FL_BLK_MALLOC(str_buf, path_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - /* Build full path */ - HDstrncpy(full_path, prefix, orig_path_len + 1); - if (need_sep) - HDstrncat(full_path, "/", (size_t)1); - HDstrncat(full_path, name, name_len); - - /* Create reference counted string for path */ - if (NULL == (ret_value = H5RS_own(full_path))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + /* Create full path */ + if (NULL == (ret_value = H5RS_create(prefix))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, NULL, "can't create ref-counted string") + if (prefix[HDstrlen(prefix) - 1] != '/') + H5RS_aputc(ret_value, '/'); /* Add separator, if the prefix doesn't end in one */ + H5RS_acat(ret_value, name); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_build_fullpath() */ +} /* end H5G__build_fullpath() */ /*------------------------------------------------------------------------- * Function: H5G_build_fullpath_refstr_str @@ -350,49 +319,11 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) HDassert(prefix); /* Create reference counted string for path */ - ret_value = H5G_build_fullpath(prefix, name); + ret_value = H5G__build_fullpath(prefix, name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_build_fullpath_refstr_str() */ -#ifdef NOT_YET - -/*------------------------------------------------------------------------- - * Function: H5G_name_build_refstr_refstr - * - * Purpose: Build a full path from a prefix & base pair of reference counted - * strings - * - * Return: Pointer to reference counted string on success, NULL on error - * - * Programmer: Quincey Koziol - * - * Date: August 19, 2005 - * - *------------------------------------------------------------------------- - */ -static H5RS_str_t * -H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r) -{ - const char *prefix; /* Pointer to raw string of prefix */ - const char *name; /* Pointer to raw string of name */ - H5RS_str_t *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Get the pointer to the prefix */ - prefix = H5RS_get_str(prefix_r); - - /* Get the pointer to the raw src user path */ - name = H5RS_get_str(name_r); - - /* Create reference counted string for path */ - ret_value = H5G_build_fullpath(prefix, name); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_build_fullpath_refstr_refstr() */ -#endif /* NOT_YET */ - /*------------------------------------------------------------------------- * Function: H5G__name_init * @@ -643,7 +574,7 @@ H5G_name_free(H5G_name_t *name) } /* end H5G_name_free() */ /*------------------------------------------------------------------------- - * Function: H5G_name_move_path + * Function: H5G__name_move_path * * Purpose: Update a user or canonical path after an object moves * @@ -656,15 +587,15 @@ H5G_name_free(H5G_name_t *name) *------------------------------------------------------------------------- */ static herr_t -H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, - const char *dst_path) +H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, + const char *dst_path) { const char *path; /* Path to update */ size_t path_len; /* Length of path */ size_t full_suffix_len; /* Length of full suffix */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(path_r_ptr && *path_r_ptr); @@ -681,27 +612,23 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char path_len = HDstrlen(path); if (full_suffix_len < path_len) { const char *dst_suffix; /* Destination suffix that changes */ - size_t dst_suffix_len; /* Length of destination suffix */ const char *src_suffix; /* Source suffix that changes */ size_t path_prefix_len; /* Length of path prefix */ const char *path_prefix2; /* 2nd prefix for path */ size_t path_prefix2_len; /* Length of 2nd path prefix */ - const char *common_prefix; /* Common prefix for src & dst paths */ size_t common_prefix_len; /* Length of common prefix */ - char * new_path; /* Pointer to new path */ - size_t new_path_len; /* Length of new path */ + H5RS_str_t *rs; /* Ref-counted string for new path */ - /* Compute path prefix before full suffix*/ + /* Compute path prefix before full suffix */ path_prefix_len = path_len - full_suffix_len; /* Determine the common prefix for src & dst paths */ - common_prefix = src_path; common_prefix_len = 0; /* Find first character that is different */ while (*(src_path + common_prefix_len) == *(dst_path + common_prefix_len)) common_prefix_len++; /* Back up to previous '/' */ - while (*(common_prefix + common_prefix_len) != '/') + while (*(src_path + common_prefix_len) != '/') common_prefix_len--; /* Include '/' */ common_prefix_len++; @@ -710,41 +637,36 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char src_suffix = src_path + (common_prefix_len - 1); /* Determine destination suffix */ - dst_suffix = dst_path + (common_prefix_len - 1); - dst_suffix_len = HDstrlen(dst_suffix); + dst_suffix = dst_path + (common_prefix_len - 1); - /* Compute path prefix before src suffix*/ + /* Compute path prefix before src suffix */ path_prefix2 = path; path_prefix2_len = path_prefix_len - HDstrlen(src_suffix); - /* Allocate space for the new path */ - new_path_len = path_prefix2_len + dst_suffix_len + full_suffix_len; - if (NULL == (new_path = (char *)H5FL_BLK_MALLOC(str_buf, new_path_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + /* Allocate new ref-counted string */ + if (NULL == (rs = H5RS_create(NULL))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create ref-counted string") /* Create the new path */ - if (path_prefix2_len > 0) { - HDstrncpy(new_path, path_prefix2, path_prefix2_len + 1); - HDstrncpy(new_path + path_prefix2_len, dst_suffix, dst_suffix_len + 1); - } /* end if */ - else - HDstrncpy(new_path, dst_suffix, dst_suffix_len + 1); + if (path_prefix2_len > 0) + H5RS_ancat(rs, path_prefix2, path_prefix2_len); + H5RS_acat(rs, dst_suffix); if (full_suffix_len > 0) - HDstrncat(new_path, full_suffix, full_suffix_len); + H5RS_acat(rs, full_suffix); /* Release previous path */ H5RS_decr(*path_r_ptr); /* Take ownership of the new full path */ - *path_r_ptr = H5RS_own(new_path); + *path_r_ptr = rs; } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_name_move_path() */ +} /* end H5G__name_move_path() */ /*------------------------------------------------------------------------- - * Function: H5G_name_replace_cb + * Function: H5G__name_replace_cb * * Purpose: H5I_iterate callback function to replace group entry names * @@ -757,7 +679,7 @@ done: *------------------------------------------------------------------------- */ static int -H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) +H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) { const H5G_names_t *names = (const H5G_names_t *)key; /* Get operation's information */ H5O_loc_t * oloc; /* Object location for object that the ID refers to */ @@ -766,7 +688,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) hbool_t obj_in_child = FALSE; /* Flag to indicate that the object is in the child mount hier. */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(obj_ptr); @@ -853,39 +775,30 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) case H5G_NAME_MOUNT: /* Check if object is in child mount hier. */ if (obj_in_child) { - const char *full_path; /* Full path of current object */ - const char *src_path; /* Full path of source object */ - size_t src_path_len; /* Length of source full path */ - char * new_full_path; /* New full path of object */ - size_t new_full_len; /* Length of new full path */ + const char *full_path; /* Full path of current object */ + const char *src_path; /* Full path of source object */ + H5RS_str_t *rs; /* Ref-counted string for new path */ /* Get pointers to paths of interest */ - full_path = H5RS_get_str(obj_path->full_path_r); - src_path = H5RS_get_str(names->src_full_path_r); - src_path_len = HDstrlen(src_path); - - /* Build new full path */ - - /* Allocate space for the new full path */ - new_full_len = src_path_len + HDstrlen(full_path); - if (NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, new_full_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + full_path = H5RS_get_str(obj_path->full_path_r); + src_path = H5RS_get_str(names->src_full_path_r); - /* Create the new full path */ - HDstrncpy(new_full_path, src_path, src_path_len + 1); - HDstrncat(new_full_path, full_path, new_full_len); + /* Create new full path */ + if (NULL == (rs = H5RS_create(src_path))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create ref-counted string") + H5RS_acat(rs, full_path); /* Release previous full path */ H5RS_decr(obj_path->full_path_r); /* Take ownership of the new full path */ - obj_path->full_path_r = H5RS_own(new_full_path); + obj_path->full_path_r = rs; } /* end if */ /* Object must be in parent mount file hier. */ else { /* Check if the source is along the entry's path */ /* (But not actually the entry itself) */ - if (H5G_common_path(obj_path->full_path_r, names->src_full_path_r) && + if (H5G__common_path(obj_path->full_path_r, names->src_full_path_r) && H5RS_cmp(obj_path->full_path_r, names->src_full_path_r)) { /* Hide the user path */ (obj_path->obj_hidden)++; @@ -899,36 +812,30 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) */ case H5G_NAME_UNMOUNT: if (obj_in_child) { - const char *full_path; /* Full path of current object */ - const char *full_suffix; /* Full path after source path */ - size_t full_suffix_len; /* Length of full path after source path */ - const char *src_path; /* Full path of source object */ - char * new_full_path; /* New full path of object */ + const char *full_path; /* Full path of current object */ + const char *full_suffix; /* Full path after source path */ + const char *src_path; /* Full path of source object */ + H5RS_str_t *rs; /* Ref-counted string for new path */ /* Get pointers to paths of interest */ full_path = H5RS_get_str(obj_path->full_path_r); src_path = H5RS_get_str(names->src_full_path_r); /* Construct full path suffix */ - full_suffix = full_path + HDstrlen(src_path); - full_suffix_len = HDstrlen(full_suffix); + full_suffix = full_path + HDstrlen(src_path); - /* Build new full path */ - - /* Create the new full path */ - if (NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, full_suffix_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - HDstrncpy(new_full_path, full_suffix, full_suffix_len + 1); + /* Create new full path suffix */ + if (NULL == (rs = H5RS_create(full_suffix))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create ref-counted string") /* Release previous full path */ H5RS_decr(obj_path->full_path_r); /* Take ownership of the new full path */ - obj_path->full_path_r = H5RS_own(new_full_path); + obj_path->full_path_r = rs; /* Check if the object's user path should be invalidated */ - if (obj_path->user_path_r && - HDstrlen(new_full_path) < (size_t)H5RS_len(obj_path->user_path_r)) { + if (obj_path->user_path_r && H5RS_len(rs) < H5RS_len(obj_path->user_path_r)) { /* Free user path */ H5RS_decr(obj_path->user_path_r); obj_path->user_path_r = NULL; @@ -936,7 +843,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) } /* end if */ else { /* Check if file being unmounted was hiding the object */ - if (H5G_common_path(obj_path->full_path_r, names->src_full_path_r) && + if (H5G__common_path(obj_path->full_path_r, names->src_full_path_r) && H5RS_cmp(obj_path->full_path_r, names->src_full_path_r)) { /* Un-hide the user path */ (obj_path->obj_hidden)--; @@ -950,7 +857,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) */ case H5G_NAME_DELETE: /* Check if the location being unlinked is in the path for the current object */ - if (H5G_common_path(obj_path->full_path_r, names->src_full_path_r)) { + if (H5G__common_path(obj_path->full_path_r, names->src_full_path_r)) { /* Free paths for object */ H5G_name_free(obj_path); } /* end if */ @@ -962,54 +869,43 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) */ case H5G_NAME_MOVE: /* Link move case, check for relative names case */ /* Check if the src object moved is in the current object's path */ - if (H5G_common_path(obj_path->full_path_r, names->src_full_path_r)) { - const char *full_path; /* Full path of current object */ - const char *full_suffix; /* Suffix of full path, after src_path */ - size_t full_suffix_len; /* Length of suffix of full path after src_path*/ - char * new_full_path; /* New full path of object */ - size_t new_full_len; /* Length of new full path */ - const char *src_path; /* Full path of source object */ - const char *dst_path; /* Full path of destination object */ - size_t dst_path_len; /* Length of destination's full path */ + if (H5G__common_path(obj_path->full_path_r, names->src_full_path_r)) { + const char *full_path; /* Full path of current object */ + const char *full_suffix; /* Suffix of full path, after src_path */ + const char *src_path; /* Full path of source object */ + const char *dst_path; /* Full path of destination object */ + H5RS_str_t *rs; /* Ref-counted string for new path */ /* Sanity check */ HDassert(names->dst_full_path_r); /* Get pointers to paths of interest */ - full_path = H5RS_get_str(obj_path->full_path_r); - src_path = H5RS_get_str(names->src_full_path_r); - dst_path = H5RS_get_str(names->dst_full_path_r); - dst_path_len = HDstrlen(dst_path); + full_path = H5RS_get_str(obj_path->full_path_r); + src_path = H5RS_get_str(names->src_full_path_r); + dst_path = H5RS_get_str(names->dst_full_path_r); /* Make certain that the source and destination names are full (not relative) paths */ HDassert(*src_path == '/'); HDassert(*dst_path == '/'); /* Get pointer to "full suffix" */ - full_suffix = full_path + HDstrlen(src_path); - full_suffix_len = HDstrlen(full_suffix); + full_suffix = full_path + HDstrlen(src_path); /* Update the user path, if one exists */ if (obj_path->user_path_r) - if (H5G_name_move_path(&(obj_path->user_path_r), full_suffix, src_path, dst_path) < 0) + if (H5G__name_move_path(&(obj_path->user_path_r), full_suffix, src_path, dst_path) < 0) HGOTO_ERROR(H5E_SYM, H5E_PATH, FAIL, "can't build user path name") - /* Build new full path */ - - /* Allocate space for the new full path */ - new_full_len = dst_path_len + full_suffix_len; - if (NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, new_full_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Create the new full path */ - HDstrncpy(new_full_path, dst_path, dst_path_len + 1); - HDstrncat(new_full_path, full_suffix, full_suffix_len); + /* Create new full path */ + if (NULL == (rs = H5RS_create(dst_path))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create ref-counted string") + H5RS_acat(rs, full_suffix); /* Release previous full path */ H5RS_decr(obj_path->full_path_r); /* Take ownership of the new full path */ - obj_path->full_path_r = H5RS_own(new_full_path); + obj_path->full_path_r = rs; } /* end if */ break; @@ -1019,7 +915,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5G_name_replace_cb() */ +} /* end H5G__name_replace_cb() */ /*------------------------------------------------------------------------- * Function: H5G_name_replace @@ -1144,17 +1040,17 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS /* Search through group IDs */ if (search_group) - if (H5I_iterate(H5I_GROUP, H5G_name_replace_cb, &names, FALSE) < 0) + if (H5I_iterate(H5I_GROUP, H5G__name_replace_cb, &names, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over groups") /* Search through dataset IDs */ if (search_dataset) - if (H5I_iterate(H5I_DATASET, H5G_name_replace_cb, &names, FALSE) < 0) + if (H5I_iterate(H5I_DATASET, H5G__name_replace_cb, &names, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datasets") /* Search through datatype IDs */ if (search_datatype) - if (H5I_iterate(H5I_DATATYPE, H5G_name_replace_cb, &names, FALSE) < 0) + if (H5I_iterate(H5I_DATATYPE, H5G__name_replace_cb, &names, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datatypes") } /* end if */ } /* end if */ @@ -1164,7 +1060,7 @@ done: } /* end H5G_name_replace() */ /*------------------------------------------------------------------------- - * Function: H5G_get_name_by_addr_cb + * Function: H5G__get_name_by_addr_cb * * Purpose: Callback for retrieving object's name by address * @@ -1178,7 +1074,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, void *_udata) +H5G__get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, void *_udata) { H5G_gnba_iter_t *udata = (H5G_gnba_iter_t *)_udata; /* User data for iteration */ H5G_loc_t obj_loc; /* Location of object */ @@ -1187,7 +1083,7 @@ H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, v hbool_t obj_found = FALSE; /* Object at 'path' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(path); @@ -1237,7 +1133,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_get_name_by_addr_cb() */ +} /* end H5G__get_name_by_addr_cb() */ /*------------------------------------------------------------------------- * Function: H5G_get_name_by_addr @@ -1285,7 +1181,7 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size) udata.path = NULL; /* Visit all the links in the file */ - if ((status = H5G_visit(&root_loc, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G_get_name_by_addr_cb, + if ((status = H5G_visit(&root_loc, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G__get_name_by_addr_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, (-1), "group traversal failed while looking for object name") else if (status > 0) diff --git a/src/H5RS.c b/src/H5RS.c index 77fa414..96d55e7 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -15,37 +15,89 @@ * Reference counted string algorithms. * * These are used for various internal strings which get copied multiple times. + * They also efficiently handle dynamically allocations and appends. * */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5RSprivate.h" /* Reference-counted strings */ +/****************/ +/* Module Setup */ +/****************/ + +#include "H5RSmodule.h" /* This source code file is part of the H5RS module */ + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5RSprivate.h" /* Reference-counted strings */ + +/****************/ +/* Local Macros */ +/****************/ + +/* Initial buffer size to allocate */ +#define H5RS_ALLOC_SIZE 256 + +/******************/ +/* Local Typedefs */ +/******************/ /* Private typedefs & structs */ struct H5RS_str_t { char * s; /* String to be reference counted */ - unsigned wrapped; /* Indicates that the string to be ref-counted is not copied */ + char * end; /* Pointer to terminating NUL character at the end of the string */ + size_t len; /* Current length of the string */ + size_t max; /* Size of allocated buffer */ + hbool_t wrapped; /* Indicates that the string to be ref-counted is not copied */ unsigned n; /* Reference count of number of pointers sharing string */ }; +/********************/ +/* Package Typedefs */ +/********************/ + +/********************/ +/* Local Prototypes */ +/********************/ +static herr_t H5RS__xstrdup(H5RS_str_t *rs, const char *s); +static herr_t H5RS__prepare_for_append(H5RS_str_t *rs); +static herr_t H5RS__resize_for_append(H5RS_str_t *rs, size_t len); + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + +/*******************/ +/* Local Variables */ +/*******************/ + /* Declare a free list to manage the H5RS_str_t struct */ H5FL_DEFINE_STATIC(H5RS_str_t); /* Declare the PQ free list for the wrapped strings */ -H5FL_BLK_DEFINE(str_buf); +H5FL_BLK_DEFINE_STATIC(str_buf); /*-------------------------------------------------------------------------- NAME - H5RS_xstrdup + H5RS__xstrdup PURPOSE Duplicate the string being reference counted USAGE - char *H5RS_xstrdup(s) + herr_t H5RS__xstrdup(rs, s) + H5RS_str_t *rs; IN/OUT: Ref-counted string to hold duplicated string const char *s; IN: String to duplicate RETURNS - Returns a pointer to a new string on success, NULL on failure. + Non-negative on success/Negative on failure DESCRIPTION Duplicate a string buffer being reference counted. Use this instead of [H5MM_][x]strdup, in order to use the free-list memory routines. @@ -54,25 +106,145 @@ H5FL_BLK_DEFINE(str_buf); EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static char * -H5RS_xstrdup(const char *s) +static herr_t +H5RS__xstrdup(H5RS_str_t *rs, const char *s) { - char *ret_value; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(rs); if (s) { - size_t len = HDstrlen(s) + 1; + size_t len = HDstrlen(s); + + /* Determine size of buffer to allocate */ + rs->max = H5RS_ALLOC_SIZE; + while ((len + 1) > rs->max) + rs->max *= 2; + + /* Allocate the underlying string */ + if (NULL == (rs->s = (char *)H5FL_BLK_MALLOC(str_buf, rs->max))) + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, FAIL, "memory allocation failed") + if (len) + HDmemcpy(rs->s, s, len); + rs->end = rs->s + len; + *rs->end = '\0'; + rs->len = len; + } /* end if */ + else { + /* Free previous string, if one */ + if (rs->s) { + H5FL_BLK_FREE(str_buf, rs->s); + rs->s = rs->end = NULL; + rs->max = rs->len = 0; + } /* end if */ + else { + /* Sanity checks */ + HDassert(NULL == rs->end); + HDassert(0 == rs->max); + HDassert(0 == rs->len); + } /* end else */ + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS__xstrdup() */ - ret_value = (char *)H5FL_BLK_MALLOC(str_buf, len); - HDassert(ret_value); - HDstrncpy(ret_value, s, len); +/*-------------------------------------------------------------------------- + NAME + H5RS__prepare_for_append + PURPOSE + Prepare a ref-counted string for an append + USAGE + herr_t H5RS__prepare_for_append(rs) + H5RS_str_t *rs; IN/OUT: Ref-counted string to hold duplicated string + RETURNS + Non-negative on success/Negative on failure + DESCRIPTION + Allocate space for a string, or duplicate a wrapped string, in preparation + for appending another string. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +static herr_t +H5RS__prepare_for_append(H5RS_str_t *rs) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(rs); + + if (NULL == rs->s) { + rs->max = H5RS_ALLOC_SIZE; + if (NULL == (rs->s = (char *)H5FL_BLK_MALLOC(str_buf, rs->max))) + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, FAIL, "memory allocation failed") + rs->end = rs->s; + *rs->s = '\0'; + rs->len = 0; } /* end if */ - else - ret_value = NULL; + else { + /* If the ref-counted string started life as a wrapper around an + * existing string, duplicate the string now, so we can modify it. + */ + if (rs->wrapped) { + if (H5RS__xstrdup(rs, rs->s) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, FAIL, "can't copy string") + rs->wrapped = FALSE; + } /* end if */ + } /* end else */ +done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5RS_xstrdup() */ +} /* end H5RS__prepare_for_append() */ + +/*-------------------------------------------------------------------------- + NAME + H5RS__resize_for_append + PURPOSE + Resize ref-counted string buffer to accommodate appending another string + USAGE + herr_t H5RS__resize_for_append(rs, len) + H5RS_str_t *rs; IN/OUT: Ref-counted string to hold duplicated string + size_t len; IN: Additional length to accommodate + RETURNS + Non-negative on success/Negative on failure + DESCRIPTION + Resize a ref-counted string buffer to be large enough to accommodate + another string of a specified length. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +static herr_t +H5RS__resize_for_append(H5RS_str_t *rs, size_t len) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(rs); + + /* Check if buffer should be re-allocated */ + if (len >= (rs->max - rs->len)) { + /* Allocate a large enough buffer */ + while (len >= (rs->max - rs->len)) + rs->max *= 2; + if (NULL == (rs->s = (char *)H5FL_BLK_REALLOC(str_buf, rs->s, rs->max))) + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, FAIL, "memory allocation failed") + rs->end = rs->s + rs->len; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS__resize() */ /*-------------------------------------------------------------------------- NAME @@ -96,18 +268,19 @@ H5RS_xstrdup(const char *s) H5RS_str_t * H5RS_create(const char *s) { - H5RS_str_t *ret_value; /* Return value */ + H5RS_str_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Allocate ref-counted string structure */ - if (NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) - HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") + if (NULL == (ret_value = H5FL_CALLOC(H5RS_str_t))) + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s = H5RS_xstrdup(s); - ret_value->wrapped = 0; - ret_value->n = 1; + if (s) + if (H5RS__xstrdup(ret_value, s) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, NULL, "can't copy string") + ret_value->n = 1; done: FUNC_LEAVE_NOAPI(ret_value) @@ -135,63 +308,233 @@ done: H5RS_str_t * H5RS_wrap(const char *s) { - H5RS_str_t *ret_value; /* Return value */ + H5RS_str_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Allocate ref-counted string structure */ if (NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) - HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s = (char *)s; - ret_value->wrapped = 1; + ret_value->s = (char *)s; + ret_value->len = HDstrlen(s); + ret_value->end = ret_value->s + ret_value->len; + + ret_value->wrapped = TRUE; + ret_value->max = 0; /* Wrapped, not allocated */ ret_value->n = 1; done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_wrap() */ -/*-------------------------------------------------------------------------- - NAME - H5RS_own - PURPOSE - Transfer ownership of a regular string to a reference counted string - USAGE - H5RS_str_t *H5RS_own(s) - const char *s; IN: String to transfer ownership of +/*------------------------------------------------------------------------- + * Function: H5RS_asprintf_cat + * + * Purpose: This function appends formatted output to a ref-counted string, + * allocating the managed string if necessary. The formatting + * string is printf() compatible. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Friday, September 18, 2020 + * + *------------------------------------------------------------------------- + */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the sprintf() calls with + * format_templ in the code below, but early (4.4.7, at least) gcc only + * allows diagnostic pragmas to be toggled outside of functions. + */ +H5_GCC_DIAG_OFF("format-nonliteral") +H5_ATTR_FORMAT(printf, 2, 3) +herr_t +H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...) +{ + va_list args1, args2; + size_t out_len; + herr_t ret_value = SUCCEED; /* Return value */ - RETURNS - Returns a pointer to a new ref-counted string on success, NULL on failure. - DESCRIPTION - Transfer ownership of a dynamically allocated string to a reference counted - string. The routine which passed in the string should not attempt to free - it, the reference counting string routines will do that when the reference - count drops to zero. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -H5RS_str_t * -H5RS_own(char *s) + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(rs); + HDassert(fmt); + + /* Prepare the [possibly wrapped or empty] ref-counted string for an append */ + if (H5RS__prepare_for_append(rs) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTINIT, FAIL, "can't initialize ref-counted string") + + /* Attempt to write formatted output into the managed string */ + HDva_start(args1, fmt); + HDva_copy(args2, args1); + while ((out_len = (size_t)HDvsnprintf(rs->end, (rs->max - rs->len), fmt, args1)) >= (rs->max - rs->len)) { + /* Allocate a large enough buffer */ + if (H5RS__resize_for_append(rs, out_len) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer") + + /* Restart the va_list */ + HDva_end(args1); + HDva_copy(args1, args2); + } /* end while */ + + /* Increment the size & end of the string */ + rs->len += out_len; + rs->end += out_len; + + /* Finish access to varargs */ + HDva_end(args1); + HDva_end(args2); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS_asprintf_cat() */ +H5_GCC_DIAG_ON("format-nonliteral") + +/*------------------------------------------------------------------------- + * Function: H5RS_acat + * + * Purpose: This function appends a character string to a ref-counted string, + * allocating the managed string if necessary. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Friday, September 18, 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5RS_acat(H5RS_str_t *rs, const char *s) { - H5RS_str_t *ret_value; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI(FAIL) - /* Allocate ref-counted string structure */ - if (NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) - HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") + /* Sanity checks */ + HDassert(rs); + HDassert(s); - /* Set the internal fields */ - ret_value->s = s; - ret_value->wrapped = 0; - ret_value->n = 1; + /* Concatenate the provided string on to the managed string */ + if (*s) { + size_t len = HDstrlen(s); + + /* Allocate the underlying string, if necessary */ + if (H5RS__prepare_for_append(rs) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTINIT, FAIL, "can't initialize ref-counted string") + + /* Increase the managed string's buffer size if necessary */ + if ((rs->len + len) >= rs->max) + if (H5RS__resize_for_append(rs, len) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer") + + /* Append the string */ + HDmemcpy(rs->end, s, len); + rs->end += len; + *rs->end = '\0'; + rs->len += len; + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5RS_own() */ +} /* end H5RS_acat() */ + +/*------------------------------------------------------------------------- + * Function: H5RS_ancat + * + * Purpose: This function appends at most 'n' characters from a string + * to a ref-counted string, allocating the managed string if + * necessary. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Friday, September 18, 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5RS_ancat(H5RS_str_t *rs, const char *s, size_t n) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(rs); + HDassert(s); + + /* Concatenate the provided string on to the managed string */ + if (n && *s) { + size_t len = HDstrlen(s); + + /* Limit characters to copy to the minimum of 'n' and 'len' */ + n = MIN(len, n); + + /* Allocate the underlying string, if necessary */ + if (H5RS__prepare_for_append(rs) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTINIT, FAIL, "can't initialize ref-counted string") + + /* Increase the managed string's buffer size if necessary */ + if ((rs->len + n) >= rs->max) + if (H5RS__resize_for_append(rs, n) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer") + + /* Append the string */ + HDmemcpy(rs->end, s, n); + rs->end += n; + *rs->end = '\0'; + rs->len += n; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS_ancat() */ + +/*------------------------------------------------------------------------- + * Function: H5RS_aputc + * + * Purpose: This function appends a character to a ref-counted string, + * allocating the managed string if necessary. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Friday, September 18, 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5RS_aputc(H5RS_str_t *rs, int c) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(rs); + HDassert(c); + + /* Allocate the underlying string, if necessary */ + if (H5RS__prepare_for_append(rs) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTINIT, FAIL, "can't initialize ref-counted string") + + /* Increase the managed string's buffer size if necessary */ + if ((rs->len + 1) >= rs->max) + if (H5RS__resize_for_append(rs, 1) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer") + + /* Append the current character */ + *rs->end++ = (char)c; + rs->len++; + *rs->end = '\0'; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS_aputc() */ /*-------------------------------------------------------------------------- NAME @@ -252,7 +595,9 @@ H5RS_decr(H5RS_str_t *rs) herr_t H5RS_incr(H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(rs); @@ -263,14 +608,16 @@ H5RS_incr(H5RS_str_t *rs) * scope appropriately. */ if (rs->wrapped) { - rs->s = H5RS_xstrdup(rs->s); - rs->wrapped = 0; + if (H5RS__xstrdup(rs, rs->s) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, FAIL, "can't copy string") + rs->wrapped = FALSE; } /* end if */ /* Increment reference count for string */ rs->n++; - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_incr() */ /*-------------------------------------------------------------------------- @@ -307,53 +654,6 @@ H5RS_dup(H5RS_str_t *ret_value) /*-------------------------------------------------------------------------- NAME - H5RS_dup_str - PURPOSE - "Duplicate" a regular string into a ref-counted string - USAGE - H5RS_str_t H5RS_dup_str(s) - const char *s; IN: Regular string to duplicate - - RETURNS - Returns a pointer to ref-counted string on success, NULL on failure. - DESCRIPTION - Duplicate a regular string into a ref-counted string. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -H5RS_str_t * -H5RS_dup_str(const char *s) -{ - char * new_str; /* Duplicate of string */ - size_t path_len; /* Length of the path */ - H5RS_str_t *ret_value; - - FUNC_ENTER_NOAPI(NULL) - - /* Sanity check */ - HDassert(s); - - /* Get the length of the string */ - path_len = HDstrlen(s); - - /* Allocate space for the string */ - if (NULL == (new_str = (char *)H5FL_BLK_MALLOC(str_buf, path_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - /* Copy name for full path */ - HDstrncpy(new_str, s, (path_len + 1)); - - /* Create reference counted string for path */ - ret_value = H5RS_own(new_str); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5RS_dup_str() */ - -/*-------------------------------------------------------------------------- - NAME H5RS_cmp PURPOSE Compare two ref-counted strings diff --git a/src/H5RSmodule.h b/src/H5RSmodule.h new file mode 100644 index 0000000..17977c7 --- /dev/null +++ b/src/H5RSmodule.h @@ -0,0 +1,32 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, October 10, 2020 + * + * Purpose: This file contains declarations which define macros for the + * H5RS package. Including this header means that the source file + * is part of the H5RS package. + */ +#ifndef H5RSmodule_H +#define H5RSmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5RS_MODULE +#define H5_MY_PKG H5RS +#define H5_MY_PKG_ERR H5E_RS +#define H5_MY_PKG_INIT NO + +#endif /* H5RSmodule_H */ diff --git a/src/H5RSprivate.h b/src/H5RSprivate.h index 32e1dc6..7d2b728 100644 --- a/src/H5RSprivate.h +++ b/src/H5RSprivate.h @@ -45,11 +45,13 @@ typedef struct H5RS_str_t H5RS_str_t; /********************/ H5_DLL H5RS_str_t *H5RS_create(const char *s); H5_DLL H5RS_str_t *H5RS_wrap(const char *s); -H5_DLL H5RS_str_t *H5RS_own(char *s); H5_DLL herr_t H5RS_decr(H5RS_str_t *rs); H5_DLL herr_t H5RS_incr(H5RS_str_t *rs); H5_DLL H5RS_str_t *H5RS_dup(H5RS_str_t *s); -H5_DLL H5RS_str_t *H5RS_dup_str(const char *s); +H5_DLL herr_t H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...) H5_ATTR_FORMAT(printf, 2, 3); +H5_DLL herr_t H5RS_acat(H5RS_str_t *rs, const char *s); +H5_DLL herr_t H5RS_ancat(H5RS_str_t *rs, const char *s, size_t len); +H5_DLL herr_t H5RS_aputc(H5RS_str_t *rs, int c); H5_DLL int H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2); H5_DLL ssize_t H5RS_len(const H5RS_str_t *rs); H5_DLL char * H5RS_get_str(const H5RS_str_t *rs); diff --git a/test/trefstr.c b/test/trefstr.c index 049384f..a3f568a 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -265,7 +265,9 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s = H5RS_get_str(rs); CHECK_PTR(s, "H5RS_get_str"); - CHECK(s, buf, "wrapping"); + if (s == buf) + TestErrPrintf("%d: Should not have gotten the same pointer from reference-counted string!\n", + __LINE__); cmp = HDstrcmp(s, buf); if (cmp <= 0) TestErrPrintf("%d: string comparison incorrect!\n", __LINE__); @@ -280,60 +282,225 @@ test_refstr_wrap(void) /**************************************************************** ** -** test_refstr_own(): Test basic H5RS (ref-counted strings) code. -** Tests transferring ownership of dynamically allocated strings -** to ref-counted strings. +** test_refstr_asprintf_cat(): Test basic H5RS (ref-counted strings) code. +** Tests appending printf-formatted output to ref-counted strings. ** ****************************************************************/ static void -test_refstr_own(void) +test_refstr_asprintf_cat(void) { - H5RS_str_t *rs; /* Ref-counted string created */ - char * s; /* Pointer to string to transfer */ - const char *t; /* Temporary pointers to string */ - int cmp; /* Comparison value */ - herr_t ret; /* Generic return value */ + H5RS_str_t *rs; /* Ref-counted string created */ + const char *s; /* Pointer to raw string in ref-counted string */ + char buf[256]; /* Buffer to compare against */ + int cmp; /* Comparison value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ - MESSAGE(5, ("Testing Transferring Ref-Counted Strings\n")); + MESSAGE(5, ("Testing Printf-formatted Output to Ref-Counted Strings\n")); - /* Initialize buffer */ - s = (char *)H5FL_BLK_MALLOC(str_buf, HDstrlen("foo") + 1); - CHECK_PTR(s, "H5FL_BLK_MALLOC"); - HDstrcpy(s, "foo"); + /* Wrap ref-counted string around existing buffer */ + rs = H5RS_create(NULL); + CHECK_PTR(rs, "H5RS_create"); - /* Transfer ownership of dynamically allocated string to ref-counted string */ - rs = H5RS_own(s); - CHECK_PTR(rs, "H5RS_own"); + /* Print initial output to ref-counted string */ + ret = H5RS_asprintf_cat(rs, "%d-%s", (int)10, "foo"); + CHECK(ret, FAIL, "H5RS_asprintf_cat"); /* Get pointer to raw string in ref-counted string */ - t = H5RS_get_str(rs); - CHECK_PTR(t, "H5RS_get_str"); - CHECK_PTR_EQ(t, s, "transferring"); - cmp = HDstrcmp(s, t); + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%d-%s", (int)10, "foo"); + cmp = HDstrcmp(s, buf); VERIFY(cmp, 0, "HDstrcmp"); - /* Increment reference count (should NOT duplicate string) */ - ret = H5RS_incr(rs); - CHECK(ret, FAIL, "H5RS_incr"); + /* Append more output to ref-counted string */ + ret = H5RS_asprintf_cat(rs, "-%f", (double)20.0); + CHECK(ret, FAIL, "H5RS_asprintf_cat"); - /* Change the buffer initially wrapped */ - *s = 'F'; + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%d-%s-%f", (int)10, "foo", (double)20.0); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Decrement reference count for string */ + ret = H5RS_decr(rs); + CHECK(ret, FAIL, "H5RS_decr"); + +} /* end test_refstr_asprintf_cat() */ + +/**************************************************************** +** +** test_refstr_acat(): Test basic H5RS (ref-counted strings) code. +** Tests appending strings to ref-counted strings. +** +****************************************************************/ +static void +test_refstr_acat(void) +{ + H5RS_str_t *rs; /* Ref-counted string created */ + const char *s; /* Pointer to raw string in ref-counted string */ + char buf[256]; /* Buffer to compare against */ + char * large_str, *large_str2; /* Large strings to append */ + int cmp; /* Comparison value */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Appending Strings to Ref-Counted Strings\n")); + + /* Wrap ref-counted string around existing buffer */ + rs = H5RS_create(NULL); + CHECK_PTR(rs, "H5RS_create"); + + /* Append first string to ref-counted string */ + ret = H5RS_acat(rs, "foo"); + CHECK(ret, FAIL, "H5RS_acat"); /* Get pointer to raw string in ref-counted string */ - t = H5RS_get_str(rs); - CHECK_PTR(t, "H5RS_get_str"); - CHECK_PTR_EQ(t, s, "transferring"); - cmp = HDstrcmp(t, s); + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%s", "foo"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Append another string to ref-counted string */ + ret = H5RS_acat(rs, "bar"); + CHECK(ret, FAIL, "H5RS_acat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%s", "foobar"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Append a large string to ref-counted string */ + large_str = HDmalloc(1024); + CHECK_PTR(large_str, "HDmalloc"); + HDmemset(large_str, 'a', 1024); + large_str[1023] = '\0'; + ret = H5RS_acat(rs, large_str); + CHECK(ret, FAIL, "H5RS_acat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%s", "foobar"); + large_str2 = HDmalloc(1024 + 6); + CHECK_PTR(large_str2, "HDmalloc"); + HDstrcpy(large_str2, "foobar"); + HDmemset(&large_str2[6], 'a', 1024); + large_str2[1029] = '\0'; + cmp = HDstrcmp(s, large_str2); VERIFY(cmp, 0, "HDstrcmp"); /* Decrement reference count for string */ ret = H5RS_decr(rs); CHECK(ret, FAIL, "H5RS_decr"); + + /* Free large strings */ + HDfree(large_str); + HDfree(large_str2); +} /* end test_refstr_acat() */ + +/**************************************************************** +** +** test_refstr_ancat(): Test basic H5RS (ref-counted strings) code. +** Tests appending length-limited strings to ref-counted strings. +** +****************************************************************/ +static void +test_refstr_ancat(void) +{ + H5RS_str_t *rs; /* Ref-counted string created */ + const char *s; /* Pointer to raw string in ref-counted string */ + char buf[256]; /* Buffer to compare against */ + int cmp; /* Comparison value */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Appending Strings to Ref-Counted Strings\n")); + + /* Wrap ref-counted string around existing buffer */ + rs = H5RS_create(NULL); + CHECK_PTR(rs, "H5RS_create"); + + /* Append first string to ref-counted string */ + ret = H5RS_ancat(rs, "foo", 2); + CHECK(ret, FAIL, "H5RS_ancat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDstrcpy(buf, "fo"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Append another string to ref-counted string */ + ret = H5RS_ancat(rs, "bar", 2); + CHECK(ret, FAIL, "H5RS_ancat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDstrcpy(buf, "foba"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Decrement reference count for string */ ret = H5RS_decr(rs); CHECK(ret, FAIL, "H5RS_decr"); +} /* end test_refstr_ancat() */ + +/**************************************************************** +** +** test_refstr_aputc(): Test basic H5RS (ref-counted strings) code. +** Tests appending characters to ref-counted strings. +** +****************************************************************/ +static void +test_refstr_aputc(void) +{ + H5RS_str_t *rs; /* Ref-counted string created */ + const char *s; /* Pointer to raw string in ref-counted string */ + char buf[256]; /* Buffer to compare against */ + int cmp; /* Comparison value */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Appending Strings to Ref-Counted Strings\n")); -} /* end test_refstr_own() */ + /* Wrap ref-counted string around existing buffer */ + rs = H5RS_create(NULL); + CHECK_PTR(rs, "H5RS_create"); + + /* Append first character to ref-counted string */ + ret = H5RS_aputc(rs, 'f'); + CHECK(ret, FAIL, "H5RS_ancat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDstrcpy(buf, "f"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Append another character to ref-counted string */ + ret = H5RS_aputc(rs, 'o'); + CHECK(ret, FAIL, "H5RS_ancat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDstrcpy(buf, "fo"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Decrement reference count for string */ + ret = H5RS_decr(rs); + CHECK(ret, FAIL, "H5RS_decr"); +} /* end test_refstr_aputc() */ /**************************************************************** ** @@ -361,12 +528,15 @@ test_refstr(void) test_refstr_init(); /* Actual ref-counted strings tests */ - test_refstr_create(); /* Test ref-counted string creation */ - test_refstr_count(); /* Test ref-counted string counting */ - test_refstr_dup(); /* Test ref-counted string duplication */ - test_refstr_cmp(); /* Test ref-counted string comparison */ - test_refstr_wrap(); /* Test ref-counted string wrapping */ - test_refstr_own(); /* Test ref-counted string ownership transfer */ + test_refstr_create(); /* Test ref-counted string creation */ + test_refstr_count(); /* Test ref-counted string counting */ + test_refstr_dup(); /* Test ref-counted string duplication */ + test_refstr_cmp(); /* Test ref-counted string comparison */ + test_refstr_wrap(); /* Test ref-counted string wrapping */ + test_refstr_asprintf_cat(); /* Test ref-counted string printf-formatted output */ + test_refstr_acat(); /* Test ref-counted string appends */ + test_refstr_ancat(); /* Test ref-counted length-limited string appends */ + test_refstr_aputc(); /* Test ref-counted character appends */ /* Finalize ref-counted strings testing data */ test_refstr_finalize(); -- cgit v0.12 From 245950c383324d09ee4161c2697371462a8b928d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 6 Apr 2021 02:43:53 -0700 Subject: Brings trace changes from develop --- bin/trace | 404 ++++-- src/H5.c | 12 +- src/H5A.c | 24 +- src/H5ACmpio.c | 5 +- src/H5ACpkg.h | 13 +- src/H5Adeprec.c | 2 +- src/H5Clog.c | 3 +- src/H5Ctag.c | 2 +- src/H5D.c | 8 +- src/H5Dio.c | 6 +- src/H5Dmpio.c | 5 +- src/H5Dscatgath.c | 5 +- src/H5E.c | 11 +- src/H5Edeprec.c | 6 +- src/H5F.c | 14 +- src/H5FD.c | 34 +- src/H5FDhdfs.c | 18 +- src/H5FDmirror.c | 4 +- src/H5FDros3.c | 13 +- src/H5FDsplitter.c | 4 +- src/H5Fdeprec.c | 2 +- src/H5G.c | 7 +- src/H5Gdeprec.c | 2 +- src/H5I.c | 6 +- src/H5L.c | 33 +- src/H5Ldeprec.c | 13 +- src/H5Lexternal.c | 6 +- src/H5M.c | 14 +- src/H5O.c | 19 +- src/H5Ocopy.c | 3 +- src/H5Odeprec.c | 24 +- src/H5P.c | 14 +- src/H5Pdapl.c | 4 +- src/H5Pdcpl.c | 3 +- src/H5Pdeprec.c | 12 +- src/H5Pdxpl.c | 12 +- src/H5Pfapl.c | 29 +- src/H5Pfcpl.c | 3 +- src/H5Plapl.c | 4 +- src/H5Pocpl.c | 12 +- src/H5Pocpypl.c | 4 +- src/H5SM.c | 2 +- src/H5Sselect.c | 3 +- src/H5T.c | 6 +- src/H5VL.c | 4 +- src/H5VLcallback.c | 123 +- src/H5VM.c | 19 +- src/H5Z.c | 2 +- src/H5private.h | 83 ++ src/H5trace.c | 3961 +++++++++++++++++++++++++++------------------------- 50 files changed, 2675 insertions(+), 2347 deletions(-) diff --git a/bin/trace b/bin/trace index a9964f9..0611fa5 100755 --- a/bin/trace +++ b/bin/trace @@ -28,61 +28,101 @@ $Source = ""; # usually the same as the package name. # %TypeString = ("haddr_t" => "a", + "H5A_info_t" => "Ai", + "H5A_operator1_t" => "Ao", + "H5A_operator2_t" => "AO", "hbool_t" => "b", + "H5AC_cache_config_t" => "Cc", + "H5AC_cache_image_config_t" => "CC", "double" => "d", "H5D_alloc_time_t" => "Da", + "H5D_append_cb_t" => "DA", "H5FD_mpio_collective_opt_t" => "Dc", "H5D_fill_time_t" => "Df", "H5D_fill_value_t" => "DF", + "H5D_gather_func_t" => "Dg", "H5FD_mpio_chunk_opt_t" => "Dh", "H5D_mpio_actual_io_mode_t" => "Di", + "H5FD_file_image_callbacks_t" => "DI", "H5D_chunk_index_t" => "Dk", "H5D_layout_t" => "Dl", "H5D_mpio_no_collective_cause_t" => "Dn", "H5D_mpio_actual_chunk_opt_mode_t" => "Do", + "H5D_operator_t" => "DO", "H5D_space_status_t" => "Ds", - "H5D_vds_view_t" => "Dv", + "H5D_scatter_func_t" => "DS", "H5FD_mpio_xfer_t" => "Dt", - "H5FD_splitter_vfd_config_t" => "Dr", + "H5D_vds_view_t" => "Dv", "herr_t" => "e", + "H5E_auto1_t" => "Ea", + "H5E_auto2_t" => "EA", "H5E_direction_t" => "Ed", "H5E_error_t" => "Ee", - "H5E_type_t" => "Et", "H5ES_status_t" => "Es", + "H5E_type_t" => "Et", + "H5FD_class_t" => "FC", "H5F_close_degree_t" => "Fd", "H5F_fspace_strategy_t" => "Ff", - "H5F_file_space_type_t" => "Ff", + "H5F_flush_cb_t" => "FF", + "H5F_info2_t" => "FI", "H5F_mem_t" => "Fm", "H5F_scope_t" => "Fs", - "H5F_fspace_type_t" => "Ft", + "H5F_file_space_type_t" => "Ft", "H5F_libver_t" => "Fv", + "H5G_iterate_t" => "Gi", "H5G_obj_t" => "Go", "H5G_stat_t" => "Gs", "hsize_t" => "h", + "H5_alloc_stats_t" => "Ha", + "H5_atclose_func_t" => "Hc", "hssize_t" => "Hs", - "H5E_major_t" => "i", - "H5E_minor_t" => "i", - "H5_iter_order_t" => "Io", - "H5_index_t" => "Ii", + "H5E_major_t" => "i", # H5E_major_t is typedef'd to hid_t + "H5E_minor_t" => "i", # H5E_minor_t is typedef'd to hid_t "hid_t" => "i", + "H5I_future_discard_func_t" => "ID", + "H5I_free_t" => "If", + "H5_index_t" => "Ii", + "H5I_iterate_func_t" => "II", + "H5_iter_order_t" => "Io", + "H5I_future_realize_func_t" => "IR", "int" => "Is", "int32_t" => "Is", + "H5I_search_func_t" => "IS", + "H5I_type_t" => "It", "unsigned" => "Iu", "unsigned int" => "Iu", "uint32_t" => "Iu", - "uint64_t" => "UL", - "H5I_type_t" => "It", "H5O_token_t" => "k", + "H5L_iterate1_t" => "Li", + "H5L_iterate2_t" => "LI", "H5G_link_t" => "Ll", #Same as H5L_type_t now "H5L_type_t" => "Ll", + "H5L_elink_traverse_t" => "Lt", + "H5MM_allocate_t" => "Ma", "MPI_Comm" => "Mc", + "H5MM_free_t" => "Mf", "MPI_Info" => "Mi", + "H5M_iterate_t" => 'MI', "H5FD_mem_t" => "Mt", "off_t" => "o", + "H5O_iterate1_t" => "Oi", + "H5O_iterate2_t" => "OI", + "H5O_mcdt_search_cb_t" => "Os", "H5O_type_t" => "Ot", "H5P_class_t" => "p", - "hobj_ref_t" => "Ro", + "H5P_cls_create_func_t" => "Pc", + "H5P_prp_create_func_t" => "PC", + "H5P_prp_delete_func_t" => "PD", + "H5P_prp_get_func_t" => "PG", + "H5P_iterate_t" => "Pi", + "H5P_cls_close_func_t" => "Pl", + "H5P_prp_close_func_t" => "PL", + "H5P_prp_compare_func_t" => "PM", + "H5P_cls_copy_func_t" => "Po", + "H5P_prp_copy_func_t" => "PO", + "H5P_prp_set_func_t" => "PS", "hdset_reg_ref_t" => "Rd", + "hobj_ref_t" => "Ro", "H5R_ref_t" => "Rr", "H5R_type_t" => "Rt", "char" => "s", @@ -92,125 +132,84 @@ $Source = ""; "H5S_sel_type" => "St", "htri_t" => "t", "H5T_cset_t", => "Tc", + "H5T_conv_t" => "TC", "H5T_direction_t", => "Td", + "H5T_pers_t" => "Te", + "H5T_conv_except_func_t" => "TE", "H5T_norm_t" => "Tn", "H5T_order_t" => "To", "H5T_pad_t" => "Tp", - "H5T_pers_t" => "Te", "H5T_sign_t" => "Ts", "H5T_class_t" => "Tt", "H5T_str_t" => "Tz", "unsigned long" => "Ul", "unsigned long long" => "UL", - "H5VL_subclass_t" => "VS", - "H5VL_get_conn_lvl_t" => "VL", + "uint64_t" => "UL", "H5VL_attr_get_t" => "Va", - "H5VL_attr_optional_t" => "Vs", + "H5VL_blob_optional_t" => "VA", "H5VL_attr_specific_t" => "Vb", "H5VL_blob_specific_t" => "VB", - "H5VL_class_value_t" => "VC", "H5VL_dataset_get_t" => "Vc", + "H5VL_class_value_t" => "VC", "H5VL_dataset_specific_t" => "Vd", - "H5VL_dataset_optional_t" => "Vt", "H5VL_datatype_get_t" => "Ve", "H5VL_datatype_specific_t" => "Vf", - "H5VL_datatype_optional_t" => "Vu", "H5VL_file_get_t" => "Vg", "H5VL_file_specific_t" => "Vh", - "H5VL_file_optional_t" => "Vv", "H5VL_group_get_t" => "Vi", "H5VL_group_specific_t" => "Vj", - "H5VL_group_optional_t" => "Vw", "H5VL_link_create_type_t" => "Vk", "H5VL_link_get_t" => "Vl", + "H5VL_get_conn_lvl_t" => "VL", "H5VL_link_specific_t" => "Vm", - "H5VL_link_optional_t" => "Vx", "H5VL_object_get_t" => "Vn", + "H5VL_request_notify_t" => "VN", "H5VL_object_specific_t" => "Vo", - "H5VL_object_optional_t" => "Vy", "H5VL_request_specific_t" => "Vr", + "H5VL_attr_optional_t" => "Vs", + "H5VL_subclass_t" => "VS", + "H5VL_dataset_optional_t" => "Vt", + "H5VL_datatype_optional_t" => "Vu", + "H5VL_file_optional_t" => "Vv", + "H5VL_group_optional_t" => "Vw", + "H5VL_link_optional_t" => "Vx", + "H5VL_object_optional_t" => "Vy", "H5VL_request_optional_t" => "Vz", - "H5VL_blob_optional_t" => "VA", - "void" => "x", - "FILE" => "x", - "H5_alloc_stats_t" => "x", - "H5A_operator_t" => "x", - "H5A_operator1_t" => "x", - "H5A_operator2_t" => "x", - "H5A_info_t" => "x", - "H5AC_cache_config_t" => "x", - "H5AC_cache_image_config_t" => "x", - "H5D_append_cb_t" => "x", - "H5D_gather_func_t" => "x", - "H5D_operator_t" => "x", - "H5D_scatter_func_t" => "x", - "H5E_auto_t" => "x", - "H5E_auto1_t" => "x", - "H5E_auto2_t" => "x", - "H5E_walk_t" => "x", - "H5E_walk1_t" => "x", - "H5E_walk2_t" => "x", - "H5F_flush_cb_t" => "x", - "H5F_info1_t" => "x", - "H5F_info2_t" => "x", - "H5F_retry_info_t" => "x", - "H5F_vfd_swmr_config_t" => "x", - "H5FD_t" => "x", - "H5FD_class_t" => "x", - "H5FD_stream_fapl_t" => "x", - "H5FD_ros3_fapl_t" => "x", - "H5FD_hdfs_fapl_t" => "x", - "H5FD_file_image_callbacks_t" => "x", - "H5FD_mirror_fapl_t" => "x", - "H5G_iterate_t" => "x", - "H5G_info_t" => "x", - "H5I_free_t" => "x", - "H5I_iterate_func_t" => "x", - "H5I_search_func_t" => "x", - "H5L_class_t" => "x", - "H5L_elink_traverse_t" => "x", - "H5L_info1_t" => "x", - "H5L_info2_t" => "x", - "H5L_iterate1_t" => "x", - "H5L_iterate2_t" => "x", - "H5M_iterate_t" => 'x', - "H5MM_allocate_t" => "x", - "H5MM_free_t" => "x", - "H5O_info1_t" => "x", - "H5O_info2_t" => "x", - "H5O_native_info_t" => "x", - "H5O_iterate1_t" => "x", - "H5O_iterate2_t" => "x", - "H5O_mcdt_search_cb_t" => "x", - "H5P_cls_create_func_t" => "x", - "H5P_cls_copy_func_t" => "x", - "H5P_cls_close_func_t" => "x", - "H5P_iterate_t" => "x", - "H5P_prp_create_func_t" => "x", - "H5P_prp_copy_func_t" => "x", - "H5P_prp_close_func_t" => "x", - "H5P_prp_delete_func_t" => "x", - "H5P_prp_get_func_t" => "x", - "H5P_prp_set_func_t" => "x", - "H5P_prp_compare_func_t" => "x", - "H5T_cdata_t" => "x", - "H5T_conv_t" => "x", - "H5T_conv_except_func_t" => "x", - "H5VL_t" => "x", - "H5VL_class_t" => "x", - "H5VL_loc_params_t" => "x", - "H5VL_request_notify_t" => "x", - "H5Z_func_t" => "x", - "H5Z_filter_func_t" => "x", "va_list" => "x", + "void" => "x", "size_t" => "z", "H5Z_SO_scale_type_t" => "Za", "H5Z_class_t" => "Zc", "H5Z_EDC_t" => "Ze", "H5Z_filter_t" => "Zf", + "H5Z_filter_func_t" => "ZF", "ssize_t" => "Zs", +# Types below must be defined here, as they appear in function arguments, +# but they are not yet supported in the H5_trace_args() routine yet. If +# they are used as an actual parameter type (and not just as a pointer to +# to the type), they must have a "real" abbreviation added (like the ones +# above), moved to the section of entries above, and support for displaying +# the type must be added to H5_trace_args(). + "H5ES_err_info_t" => "#", + "H5FD_t" => "#", + "H5FD_hdfs_fapl_t" => "#", + "H5FD_mirror_fapl_t" => "#", + "H5FD_ros3_fapl_t" => "#", + "H5FD_splitter_vfd_config_t" => "#", + "H5L_class_t" => "#", + "H5VL_class_t" => "#", + "H5VL_loc_params_t" => "#", + "H5VL_request_status_t" => "#", ); + +############################################################################## +# Maximum length of H5TRACE macro line +# If the ColumnLimit in .clang-format is changed, this value will need to be updated +# +my $max_trace_macro_line_len = 110; + + ############################################################################## # Print an error message. # @@ -241,7 +240,9 @@ sub argstring ($$$) { # Normalize the data type by removing redundant white space, # certain type qualifiers, and indirection. - $atype =~ s/^\bconst\b//; + $atype =~ s/^\bconst\b//; # Leading const + $atype =~ s/\s*const\s*//; # const after type, possibly in the middle of '*'s + $atype =~ s/^\bstatic\b//; $atype =~ s/\bH5_ATTR_UNUSED\b//g; $atype =~ s/\bH5_ATTR_DEPRECATED_USED\b//g; $atype =~ s/\bH5_ATTR_NDEBUG_UNUSED\b//g; @@ -265,53 +266,65 @@ sub argstring ($$$) { --$ptr; $tstr = $TypeString{"$atype*"}; } elsif (!exists $TypeString{$atype}) { - errmesg $file, $func, "untraceable type \`$atype", '*'x$ptr, "\'"; +# Defer throwing error until type is actually used +# errmesg $file, $func, "untraceable type \`$atype", '*'x$ptr, "\'"; } else { $tstr = $TypeString{$atype}; } - return ("*" x $ptr) . ($array?"[$array]":"") . $tstr; + return ("*" x $ptr) . ($array ? "[$array]" : "") . $tstr; } ############################################################################## # Given information about an API function, rewrite that function with # updated tracing information. # -sub rewrite_func ($$$$$) { - my ($file, $type, $name, $args, $body) = @_; - my ($arg,$trace); - my (@arg_name, @arg_str); +my $file_api = 0; +my $file_args = 0; +my $total_api = 0; +my $total_args = 0; +sub rewrite_func ($$$$$$$$) { + my ($file, $begin, $type, $aftertype, $name, $args, $close, $body) = @_; + my ($arg, $trace, $argtrace); + my (@arg_name, @arg_str, @arg_type); local $_; + # Keep copy of original arguments + my $orig_args = $args; + # Parse return value my $rettype = argstring $file, $name, $type; - goto error if $rettype =~ /!/; # Parse arguments if ($args eq "void") { - $trace = "H5TRACE0(\"$rettype\",\"\");\n"; + $trace = "H5TRACE0(\"$rettype\", \"\");\n"; + $argtrace = "H5ARG_TRACE0(\"\")"; } else { # Split arguments. First convert `/*in,out*/' to get rid of the - # comma, then split the arguments on commas. - $args =~ s/(\/\*\s*in),\s*(out\s*\*\/)/$1_$2/g; + # comma and remove lines beginning with a '#', then split the arguments + # on commas. + $args =~ s/(\/\*\s*in),\s*(out\s*\*\/)/$1_$2/g; # Get rid of comma in 'in,out' + $args =~ s/H5FL_TRACK_PARAMS//g; # Remove free list macro + $args =~ s/\n#.*?\n/\n/g; # Remove lines beginning with '#' my @args = split /,[\s\n]*/, $args; my $argno = 0; my %names; for $arg (@args) { - if($arg=~/\w*\.{3}\w*/){ + if($arg=~/\w*\.{3}\w*/){ # Skip "..." for varargs parameter next; } - unless ($arg=~/^(([a-z_A-Z]\w*\s+)+\**) + unless ($arg=~/^((\s*[a-z_A-Z](\w|\*)*\s+)+(\s*\*\s*|\s*const\s*|\s*volatile\s*)*) ([a-z_A-Z]\w*)(\[.*?\])? (\s*\/\*\s*(in|out|in_out)\s*\*\/)?\s*$/x) { errmesg $file, $name, "unable to parse \`$arg\'"; goto error; } else { - my ($atype, $aname, $array, $adir) = ($1, $3, $4, $6); + my ($atype, $aname, $array, $adir) = ($1, $5, $6, $8); $names{$aname} = $argno++; $adir ||= "in"; $atype =~ s/\s+$//; push @arg_name, $aname; + push @arg_type, $atype; if ($adir eq "out") { push @arg_str, "x"; @@ -332,71 +345,173 @@ sub rewrite_func ($$$$$) { } } } + + # Compose the trace macro $trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\", \""; + $argtrace = "H5ARG_TRACE" . scalar(@arg_str) . "(FUNC, \""; $trace .= join("", @arg_str) . "\""; - my $len = 4 + length $trace; + $argtrace .= join("", @arg_str) . "\""; + my $len = 4 + length $trace; # Add 4, for indenting the line for (@arg_name) { - if ($len + length >= 77) { - $trace .= ",\n $_"; - $len = 13 + length; + # Wrap lines that will be longer than the limit, after ');' is added + if ($len + length >= ($max_trace_macro_line_len - 2)) { + # Wrap line, with indention + $trace .= ",\n "; + $len = 13; # Set to 13, for indention + + # Indent an extra space to account for extra digit in 'H5TRACE' macro + if (scalar(@arg_str) >= 10) { + $trace .= " "; + $len++; + } } else { - $trace .= ", $_"; - $len += 1 + length; + $trace .= ", "; + $len += 2; # Add 2, for ', ' } + + # Append argument + $trace .= "$_"; + $argtrace .= ", $_"; + $len += length; # Add length of appended argument name } + + # Append final ');' for macro $trace .= ");\n"; + $argtrace .= ")"; } - goto error if grep {/!/} @arg_str; - - # The H5TRACE() statement - if ($body =~ /\/\*[ \t]*NO[ \t]*TRACE[ \t]*\*\//) { - # Ignored due to NO TRACE comment. - } elsif ($body =~ s/((\n[ \t]*)H5TRACE\d+\s*\(.*?\);)\n/"$2$trace"/es) { - # Replaced an H5TRACE macro. - } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*[ \t]*(\(.*?\))?;??)\n/"$1$2$trace"/es) { - # Added an H5TRACE macro after a FUNC_ENTER macro. - } else { - errmesg $file, $name, "unable to insert tracing information"; - print "body = ", $body, "\n"; - goto error; + + # Check for API / non-API routine name + if( $name =~ /H5[A-Z]{0,2}[a-z].*/) { + # The H5TRACE() statement, for API routines + if ($body =~ /\/\*[ \t]*NO[ \t]*TRACE[ \t]*\*\//) { + # Ignored due to NO TRACE comment. + } else { + # Check for known, but unsupported type + if ( $trace =~ /(^#)|([^*]#)/ ) { + # Check for unsupported return type + if ( $type =~ /(^#)|([^*]#)/ ) { + errmesg $file, $name, "unsupported type in return type\nAdd to TypeString hash in trace script and update H5_trace_args()"; + print "type = '$type'\n"; + } + + # Check for unsupported argument type + $index = 0; + for (@arg_str) { + if ( $_ =~ /(^#)|([^*]#)/ ) { + errmesg $file, $name, "unsupported type in args\nAdd to TypeString hash in trace script and update H5_trace_args()"; + print "type = $arg_type[$index]\n"; + } + $index++; + } + goto error; + } + + # Check for unknown (and therefore unsupported) type + if ( $trace =~ /(^!)|([^*]!)/ ) { + # Check for unsupported return type + if ( $type =~ /(^!)|([^*]!)/ ) { + errmesg $file, $name, "unknown type in return type\nAdd to TypeString hash in trace script and also update H5_trace_args() if used by value"; + print "type = '$type'\n"; + } + + # Check for unsupported argument type + $index = 0; + for (@arg_str) { + if ( $_ =~ /(^!)|([^*]!)/ ) { + errmesg $file, $name, "unknown type in args\nAdd to TypeString hash in trace script and also update H5_trace_args() if used by value"; + print "type = $arg_type[$index]\n"; + } + $index++; + } + goto error; + } + + if ($body =~ s/((\n[ \t]*)H5TRACE\d+\s*\(.*?\);)\n/"$2$trace"/es) { + # Replaced an H5TRACE macro. + } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*[ \t]*(\(.*?\))?;??)\n/"$1$2$trace"/es) { + # Added an H5TRACE macro after a FUNC_ENTER macro. + } else { + errmesg $file, $name, "unable to insert tracing information"; + print "body = ", $body, "\n"; + goto error; + } + } + + #Increment # of API routines modified + $file_api++; + } + + # Check for H5ARG_TRACE macros in non-API routines + if ( $body =~ /H5ARG_TRACE/ ) { + # Check for untraceable type (deferred until $argtrace used) + if ( $argtrace =~ /(^!)|([^*]!)/ ) { + errmesg $file, $name, "untraceable type in args"; + print "args = '$orig_args'\n"; + goto error; + } + + # Replace / update H5ARG_TRACE macro. + $body =~ s/(H5ARG_TRACE(\d+\s*\(.*?\))?)/"$argtrace"/esg; + + #Increment # of non-API routines modified + $file_args++; } - error: - return "\n$type\n$name($args)\n$body"; + return "\n$begin$type$aftertype$name($orig_args)$close$body"; } ############################################################################## # Process each source file, rewriting API functions with updated # tracing information. # -my $total_api = 0; for $file (@ARGV) { + $file_api = 0; + $file_args = 0; + # Ignore some files that do not need tracing macros - unless ($file eq "H5FDmulti.c" or $file eq "src/H5FDmulti.c" or $file eq "H5FDstdio.c" or $file eq "src/H5FDstdio.c") { - + unless ($file eq "H5FDmulti.c" or $file eq "src/H5FDmulti.c" or $file eq "H5FDstdio.c" or $file eq "src/H5FDstdio.c" or $file eq "src/H5TS.c") { + # Snarf up the entire file open SOURCE, $file or die "$file: $!\n"; $Source = join "", ; close SOURCE; - # Make modifications + # Make a copy of the original data my $original = $Source; - my $napi = $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type - (H5[A-Z]{0,2}[^_A-Z0-9]\w*) #name - \s*\((.*?)\)\s* #args - (\{.*?\n\}[^\n]*) #body - /rewrite_func($file,$1,$3,$4,$5)/segx; - $total_api += $napi; + + # Check which style of function declaration is used in this file + if ( $Source =~ /BEGIN_FUNC/ ) { + # Make modifications + $Source =~ s/\n(BEGIN_FUNC.*?\n) #begin + ([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**) #type + (.*?\n) #aftertype + (H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name + \s*\((.*?)\)\s* #args + (\)) #close + (\n.*?\nEND_FUNC\([^\n]*) #body + /rewrite_func($file,$1,$2,$4,$5,$6,$7,$8)/segx; + } else { + # Make modifications + $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type + (H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name + \s*\((.*?)\)\s* #args + (\{.*?\n\}[^\n]*) #body + /rewrite_func($file,"",$1,"\n",$3,$4,"\n",$5)/segx; + } # If the source changed then print out the new version if ($original ne $Source) { - printf "%s: instrumented %d API function%s\n", - $file, $napi, 1==$napi?"":"s"; + printf "%s: instrumented %d API function%s and %d argument list%s\n", + $file, $file_api, (1 == $file_api ? "" : "s"), + $file_args, (1 == $file_args ? "" : "s"); rename $file, "$file~" or die "unable to make backup"; open SOURCE, ">$file" or die "unable to modify source"; print SOURCE $Source; close SOURCE; + + $total_api += $file_api; + $total_args += $file_args; } } } @@ -408,6 +523,9 @@ if ($found_errors eq 1) { printf "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; exit 1; } else { - printf "Finished processing HDF5 API calls\n"; + printf "Finished processing HDF5 API calls:\n"; + printf "\tinstrumented %d API function%s and %d argument list%s\n", + $total_api, (1 == $total_api ? "" : "s"), + $total_args, (1 == $total_args ? "" : "s"); } diff --git a/src/H5.c b/src/H5.c index 50d6dd9..0a572a7 100644 --- a/src/H5.c +++ b/src/H5.c @@ -452,7 +452,7 @@ H5dont_atexit(void) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT_NOERR_NOFS - H5TRACE0("e",""); + H5TRACE0("e", ""); if (H5_dont_atexit_g) ret_value = FAIL; @@ -485,7 +485,7 @@ H5garbage_collect(void) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE0("e",""); + H5TRACE0("e", ""); /* Call the garbage collection routines in the library */ if (H5FL_garbage_coll() < 0) @@ -529,8 +529,8 @@ H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE6("e", "IsIsIsIsIsIs", reg_global_lim, reg_list_lim, arr_global_lim, - arr_list_lim, blk_global_lim, blk_list_lim); + H5TRACE6("e", "IsIsIsIsIsIs", reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, + blk_list_lim); /* Call the free list function to actually set the limits */ if (H5FL_set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, @@ -609,7 +609,7 @@ H5get_alloc_stats(H5_alloc_stats_t *stats) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*x", stats); + H5TRACE1("e", "*Ha", stats); /* Call the internal allocation stat routine to get the values */ if (H5MM_get_alloc_stats(stats) < 0) @@ -954,7 +954,7 @@ H5close(void) * this function for an uninitialized library. */ FUNC_ENTER_API_NOINIT_NOERR_NOFS - H5TRACE0("e",""); + H5TRACE0("e", ""); H5_term_library(); diff --git a/src/H5A.c b/src/H5A.c index 5ba5b67..f16741c 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -350,8 +350,7 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE8("i", "i*s*siiiii", loc_id, obj_name, attr_name, type_id, space_id, - acpl_id, aapl_id, lapl_id); + H5TRACE8("i", "i*s*siiiii", loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id); /* Check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -575,8 +574,7 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE7("i", "i*sIiIohii", loc_id, obj_name, idx_type, order, n, aapl_id, - lapl_id); + H5TRACE7("i", "i*sIiIohii", loc_id, obj_name, idx_type, order, n, aapl_id, lapl_id); /* Check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -905,8 +903,7 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("Zs", "i*sIiIohxzi", loc_id, obj_name, idx_type, order, n, name, size, - lapl_id); + H5TRACE8("Zs", "i*sIiIohxzi", loc_id, obj_name, idx_type, order, n, name, size, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1005,7 +1002,7 @@ H5Aget_info(hid_t attr_id, H5A_info_t *ainfo) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", attr_id, ainfo); + H5TRACE2("e", "i*Ai", attr_id, ainfo); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -1047,7 +1044,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*s*xi", loc_id, obj_name, attr_name, ainfo, lapl_id); + H5TRACE5("e", "i*s*s*Aii", loc_id, obj_name, attr_name, ainfo, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1104,8 +1101,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIoh*xi", loc_id, obj_name, idx_type, order, n, ainfo, - lapl_id); + H5TRACE7("e", "i*sIiIoh*Aii", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1221,8 +1217,7 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*s*si", loc_id, obj_name, old_attr_name, new_attr_name, - lapl_id); + H5TRACE5("e", "i*s*s*si", loc_id, obj_name, old_attr_name, new_attr_name, lapl_id); /* check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1312,7 +1307,7 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *i herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIo*hx*x", loc_id, idx_type, order, idx, op, op_data); + H5TRACE6("e", "iIiIo*hAO*x", loc_id, idx_type, order, idx, op, op_data); /* check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1390,8 +1385,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, obj_name, idx_type, order, idx, op, - op_data, lapl_id); + H5TRACE8("e", "i*sIiIo*hAO*xi", loc_id, obj_name, idx_type, order, idx, op, op_data, lapl_id); /* check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 1ae6cc4..b0b54eb 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -137,8 +137,7 @@ H5FL_DEFINE_STATIC(H5AC_slist_entry_t); *------------------------------------------------------------------------- */ herr_t -H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, - void (*sync_point_done)(unsigned num_writes, haddr_t *written_entries_tbl)) +H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, H5AC_sync_point_done_cb_t sync_point_done) { H5AC_aux_t *aux_ptr; @@ -170,7 +169,7 @@ H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, *------------------------------------------------------------------------- */ herr_t -H5AC__set_write_done_callback(H5C_t *cache_ptr, void (*write_done)(void)) +H5AC__set_write_done_callback(H5C_t *cache_ptr, H5AC_write_done_cb_t write_done) { H5AC_aux_t *aux_ptr; diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 7da46a0..521f85a 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -401,7 +401,12 @@ typedef struct H5AC_aux_t { unsigned p0_image_len; } H5AC_aux_t; /* struct H5AC_aux_t */ -#endif /* H5_HAVE_PARALLEL */ + +/* Typedefs for debugging function pointers */ +typedef void (*H5AC_sync_point_done_cb_t)(unsigned num_writes, haddr_t *written_entries_tbl); +typedef void (*H5AC_write_done_cb_t)(void); + +#endif /* H5_HAVE_PARALLEL */ /******************************/ /* Package Private Prototypes */ @@ -417,10 +422,8 @@ H5_DLL herr_t H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr); H5_DLL herr_t H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr); H5_DLL herr_t H5AC__flush_entries(H5F_t *f); H5_DLL herr_t H5AC__run_sync_point(H5F_t *f, int sync_point_op); -H5_DLL herr_t H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, - void (*sync_point_done)(unsigned num_writes, - haddr_t *written_entries_tbl)); -H5_DLL herr_t H5AC__set_write_done_callback(H5C_t *cache_ptr, void (*write_done)(void)); +H5_DLL herr_t H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, H5AC_sync_point_done_cb_t sync_point_done); +H5_DLL herr_t H5AC__set_write_done_callback(H5C_t *cache_ptr, H5AC_write_done_cb_t write_done); #endif /* H5_HAVE_PARALLEL */ #endif /* H5ACpkg_H */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 9e441eb..ba12d4c 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -379,7 +379,7 @@ H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) herr_t ret_value; /* Return value */ FUNC_ENTER_API(H5_ITER_ERROR) - H5TRACE4("e", "i*Iux*x", loc_id, attr_num, op, op_data); + H5TRACE4("e", "i*IuAo*x", loc_id, attr_num, op, op_data); /* check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) diff --git a/src/H5Clog.c b/src/H5Clog.c index 6fb24ca..14b37d4 100644 --- a/src/H5Clog.c +++ b/src/H5Clog.c @@ -269,8 +269,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_get_logging_status(const H5C_t *cache, /*OUT*/ hbool_t *is_enabled, - /*OUT*/ hbool_t *is_currently_logging) +H5C_get_logging_status(const H5C_t *cache, hbool_t *is_enabled, hbool_t *is_currently_logging) { FUNC_ENTER_NOAPI_NOERR diff --git a/src/H5Ctag.c b/src/H5Ctag.c index 75175ae..a3f04e8 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -885,7 +885,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_get_tag(const void *thing, haddr_t *tag /*OUT*/) +H5C_get_tag(const void *thing, haddr_t *tag) { const H5C_cache_entry_t *entry = (const H5C_cache_entry_t *)thing; /* Pointer to cache entry */ diff --git a/src/H5D.c b/src/H5D.c index c64452d..d60465e 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -96,8 +96,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE7("i", "i*siiiii", loc_id, name, type_id, space_id, lcpl_id, dcpl_id, - dapl_id); + H5TRACE7("i", "i*siiiii", loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id); /* Check arguments */ if (!name) @@ -662,7 +661,7 @@ H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *op herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "*xiix*x", buf, type_id, space_id, op, operator_data); + H5TRACE5("e", "*xiiDO*x", buf, type_id, space_id, op, operator_data); /* Check args */ if (NULL == op) @@ -1052,8 +1051,7 @@ H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *of herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE7("e", "iih*h*Iu*a*h", dset_id, fspace_id, chk_index, offset, - filter_mask, addr, size); + H5TRACE7("e", "iih*h*Iu*a*h", dset_id, fspace_id, chk_index, offset, filter_mask, addr, size); /* Check arguments */ if (NULL == offset && NULL == filter_mask && NULL == addr && NULL == size) diff --git a/src/H5Dio.c b/src/H5Dio.c index 108c3aa..75727a9 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -155,8 +155,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_i herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iiiiix", dset_id, mem_type_id, mem_space_id, file_space_id, - dxpl_id, buf); + H5TRACE6("e", "iiiiix", dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf); /* Check arguments */ if (mem_space_id < 0) @@ -274,8 +273,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iiiii*x", dset_id, mem_type_id, mem_space_id, file_space_id, - dxpl_id, buf); + H5TRACE6("e", "iiiii*x", dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf); /* Check arguments */ if (mem_space_id < 0) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index f134a2e..16a8221 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -207,6 +207,9 @@ typedef struct H5D_filtered_collective_io_info_t { } async_info; } H5D_filtered_collective_io_info_t; +/* Function pointer typedef for sort function */ +typedef int (*H5D_mpio_sort_func_cb_t)(const void *, const void *); + /********************/ /* Local Prototypes */ /********************/ @@ -527,7 +530,7 @@ done: static herr_t H5D__mpio_array_gatherv(void *local_array, size_t local_array_num_entries, size_t array_entry_size, void **_gathered_array, size_t *_gathered_array_num_entries, hbool_t allgather, - int root, MPI_Comm comm, int (*sort_func)(const void *, const void *)) + int root, MPI_Comm comm, H5D_mpio_sort_func_cb_t sort_func) { size_t gathered_array_num_entries = 0; /* The size of the newly-constructed array */ void * gathered_array = NULL; /* The newly-constructed array returned to the caller */ diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index a477f5d..e8b70e3 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -930,7 +930,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "x*xii*x", op, op_data, type_id, dst_space_id, dst_buf); + H5TRACE5("e", "DS*xii*x", op, op_data, type_id, dst_space_id, dst_buf); /* Check args */ if (op == NULL) @@ -1026,8 +1026,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*xiz*xx*x", src_space_id, src_buf, type_id, dst_buf_size, - dst_buf, op, op_data); + H5TRACE7("e", "i*xiz*xDg*x", src_space_id, src_buf, type_id, dst_buf_size, dst_buf, op, op_data); /* Check args */ if (NULL == (src_space = (H5S_t *)H5I_object_verify(src_space_id, H5I_DATASPACE))) diff --git a/src/H5E.c b/src/H5E.c index 203e0ce..7fc4559 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -877,7 +877,7 @@ H5Ecreate_stack(void) hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE0("i",""); + H5TRACE0("i", ""); /* Allocate a new error stack */ if (NULL == (stk = H5FL_CALLOC(H5E_t))) @@ -916,7 +916,7 @@ H5Eget_current_stack(void) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5I_INVALID_HID) - H5TRACE0("i",""); + H5TRACE0("i", ""); /* Get the current stack */ if (NULL == (stk = H5E__get_current_stack())) @@ -1335,8 +1335,7 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(FAIL) - H5TRACE8("e", "i*s*sIuiii*s", err_stack, file, func, line, cls_id, maj_id, - min_id, fmt); + H5TRACE8("e", "i*s*sIuiii*s", err_stack, file, func, line, cls_id, maj_id, min_id, fmt); if (err_stack == H5E_DEFAULT) estack = NULL; @@ -1564,7 +1563,7 @@ H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func, void **client_data) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", estack_id, func, client_data); + H5TRACE3("e", "i*EA**x", estack_id, func, client_data); if (estack_id == H5E_DEFAULT) { if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in @@ -1622,7 +1621,7 @@ H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(FAIL) - H5TRACE3("e", "ix*x", estack_id, func, client_data); + H5TRACE3("e", "iEA*x", estack_id, func, client_data); if (estack_id == H5E_DEFAULT) { if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index c8b147d..cf20cfe 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -231,7 +231,7 @@ H5Eclear1(void) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(FAIL) - H5TRACE0("e",""); + H5TRACE0("e", ""); /* Clear the default error stack */ if (H5E_clear_stack(NULL) < 0) @@ -342,7 +342,7 @@ H5Eget_auto1(H5E_auto1_t *func, void **client_data) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "*x**x", func, client_data); + H5TRACE2("e", "*Ea**x", func, client_data); /* Retrieve default error stack */ if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in @@ -396,7 +396,7 @@ H5Eset_auto1(H5E_auto1_t func, void *client_data) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(FAIL) - H5TRACE2("e", "x*x", func, client_data); + H5TRACE2("e", "Ea*x", func, client_data); if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ diff --git a/src/H5F.c b/src/H5F.c index 95e218f..99e352e 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1055,7 +1055,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", file_id, config_ptr); + H5TRACE2("e", "i*Cc", file_id, config_ptr); /* Check args */ if ((NULL == config_ptr) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) @@ -1092,7 +1092,7 @@ H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", file_id, config_ptr); + H5TRACE2("e", "i*Cc", file_id, config_ptr); /* Get the file object */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) @@ -1164,8 +1164,7 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*z*z*z*Is", file_id, max_size_ptr, min_clean_size_ptr, - cur_size_ptr, cur_num_entries_ptr); + H5TRACE5("e", "i*z*z*z*Is", file_id, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1287,7 +1286,7 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", obj_id, finfo); + H5TRACE2("e", "i*FI", obj_id, finfo); /* Check args */ if (!finfo) @@ -1329,7 +1328,7 @@ H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", file_id, info); + H5TRACE2("e", "i*!", file_id, info); /* Check args */ if (!info) @@ -1698,8 +1697,7 @@ H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2 herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "i*Iu*Iu*Iu*Iu*Iu", file_id, accesses, hits, misses, evictions, - bypasses); + H5TRACE6("e", "i*Iu*Iu*Iu*Iu*Iu", file_id, accesses, hits, misses, evictions, bypasses); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) diff --git a/src/H5FD.c b/src/H5FD.c index d3ece17..1e9274f 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -226,7 +226,7 @@ H5FDregister(const H5FD_class_t *cls) hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE1("i", "*x", cls); + H5TRACE1("i", "*FC", cls); /* Check arguments */ if (!cls) @@ -652,7 +652,7 @@ H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5FD_t *ret_value = NULL; FUNC_ENTER_API(NULL) - H5TRACE4("*x", "*sIuia", name, flags, fapl_id, maxaddr); + H5TRACE4("*#", "*sIuia", name, flags, fapl_id, maxaddr); /* Check arguments */ if (H5P_DEFAULT == fapl_id) @@ -888,7 +888,7 @@ H5FDclose(H5FD_t *file) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*x", file); + H5TRACE1("e", "*#", file); /* Check arguments */ if (!file) @@ -979,7 +979,7 @@ H5FDcmp(const H5FD_t *f1, const H5FD_t *f2) int ret_value = -1; FUNC_ENTER_API(-1) /* return value is arbitrary */ - H5TRACE2("Is", "*x*x", f1, f2); + H5TRACE2("Is", "*#*#", f1, f2); /* Call private function */ ret_value = H5FD_cmp(f1, f2); @@ -1049,7 +1049,7 @@ H5FDquery(const H5FD_t *file, unsigned long *flags /*out*/) int ret_value = 0; FUNC_ENTER_API((-1)) - H5TRACE2("Is", "*xx", file, flags); + H5TRACE2("Is", "*#x", file, flags); /* Check arguments */ if (!file) @@ -1142,7 +1142,7 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_API(HADDR_UNDEF) - H5TRACE4("a", "*xMtih", file, type, dxpl_id, size); + H5TRACE4("a", "*#Mtih", file, type, dxpl_id, size); /* Check arguments */ if (!file) @@ -1192,7 +1192,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "*xMtiah", file, type, dxpl_id, addr, size); + H5TRACE5("e", "*#Mtiah", file, type, dxpl_id, addr, size); /* Check arguments */ if (!file) @@ -1235,7 +1235,7 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type) haddr_t ret_value; FUNC_ENTER_API(HADDR_UNDEF) - H5TRACE2("a", "*xMt", file, type); + H5TRACE2("a", "*#Mt", file, type); /* Check arguments */ if (!file) @@ -1283,7 +1283,7 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xMta", file, type, addr); + H5TRACE3("e", "*#Mta", file, type, addr); /* Check arguments */ if (!file) @@ -1331,7 +1331,7 @@ H5FDget_eof(H5FD_t *file, H5FD_mem_t type) haddr_t ret_value; FUNC_ENTER_API(HADDR_UNDEF) - H5TRACE2("a", "*xMt", file, type); + H5TRACE2("a", "*#Mt", file, type); /* Check arguments */ if (!file) @@ -1482,7 +1482,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "*xMtiazx", file, type, dxpl_id, addr, size, buf); + H5TRACE6("e", "*#Mtiazx", file, type, dxpl_id, addr, size, buf); /* Check arguments */ if (!file) @@ -1528,7 +1528,7 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "*xMtiaz*x", file, type, dxpl_id, addr, size, buf); + H5TRACE6("e", "*#Mtiaz*x", file, type, dxpl_id, addr, size, buf); /* Check arguments */ if (!file) @@ -1572,7 +1572,7 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xib", file, dxpl_id, closing); + H5TRACE3("e", "*#ib", file, dxpl_id, closing); /* Check arguments */ if (!file) @@ -1639,7 +1639,7 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xib", file, dxpl_id, closing); + H5TRACE3("e", "*#ib", file, dxpl_id, closing); /* Check arguments */ if (!file) @@ -1705,7 +1705,7 @@ H5FDlock(H5FD_t *file, hbool_t rw) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "*xb", file, rw); + H5TRACE2("e", "*#b", file, rw); /* Check arguments */ if (!file) @@ -1764,7 +1764,7 @@ H5FDunlock(H5FD_t *file) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*x", file); + H5TRACE1("e", "*#", file); /* Check arguments */ if (!file) @@ -1850,7 +1850,7 @@ H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xi**x", file, fapl_id, file_handle); + H5TRACE3("e", "*#i**x", file, fapl_id, file_handle); /* Check arguments */ if (!file) diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 6599b9b..4cccaed 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -625,7 +625,7 @@ H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa) herr_t ret_value = FAIL; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa); + H5TRACE2("e", "i*#", fapl_id, fa); HDassert(fa != NULL); @@ -721,7 +721,7 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa_out); + H5TRACE2("e", "i*#", fapl_id, fa_out); #if HDFS_DEBUG HDfprintf(stdout, "H5Pget_fapl_hdfs() called.\n"); @@ -1537,7 +1537,7 @@ H5FD_hdfs_cmp(const H5FD_t H5_ATTR_UNUSED *_f1, const H5FD_t H5_ATTR_UNUSED *_f2 *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) /* out variable */ +H5FD_hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1545,7 +1545,8 @@ H5FD_hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) /* out HDfprintf(stdout, "H5FD_hdfs_query() called.\n"); #endif - if (flags) { + if (flags) +{ *flags = 0; *flags |= H5FD_FEAT_DATA_SIEVE; } @@ -1804,10 +1805,8 @@ done: #ifdef H5_HAVE_LIBHDFS static herr_t -H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, /* start offset */ - size_t size, /* length of read */ - void * buf) /* out */ +H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, + size_t size, void *buf) { herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; @@ -1831,7 +1830,8 @@ H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS filesize = (size_t)file->hdfs_handle->fileinfo->mSize; - if ((addr > filesize) || ((addr + size) > filesize)) { + if ((addr > filesize) || ((addr + size) > filesize)) +{ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address") } diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index 578108d..2b4b158 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -1197,7 +1197,7 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa_out); + H5TRACE2("e", "i*#", fapl_id, fa_out); LOG_OP_CALL("H5Pget_fapl_mirror"); @@ -1243,7 +1243,7 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa) herr_t ret_value = FAIL; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa); + H5TRACE2("e", "i*#", fapl_id, fa); LOG_OP_CALL("H5Pset_fapl_mirror"); diff --git a/src/H5FDros3.c b/src/H5FDros3.c index 52f5134..5153c34 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -398,7 +398,7 @@ H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa) herr_t ret_value = FAIL; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa); + H5TRACE2("e", "i*#", fapl_id, fa); HDassert(fa != NULL); @@ -493,7 +493,7 @@ H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa_out); + H5TRACE2("e", "i*#", fapl_id, fa_out); #if ROS3_DEBUG HDfprintf(stdout, "H5Pget_fapl_ros3() called.\n"); @@ -1538,10 +1538,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, /* start offset */ - size_t size, /* length of read */ - void * buf) /* out */ +H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, + size_t size, void *buf) { H5FD_ros3_t *file = (H5FD_ros3_t *)_file; size_t filesize = 0; @@ -1564,7 +1562,8 @@ H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS filesize = H5FD_s3comms_s3r_get_filesize(file->s3r_handle); - if ((addr > filesize) || ((addr + size) > filesize)) { + if ((addr > filesize) || ((addr + size) > filesize)) +{ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address") } diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 05d2c05..790b953 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -306,7 +306,7 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) H5Eclear2(H5E_DEFAULT); FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Dr", fapl_id, vfd_config); + H5TRACE2("e", "i*#", fapl_id, vfd_config); H5FD_SPLITTER_LOG_CALL("H5Pset_fapl_splitter"); @@ -398,7 +398,7 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Dr", fapl_id, config_out); + H5TRACE2("e", "i*#", fapl_id, config_out); H5FD_SPLITTER_LOG_CALL("H5Pget_fapl_splitter"); diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 4474f50..0bd56b3 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -95,7 +95,7 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", obj_id, finfo); + H5TRACE2("e", "i*!", obj_id, finfo); /* Check args */ if (!finfo) diff --git a/src/H5G.c b/src/H5G.c index b1596fd..05fc891 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -574,7 +574,7 @@ H5Gget_info(hid_t loc_id, H5G_info_t *group_info) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", loc_id, group_info); + H5TRACE2("e", "i*!", loc_id, group_info); /* Check args */ id_type = H5I_get_type(loc_id); @@ -616,7 +616,7 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *group_info, hid_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*s*xi", loc_id, name, group_info, lapl_id); + H5TRACE4("e", "i*s*!i", loc_id, name, group_info, lapl_id); /* Check args */ if (!name) @@ -668,8 +668,7 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5 herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, group_info, - lapl_id); + H5TRACE7("e", "i*sIiIoh*!i", loc_id, group_name, idx_type, order, n, group_info, lapl_id); /* Check args */ if (!group_name) diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 412f97b..87d3fdd 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -800,7 +800,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, void *o herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*Isx*x", loc_id, name, idx_p, op, op_data); + H5TRACE5("e", "i*s*IsGi*x", loc_id, name, idx_p, op, op_data); /* Check args */ if (!name || !*name) diff --git a/src/H5I.c b/src/H5I.c index dba1ded..c9bad09 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -218,7 +218,7 @@ H5Iregister_type(size_t H5_ATTR_DEBUG_API_USED hash_size, unsigned reserved, H5I H5I_type_t ret_value = H5I_BADID; /* Return value */ FUNC_ENTER_API(H5I_BADID) - H5TRACE3("It", "zIux", hash_size, reserved, free_func); + H5TRACE3("It", "zIuIf", hash_size, reserved, free_func); /* Generate a new H5I_type_t value */ @@ -1906,7 +1906,7 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) void * ret_value; /* Return value */ FUNC_ENTER_API(NULL) - H5TRACE3("*x", "Itx*x", type, func, key); + H5TRACE3("*x", "ItIS*x", type, func, key); /* Check arguments */ if (H5I_IS_LIB_TYPE(type)) @@ -1998,7 +1998,7 @@ H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data) herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "Itx*x", type, op, op_data); + H5TRACE3("e", "ItII*x", type, op, op_data); /* Set up udata struct */ int_udata.op = op; diff --git a/src/H5L.c b/src/H5L.c index 7d8ec32..3284a12 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -267,8 +267,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *ds herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, - lapl_id); + H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, lapl_id); /* Check arguments */ if (src_loc_id == H5L_SAME_LOC && dst_loc_id == H5L_SAME_LOC) @@ -358,8 +357,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *ds herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, - lapl_id); + H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, lapl_id); /* Check arguments */ if (src_loc_id == H5L_SAME_LOC && dst_loc_id == H5L_SAME_LOC) @@ -524,8 +522,7 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, hid_t new_loc_id, const c herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "i*si*sii", cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, - lapl_id); + H5TRACE6("e", "i*si*sii", cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, lapl_id); /* Check arguments */ if (cur_loc_id == H5L_SAME_LOC && new_loc_id == H5L_SAME_LOC) @@ -625,8 +622,7 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, con herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sLl*xzii", link_loc_id, link_name, link_type, udata, - udata_size, lcpl_id, lapl_id); + H5TRACE7("e", "i*sLl*xzii", link_loc_id, link_name, link_type, udata, udata_size, lcpl_id, lapl_id); /* Check arguments */ if (!link_name || !*link_name) @@ -864,8 +860,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, buf, size, - lapl_id); + H5TRACE8("e", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, buf, size, lapl_id); /* Check arguments */ if (!group_name || !*group_name) @@ -1023,8 +1018,7 @@ H5Lget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo, - lapl_id); + H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo, lapl_id); /* Check arguments */ if (!group_name || !*group_name) @@ -1084,7 +1078,7 @@ H5Lregister(const H5L_class_t *cls) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*x", cls); + H5TRACE1("e", "*#", cls); /* Check args */ if (cls == NULL) @@ -1221,8 +1215,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5 ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE8("Zs", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, name, size, - lapl_id); + H5TRACE8("Zs", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, name, size, lapl_id); /* Check arguments */ if (!group_name || !*group_name) @@ -1286,7 +1279,7 @@ H5Literate2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIo*hx*x", group_id, idx_type, order, idx_p, op, op_data); + H5TRACE6("e", "iIiIo*hLI*x", group_id, idx_type, order, idx_p, op, op_data); /* Check arguments */ id_type = H5I_get_type(group_id); @@ -1348,8 +1341,7 @@ H5Literate_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, group_name, idx_type, order, idx_p, op, - op_data, lapl_id); + H5TRACE8("e", "i*sIiIo*hLI*xi", loc_id, group_name, idx_type, order, idx_p, op, op_data, lapl_id); /* Check arguments */ if (!group_name) @@ -1423,7 +1415,7 @@ H5Lvisit2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterat herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIiIox*x", group_id, idx_type, order, op, op_data); + H5TRACE5("e", "iIiIoLI*x", group_id, idx_type, order, op, op_data); /* Check args */ id_type = H5I_get_type(group_id); @@ -1490,8 +1482,7 @@ H5Lvisit_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIox*xi", loc_id, group_name, idx_type, order, op, op_data, - lapl_id); + H5TRACE7("e", "i*sIiIoLI*xi", loc_id, group_name, idx_type, order, op, op_data, lapl_id); /* Check args */ if (!group_name) diff --git a/src/H5Ldeprec.c b/src/H5Ldeprec.c index c4501e9..bed0566 100644 --- a/src/H5Ldeprec.c +++ b/src/H5Ldeprec.c @@ -149,7 +149,7 @@ H5Literate1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIo*hx*x", group_id, idx_type, order, idx_p, op, op_data); + H5TRACE6("e", "iIiIo*hLi*x", group_id, idx_type, order, idx_p, op, op_data); /* Check arguments */ id_type = H5I_get_type(group_id); @@ -226,8 +226,7 @@ H5Literate_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, group_name, idx_type, order, idx_p, op, - op_data, lapl_id); + H5TRACE8("e", "i*sIiIo*hLi*xi", loc_id, group_name, idx_type, order, idx_p, op, op_data, lapl_id); /* Check arguments */ if (!group_name) @@ -384,8 +383,7 @@ H5Lget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo, - lapl_id); + H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo, lapl_id); /* Check arguments */ if (!group_name || !*group_name) @@ -489,7 +487,7 @@ H5Lvisit1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterat herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIiIox*x", group_id, idx_type, order, op, op_data); + H5TRACE5("e", "iIiIoLi*x", group_id, idx_type, order, op, op_data); /* Check args */ id_type = H5I_get_type(group_id); @@ -572,8 +570,7 @@ H5Lvisit_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIox*xi", loc_id, group_name, idx_type, order, op, op_data, - lapl_id); + H5TRACE7("e", "i*sIiIoLi*xi", loc_id, group_name, idx_type, order, op, op_data, lapl_id); /* Check args */ if (!group_name) diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 801b8ba..9cc8ffa 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -349,8 +349,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_i herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "*s*si*sii", file_name, obj_name, link_loc_id, link_name, - lcpl_id, lapl_id); + H5TRACE6("e", "*s*si*sii", file_name, obj_name, link_loc_id, link_name, lcpl_id, lapl_id); /* Check arguments */ if (!file_name || !*file_name) @@ -473,8 +472,7 @@ H5Lunpack_elink_val(const void *_ext_linkval, size_t link_size, unsigned *flags, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "*xz*Iu**s**s", _ext_linkval, link_size, flags, filename, - obj_path); + H5TRACE5("e", "*xz*Iu**s**s", _ext_linkval, link_size, flags, filename, obj_path); /* Sanity check external link buffer */ if (ext_linkval == NULL) diff --git a/src/H5M.c b/src/H5M.c index fdd1e0f..dc85812 100644 --- a/src/H5M.c +++ b/src/H5M.c @@ -246,8 +246,7 @@ H5Mcreate(hid_t loc_id, const char *name, hid_t key_type_id, hid_t val_type_id, hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE7("i", "i*siiiii", loc_id, name, key_type_id, val_type_id, lcpl_id, - mcpl_id, mapl_id); + H5TRACE7("i", "i*siiiii", loc_id, name, key_type_id, val_type_id, lcpl_id, mcpl_id, mapl_id); /* Check arguments */ if (!name) @@ -672,8 +671,7 @@ H5Mput(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "ii*xi*xi", map_id, key_mem_type_id, key, val_mem_type_id, value, - dxpl_id); + H5TRACE6("e", "ii*xi*xi", map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id); /* Check arguments */ if (key_mem_type_id < 0) @@ -730,8 +728,7 @@ H5Mget(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "ii*xi*xi", map_id, key_mem_type_id, key, val_mem_type_id, value, - dxpl_id); + H5TRACE6("e", "ii*xi*xi", map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id); /* Check arguments */ if (key_mem_type_id < 0) @@ -848,7 +845,7 @@ H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "i*hix*xi", map_id, idx, key_mem_type_id, op, op_data, dxpl_id); + H5TRACE6("e", "i*hiMI*xi", map_id, idx, key_mem_type_id, op, op_data, dxpl_id); /* Check arguments */ if (key_mem_type_id < 0) @@ -922,8 +919,7 @@ H5Miterate_by_name(hid_t loc_id, const char *map_name, hsize_t *idx, hid_t key_m herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*s*hix*xii", loc_id, map_name, idx, key_mem_type_id, op, - op_data, dxpl_id, lapl_id); + H5TRACE8("e", "i*s*hiMI*xii", loc_id, map_name, idx, key_mem_type_id, op, op_data, dxpl_id, lapl_id); /* Check arguments */ if (!map_name) diff --git a/src/H5O.c b/src/H5O.c index 97fe10a..10fb35d 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -529,7 +529,7 @@ H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo, unsigned fields) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*xIu", loc_id, oinfo, fields); + H5TRACE3("e", "i*!Iu", loc_id, oinfo, fields); /* Check args */ if (!oinfo) @@ -574,7 +574,7 @@ H5Oget_info_by_name3(hid_t loc_id, const char *name, H5O_info2_t *oinfo, unsigne herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*xIui", loc_id, name, oinfo, fields, lapl_id); + H5TRACE5("e", "i*s*!Iui", loc_id, name, oinfo, fields, lapl_id); /* Check args */ if (!name) @@ -632,8 +632,7 @@ H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIoh*xIui", loc_id, group_name, idx_type, order, n, oinfo, - fields, lapl_id); + H5TRACE8("e", "i*sIiIoh*!Iui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -692,7 +691,7 @@ H5Oget_native_info(hid_t loc_id, H5O_native_info_t *oinfo, unsigned fields) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*xIu", loc_id, oinfo, fields); + H5TRACE3("e", "i*!Iu", loc_id, oinfo, fields); /* Check args */ if (!oinfo) @@ -738,7 +737,7 @@ H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oi herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*xIui", loc_id, name, oinfo, fields, lapl_id); + H5TRACE5("e", "i*s*!Iui", loc_id, name, oinfo, fields, lapl_id); /* Check args */ if (!name) @@ -796,8 +795,7 @@ H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_t herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIoh*xIui", loc_id, group_name, idx_type, order, n, oinfo, - fields, lapl_id); + H5TRACE8("e", "i*sIiIoh*!Iui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -1078,7 +1076,7 @@ H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2 herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIox*xIu", obj_id, idx_type, order, op, op_data, fields); + H5TRACE6("e", "iIiIoOI*xIu", obj_id, idx_type, order, op, op_data, fields); /* Check args */ if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) @@ -1152,8 +1150,7 @@ H5Ovisit_by_name3(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIox*xIui", loc_id, obj_name, idx_type, order, op, op_data, - fields, lapl_id); + H5TRACE8("e", "i*sIiIoOI*xIui", loc_id, obj_name, idx_type, order, op, op_data, fields, lapl_id); /* Check args */ if (!obj_name) diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 2f88a43..d28590f 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -195,8 +195,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *ds herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, - ocpypl_id, lcpl_id); + H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, ocpypl_id, lcpl_id); /* Check arguments */ if (!src_name || !*src_name) diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c index c8c373f..9e75e61 100644 --- a/src/H5Odeprec.c +++ b/src/H5Odeprec.c @@ -392,7 +392,7 @@ H5Oget_info1(hid_t loc_id, H5O_info1_t *oinfo) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", loc_id, oinfo); + H5TRACE2("e", "i*!", loc_id, oinfo); /* Check args */ if (!oinfo) @@ -432,7 +432,7 @@ H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo, hid_t l herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*s*xi", loc_id, name, oinfo, lapl_id); + H5TRACE4("e", "i*s*!i", loc_id, name, oinfo, lapl_id); /* Check args */ if (!name) @@ -487,8 +487,7 @@ H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, oinfo, - lapl_id); + H5TRACE7("e", "i*sIiIoh*!i", loc_id, group_name, idx_type, order, n, oinfo, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -547,7 +546,7 @@ H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo, unsigned fields) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*xIu", loc_id, oinfo, fields); + H5TRACE3("e", "i*!Iu", loc_id, oinfo, fields); /* Check args */ if (!oinfo) @@ -602,7 +601,7 @@ H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo, unsigne herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*xIui", loc_id, name, oinfo, fields, lapl_id); + H5TRACE5("e", "i*s*!Iui", loc_id, name, oinfo, fields, lapl_id); /* Check args */ if (!name) @@ -670,8 +669,7 @@ H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIoh*xIui", loc_id, group_name, idx_type, order, n, oinfo, - fields, lapl_id); + H5TRACE8("e", "i*sIiIoh*!Iui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -758,7 +756,7 @@ H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1 herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIiIox*x", obj_id, idx_type, order, op, op_data); + H5TRACE5("e", "iIiIoOi*x", obj_id, idx_type, order, op, op_data); /* Check args */ if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) @@ -833,8 +831,7 @@ H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIox*xi", loc_id, obj_name, idx_type, order, op, op_data, - lapl_id); + H5TRACE7("e", "i*sIiIoOi*xi", loc_id, obj_name, idx_type, order, op, op_data, lapl_id); /* Check args */ if (!obj_name) @@ -923,7 +920,7 @@ H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1 herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIox*xIu", obj_id, idx_type, order, op, op_data, fields); + H5TRACE6("e", "iIiIoOi*xIu", obj_id, idx_type, order, op, op_data, fields); /* Check args */ if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) @@ -1012,8 +1009,7 @@ H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIox*xIui", loc_id, obj_name, idx_type, order, op, op_data, - fields, lapl_id); + H5TRACE8("e", "i*sIiIoOi*xIui", loc_id, obj_name, idx_type, order, op, op_data, fields, lapl_id); /* Check args */ if (!obj_name) diff --git a/src/H5P.c b/src/H5P.c index a72d2f8..5774f55 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -173,8 +173,8 @@ H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE8("i", "i*sx*xx*xx*x", parent, name, cls_create, create_data, cls_copy, - copy_data, cls_close, close_data); + H5TRACE8("i", "i*sPc*xPo*xPl*x", parent, name, cls_create, create_data, cls_copy, copy_data, cls_close, + close_data); /* Check arguments. */ if (H5P_DEFAULT != parent && (H5I_GENPROP_CLS != H5I_get_type(parent))) @@ -414,8 +414,8 @@ H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_p herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE11("e", "i*sz*xxxxxxxx", cls_id, name, size, def_value, prp_create, - prp_set, prp_get, prp_delete, prp_copy, prp_cmp, prp_close); + H5TRACE11("e", "i*sz*xPCPSPGPDPOPMPL", cls_id, name, size, def_value, prp_create, prp_set, prp_get, + prp_delete, prp_copy, prp_cmp, prp_close); /* Check arguments. */ if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS))) @@ -598,8 +598,8 @@ H5Pinsert2(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_s herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE10("e", "i*sz*xxxxxxx", plist_id, name, size, value, prp_set, prp_get, - prp_delete, prp_copy, prp_cmp, prp_close); + H5TRACE10("e", "i*sz*xPSPGPDPOPMPL", plist_id, name, size, value, prp_set, prp_get, prp_delete, prp_copy, + prp_cmp, prp_close); /* Check arguments. */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) @@ -1199,7 +1199,7 @@ H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) int ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("Is", "i*Isx*x", id, idx, iter_func, iter_data); + H5TRACE4("Is", "i*IsPi*x", id, idx, iter_func, iter_data); /* Check arguments. */ if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 65da2bc..a7a541c 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -1292,7 +1292,7 @@ H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t *boundary, H5D herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIu*hx*x", plist_id, ndims, boundary, func, udata); + H5TRACE5("e", "iIu*hDA*x", plist_id, ndims, boundary, func, udata); /* Check arguments */ if (0 == ndims) @@ -1353,7 +1353,7 @@ H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_appe herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIu*h*x**x", plist_id, ndims, boundary, func, udata); + H5TRACE5("e", "iIu*h*DA**x", plist_id, ndims, boundary, func, udata); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 73366a8..63402e2 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -2266,8 +2266,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "ii*s*si", dcpl_id, vspace_id, src_file_name, src_dset_name, - src_space_id); + H5TRACE5("e", "ii*s*si", dcpl_id, vspace_id, src_file_name, src_dset_name, src_space_id); /* Check arguments */ if (!src_file_name) diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index b5129a9..41eb05e 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -220,8 +220,8 @@ H5Pregister1(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_p herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE10("e", "i*sz*xxxxxxx", cls_id, name, size, def_value, prp_create, - prp_set, prp_get, prp_delete, prp_copy, prp_close); + H5TRACE10("e", "i*sz*xPCPSPGPDPOPL", cls_id, name, size, def_value, prp_create, prp_set, prp_get, + prp_delete, prp_copy, prp_close); /* Check arguments. */ if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS))) @@ -404,8 +404,8 @@ H5Pinsert1(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_s herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE9("e", "i*sz*xxxxxx", plist_id, name, size, value, prp_set, prp_get, - prp_delete, prp_copy, prp_close); + H5TRACE9("e", "i*sz*xPSPGPDPOPL", plist_id, name, size, value, prp_set, prp_get, prp_delete, prp_copy, + prp_close); /* Check arguments. */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) @@ -545,7 +545,7 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "iFfh", plist_id, strategy, threshold); + H5TRACE3("e", "iFth", plist_id, strategy, threshold); if ((unsigned)in_strategy >= H5F_FILE_SPACE_NTYPES) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid strategy") @@ -614,7 +614,7 @@ H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy, hsize_t *thre herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*Ff*h", plist_id, strategy, threshold); + H5TRACE3("e", "i*Ft*h", plist_id, strategy, threshold); /* Get current file space info */ if (H5Pget_file_space_strategy(plist_id, &new_strategy, &new_persist, &new_threshold) < 0) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 53159ac..9c08727 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -1316,7 +1316,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) H5Z_cb_t cb_struct; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", plist_id, func, op_data); + H5TRACE3("e", "iZF*x", plist_id, func, op_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1357,7 +1357,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat H5T_conv_cb_t cb_struct; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", plist_id, op, operate_data); + H5TRACE3("e", "iTE*x", plist_id, op, operate_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1398,7 +1398,7 @@ H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op, void **operate_d herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", plist_id, op, operate_data); + H5TRACE3("e", "i*TE**x", plist_id, op, operate_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1583,8 +1583,7 @@ H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func, void *alloc_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "ix*xx*x", plist_id, alloc_func, alloc_info, free_func, - free_info); + H5TRACE5("e", "iMa*xMf*x", plist_id, alloc_func, alloc_info, free_func, free_info); /* Check arguments */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -2027,8 +2026,7 @@ H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_ca herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*Iu*Iu", plist_id, local_no_collective_cause, - global_no_collective_cause); + H5TRACE3("e", "i*Iu*Iu", plist_id, local_no_collective_cause, global_no_collective_cause); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 55a4624..e2db3e4 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -1705,8 +1705,7 @@ H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, size_t rdcc_nslots, herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIszzd", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, - rdcc_w0); + H5TRACE5("e", "iIszzd", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Check arguments */ if (rdcc_w0 < (double)0.0f || rdcc_w0 > (double)1.0f) @@ -1752,8 +1751,7 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nslots, size_t *rdcc_ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*Is*z*z*d", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, - rdcc_w0); + H5TRACE5("e", "i*Is*z*z*d", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -1799,7 +1797,7 @@ H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "i*CC", plist_id, config_ptr); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -1846,7 +1844,7 @@ H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "i*CC", plist_id, config_ptr); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -1892,7 +1890,7 @@ H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "i*Cc", plist_id, config_ptr); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -1939,7 +1937,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "i*Cc", plist_id, config_ptr); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2846,7 +2844,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, callbacks_ptr); + H5TRACE2("e", "i*DI", fapl_id, callbacks_ptr); /* Get the plist structure */ if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -2922,7 +2920,7 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, callbacks_ptr); + H5TRACE2("e", "i*DI", fapl_id, callbacks_ptr); /* Get the plist structure */ if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -4324,7 +4322,7 @@ H5Pset_object_flush_cb(hid_t plist_id, H5F_flush_cb_t func, void *udata) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", plist_id, func, udata); + H5TRACE3("e", "iFF*x", plist_id, func, udata); /* Check if the callback function is NULL and the user data is non-NULL. * This is almost certainly an error as the user data will not be used. */ @@ -4367,7 +4365,7 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", plist_id, func, udata); + H5TRACE3("e", "i*FF**x", plist_id, func, udata); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -4455,8 +4453,7 @@ H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled, char *location, size herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*b*s*z*b", plist_id, is_enabled, location, location_size, - start_on_access); + H5TRACE5("e", "i*b*s*z*b", plist_id, is_enabled, location, location_size, start_on_access); /* Get the property list structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -5736,7 +5733,7 @@ H5Pset_vfd_swmr_config(hid_t plist_id, H5F_vfd_swmr_config_t *config_ptr) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "i*!", plist_id, config_ptr); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -5916,7 +5913,7 @@ H5Pget_vfd_swmr_config(hid_t plist_id, H5F_vfd_swmr_config_t *config_ptr) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "i*!", plist_id, config_ptr); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 8484fc9..47a3cf7 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -959,8 +959,7 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iIu*Iu*Iu", plist_id, index_num, mesg_type_flags, - min_mesg_size); + H5TRACE4("e", "iIu*Iu*Iu", plist_id, index_num, mesg_type_flags, min_mesg_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) diff --git a/src/H5Plapl.c b/src/H5Plapl.c index ddfd2bb..b1722bc 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -1223,7 +1223,7 @@ H5Pset_elink_cb(hid_t lapl_id, H5L_elink_traverse_t func, void *op_data) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", lapl_id, func, op_data); + H5TRACE3("e", "iLt*x", lapl_id, func, op_data); /* Check if the callback function is NULL and the user data is non-NULL. * This is almost certainly an error as the user data will not be used. */ @@ -1267,7 +1267,7 @@ H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func, void **op_data) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", lapl_id, func, op_data); + H5TRACE3("e", "i*Lt**x", lapl_id, func, op_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index e6955b7..b977a35 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -840,8 +840,7 @@ H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t H5Z_filter_t ret_value; /* return value */ FUNC_ENTER_API(H5Z_FILTER_ERROR) - H5TRACE8("Zf", "iIux*zxzxx", plist_id, idx, flags, cd_nelmts, cd_values, - namelen, name, filter_config); + H5TRACE8("Zf", "iIux*zxzxx", plist_id, idx, flags, cd_nelmts, cd_values, namelen, name, filter_config); /* Check args */ if (cd_nelmts || cd_values) { @@ -978,8 +977,7 @@ H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out* herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "iZfx*zxzx*Iu", plist_id, id, flags, cd_nelmts, cd_values, - namelen, name, filter_config); + H5TRACE8("e", "iZfx*zxzx*Iu", plist_id, id, flags, cd_nelmts, cd_values, namelen, name, filter_config); /* Check args */ if (cd_nelmts || cd_values) { @@ -1830,8 +1828,7 @@ H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t H5Z_filter_t ret_value; /* return value */ FUNC_ENTER_API(H5Z_FILTER_ERROR) - H5TRACE7("Zf", "iIux*zxzx", plist_id, idx, flags, cd_nelmts, cd_values, namelen, - name); + H5TRACE7("Zf", "iIux*zxzx", plist_id, idx, flags, cd_nelmts, cd_values, namelen, name); /* Check args */ if (cd_nelmts || cd_values) { @@ -1911,8 +1908,7 @@ H5Pget_filter_by_id1(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out* herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "iZfx*zxzx", plist_id, id, flags, cd_nelmts, cd_values, namelen, - name); + H5TRACE7("e", "iZfx*zxzx", plist_id, id, flags, cd_nelmts, cd_values, namelen, name); /* Check args */ if (cd_nelmts || cd_values) { diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index d1f9b42..3007ce6 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -837,7 +837,7 @@ H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", plist_id, func, op_data); + H5TRACE3("e", "iOs*x", plist_id, func, op_data); /* Check if the callback function is NULL and the user data is non-NULL. * This is almost certainly an error as the user data will not be used. */ @@ -885,7 +885,7 @@ H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", plist_id, func, op_data); + H5TRACE3("e", "i*Os**x", plist_id, func, op_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) diff --git a/src/H5SM.c b/src/H5SM.c index 550367d..76a1428 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -1755,7 +1755,7 @@ H5SM__decr_ref(void *record, void *op_data, hbool_t *changed) */ static herr_t H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, const H5O_shared_t *mesg, - unsigned *cache_flags, size_t * /*out*/ mesg_size, void ** /*out*/ encoded_mesg) + unsigned *cache_flags, size_t *mesg_size /*out*/, void **encoded_mesg /*out*/) { H5SM_list_t * list = NULL; H5SM_mesg_key_t key; diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 656d92c..f7e4a5e 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -3063,8 +3063,7 @@ H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "izz*z*z*h*z", sel_iter_id, maxseq, maxbytes, nseq, nbytes, off, - len); + H5TRACE7("e", "izz*z*z*h*z", sel_iter_id, maxseq, maxbytes, nseq, nbytes, off, len); /* Check args */ if (NULL == (sel_iter = (H5S_sel_iter_t *)H5I_object_verify(sel_iter_id, H5I_SPACE_SEL_ITER))) diff --git a/src/H5T.c b/src/H5T.c index f1ec5f0..ce3fbd8 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -2723,7 +2723,7 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_c herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); + H5TRACE5("e", "Te*siiTC", pers, name, src_id, dst_id, func); /* Check args */ if (H5T_PERS_HARD != pers && H5T_PERS_SOFT != pers) @@ -2876,7 +2876,7 @@ H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); + H5TRACE5("e", "Te*siiTC", pers, name, src_id, dst_id, func); /* Check arguments */ if (src_id > 0 && (NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)))) @@ -2917,7 +2917,7 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) H5T_conv_t ret_value; /* Return value */ FUNC_ENTER_API(NULL) - H5TRACE3("x", "ii**x", src_id, dst_id, pcdata); + H5TRACE3("TC", "ii**!", src_id, dst_id, pcdata); /* Check args */ if (NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || diff --git a/src/H5VL.c b/src/H5VL.c index 3a28aad..77a749f 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -85,7 +85,7 @@ H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id) hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE2("i", "*xi", cls, vipl_id); + H5TRACE2("i", "*#i", cls, vipl_id); /* Check arguments */ if (!cls) @@ -842,7 +842,7 @@ H5VLreset_lib_state(void) /* Must use this, to avoid modifying the API context stack in FUNC_ENTER */ FUNC_ENTER_API_NOINIT - H5TRACE0("e",""); + H5TRACE0("e", ""); /* Reset the library state */ if (H5VL_reset_lib_state() < 0) diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index 7fd670e..85c5ebd 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -1000,8 +1000,8 @@ H5VLattr_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE10("*x", "*x*xi*siiiii**x", obj, loc_params, connector_id, name, - type_id, space_id, acpl_id, aapl_id, dxpl_id, req); + H5TRACE10("*x", "*x*#i*siiiii**x", obj, loc_params, connector_id, name, type_id, space_id, acpl_id, + aapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -1103,8 +1103,7 @@ H5VLattr_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("*x", "*x*xi*sii**x", obj, loc_params, connector_id, name, aapl_id, - dxpl_id, req); + H5TRACE7("*x", "*x*#i*sii**x", obj, loc_params, connector_id, name, aapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -1406,8 +1405,7 @@ H5VLattr_get(void *obj, hid_t connector_id, H5VL_attr_get_t get_type, hid_t dxpl herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVai**xx", obj, connector_id, get_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVai**xx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -1516,8 +1514,7 @@ H5VLattr_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connecto herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVbi**xx", obj, loc_params, connector_id, specific_type, - dxpl_id, req, arguments); + H5TRACE7("e", "*x*#iVbi**xx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -1626,8 +1623,7 @@ H5VLattr_optional(void *obj, hid_t connector_id, H5VL_attr_optional_t opt_type, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVsi**xx", obj, connector_id, opt_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVsi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -1823,8 +1819,8 @@ H5VLdataset_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connect void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE11("*x", "*x*xi*siiiiii**x", obj, loc_params, connector_id, name, - lcpl_id, type_id, space_id, dcpl_id, dapl_id, dxpl_id, req); + H5TRACE11("*x", "*x*#i*siiiiii**x", obj, loc_params, connector_id, name, lcpl_id, type_id, space_id, + dcpl_id, dapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -1926,8 +1922,7 @@ H5VLdataset_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("*x", "*x*xi*sii**x", obj, loc_params, connector_id, name, dapl_id, - dxpl_id, req); + H5TRACE7("*x", "*x*#i*sii**x", obj, loc_params, connector_id, name, dapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -2028,8 +2023,8 @@ H5VLdataset_read(void *obj, hid_t connector_id, hid_t mem_type_id, hid_t mem_spa herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE8("e", "*xiiiii*x**x", obj, connector_id, mem_type_id, mem_space_id, - file_space_id, dxpl_id, buf, req); + H5TRACE8("e", "*xiiiii*x**x", obj, connector_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, + req); /* Check args and get class pointer */ if (NULL == obj) @@ -2130,8 +2125,8 @@ H5VLdataset_write(void *obj, hid_t connector_id, hid_t mem_type_id, hid_t mem_sp herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE8("e", "*xiiiii*x**x", obj, connector_id, mem_type_id, mem_space_id, - file_space_id, dxpl_id, buf, req); + H5TRACE8("e", "*xiiiii*x**x", obj, connector_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, + req); /* Check args and get class pointer */ if (NULL == obj) @@ -2238,8 +2233,7 @@ H5VLdataset_get(void *obj, hid_t connector_id, H5VL_dataset_get_t get_type, hid_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVci**xx", obj, connector_id, get_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVci**xx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -2348,8 +2342,7 @@ H5VLdataset_specific(void *obj, hid_t connector_id, H5VL_dataset_specific_t spec herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVdi**xx", obj, connector_id, specific_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVdi**xx", obj, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -2457,8 +2450,7 @@ H5VLdataset_optional(void *obj, hid_t connector_id, H5VL_dataset_optional_t opt_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVti**xx", obj, connector_id, opt_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVti**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -2668,8 +2660,8 @@ H5VLdatatype_commit(void *obj, const H5VL_loc_params_t *loc_params, hid_t connec void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE10("*x", "*x*xi*siiiii**x", obj, loc_params, connector_id, name, - type_id, lcpl_id, tcpl_id, tapl_id, dxpl_id, req); + H5TRACE10("*x", "*x*#i*siiiii**x", obj, loc_params, connector_id, name, type_id, lcpl_id, tcpl_id, + tapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -2771,8 +2763,7 @@ H5VLdatatype_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connecto void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("*x", "*x*xi*sii**x", obj, loc_params, connector_id, name, tapl_id, - dxpl_id, req); + H5TRACE7("*x", "*x*#i*sii**x", obj, loc_params, connector_id, name, tapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -2879,8 +2870,7 @@ H5VLdatatype_get(void *obj, hid_t connector_id, H5VL_datatype_get_t get_type, hi herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVei**xx", obj, connector_id, get_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVei**xx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -2993,8 +2983,7 @@ H5VLdatatype_specific(void *obj, hid_t connector_id, H5VL_datatype_specific_t sp herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVfi**xx", obj, connector_id, specific_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVfi**xx", obj, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -3103,8 +3092,7 @@ H5VLdatatype_optional(void *obj, hid_t connector_id, H5VL_datatype_optional_t op herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVui**xx", obj, connector_id, opt_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVui**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -3517,8 +3505,7 @@ H5VLfile_get(void *obj, hid_t connector_id, H5VL_file_get_t get_type, hid_t dxpl herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVgi**xx", obj, connector_id, get_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVgi**xx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -3662,8 +3649,7 @@ H5VLfile_specific(void *obj, hid_t connector_id, H5VL_file_specific_t specific_t herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVhi**xx", obj, connector_id, specific_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVhi**xx", obj, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -3769,8 +3755,7 @@ H5VLfile_optional(void *obj, hid_t connector_id, H5VL_file_optional_t opt_type, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVvi**xx", obj, connector_id, opt_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVvi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -3973,8 +3958,8 @@ H5VLgroup_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE9("*x", "*x*xi*siiii**x", obj, loc_params, connector_id, name, lcpl_id, - gcpl_id, gapl_id, dxpl_id, req); + H5TRACE9("*x", "*x*#i*siiii**x", obj, loc_params, connector_id, name, lcpl_id, gcpl_id, gapl_id, dxpl_id, + req); /* Check args and get class pointer */ if (NULL == obj) @@ -4076,8 +4061,7 @@ H5VLgroup_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_i void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("*x", "*x*xi*sii**x", obj, loc_params, connector_id, name, gapl_id, - dxpl_id, req); + H5TRACE7("*x", "*x*#i*sii**x", obj, loc_params, connector_id, name, gapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -4184,8 +4168,7 @@ H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_t get_type, hid_t dx herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVii**xx", obj, connector_id, get_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVii**xx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -4294,8 +4277,7 @@ H5VLgroup_specific(void *obj, hid_t connector_id, H5VL_group_specific_t specific herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVji**xx", obj, connector_id, specific_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVji**xx", obj, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -4404,8 +4386,7 @@ H5VLgroup_optional(void *obj, hid_t connector_id, H5VL_group_optional_t opt_type herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVwi**xx", obj, connector_id, opt_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVwi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -4639,8 +4620,8 @@ H5VLlink_create(H5VL_link_create_type_t create_type, void *obj, const H5VL_loc_p herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE9("e", "Vk*x*xiiii**xx", create_type, obj, loc_params, connector_id, - lcpl_id, lapl_id, dxpl_id, req, arguments); + H5TRACE9("e", "Vk*x*#iiii**xx", create_type, obj, loc_params, connector_id, lcpl_id, lapl_id, dxpl_id, + req, arguments); /* Get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -4746,8 +4727,8 @@ H5VLlink_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE9("e", "*x*x*x*xiiii**x", src_obj, loc_params1, dst_obj, loc_params2, - connector_id, lcpl_id, lapl_id, dxpl_id, req); + H5TRACE9("e", "*x*#*x*#iiii**x", src_obj, loc_params1, dst_obj, loc_params2, connector_id, lcpl_id, + lapl_id, dxpl_id, req); /* Get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -4853,8 +4834,8 @@ H5VLlink_move(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE9("e", "*x*x*x*xiiii**x", src_obj, loc_params1, dst_obj, loc_params2, - connector_id, lcpl_id, lapl_id, dxpl_id, req); + H5TRACE9("e", "*x*#*x*#iiii**x", src_obj, loc_params1, dst_obj, loc_params2, connector_id, lcpl_id, + lapl_id, dxpl_id, req); /* Get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -4961,8 +4942,7 @@ H5VLlink_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVli**xx", obj, loc_params, connector_id, get_type, dxpl_id, - req, arguments); + H5TRACE7("e", "*x*#iVli**xx", obj, loc_params, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5071,8 +5051,7 @@ H5VLlink_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connecto herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVmi**xx", obj, loc_params, connector_id, specific_type, - dxpl_id, req, arguments); + H5TRACE7("e", "*x*#iVmi**xx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5180,8 +5159,7 @@ H5VLlink_optional(void *obj, hid_t connector_id, H5VL_link_optional_t opt_type, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVxi**xx", obj, connector_id, opt_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVxi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5282,8 +5260,7 @@ H5VLobject_open(void *obj, const H5VL_loc_params_t *params, hid_t connector_id, void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("*x", "*x*xi*Iti**x", obj, params, connector_id, opened_type, dxpl_id, - req); + H5TRACE6("*x", "*x*#i*Iti**x", obj, params, connector_id, opened_type, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -5393,9 +5370,8 @@ H5VLobject_copy(void *src_obj, const H5VL_loc_params_t *src_loc_params, const ch herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE11("e", "*x*x*s*x*x*siiii**x", src_obj, src_loc_params, src_name, - dst_obj, dst_loc_params, dst_name, connector_id, ocpypl_id, lcpl_id, - dxpl_id, req); + H5TRACE11("e", "*x*#*s*x*#*siiii**x", src_obj, src_loc_params, src_name, dst_obj, dst_loc_params, + dst_name, connector_id, ocpypl_id, lcpl_id, dxpl_id, req); /* Check args and get class pointers */ if (NULL == src_obj || NULL == dst_obj) @@ -5505,8 +5481,7 @@ H5VLobject_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_i herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVni**xx", obj, loc_params, connector_id, get_type, dxpl_id, - req, arguments); + H5TRACE7("e", "*x*#iVni**xx", obj, loc_params, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5615,8 +5590,7 @@ H5VLobject_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connec herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVoi**xx", obj, loc_params, connector_id, specific_type, - dxpl_id, req, arguments); + H5TRACE7("e", "*x*#iVoi**xx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5728,8 +5702,7 @@ H5VLobject_optional(void *obj, hid_t connector_id, H5VL_object_optional_t opt_ty herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVyi**xx", obj, connector_id, opt_type, dxpl_id, req, - arguments); + H5TRACE6("e", "*xiVyi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5838,7 +5811,7 @@ H5VLintrospect_get_conn_cls(void *obj, hid_t connector_id, H5VL_get_conn_lvl_t l herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE4("e", "*xiVL**x", obj, connector_id, lvl, conn_cls); + H5TRACE4("e", "*xiVL**#", obj, connector_id, lvl, conn_cls); /* Check args */ if (NULL == obj) @@ -6168,7 +6141,7 @@ H5VLrequest_notify(void *req, hid_t connector_id, H5VL_request_notify_t cb, void herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE4("e", "*xix*x", req, connector_id, cb, ctx); + H5TRACE4("e", "*xiVN*x", req, connector_id, cb, ctx); /* Get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) diff --git a/src/H5VM.c b/src/H5VM.c index 2a0e69b..20b2707 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -468,13 +468,8 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, con *------------------------------------------------------------------------- */ herr_t -H5VM_hyper_copy(unsigned n, const hsize_t *_size, - - /*destination*/ - const hsize_t *dst_size, const hsize_t *dst_offset, void *_dst, - - /*source*/ - const hsize_t *src_size, const hsize_t *src_offset, const void *_src) +H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const hsize_t *dst_offset, + void *_dst, const hsize_t *src_size, const hsize_t *src_offset, const void *_src) { const uint8_t *src = (const uint8_t *)_src; /*cast for ptr arithmtc */ uint8_t * dst = (uint8_t *)_dst; /*cast for ptr arithmtc */ @@ -824,13 +819,9 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss *------------------------------------------------------------------------- */ static void -H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, - - /* destination */ - unsigned dst_n, const hsize_t *dst_size, const hsize_t *dst_stride, void *_dst, - - /* source */ - unsigned src_n, const hsize_t *src_size, const hsize_t *src_stride, const void *_src) +H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsize_t *dst_size, + const hsize_t *dst_stride, void *_dst, unsigned src_n, const hsize_t *src_size, + const hsize_t *src_stride, const void *_src) { uint8_t * dst = (uint8_t *)_dst; const uint8_t *src = (const uint8_t *)_src; diff --git a/src/H5Z.c b/src/H5Z.c index cc7f642..fc7b113 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -573,7 +573,7 @@ done: *------------------------------------------------------------------------- */ static int -H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key H5_ATTR_PARALLEL_USED) +H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_PARALLEL_USED *key) { H5F_t *f = (H5F_t *)obj_ptr; /* File object for operations */ #ifdef H5_HAVE_PARALLEL diff --git a/src/H5private.h b/src/H5private.h index 683781b..4c77a98 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1950,7 +1950,31 @@ extern char H5libhdf5_settings[]; /* embedded library information */ #define H5TRACE_RETURN(V) /*void*/ #endif /* H5_DEBUG_API */ +/* Argument tracing macros (defined all the time) */ +#define H5ARG_TRACE0(C, T) C, T +#define H5ARG_TRACE1(C, T, A0) C, T, #A0, A0 +#define H5ARG_TRACE2(C, T, A0, A1) C, T, #A0, A0, #A1, A1 +#define H5ARG_TRACE3(C, T, A0, A1, A2) C, T, #A0, A0, #A1, A1, #A2, A2 +#define H5ARG_TRACE4(C, T, A0, A1, A2, A3) C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3 +#define H5ARG_TRACE5(C, T, A0, A1, A2, A3, A4) C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4 +#define H5ARG_TRACE6(C, T, A0, A1, A2, A3, A4, A5) C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5 +#define H5ARG_TRACE7(C, T, A0, A1, A2, A3, A4, A5, A6) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6 +#define H5ARG_TRACE8(C, T, A0, A1, A2, A3, A4, A5, A6, A7) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7 +#define H5ARG_TRACE9(C, T, A0, A1, A2, A3, A4, A5, A6, A7, A8) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7, #A8, A8 +#define H5ARG_TRACE10(C, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7, #A8, A8, #A9, A9 +#define H5ARG_TRACE11(C, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7, #A8, A8, #A9, A9, #A10, A10 +#define H5ARG_TRACE12(C, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7, #A8, A8, #A9, A9, #A10, \ + A10, #A11, A11 + +struct H5RS_str_t; H5_DLL double H5_trace(const double *calltime, const char *func, const char *type, ...); +H5_DLL herr_t H5_trace_args(struct H5RS_str_t *rs, const char *type, va_list ap); /*------------------------------------------------------------------------- * Purpose: Register function entry for library initialization and code @@ -2302,6 +2326,23 @@ H5_DLL herr_t H5CX_pop(void); FUNC_ENTER_API_INIT(err); \ { +/* + * Use this macro for API functions that shouldn't perform _any_ initialization + * of the library or an interface, or push themselves on the function + * stack, or perform tracing, etc. This macro _only_ sanity checks the + * API name itself. Examples are: H5TSmutex_acquire, + * + */ +#define FUNC_ENTER_API_NAMECHECK_ONLY \ + { \ + { \ + { \ + { \ + { \ + { \ + FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \ + { + /* Note: this macro only works when there's _no_ interface initialization routine for the module */ #define FUNC_ENTER_NOAPI_INIT(err) \ /* Initialize the package, if appropriate */ \ @@ -2381,6 +2422,17 @@ H5_DLL herr_t H5CX_pop(void); FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { +/* + * Use this macro for non-API functions that shouldn't perform _any_ initialization + * of the library or an interface, or push themselves on the function + * stack, or perform tracing, etc. This macro _only_ sanity checks the + * API name itself. Examples are private routines in the H5TS package. + * + */ +#define FUNC_ENTER_NOAPI_NAMECHECK_ONLY \ + { \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); + /* Use the following two macros as replacements for the FUNC_ENTER_NOAPI * and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set * up a metadata tag. */ @@ -2448,6 +2500,17 @@ H5_DLL herr_t H5CX_pop(void); FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { +/* + * Use this macro for non-API functions that shouldn't perform _any_ initialization + * of the library or an interface, or push themselves on the function + * stack, or perform tracing, etc. This macro _only_ sanity checks the + * API name itself. Examples are static routines in the H5TS package. + * + */ +#define FUNC_ENTER_STATIC_NAMECHECK_ONLY \ + { \ + FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); + /* Use the following macro as replacement for the FUNC_ENTER_STATIC * macro when the function needs to set up a metadata tag. */ #define FUNC_ENTER_STATIC_TAG(tag) \ @@ -2538,6 +2601,18 @@ H5_DLL herr_t H5CX_pop(void); } \ } /*end scope from beginning of FUNC_ENTER*/ +/* Use this macro to match the FUNC_ENTER_API_NAMECHECK_ONLY macro */ +#define FUNC_LEAVE_API_NAMECHECK_ONLY(ret_value) \ + ; \ + } /*end scope from end of FUNC_ENTER*/ \ + return (ret_value); \ + } \ + } \ + } \ + } \ + } \ + } /*end scope from beginning of FUNC_ENTER*/ + #define FUNC_LEAVE_NOAPI(ret_value) \ ; \ } /*end scope from end of FUNC_ENTER*/ \ @@ -2563,6 +2638,14 @@ H5_DLL herr_t H5CX_pop(void); return (ret_value); \ } /*end scope from beginning of FUNC_ENTER*/ +/* Use these macros to match the FUNC_ENTER_NOAPI_NAMECHECK_ONLY macro */ +#define FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) \ + return (ret_value); \ + } /*end scope from beginning of FUNC_ENTER*/ +#define FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY \ + return; \ + } /*end scope from beginning of FUNC_ENTER*/ + /* Use this macro when exiting a function that set up a metadata tag */ #define FUNC_LEAVE_NOAPI_TAG(ret_value) \ ; \ diff --git a/src/H5trace.c b/src/H5trace.c index fc01280..85195c5 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -15,7 +15,7 @@ * * Created: H5trace.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal code for tracing API calls * @@ -25,7 +25,7 @@ /****************/ /* Module Setup */ /****************/ -#define H5I_FRIEND /*suppress error about including H5Ipkg */ +#define H5I_FRIEND /*suppress error about including H5Ipkg */ /***********/ /* Headers */ @@ -36,7 +36,9 @@ #include "H5FDprivate.h" /* File drivers */ #include "H5Rprivate.h" /* References */ #include "H5Ipkg.h" /* IDs */ +#include "H5Mpublic.h" /* Maps */ #include "H5MMprivate.h" /* Memory management */ +#include "H5RSprivate.h" /* Reference-counted strings */ #include "H5VLprivate.h" /* Virtual Object Layer */ #ifdef H5_HAVE_PARALLEL @@ -59,6 +61,9 @@ /********************/ /* Local Prototypes */ /********************/ +static herr_t H5_trace_args_bool(H5RS_str_t *rs, hbool_t val); +static herr_t H5_trace_args_cset(H5RS_str_t *rs, H5T_cset_t cset); +static herr_t H5_trace_args_close_degree(H5RS_str_t *rs, H5F_close_degree_t degree); /*********************/ /* Package Variables */ @@ -73,134 +78,170 @@ /*******************/ /*------------------------------------------------------------------------- - * Function: H5_trace + * Function: H5_trace_args_bool * - * Purpose: This function is called whenever an API function is called - * and tracing is turned on. If RETURNING is non-zero then - * the caller is about to return and RETURNING points to the - * time for the corresponding function call event. Otherwise - * we print the function name and the arguments. + * Purpose: This routine formats an hbool_t and adds the output to + * the refcounted string (RS) argument. * - * The TYPE argument is a string which gives the type of each of - * the following argument pairs. Each type is zero or more - * asterisks (one for each level of indirection, although some - * types have one level of indirection already implied) followed - * by either one letter (lower case) or two letters (first one - * uppercase). + * Return: SUCCEED / FAIL * - * The variable argument list consists of pairs of values. Each - * pair is a string which is the formal argument name in the - * calling function, followed by the argument value. The type - * of the argument value is given by the TYPE string. + * Programmer: Quincey Koziol + * Monday, September 21, 2020 * - * Note: The TYPE string is meant to be terse and is generated by a - * separate perl script. + *------------------------------------------------------------------------- + */ +static herr_t +H5_trace_args_bool(H5RS_str_t *rs, hbool_t val) +{ + /* FUNC_ENTER() should not be called */ + + if (TRUE == val) + H5RS_acat(rs, "TRUE"); + else if (!val) + H5RS_acat(rs, "FALSE"); + else + H5RS_asprintf_cat(rs, "TRUE(%u)", (unsigned)val); + + return SUCCEED; +} /* end H5_trace_args_bool() */ + +/*------------------------------------------------------------------------- + * Function: H5_trace_args_cset * - * WARNING: DO NOT CALL ANY HDF5 FUNCTION THAT CALLS FUNC_ENTER(). DOING - * SO MAY CAUSE H5_trace() TO BE INVOKED RECURSIVELY OR MAY - * CAUSE LIBRARY INITIALIZATIONS THAT ARE NOT DESIRED. + * Purpose: This routine formats an H5T_cset_t and adds the output to + * the refcounted string (RS) argument. * - * Return: Execution time for an API call + * Return: SUCCEED / FAIL * - * Programmer: Robb Matzke - * Tuesday, June 16, 1998 + * Programmer: Quincey Koziol + * Sunday, September 20, 2020 * *------------------------------------------------------------------------- */ -double -H5_trace(const double *returning, const char *func, const char *type, ...) +static herr_t +H5_trace_args_cset(H5RS_str_t *rs, H5T_cset_t cset) { - va_list ap; - char buf[64], *rest; - const char * argname; - int argno = 0, ptr, asize_idx; - hssize_t asize[16]; - hssize_t i; - void * vp = NULL; - FILE * out = H5_debug_g.trace; - static hbool_t is_first_invocation = TRUE; - H5_timer_t function_timer; - H5_timevals_t function_times; - static H5_timer_t running_timer; - H5_timevals_t running_times; - static int current_depth = 0; - static int last_call_depth = 0; + /* FUNC_ENTER() should not be called */ + + switch (cset) { + case H5T_CSET_ERROR: + H5RS_acat(rs, "H5T_CSET_ERROR"); + break; + + case H5T_CSET_ASCII: + H5RS_acat(rs, "H5T_CSET_ASCII"); + break; + + case H5T_CSET_UTF8: + H5RS_acat(rs, "H5T_CSET_UTF8"); + break; + + case H5T_CSET_RESERVED_2: + case H5T_CSET_RESERVED_3: + case H5T_CSET_RESERVED_4: + case H5T_CSET_RESERVED_5: + case H5T_CSET_RESERVED_6: + case H5T_CSET_RESERVED_7: + case H5T_CSET_RESERVED_8: + case H5T_CSET_RESERVED_9: + case H5T_CSET_RESERVED_10: + case H5T_CSET_RESERVED_11: + case H5T_CSET_RESERVED_12: + case H5T_CSET_RESERVED_13: + case H5T_CSET_RESERVED_14: + case H5T_CSET_RESERVED_15: + H5RS_asprintf_cat(rs, "H5T_CSET_RESERVED_%ld", (long)cset); + break; + + default: + H5RS_asprintf_cat(rs, "%ld", (long)cset); + break; + } /* end switch */ + + return SUCCEED; +} /* end H5_trace_args_cset() */ +/*------------------------------------------------------------------------- + * Function: H5_trace_args_close_degree + * + * Purpose: This routine formats an H5F_close_degree_t and adds the output to + * the refcounted string (RS) argument. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Monday, September 21, 2020 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5_trace_args_close_degree(H5RS_str_t *rs, H5F_close_degree_t degree) +{ /* FUNC_ENTER() should not be called */ - if (!out) - return 0.0F; /*tracing is off*/ - HDva_start(ap, type); + switch (degree) { + case H5F_CLOSE_DEFAULT: + H5RS_acat(rs, "H5F_CLOSE_DEFAULT"); + break; - if (H5_debug_g.ttop) { - if (returning) { - if (current_depth > 1) { - --current_depth; - return 0.0F; - } /* end if */ - } /* end if */ - else { - if (current_depth > 0) { - /*do not update last_call_depth*/ - current_depth++; - return 0.0F; - } /* end if */ - } /* end else */ - } /* end if */ + case H5F_CLOSE_WEAK: + H5RS_acat(rs, "H5F_CLOSE_WEAK"); + break; - /* Get time for event if the trace times flag is set */ - if (is_first_invocation && H5_debug_g.ttimes) { - /* start the library-wide timer */ - is_first_invocation = FALSE; - H5_timer_init(&running_timer); - H5_timer_start(&running_timer); - } /* end if */ - if (H5_debug_g.ttimes) { - /* start the timer for this function */ - H5_timer_init(&function_timer); - H5_timer_start(&function_timer); - } /* end if */ + case H5F_CLOSE_SEMI: + H5RS_acat(rs, "H5F_CLOSE_SEMI"); + break; - /* Print the first part of the line. This is the indication of the - * nesting depth followed by the function name and either start of - * argument list or start of return value. If this call is for a - * function return and no other calls have been made to H5_trace() - * since the one for the function call, then we're continuing - * the same line. */ - if (returning) { - HDassert(current_depth > 0); - --current_depth; - if (current_depth < last_call_depth) { - /* We are at the beginning of a line */ - if (H5_debug_g.ttimes) { - char tmp[320]; + case H5F_CLOSE_STRONG: + H5RS_acat(rs, "H5F_CLOSE_STRONG"); + break; - H5_timer_get_times(function_timer, &function_times); - H5_timer_get_times(running_timer, &running_times); - HDsprintf(tmp, "%.6f", (function_times.elapsed - running_times.elapsed)); - HDfprintf(out, " %*s ", (int)HDstrlen(tmp), ""); - } /* end if */ - for (i = 0; i < current_depth; i++) - HDfputc('+', out); - HDfprintf(out, "%*s%s = ", 2 * current_depth, "", func); - } /* end if */ - else { - /* Continue current line with return value */ - HDfprintf(out, " = "); - } /* end else */ - } /* end if */ - else { - if (current_depth > last_call_depth) - HDfputs(" = \n", out); - if (H5_debug_g.ttimes) { - H5_timer_get_times(function_timer, &function_times); - H5_timer_get_times(running_timer, &running_times); - HDfprintf(out, "@%.6f ", (function_times.elapsed - running_times.elapsed)); - } /* end if */ - for (i = 0; i < current_depth; i++) - HDfputc('+', out); - HDfprintf(out, "%*s%s(", 2 * current_depth, "", func); - } /* end else */ + default: + H5RS_asprintf_cat(rs, "%ld", (long)degree); + break; + } /* end switch */ + + return SUCCEED; +} /* end H5_trace_args_cset() */ + +/*------------------------------------------------------------------------- + * Function: H5_trace_args + * + * Purpose: This routine formats a set of function arguments, placing the + * resulting string in the refcounted string (RS) argument. + * + * The TYPE argument is a string which gives the type of each of + * the following argument pairs. Each type begins with zero or + * more asterisks (one for each level of indirection, although + * some types have one level of indirection already implied) + * followed by either one letter (lower case) or two letters + * (first one uppercase). + * + * The variable argument list consists of pairs of values. Each + * pair is a string which is the formal argument name in the + * calling function, followed by the argument value. The type + * of the argument value is given by the TYPE string. + * + * Note: The TYPE string is meant to be terse and is generated by a + * separate perl script. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Saturday, September 19, 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap) +{ + const char *argname; + int argno = 0, ptr, asize_idx; + hssize_t asize[16]; + hssize_t i; + void * vp = NULL; + + /* FUNC_ENTER() should not be called */ /* Clear array sizes */ for (i = 0; i < (hssize_t)NELMTS(asize); i++) @@ -211,7 +252,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* Count levels of indirection */ for (ptr = 0; '*' == *type; type++) ptr++; + + /* Array parameter, possibly with another argument as the array size */ if ('[' == *type) { + char *rest; + if ('a' == type[1]) { asize_idx = (int)HDstrtol(type + 2, &rest, 10); HDassert(0 <= asize_idx && asize_idx < (int)NELMTS(asize)); @@ -229,1136 +274,1334 @@ H5_trace(const double *returning, const char *func, const char *type, ...) asize_idx = -1; /* - * The argument name. Leave off the `_id' part. If the argument - * name is the null pointer then don't print the argument or the - * following `='. This is used for return values. + * The argument name. If the argument name is the null pointer then + * don't print the argument or the following `=' (this is used for + * return values). */ argname = HDva_arg(ap, char *); - if (argname) { - unsigned n = (unsigned)MAX(0, (int)HDstrlen(argname) - 3); - - if (!HDstrcmp(argname + n, "_id")) { - HDstrncpy(buf, argname, (size_t)MIN((int)sizeof(buf) - 1, n)); - buf[MIN((int)sizeof(buf) - 1, n)] = '\0'; - argname = buf; - } /* end if */ - HDfprintf(out, "%s%s=", argno ? ", " : "", argname); - } /* end if */ + if (argname) + H5RS_asprintf_cat(rs, "%s%s=", argno ? ", " : "", argname); else argname = ""; - /* The value */ - if (ptr) + /* A pointer/array */ + if (ptr) { vp = HDva_arg(ap, void *); - switch (type[0]) { - case 'a': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + if (vp) { + switch (type[0]) { + case 'h': /* hsize_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + hsize_t *p = (hsize_t *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) { + if (H5S_UNLIMITED == p[i]) + H5RS_asprintf_cat(rs, "%sH5S_UNLIMITED", (i ? ", " : "")); + else + H5RS_asprintf_cat(rs, "%s%" PRIuHSIZE, (i ? ", " : ""), p[i]); + } /* end for */ + H5RS_acat(rs, "}"); + } /* end if */ + break; + + case 'H': + if ('s' == type[1]) { /* hssize_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + hssize_t *p = (hssize_t *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%" PRIdHSIZE, (i ? ", " : ""), p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end if */ + else + H5RS_asprintf_cat(rs, "%p", vp); + break; + + case 'I': + if ('s' == type[1]) { /* int / int32_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + int *p = (int *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%d", (i ? ", " : ""), p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end if */ + else if ('u' == type[1]) { /* unsigned / uint32_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + unsigned *p = (unsigned *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%u", i ? ", " : "", p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end else-if */ + else + H5RS_asprintf_cat(rs, "%p", vp); + break; + + case 's': /* char* */ + /* Strings have one level of indirection by default, pointers + * to strings have 2 or more. + */ + if (ptr > 1) + H5RS_asprintf_cat(rs, "%p", vp); + else + H5RS_asprintf_cat(rs, "\"%s\"", (const char *)vp); + break; + + case 'U': + if ('l' == type[1]) { /* unsigned long */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + unsigned long *p = (unsigned long *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%lu", i ? ", " : "", p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end if */ + else if ('L' == type[1]) { /* unsigned long long / uint64_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + unsigned long long *p = (unsigned long long *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%llu", i ? ", " : "", p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end else-if */ + else + H5RS_asprintf_cat(rs, "%p", vp); + break; + + case 'x': /* void */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + void **p = (void **)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) { + if (p[i]) + H5RS_asprintf_cat(rs, "%s%p", (i ? ", " : ""), p[i]); + else + H5RS_asprintf_cat(rs, "%sNULL", (i ? ", " : "")); + } /* end for */ + H5RS_acat(rs, "}"); + } /* end if */ + break; + + case 'z': /* size_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + size_t *p = (size_t *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%zu", (i ? ", " : ""), p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + break; + + case 'Z': + if ('s' == type[1]) { /* ssize_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + ssize_t *p = (ssize_t *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%zd", (i ? ", " : ""), p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end if */ + else + H5RS_asprintf_cat(rs, "%p", vp); + break; + + default: + H5RS_asprintf_cat(rs, "%p", vp); + } /* end switch */ + } /* end if */ + else + H5RS_acat(rs, "NULL"); + } /* end if */ + /* A value */ + else { + switch (type[0]) { + case 'a': /* haddr_t */ + { haddr_t addr = HDva_arg(ap, haddr_t); - HDfprintf(out, "%a", addr); - } /* end else */ + if (H5F_addr_defined(addr)) + H5RS_asprintf_cat(rs, "%" PRIuHADDR, addr); + else + H5RS_acat(rs, "UNDEF"); + } /* end block */ break; - case 'b': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'A': + switch (type[1]) { + case 'i': /* H5A_info_t */ + { + H5A_info_t ainfo = HDva_arg(ap, H5A_info_t); + + H5RS_acat(rs, "{"); + H5_trace_args_bool(rs, ainfo.corder_valid); + H5RS_asprintf_cat(rs, ", %u, ", ainfo.corder); + H5_trace_args_cset(rs, ainfo.cset); + H5RS_asprintf_cat(rs, "%" PRIuHSIZE "}", ainfo.data_size); + } /* end block */ + break; + +#ifndef H5_NO_DEPRECATED_SYMBOLS + case 'o': /* H5A_operator1_t */ + { + H5A_operator1_t aop1 = (H5A_operator1_t)HDva_arg(ap, H5A_operator1_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)aop1); + } /* end block */ + break; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + case 'O': /* H5A_operator2_t */ + { + H5A_operator2_t aop2 = (H5A_operator2_t)HDva_arg(ap, H5A_operator2_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)aop2); + } /* end block */ + break; + + default: + H5RS_asprintf_cat(rs, "BADTYPE(A%c)", type[1]); + goto error; + } /* end switch */ + break; + + case 'b': /* hbool_t */ + { /* Can't pass hbool_t to HDva_arg() */ hbool_t bool_var = (hbool_t)HDva_arg(ap, int); - if (TRUE == bool_var) - HDfprintf(out, "TRUE"); - else if (!bool_var) - HDfprintf(out, "FALSE"); - else - HDfprintf(out, "TRUE(%u)", (unsigned)bool_var); - } + + H5_trace_args_bool(rs, bool_var); + } /* end block */ break; - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'C': + switch (type[1]) { + case 'c': /* H5AC_cache_config_t */ + { + H5AC_cache_config_t cc = HDva_arg(ap, H5AC_cache_config_t); + + H5RS_asprintf_cat(rs, "{%d, ", cc.version); + H5_trace_args_bool(rs, cc.rpt_fcn_enabled); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cc.open_trace_file); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cc.close_trace_file); + H5RS_asprintf_cat(rs, ", '%s', ", cc.trace_file_name); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cc.evictions_enabled); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cc.set_initial_size); + H5RS_asprintf_cat(rs, ", %zu, ", cc.initial_size); + H5RS_asprintf_cat(rs, "%f, ", cc.min_clean_fraction); + H5RS_asprintf_cat(rs, "%zu, ", cc.max_size); + H5RS_asprintf_cat(rs, "%zu, ", cc.min_size); + H5RS_asprintf_cat(rs, "%ld, ", cc.epoch_length); + switch (cc.incr_mode) { + case H5C_incr__off: + H5RS_acat(rs, "H5C_incr__off"); + break; + + case H5C_incr__threshold: + H5RS_acat(rs, "H5C_incr__threshold"); + break; + + default: + H5RS_asprintf_cat(rs, "%ld", (long)cc.incr_mode); + break; + } /* end switch */ + H5RS_asprintf_cat(rs, ", %f, ", cc.lower_hr_threshold); + H5RS_asprintf_cat(rs, "%f, ", cc.increment); + H5_trace_args_bool(rs, cc.apply_max_increment); + H5RS_asprintf_cat(rs, ", %zu, ", cc.max_increment); + switch (cc.flash_incr_mode) { + case H5C_flash_incr__off: + H5RS_acat(rs, "H5C_flash_incr__off"); + break; + + case H5C_flash_incr__add_space: + H5RS_acat(rs, "H5C_flash_incr__add_space"); + break; + + default: + H5RS_asprintf_cat(rs, "%ld", (long)cc.flash_incr_mode); + break; + } /* end switch */ + H5RS_asprintf_cat(rs, ", %f, ", cc.flash_multiple); + H5RS_asprintf_cat(rs, "%f, ", cc.flash_threshold); + switch (cc.decr_mode) { + case H5C_decr__off: + H5RS_acat(rs, "H5C_decr__off"); + break; + + case H5C_decr__threshold: + H5RS_acat(rs, "H5C_decr__threshold"); + break; + + case H5C_decr__age_out: + H5RS_acat(rs, "H5C_decr__age_out"); + break; + + case H5C_decr__age_out_with_threshold: + H5RS_acat(rs, "H5C_decr__age_out_with_threshold"); + break; + + default: + H5RS_asprintf_cat(rs, "%ld", (long)cc.decr_mode); + break; + } /* end switch */ + H5RS_asprintf_cat(rs, ", %f, ", cc.upper_hr_threshold); + H5RS_asprintf_cat(rs, "%f, ", cc.decrement); + H5_trace_args_bool(rs, cc.apply_max_decrement); + H5RS_asprintf_cat(rs, ", %zu, ", cc.max_decrement); + H5RS_asprintf_cat(rs, "%d, ", cc.epochs_before_eviction); + H5_trace_args_bool(rs, cc.apply_empty_reserve); + H5RS_asprintf_cat(rs, ", %f, ", cc.empty_reserve); + H5RS_asprintf_cat(rs, "%zu, ", cc.dirty_bytes_threshold); + H5RS_asprintf_cat(rs, "%d}", cc.metadata_write_strategy); + } /* end block */ + break; + + case 'C': /* H5AC_cache_image_config_t */ + { + H5AC_cache_image_config_t cic = HDva_arg(ap, H5AC_cache_image_config_t); + + H5RS_asprintf_cat(rs, "{%d, ", cic.version); + H5_trace_args_bool(rs, cic.generate_image); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cic.save_resize_status); + H5RS_acat(rs, ", "); + H5RS_asprintf_cat(rs, "%d}", cic.entry_ageout); + } /* end block */ + break; + + default: + H5RS_asprintf_cat(rs, "BADTYPE(C%c)", type[1]); + goto error; + } /* end switch */ + break; + + case 'd': /* double */ + { double dbl = HDva_arg(ap, double); - HDfprintf(out, "%g", dbl); - } /* end else */ + H5RS_asprintf_cat(rs, "%g", dbl); + } /* end block */ break; - case 'D': - switch (type[1]) { - case 'a': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'D': + switch (type[1]) { + case 'a': /* H5D_alloc_time_t */ + { H5D_alloc_time_t alloc_time = (H5D_alloc_time_t)HDva_arg(ap, int); switch (alloc_time) { case H5D_ALLOC_TIME_ERROR: - HDfprintf(out, "H5D_ALLOC_TIME_ERROR"); + H5RS_acat(rs, "H5D_ALLOC_TIME_ERROR"); break; case H5D_ALLOC_TIME_DEFAULT: - HDfprintf(out, "H5D_ALLOC_TIME_DEFAULT"); + H5RS_acat(rs, "H5D_ALLOC_TIME_DEFAULT"); break; case H5D_ALLOC_TIME_EARLY: - HDfprintf(out, "H5D_ALLOC_TIME_EARLY"); + H5RS_acat(rs, "H5D_ALLOC_TIME_EARLY"); break; case H5D_ALLOC_TIME_LATE: - HDfprintf(out, "H5D_ALLOC_TIME_LATE"); + H5RS_acat(rs, "H5D_ALLOC_TIME_LATE"); break; case H5D_ALLOC_TIME_INCR: - HDfprintf(out, "H5D_ALLOC_TIME_INCR"); + H5RS_acat(rs, "H5D_ALLOC_TIME_INCR"); break; default: - HDfprintf(out, "%ld", (long)alloc_time); + H5RS_asprintf_cat(rs, "%ld", (long)alloc_time); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'A': /* H5D_append_cb_t */ + { + H5D_append_cb_t dapp = (H5D_append_cb_t)HDva_arg(ap, H5D_append_cb_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)dapp); + } /* end block */ + break; + + case 'c': /* H5FD_mpio_collective_opt_t */ + { H5FD_mpio_collective_opt_t opt = (H5FD_mpio_collective_opt_t)HDva_arg(ap, int); switch (opt) { case H5FD_MPIO_COLLECTIVE_IO: - HDfprintf(out, "H5FD_MPIO_COLLECTIVE_IO"); + H5RS_acat(rs, "H5FD_MPIO_COLLECTIVE_IO"); break; case H5FD_MPIO_INDIVIDUAL_IO: - HDfprintf(out, "H5FD_MPIO_INDIVIDUAL_IO"); + H5RS_acat(rs, "H5FD_MPIO_INDIVIDUAL_IO"); break; default: - HDfprintf(out, "%ld", (long)opt); + H5RS_asprintf_cat(rs, "%ld", (long)opt); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'f': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'f': /* H5D_fill_time_t */ + { H5D_fill_time_t fill_time = (H5D_fill_time_t)HDva_arg(ap, int); switch (fill_time) { case H5D_FILL_TIME_ERROR: - HDfprintf(out, "H5D_FILL_TIME_ERROR"); + H5RS_acat(rs, "H5D_FILL_TIME_ERROR"); break; case H5D_FILL_TIME_ALLOC: - HDfprintf(out, "H5D_FILL_TIME_ALLOC"); + H5RS_acat(rs, "H5D_FILL_TIME_ALLOC"); break; case H5D_FILL_TIME_NEVER: - HDfprintf(out, "H5D_FILL_TIME_NEVER"); + H5RS_acat(rs, "H5D_FILL_TIME_NEVER"); break; case H5D_FILL_TIME_IFSET: - HDfprintf(out, "H5D_FILL_TIME_IFSET"); + H5RS_acat(rs, "H5D_FILL_TIME_IFSET"); break; default: - HDfprintf(out, "%ld", (long)fill_time); + H5RS_asprintf_cat(rs, "%ld", (long)fill_time); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'F': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'F': /* H5D_fill_value_t */ + { H5D_fill_value_t fill_value = (H5D_fill_value_t)HDva_arg(ap, int); switch (fill_value) { case H5D_FILL_VALUE_ERROR: - HDfprintf(out, "H5D_FILL_VALUE_ERROR"); + H5RS_acat(rs, "H5D_FILL_VALUE_ERROR"); break; case H5D_FILL_VALUE_UNDEFINED: - HDfprintf(out, "H5D_FILL_VALUE_UNDEFINED"); + H5RS_acat(rs, "H5D_FILL_VALUE_UNDEFINED"); break; case H5D_FILL_VALUE_DEFAULT: - HDfprintf(out, "H5D_FILL_VALUE_DEFAULT"); + H5RS_acat(rs, "H5D_FILL_VALUE_DEFAULT"); break; case H5D_FILL_VALUE_USER_DEFINED: - HDfprintf(out, "H5D_FILL_VALUE_USER_DEFINED"); + H5RS_acat(rs, "H5D_FILL_VALUE_USER_DEFINED"); break; default: - HDfprintf(out, "%ld", (long)fill_value); + H5RS_asprintf_cat(rs, "%ld", (long)fill_value); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'h': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'g': /* H5D_gather_func_t */ + { + H5D_gather_func_t gop = (H5D_gather_func_t)HDva_arg(ap, H5D_gather_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)gop); + } /* end block */ + break; + + case 'h': /* H5FD_mpio_chunk_opt_t */ + { H5FD_mpio_chunk_opt_t opt = (H5FD_mpio_chunk_opt_t)HDva_arg(ap, int); switch (opt) { case H5FD_MPIO_CHUNK_DEFAULT: - HDfprintf(out, "H5FD_MPIO_CHUNK_DEFAULT"); + H5RS_acat(rs, "H5FD_MPIO_CHUNK_DEFAULT"); break; case H5FD_MPIO_CHUNK_ONE_IO: - HDfprintf(out, "H5FD_MPIO_CHUNK_ONE_IO"); + H5RS_acat(rs, "H5FD_MPIO_CHUNK_ONE_IO"); break; case H5FD_MPIO_CHUNK_MULTI_IO: - HDfprintf(out, "H5FD_MPIO_CHUNK_MULTI_IO"); + H5RS_acat(rs, "H5FD_MPIO_CHUNK_MULTI_IO"); break; default: - HDfprintf(out, "%ld", (long)opt); + H5RS_asprintf_cat(rs, "%ld", (long)opt); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'i': /* H5D_mpio_actual_io_mode_t */ + { H5D_mpio_actual_io_mode_t actual_io_mode = (H5D_mpio_actual_io_mode_t)HDva_arg(ap, int); switch (actual_io_mode) { case H5D_MPIO_NO_COLLECTIVE: - HDfprintf(out, "H5D_MPIO_NO_COLLECTIVE"); + H5RS_acat(rs, "H5D_MPIO_NO_COLLECTIVE"); break; case H5D_MPIO_CHUNK_INDEPENDENT: - HDfprintf(out, "H5D_MPIO_CHUNK_INDEPENDENT"); + H5RS_acat(rs, "H5D_MPIO_CHUNK_INDEPENDENT"); break; case H5D_MPIO_CHUNK_COLLECTIVE: - HDfprintf(out, "H5D_MPIO_CHUNK_COLLECTIVE"); + H5RS_acat(rs, "H5D_MPIO_CHUNK_COLLECTIVE"); break; case H5D_MPIO_CHUNK_MIXED: - HDfprintf(out, "H5D_MPIO_CHUNK_MIXED"); + H5RS_acat(rs, "H5D_MPIO_CHUNK_MIXED"); break; case H5D_MPIO_CONTIGUOUS_COLLECTIVE: - HDfprintf(out, "H5D_MPIO_CONTIGUOUS_COLLECTIVE"); + H5RS_acat(rs, "H5D_MPIO_CONTIGUOUS_COLLECTIVE"); break; default: - HDfprintf(out, "%ld", (long)actual_io_mode); + H5RS_asprintf_cat(rs, "%ld", (long)actual_io_mode); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'k': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'I': /* H5FD_file_image_callbacks_t */ + { + H5FD_file_image_callbacks_t ficb = HDva_arg(ap, H5FD_file_image_callbacks_t); + + H5RS_asprintf_cat(rs, "{%p, ", (void *)(uintptr_t)ficb.image_malloc); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.image_memcpy); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.image_realloc); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.image_free); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.udata_copy); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.udata_free); + H5RS_asprintf_cat(rs, "%p}", ficb.udata); + } /* end block */ + break; + + case 'k': /* H5D_chunk_index_t */ + { H5D_chunk_index_t idx = (H5D_chunk_index_t)HDva_arg(ap, int); switch (idx) { case H5D_CHUNK_IDX_BTREE: - HDfprintf(out, "H5D_CHUNK_IDX_BTREE"); + H5RS_acat(rs, "H5D_CHUNK_IDX_BTREE"); break; case H5D_CHUNK_IDX_NONE: - HDfprintf(out, "H5D_CHUNK_IDX_NONE"); + H5RS_acat(rs, "H5D_CHUNK_IDX_NONE"); break; case H5D_CHUNK_IDX_FARRAY: - HDfprintf(out, "H5D_CHUNK_IDX_FARRAY"); + H5RS_acat(rs, "H5D_CHUNK_IDX_FARRAY"); break; case H5D_CHUNK_IDX_EARRAY: - HDfprintf(out, "H5D_CHUNK_IDX_EARRAY"); + H5RS_acat(rs, "H5D_CHUNK_IDX_EARRAY"); break; case H5D_CHUNK_IDX_BT2: - HDfprintf(out, "H5D_CHUNK_IDX_BT2"); + H5RS_acat(rs, "H5D_CHUNK_IDX_BT2"); break; case H5D_CHUNK_IDX_SINGLE: - HDfprintf(out, "H5D_CHUNK_IDX_SINGLE"); + H5RS_acat(rs, "H5D_CHUNK_IDX_SINGLE"); break; case H5D_CHUNK_IDX_NTYPES: - HDfprintf(out, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)"); + H5RS_acat(rs, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)"); break; default: - HDfprintf(out, "UNKNOWN VALUE: %ld", (long)idx); + H5RS_asprintf_cat(rs, "UNKNOWN VALUE: %ld", (long)idx); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'l': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'l': /* H5D_layout_t */ + { H5D_layout_t layout = (H5D_layout_t)HDva_arg(ap, int); switch (layout) { case H5D_LAYOUT_ERROR: - HDfprintf(out, "H5D_LAYOUT_ERROR"); + H5RS_acat(rs, "H5D_LAYOUT_ERROR"); break; case H5D_COMPACT: - HDfprintf(out, "H5D_COMPACT"); + H5RS_acat(rs, "H5D_COMPACT"); break; case H5D_CONTIGUOUS: - HDfprintf(out, "H5D_CONTIGUOUS"); + H5RS_acat(rs, "H5D_CONTIGUOUS"); break; case H5D_CHUNKED: - HDfprintf(out, "H5D_CHUNKED"); + H5RS_acat(rs, "H5D_CHUNKED"); break; case H5D_VIRTUAL: - HDfprintf(out, "H5D_VIRTUAL"); + H5RS_acat(rs, "H5D_VIRTUAL"); break; case H5D_NLAYOUTS: - HDfprintf(out, "H5D_NLAYOUTS"); + H5RS_acat(rs, "H5D_NLAYOUTS"); break; default: - HDfprintf(out, "%ld", (long)layout); + H5RS_asprintf_cat(rs, "%ld", (long)layout); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'n': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'n': /* H5D_mpio_no_collective_cause_t */ + { H5D_mpio_no_collective_cause_t nocol_cause_mode = (H5D_mpio_no_collective_cause_t)HDva_arg(ap, int); hbool_t flag_already_displayed = FALSE; /* Check for all bit-flags which might be set */ if (nocol_cause_mode & H5D_MPIO_COLLECTIVE) { - HDfprintf(out, "H5D_MPIO_COLLECTIVE"); + H5RS_acat(rs, "H5D_MPIO_COLLECTIVE"); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_SET_INDEPENDENT) { - HDfprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_SET_INDEPENDENT", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_DATATYPE_CONVERSION) { - HDfprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_DATATYPE_CONVERSION", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_DATA_TRANSFORMS) { - HDfprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_DATA_TRANSFORMS", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED) { - HDfprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES) { - HDfprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET) { - HDfprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ /* Display '' if there's no flags set */ if (!flag_already_displayed) - HDfprintf(out, ""); - } /* end else */ + H5RS_acat(rs, ""); + } /* end block */ break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'o': /* H5D_mpio_actual_chunk_opt_mode_t */ + { H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode = (H5D_mpio_actual_chunk_opt_mode_t)HDva_arg(ap, int); switch (chunk_opt_mode) { case H5D_MPIO_NO_CHUNK_OPTIMIZATION: - HDfprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); + H5RS_acat(rs, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); break; case H5D_MPIO_LINK_CHUNK: - HDfprintf(out, "H5D_MPIO_LINK_CHUNK"); + H5RS_acat(rs, "H5D_MPIO_LINK_CHUNK"); break; case H5D_MPIO_MULTI_CHUNK: - HDfprintf(out, "H5D_MPIO_MULTI_CHUNK"); + H5RS_acat(rs, "H5D_MPIO_MULTI_CHUNK"); break; default: - HDfprintf(out, "%ld", (long)chunk_opt_mode); + H5RS_asprintf_cat(rs, "%ld", (long)chunk_opt_mode); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'O': /* H5D_operator_t */ + { + H5D_operator_t dop = (H5D_operator_t)HDva_arg(ap, H5D_operator_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)dop); + } /* end block */ + break; + + case 's': /* H5D_space_status_t */ + { H5D_space_status_t space_status = (H5D_space_status_t)HDva_arg(ap, int); switch (space_status) { case H5D_SPACE_STATUS_NOT_ALLOCATED: - HDfprintf(out, "H5D_SPACE_STATUS_NOT_ALLOCATED"); + H5RS_acat(rs, "H5D_SPACE_STATUS_NOT_ALLOCATED"); break; case H5D_SPACE_STATUS_PART_ALLOCATED: - HDfprintf(out, "H5D_SPACE_STATUS_PART_ALLOCATED"); + H5RS_acat(rs, "H5D_SPACE_STATUS_PART_ALLOCATED"); break; case H5D_SPACE_STATUS_ALLOCATED: - HDfprintf(out, "H5D_SPACE_STATUS_ALLOCATED"); + H5RS_acat(rs, "H5D_SPACE_STATUS_ALLOCATED"); break; case H5D_SPACE_STATUS_ERROR: - HDfprintf(out, "H5D_SPACE_STATUS_ERROR"); + H5RS_acat(rs, "H5D_SPACE_STATUS_ERROR"); break; default: - HDfprintf(out, "%ld", (long)space_status); + H5RS_asprintf_cat(rs, "%ld", (long)space_status); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - H5FD_mpio_xfer_t transfer = (H5FD_mpio_xfer_t)HDva_arg(ap, int); + case 'S': /* H5D_scatter_func_t */ + { + H5D_scatter_func_t sop = (H5D_scatter_func_t)HDva_arg(ap, H5D_scatter_func_t); - switch (transfer) { + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)sop); + } /* end block */ + break; + + case 't': /* H5FD_mpio_xfer_t */ + { + H5FD_mpio_xfer_t transfer = (H5FD_mpio_xfer_t)HDva_arg(ap, int); + + switch (transfer) { case H5FD_MPIO_INDEPENDENT: - HDfprintf(out, "H5FD_MPIO_INDEPENDENT"); + H5RS_acat(rs, "H5FD_MPIO_INDEPENDENT"); break; case H5FD_MPIO_COLLECTIVE: - HDfprintf(out, "H5FD_MPIO_COLLECTIVE"); + H5RS_acat(rs, "H5FD_MPIO_COLLECTIVE"); break; default: - HDfprintf(out, "%ld", (long)transfer); + H5RS_asprintf_cat(rs, "%ld", (long)transfer); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'v': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'v': /* H5D_vds_view_t */ + { H5D_vds_view_t view = (H5D_vds_view_t)HDva_arg(ap, int); switch (view) { case H5D_VDS_ERROR: - HDfprintf(out, "H5D_VDS_ERROR"); + H5RS_acat(rs, "H5D_VDS_ERROR"); break; case H5D_VDS_FIRST_MISSING: - HDfprintf(out, "H5D_VDS_FIRST_MISSING"); + H5RS_acat(rs, "H5D_VDS_FIRST_MISSING"); break; case H5D_VDS_LAST_AVAILABLE: - HDfprintf(out, "H5D_VDS_LAST_AVAILABLE"); + H5RS_acat(rs, "H5D_VDS_LAST_AVAILABLE"); break; default: - HDfprintf(out, "%ld", (long)view); + H5RS_asprintf_cat(rs, "%ld", (long)view); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(D%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(D%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* herr_t */ + { herr_t status = HDva_arg(ap, herr_t); if (status >= 0) - HDfprintf(out, "SUCCEED"); + H5RS_acat(rs, "SUCCEED"); else - HDfprintf(out, "FAIL"); - } /* end else */ + H5RS_acat(rs, "FAIL"); + } /* end block */ break; - case 'E': - switch (type[1]) { - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'E': + switch (type[1]) { +#ifndef H5_NO_DEPRECATED_SYMBOLS + case 'a': /* H5E_auto1_t */ + { + H5E_auto1_t eauto1 = (H5E_auto1_t)HDva_arg(ap, H5E_auto1_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)eauto1); + } /* end block */ + break; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + case 'A': /* H5E_auto2_t */ + { + H5E_auto2_t eauto2 = (H5E_auto2_t)HDva_arg(ap, H5E_auto2_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)eauto2); + } /* end block */ + break; + + case 'd': /* H5E_direction_t */ + { H5E_direction_t direction = (H5E_direction_t)HDva_arg(ap, int); switch (direction) { case H5E_WALK_UPWARD: - HDfprintf(out, "H5E_WALK_UPWARD"); + H5RS_acat(rs, "H5E_WALK_UPWARD"); break; case H5E_WALK_DOWNWARD: - HDfprintf(out, "H5E_WALK_DOWNWARD"); + H5RS_acat(rs, "H5E_WALK_DOWNWARD"); break; default: - HDfprintf(out, "%ld", (long)direction); + H5RS_asprintf_cat(rs, "%ld", (long)direction); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* H5E_error_t */ + { H5E_error2_t *error = HDva_arg(ap, H5E_error2_t *); - HDfprintf(out, "0x%p", error); - } /* end else */ + H5RS_asprintf_cat(rs, "%p", (void *)error); + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5ES_status_t */ + { H5ES_status_t status = (H5ES_status_t)HDva_arg(ap, int); switch (status) { case H5ES_STATUS_IN_PROGRESS: - HDfprintf(out, "H5ES_STATUS_IN_PROGRESS"); + H5RS_acat(rs, "H5ES_STATUS_IN_PROGRESS"); break; + case H5ES_STATUS_SUCCEED: - HDfprintf(out, "H5ES_STATUS_SUCCEED"); + H5RS_acat(rs, "H5ES_STATUS_SUCCEED"); break; + case H5ES_STATUS_FAIL: - HDfprintf(out, "H5ES_STATUS_FAIL"); - break; - case H5ES_STATUS_CANCELED: - HDfprintf(out, "H5ES_STATUS_CANCELED"); + H5RS_acat(rs, "H5ES_STATUS_FAIL"); break; default: - HDfprintf(out, "%ld", (long)status); + H5RS_asprintf_cat(rs, "%ld", (long)status); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5E_type_t */ + { H5E_type_t etype = (H5E_type_t)HDva_arg(ap, int); switch (etype) { case H5E_MAJOR: - HDfprintf(out, "H5E_MAJOR"); + H5RS_acat(rs, "H5E_MAJOR"); break; case H5E_MINOR: - HDfprintf(out, "H5E_MINOR"); + H5RS_acat(rs, "H5E_MINOR"); break; default: - HDfprintf(out, "%ld", (long)etype); + H5RS_asprintf_cat(rs, "%ld", (long)etype); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(E%c)", type[1]); - goto error; - } /* end switch */ - break; - - case 'F': - switch (type[1]) { - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - H5F_close_degree_t degree = (H5F_close_degree_t)HDva_arg(ap, int); - - switch (degree) { - case H5F_CLOSE_DEFAULT: - HDfprintf(out, "H5F_CLOSE_DEFAULT"); - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(E%c)", type[1]); + goto error; + } /* end switch */ + break; - case H5F_CLOSE_WEAK: - HDfprintf(out, "H5F_CLOSE_WEAK"); - break; + case 'F': + switch (type[1]) { + case 'C': /* H5FD_class_t */ + { + H5FD_class_t cls = HDva_arg(ap, H5FD_class_t); - case H5F_CLOSE_SEMI: - HDfprintf(out, "H5F_CLOSE_SEMI"); - break; + H5RS_asprintf_cat(rs, "{'%s', " H5_PRINTF_HADDR_FMT ", ", cls.name, cls.maxaddr); + H5_trace_args_close_degree(rs, cls.fc_degree); + H5RS_acat(rs, ", ...}"); + } /* end block */ + break; - case H5F_CLOSE_STRONG: - HDfprintf(out, "H5F_CLOSE_STRONG"); - break; + case 'd': /* H5F_close_degree_t */ + { + H5F_close_degree_t degree = (H5F_close_degree_t)HDva_arg(ap, int); - default: - HDfprintf(out, "%ld", (long)degree); - break; - } /* end switch */ - } /* end else */ + H5_trace_args_close_degree(rs, degree); + } /* end block */ break; - case 'f': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'f': /* H5F_fspace_strategy_t */ + { H5F_fspace_strategy_t fs_strategy = (H5F_fspace_strategy_t)HDva_arg(ap, int); switch (fs_strategy) { case H5F_FSPACE_STRATEGY_FSM_AGGR: - HDfprintf(out, "H5F_FSPACE_STRATEGY_FSM_AGGR"); + H5RS_acat(rs, "H5F_FSPACE_STRATEGY_FSM_AGGR"); break; case H5F_FSPACE_STRATEGY_PAGE: - HDfprintf(out, "H5F_FSPACE_STRATEGY_PAGE"); + H5RS_acat(rs, "H5F_FSPACE_STRATEGY_PAGE"); break; case H5F_FSPACE_STRATEGY_AGGR: - HDfprintf(out, "H5F_FSPACE_STRATEGY_AGGR"); + H5RS_acat(rs, "H5F_FSPACE_STRATEGY_AGGR"); break; case H5F_FSPACE_STRATEGY_NONE: - HDfprintf(out, "H5F_FSPACE_STRATEGY_NONE"); + H5RS_acat(rs, "H5F_FSPACE_STRATEGY_NONE"); break; case H5F_FSPACE_STRATEGY_NTYPES: default: - HDfprintf(out, "%ld", (long)fs_strategy); + H5RS_asprintf_cat(rs, "%ld", (long)fs_strategy); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'm': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'F': /* H5F_flush_cb_t */ + { + H5F_flush_cb_t fflsh = (H5F_flush_cb_t)HDva_arg(ap, H5F_flush_cb_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)fflsh); + } /* end block */ + break; + + case 'I': /* H5F_info2_t */ + { + H5F_info2_t fi2 = HDva_arg(ap, H5F_info2_t); + + H5RS_asprintf_cat(rs, "{{%u, %" PRIuHSIZE ", %" PRIuHSIZE "}, ", + fi2.super.version, fi2.super.super_size, + fi2.super.super_ext_size); + H5RS_asprintf_cat(rs, "{%u, %" PRIuHSIZE ", %" PRIuHSIZE "}, ", fi2.free.version, + fi2.free.meta_size, fi2.free.tot_space); + H5RS_asprintf_cat(rs, "{%u, %" PRIuHSIZE ", {%" PRIuHSIZE ", %" PRIuHSIZE "}}}", + fi2.sohm.version, fi2.sohm.hdr_size, + fi2.sohm.msgs_info.index_size, fi2.sohm.msgs_info.heap_size); + } /* end block */ + break; + + case 'm': /* H5F_mem_t */ + { H5F_mem_t mem_type = (H5F_mem_t)HDva_arg(ap, int); switch (mem_type) { case H5FD_MEM_NOLIST: - HDfprintf(out, "H5FD_MEM_NOLIST"); + H5RS_acat(rs, "H5FD_MEM_NOLIST"); break; case H5FD_MEM_DEFAULT: - HDfprintf(out, "H5FD_MEM_DEFAULT"); + H5RS_acat(rs, "H5FD_MEM_DEFAULT"); break; case H5FD_MEM_SUPER: - HDfprintf(out, "H5FD_MEM_SUPER"); + H5RS_acat(rs, "H5FD_MEM_SUPER"); break; case H5FD_MEM_BTREE: - HDfprintf(out, "H5FD_MEM_BTREE"); + H5RS_acat(rs, "H5FD_MEM_BTREE"); break; case H5FD_MEM_DRAW: - HDfprintf(out, "H5FD_MEM_DRAW"); + H5RS_acat(rs, "H5FD_MEM_DRAW"); break; case H5FD_MEM_GHEAP: - HDfprintf(out, "H5FD_MEM_GHEAP"); + H5RS_acat(rs, "H5FD_MEM_GHEAP"); break; case H5FD_MEM_LHEAP: - HDfprintf(out, "H5FD_MEM_LHEAP"); + H5RS_acat(rs, "H5FD_MEM_LHEAP"); break; case H5FD_MEM_OHDR: - HDfprintf(out, "H5FD_MEM_OHDR"); + H5RS_acat(rs, "H5FD_MEM_OHDR"); break; case H5FD_MEM_NTYPES: default: - HDfprintf(out, "%ld", (long)mem_type); + H5RS_asprintf_cat(rs, "%ld", (long)mem_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5F_scope_t */ + { H5F_scope_t scope = (H5F_scope_t)HDva_arg(ap, int); switch (scope) { case H5F_SCOPE_LOCAL: - HDfprintf(out, "H5F_SCOPE_LOCAL"); + H5RS_acat(rs, "H5F_SCOPE_LOCAL"); break; case H5F_SCOPE_GLOBAL: - HDfprintf(out, "H5F_SCOPE_GLOBAL"); + H5RS_acat(rs, "H5F_SCOPE_GLOBAL"); break; default: - HDfprintf(out, "%ld", (long)scope); + H5RS_asprintf_cat(rs, "%ld", (long)scope); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ + case 't': /* H5F_file_space_type_t */ + { + H5F_file_space_type_t fspace_type = (H5F_file_space_type_t)HDva_arg(ap, int); + + switch (fspace_type) { + case H5F_FILE_SPACE_DEFAULT: + H5RS_acat(rs, "H5F_FILE_SPACE_DEFAULT"); + break; + + case H5F_FILE_SPACE_ALL_PERSIST: + H5RS_acat(rs, "H5F_FILE_SPACE_ALL_PERSIST"); + break; + + case H5F_FILE_SPACE_ALL: + H5RS_acat(rs, "H5F_FILE_SPACE_ALL"); + break; + + case H5F_FILE_SPACE_AGGR_VFD: + H5RS_acat(rs, "H5F_FILE_SPACE_AGGR_VFD"); + break; + + case H5F_FILE_SPACE_VFD: + H5RS_acat(rs, "H5F_FILE_SPACE_VFD"); + break; + + case H5F_FILE_SPACE_NTYPES: + default: + H5RS_asprintf_cat(rs, "%ld", (long)fspace_type); + break; + } /* end switch */ + } /* end block */ break; - case 'v': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'v': /* H5F_libver_t */ + { H5F_libver_t libver_vers = (H5F_libver_t)HDva_arg(ap, int); switch (libver_vers) { case H5F_LIBVER_EARLIEST: - HDfprintf(out, "H5F_LIBVER_EARLIEST"); + H5RS_acat(rs, "H5F_LIBVER_EARLIEST"); break; case H5F_LIBVER_V18: - HDfprintf(out, "H5F_LIBVER_V18"); + H5RS_acat(rs, "H5F_LIBVER_V18"); break; case H5F_LIBVER_V110: - HDfprintf(out, "H5F_LIBVER_V110"); + H5RS_acat(rs, "H5F_LIBVER_V110"); break; case H5F_LIBVER_V112: - HDfprintf(out, "H5F_LIBVER_V112"); + H5RS_acat(rs, "H5F_LIBVER_V112"); break; case H5F_LIBVER_V114: HDcompile_assert(H5F_LIBVER_LATEST == H5F_LIBVER_V114); - HDfprintf(out, "H5F_LIBVER_LATEST"); + H5RS_acat(rs, "H5F_LIBVER_LATEST"); break; case H5F_LIBVER_ERROR: case H5F_LIBVER_NBOUNDS: default: - HDfprintf(out, "%ld", (long)libver_vers); + H5RS_asprintf_cat(rs, "%ld", (long)libver_vers); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(F%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(F%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'G': - switch (type[1]) { + case 'G': + switch (type[1]) { #ifndef H5_NO_DEPRECATED_SYMBOLS - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'i': /* H5G_iterate_t */ + { + H5G_iterate_t git = (H5G_iterate_t)HDva_arg(ap, H5G_iterate_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)git); + } /* end block */ + break; + + case 'o': /* H5G_obj_t */ + { H5G_obj_t obj_type = (H5G_obj_t)HDva_arg(ap, int); switch (obj_type) { case H5G_UNKNOWN: - HDfprintf(out, "H5G_UNKNOWN"); + H5RS_acat(rs, "H5G_UNKNOWN"); break; case H5G_GROUP: - HDfprintf(out, "H5G_GROUP"); + H5RS_acat(rs, "H5G_GROUP"); break; case H5G_DATASET: - HDfprintf(out, "H5G_DATASET"); + H5RS_acat(rs, "H5G_DATASET"); break; case H5G_TYPE: - HDfprintf(out, "H5G_TYPE"); + H5RS_acat(rs, "H5G_TYPE"); break; case H5G_LINK: - HDfprintf(out, "H5G_LINK"); + H5RS_acat(rs, "H5G_LINK"); break; case H5G_UDLINK: - HDfprintf(out, "H5G_UDLINK"); + H5RS_acat(rs, "H5G_UDLINK"); break; case H5G_RESERVED_5: case H5G_RESERVED_6: case H5G_RESERVED_7: - HDfprintf(out, "H5G_RESERVED(%ld)", (long)obj_type); + H5RS_asprintf_cat(rs, "H5G_RESERVED(%ld)", (long)obj_type); break; default: - HDfprintf(out, "%ld", (long)obj_type); + H5RS_asprintf_cat(rs, "%ld", (long)obj_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5G_stat_t */ + { H5G_stat_t *statbuf = HDva_arg(ap, H5G_stat_t *); - HDfprintf(out, "0x%p", statbuf); - } + H5RS_asprintf_cat(rs, "%p", (void *)statbuf); + } /* end block */ break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - default: - HDfprintf(out, "BADTYPE(G%c)", type[1]); - goto error; - } - break; - - case 'h': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - hsize_t *p = (hsize_t *)vp; + default: + H5RS_asprintf_cat(rs, "BADTYPE(G%c)", type[1]); + goto error; + } /* end switch */ + break; - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) { - if (H5S_UNLIMITED == p[i]) - HDfprintf(out, "%sH5S_UNLIMITED", (i ? ", " : "")); - else - HDfprintf(out, "%s%Hu", (i ? ", " : ""), p[i]); - } /* end for */ - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'h': /* hsize_t */ + { hsize_t hsize = HDva_arg(ap, hsize_t); if (H5S_UNLIMITED == hsize) - HDfprintf(out, "H5S_UNLIMITED"); + H5RS_acat(rs, "H5S_UNLIMITED"); else { - HDfprintf(out, "%Hu", hsize); + H5RS_asprintf_cat(rs, "%" PRIuHSIZE, hsize); asize[argno] = (hssize_t)hsize; } /* end else */ - } /* end else */ + } /* end block */ break; - case 'H': - switch (type[1]) { - case 's': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - hssize_t *p = (hssize_t *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%Hd", (i ? ", " : ""), p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'H': + switch (type[1]) { + case 'a': /* H5_alloc_stats_t */ + { + H5_alloc_stats_t stats = HDva_arg(ap, H5_alloc_stats_t); + + H5RS_asprintf_cat(rs, "{%llu, %zu, %zu, %zu, %zu, %zu, %zu}", + stats.total_alloc_bytes, stats.curr_alloc_bytes, + stats.peak_alloc_bytes, stats.max_block_size, + stats.total_alloc_blocks_count, stats.curr_alloc_blocks_count, + stats.peak_alloc_blocks_count); + } /* end block */ + break; + + case 's': /* hssize_t */ + { hssize_t hssize = HDva_arg(ap, hssize_t); - HDfprintf(out, "%Hd", hssize); + H5RS_asprintf_cat(rs, "%" PRIdHSIZE, hssize); asize[argno] = (hssize_t)hssize; - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(H%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(H%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'i': /* hid_t (and H5E_major_t / H5E_minor_t) */ + { hid_t obj = HDva_arg(ap, hid_t); if (H5P_DEFAULT == obj) - HDfprintf(out, "H5P_DEFAULT"); + H5RS_acat(rs, "H5P_DEFAULT"); else if (obj < 0) - HDfprintf(out, "FAIL"); + H5RS_acat(rs, "FAIL"); else { switch (H5I_TYPE(obj)) { /* Use internal H5I macro instead of function call */ case H5I_UNINIT: - HDfprintf(out, "%ld (uninit - error)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (uninit - error)", (unsigned long long)obj); break; case H5I_BADID: - HDfprintf(out, "%ld (error)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (badid - error)", (unsigned long long)obj); break; case H5I_FILE: - HDfprintf(out, "%ld (file)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (file)", (unsigned long long)obj); break; case H5I_GROUP: - HDfprintf(out, "%ld (group)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (group)", (unsigned long long)obj); break; case H5I_DATATYPE: if (obj == H5T_NATIVE_SCHAR_g) - HDfprintf(out, "H5T_NATIVE_SCHAR"); + H5RS_acat(rs, "H5T_NATIVE_SCHAR"); else if (obj == H5T_NATIVE_UCHAR_g) - HDfprintf(out, "H5T_NATIVE_UCHAR"); + H5RS_acat(rs, "H5T_NATIVE_UCHAR"); else if (obj == H5T_NATIVE_SHORT_g) - HDfprintf(out, "H5T_NATIVE_SHORT"); + H5RS_acat(rs, "H5T_NATIVE_SHORT"); else if (obj == H5T_NATIVE_USHORT_g) - HDfprintf(out, "H5T_NATIVE_USHORT"); + H5RS_acat(rs, "H5T_NATIVE_USHORT"); else if (obj == H5T_NATIVE_INT_g) - HDfprintf(out, "H5T_NATIVE_INT"); + H5RS_acat(rs, "H5T_NATIVE_INT"); else if (obj == H5T_NATIVE_UINT_g) - HDfprintf(out, "H5T_NATIVE_UINT"); + H5RS_acat(rs, "H5T_NATIVE_UINT"); else if (obj == H5T_NATIVE_LONG_g) - HDfprintf(out, "H5T_NATIVE_LONG"); + H5RS_acat(rs, "H5T_NATIVE_LONG"); else if (obj == H5T_NATIVE_ULONG_g) - HDfprintf(out, "H5T_NATIVE_ULONG"); + H5RS_acat(rs, "H5T_NATIVE_ULONG"); else if (obj == H5T_NATIVE_LLONG_g) - HDfprintf(out, "H5T_NATIVE_LLONG"); + H5RS_acat(rs, "H5T_NATIVE_LLONG"); else if (obj == H5T_NATIVE_ULLONG_g) - HDfprintf(out, "H5T_NATIVE_ULLONG"); + H5RS_acat(rs, "H5T_NATIVE_ULLONG"); else if (obj == H5T_NATIVE_FLOAT_g) - HDfprintf(out, "H5T_NATIVE_FLOAT"); + H5RS_acat(rs, "H5T_NATIVE_FLOAT"); else if (obj == H5T_NATIVE_DOUBLE_g) - HDfprintf(out, "H5T_NATIVE_DOUBLE"); + H5RS_acat(rs, "H5T_NATIVE_DOUBLE"); #if H5_SIZEOF_LONG_DOUBLE != 0 else if (obj == H5T_NATIVE_LDOUBLE_g) - HDfprintf(out, "H5T_NATIVE_LDOUBLE"); + H5RS_acat(rs, "H5T_NATIVE_LDOUBLE"); #endif else if (obj == H5T_IEEE_F32BE_g) - HDfprintf(out, "H5T_IEEE_F32BE"); + H5RS_acat(rs, "H5T_IEEE_F32BE"); else if (obj == H5T_IEEE_F32LE_g) - HDfprintf(out, "H5T_IEEE_F32LE"); + H5RS_acat(rs, "H5T_IEEE_F32LE"); else if (obj == H5T_IEEE_F64BE_g) - HDfprintf(out, "H5T_IEEE_F64BE"); + H5RS_acat(rs, "H5T_IEEE_F64BE"); else if (obj == H5T_IEEE_F64LE_g) - HDfprintf(out, "H5T_IEEE_F64LE"); + H5RS_acat(rs, "H5T_IEEE_F64LE"); else if (obj == H5T_STD_I8BE_g) - HDfprintf(out, "H5T_STD_I8BE"); + H5RS_acat(rs, "H5T_STD_I8BE"); else if (obj == H5T_STD_I8LE_g) - HDfprintf(out, "H5T_STD_I8LE"); + H5RS_acat(rs, "H5T_STD_I8LE"); else if (obj == H5T_STD_I16BE_g) - HDfprintf(out, "H5T_STD_I16BE"); + H5RS_acat(rs, "H5T_STD_I16BE"); else if (obj == H5T_STD_I16LE_g) - HDfprintf(out, "H5T_STD_I16LE"); + H5RS_acat(rs, "H5T_STD_I16LE"); else if (obj == H5T_STD_I32BE_g) - HDfprintf(out, "H5T_STD_I32BE"); + H5RS_acat(rs, "H5T_STD_I32BE"); else if (obj == H5T_STD_I32LE_g) - HDfprintf(out, "H5T_STD_I32LE"); + H5RS_acat(rs, "H5T_STD_I32LE"); else if (obj == H5T_STD_I64BE_g) - HDfprintf(out, "H5T_STD_I64BE"); + H5RS_acat(rs, "H5T_STD_I64BE"); else if (obj == H5T_STD_I64LE_g) - HDfprintf(out, "H5T_STD_I64LE"); + H5RS_acat(rs, "H5T_STD_I64LE"); else if (obj == H5T_STD_U8BE_g) - HDfprintf(out, "H5T_STD_U8BE"); + H5RS_acat(rs, "H5T_STD_U8BE"); else if (obj == H5T_STD_U8LE_g) - HDfprintf(out, "H5T_STD_U8LE"); + H5RS_acat(rs, "H5T_STD_U8LE"); else if (obj == H5T_STD_U16BE_g) - HDfprintf(out, "H5T_STD_U16BE"); + H5RS_acat(rs, "H5T_STD_U16BE"); else if (obj == H5T_STD_U16LE_g) - HDfprintf(out, "H5T_STD_U16LE"); + H5RS_acat(rs, "H5T_STD_U16LE"); else if (obj == H5T_STD_U32BE_g) - HDfprintf(out, "H5T_STD_U32BE"); + H5RS_acat(rs, "H5T_STD_U32BE"); else if (obj == H5T_STD_U32LE_g) - HDfprintf(out, "H5T_STD_U32LE"); + H5RS_acat(rs, "H5T_STD_U32LE"); else if (obj == H5T_STD_U64BE_g) - HDfprintf(out, "H5T_STD_U64BE"); + H5RS_acat(rs, "H5T_STD_U64BE"); else if (obj == H5T_STD_U64LE_g) - HDfprintf(out, "H5T_STD_U64LE"); + H5RS_acat(rs, "H5T_STD_U64LE"); else if (obj == H5T_STD_B8BE_g) - HDfprintf(out, "H5T_STD_B8BE"); + H5RS_acat(rs, "H5T_STD_B8BE"); else if (obj == H5T_STD_B8LE_g) - HDfprintf(out, "H5T_STD_B8LE"); + H5RS_acat(rs, "H5T_STD_B8LE"); else if (obj == H5T_STD_B16BE_g) - HDfprintf(out, "H5T_STD_B16BE"); + H5RS_acat(rs, "H5T_STD_B16BE"); else if (obj == H5T_STD_B16LE_g) - HDfprintf(out, "H5T_STD_B16LE"); + H5RS_acat(rs, "H5T_STD_B16LE"); else if (obj == H5T_STD_B32BE_g) - HDfprintf(out, "H5T_STD_B32BE"); + H5RS_acat(rs, "H5T_STD_B32BE"); else if (obj == H5T_STD_B32LE_g) - HDfprintf(out, "H5T_STD_B32LE"); + H5RS_acat(rs, "H5T_STD_B32LE"); else if (obj == H5T_STD_B64BE_g) - HDfprintf(out, "H5T_STD_B64BE"); + H5RS_acat(rs, "H5T_STD_B64BE"); else if (obj == H5T_STD_B64LE_g) - HDfprintf(out, "H5T_STD_B64LE"); + H5RS_acat(rs, "H5T_STD_B64LE"); else if (obj == H5T_C_S1_g) - HDfprintf(out, "H5T_C_S1"); + H5RS_acat(rs, "H5T_C_S1"); else if (obj == H5T_FORTRAN_S1_g) - HDfprintf(out, "H5T_FORTRAN_S1"); + H5RS_acat(rs, "H5T_FORTRAN_S1"); else - HDfprintf(out, "%ld (dtype)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (dtype)", (unsigned long long)obj); break; case H5I_DATASPACE: - HDfprintf(out, "%ld (dspace)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (dspace)", (unsigned long long)obj); /* Save the rank of simple dataspaces for arrays */ /* This may generate recursive call to the library... -QAK */ { @@ -1371,506 +1614,515 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case H5I_DATASET: - HDfprintf(out, "%ld (dset)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (dset)", (unsigned long long)obj); break; case H5I_ATTR: - HDfprintf(out, "%ld (attr)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (attr)", (unsigned long long)obj); break; case H5I_MAP: - HDfprintf(out, "%ld (map)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (map)", (unsigned long long)obj); break; case H5I_VFL: - HDfprintf(out, "%ld (file driver)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (file driver)", (unsigned long long)obj); break; case H5I_VOL: - HDfprintf(out, "%ld (VOL plugin)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (VOL plugin)", (unsigned long long)obj); break; case H5I_GENPROP_CLS: - HDfprintf(out, "%ld (genprop class)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (genprop class)", (unsigned long long)obj); break; case H5I_GENPROP_LST: - HDfprintf(out, "%ld (genprop list)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (genprop list)", (unsigned long long)obj); break; case H5I_ERROR_CLASS: - HDfprintf(out, "%ld (err class)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (err class)", (unsigned long long)obj); break; case H5I_ERROR_MSG: - HDfprintf(out, "%ld (err msg)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (err msg)", (unsigned long long)obj); break; case H5I_ERROR_STACK: - HDfprintf(out, "%ld (err stack)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (err stack)", (unsigned long long)obj); break; case H5I_SPACE_SEL_ITER: - HDfprintf(out, "%ld (dataspace selection iterator)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (dataspace selection iterator)", + (unsigned long long)obj); break; case H5I_NTYPES: - HDfprintf(out, "%ld (ntypes - error)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (ntypes - error)", (unsigned long long)obj); break; default: - HDfprintf(out, "%ld (unknown class)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (unknown class)", (unsigned long long)obj); break; } /* end switch */ } /* end else */ - } /* end else */ + } /* end block */ break; - case 'I': - switch (type[1]) { - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'I': + switch (type[1]) { + case 'f': /* H5I_free_t */ + { + H5I_free_t ifree = (H5I_free_t)HDva_arg(ap, H5I_free_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)ifree); + } /* end block */ + break; + + case 'i': /* H5_index_t */ + { H5_index_t idx_type = (H5_index_t)HDva_arg(ap, int); switch (idx_type) { case H5_INDEX_UNKNOWN: - HDfprintf(out, "H5_INDEX_UNKNOWN"); + H5RS_acat(rs, "H5_INDEX_UNKNOWN"); break; case H5_INDEX_NAME: - HDfprintf(out, "H5_INDEX_NAME"); + H5RS_acat(rs, "H5_INDEX_NAME"); break; case H5_INDEX_CRT_ORDER: - HDfprintf(out, "H5_INDEX_CRT_ORDER"); + H5RS_acat(rs, "H5_INDEX_CRT_ORDER"); break; case H5_INDEX_N: - HDfprintf(out, "H5_INDEX_N"); + H5RS_acat(rs, "H5_INDEX_N"); break; default: - HDfprintf(out, "%ld", (long)idx_type); + H5RS_asprintf_cat(rs, "%ld", (long)idx_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'I': /* H5I_iterate_func_t */ + { + H5I_iterate_func_t iiter = (H5I_iterate_func_t)HDva_arg(ap, H5I_iterate_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)iiter); + } /* end block */ + break; + + case 'o': /* H5_iter_order_t */ + { H5_iter_order_t order = (H5_iter_order_t)HDva_arg(ap, int); switch (order) { case H5_ITER_UNKNOWN: - HDfprintf(out, "H5_ITER_UNKNOWN"); + H5RS_acat(rs, "H5_ITER_UNKNOWN"); break; case H5_ITER_INC: - HDfprintf(out, "H5_ITER_INC"); + H5RS_acat(rs, "H5_ITER_INC"); break; case H5_ITER_DEC: - HDfprintf(out, "H5_ITER_DEC"); + H5RS_acat(rs, "H5_ITER_DEC"); break; case H5_ITER_NATIVE: - HDfprintf(out, "H5_ITER_NATIVE"); + H5RS_acat(rs, "H5_ITER_NATIVE"); break; case H5_ITER_N: - HDfprintf(out, "H5_ITER_N"); + H5RS_acat(rs, "H5_ITER_N"); break; default: - HDfprintf(out, "%ld", (long)order); + H5RS_asprintf_cat(rs, "%ld", (long)order); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - int *p = (int *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%d", (i ? ", " : ""), p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* int / int32_t */ + { int is = HDva_arg(ap, int); - HDfprintf(out, "%d", is); + H5RS_asprintf_cat(rs, "%d", is); asize[argno] = is; - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'S': /* H5I_search_func_t */ + { + H5I_search_func_t isearch = (H5I_search_func_t)HDva_arg(ap, H5I_search_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)isearch); + } /* end block */ + break; + + case 't': /* H5I_type_t */ + { H5I_type_t id_type = (H5I_type_t)HDva_arg(ap, int); switch (id_type) { case H5I_UNINIT: - HDfprintf(out, "H5I_UNINIT"); + H5RS_acat(rs, "H5I_UNINIT"); break; case H5I_BADID: - HDfprintf(out, "H5I_BADID"); + H5RS_acat(rs, "H5I_BADID"); break; case H5I_FILE: - HDfprintf(out, "H5I_FILE"); + H5RS_acat(rs, "H5I_FILE"); break; case H5I_GROUP: - HDfprintf(out, "H5I_GROUP"); + H5RS_acat(rs, "H5I_GROUP"); break; case H5I_DATATYPE: - HDfprintf(out, "H5I_DATATYPE"); + H5RS_acat(rs, "H5I_DATATYPE"); break; case H5I_DATASPACE: - HDfprintf(out, "H5I_DATASPACE"); + H5RS_acat(rs, "H5I_DATASPACE"); break; case H5I_DATASET: - HDfprintf(out, "H5I_DATASET"); + H5RS_acat(rs, "H5I_DATASET"); break; case H5I_ATTR: - HDfprintf(out, "H5I_ATTR"); + H5RS_acat(rs, "H5I_ATTR"); break; case H5I_MAP: - HDfprintf(out, "H5I_MAP"); + H5RS_acat(rs, "H5I_MAP"); break; case H5I_VFL: - HDfprintf(out, "H5I_VFL"); + H5RS_acat(rs, "H5I_VFL"); break; case H5I_VOL: - HDfprintf(out, "H5I_VOL"); + H5RS_acat(rs, "H5I_VOL"); break; case H5I_GENPROP_CLS: - HDfprintf(out, "H5I_GENPROP_CLS"); + H5RS_acat(rs, "H5I_GENPROP_CLS"); break; case H5I_GENPROP_LST: - HDfprintf(out, "H5I_GENPROP_LST"); + H5RS_acat(rs, "H5I_GENPROP_LST"); break; case H5I_ERROR_CLASS: - HDfprintf(out, "H5I_ERROR_CLASS"); + H5RS_acat(rs, "H5I_ERROR_CLASS"); break; case H5I_ERROR_MSG: - HDfprintf(out, "H5I_ERROR_MSG"); + H5RS_acat(rs, "H5I_ERROR_MSG"); break; case H5I_ERROR_STACK: - HDfprintf(out, "H5I_ERROR_STACK"); + H5RS_acat(rs, "H5I_ERROR_STACK"); break; case H5I_SPACE_SEL_ITER: - HDfprintf(out, "H5I_SPACE_SEL_ITER"); + H5RS_acat(rs, "H5I_SPACE_SEL_ITER"); break; case H5I_NTYPES: - HDfprintf(out, "H5I_NTYPES"); + H5RS_acat(rs, "H5I_NTYPES"); break; default: - HDfprintf(out, "%ld", (long)id_type); + H5RS_asprintf_cat(rs, "%ld", (long)id_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'u': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - unsigned *p = (unsigned *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%u", i ? ", " : "", p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'u': /* unsigned / uint32_t */ + { unsigned iu = HDva_arg(ap, unsigned); - HDfprintf(out, "%u", iu); + H5RS_asprintf_cat(rs, "%u", iu); asize[argno] = iu; - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(I%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(I%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'k': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'k': /* H5O_token_t */ + { H5O_token_t token = HDva_arg(ap, H5O_token_t); int j; for (j = 0; j < H5O_MAX_TOKEN_SIZE; j++) - HDfprintf(out, "%02x", token.__data[j]); - } /* end else */ + H5RS_asprintf_cat(rs, "%02x", token.__data[j]); + } /* end block */ break; - case 'L': - switch (type[1]) { - case 'l': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'L': + switch (type[1]) { +#ifndef H5_NO_DEPRECATED_SYMBOLS + case 'i': /* H5L_iterate1_t */ + { + H5L_iterate1_t liter = (H5L_iterate1_t)HDva_arg(ap, H5L_iterate1_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)liter); + } /* end block */ + break; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + case 'I': /* H5L_iterate2_t */ + { + H5L_iterate2_t liter = (H5L_iterate2_t)HDva_arg(ap, H5L_iterate2_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)liter); + } /* end block */ + break; + + case 'l': /* H5L_type_t (or H5G_link_t) */ + { H5L_type_t link_type = (H5L_type_t)HDva_arg(ap, int); switch (link_type) { case H5L_TYPE_ERROR: - HDfprintf(out, "H5L_TYPE_ERROR"); + H5RS_acat(rs, "H5L_TYPE_ERROR"); break; case H5L_TYPE_HARD: - HDfprintf(out, "H5L_TYPE_HARD"); + H5RS_acat(rs, "H5L_TYPE_HARD"); break; case H5L_TYPE_SOFT: - HDfprintf(out, "H5L_TYPE_SOFT"); + H5RS_acat(rs, "H5L_TYPE_SOFT"); break; case H5L_TYPE_EXTERNAL: - HDfprintf(out, "H5L_TYPE_EXTERNAL"); + H5RS_acat(rs, "H5L_TYPE_EXTERNAL"); break; case H5L_TYPE_MAX: - HDfprintf(out, "H5L_TYPE_MAX"); + H5RS_acat(rs, "H5L_TYPE_MAX"); break; default: - HDfprintf(out, "%ld", (long)link_type); + H5RS_asprintf_cat(rs, "%ld", (long)link_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(G%c)", type[1]); - goto error; - } /* end switch */ - break; + case 't': /* H5L_elink_traverse_t */ + { + H5L_elink_traverse_t elt = + (H5L_elink_traverse_t)HDva_arg(ap, H5L_elink_traverse_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)elt); + } /* end block */ + break; + + default: + H5RS_asprintf_cat(rs, "BADTYPE(G%c)", type[1]); + goto error; + } /* end switch */ + break; + + case 'M': + switch (type[1]) { + case 'a': /* H5MM_allocate_t */ + { + H5MM_allocate_t afunc = (H5MM_allocate_t)HDva_arg(ap, H5MM_allocate_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)afunc); + } /* end block */ + break; - case 'M': - switch (type[1]) { - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ #ifdef H5_HAVE_PARALLEL - else { + case 'c': /* MPI_Comm */ + { MPI_Comm comm = HDva_arg(ap, MPI_Comm); - HDfprintf(out, "%ld", (long)comm); - } /* end else */ -#endif /* H5_HAVE_PARALLEL */ + H5RS_asprintf_cat(rs, "%ld", (long)comm); + } /* end block */ + break; +#endif /* H5_HAVE_PARALLEL */ + + case 'f': /* H5MM_free_t */ + { + H5MM_free_t ffunc = (H5MM_free_t)HDva_arg(ap, H5MM_free_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)ffunc); + } /* end block */ break; - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ #ifdef H5_HAVE_PARALLEL - else { + case 'i': /* MPI_Info */ + { MPI_Info info = HDva_arg(ap, MPI_Info); - HDfprintf(out, "%ld", (long)info); - } /* end else */ -#endif /* H5_HAVE_PARALLEL */ + H5RS_asprintf_cat(rs, "%ld", (long)info); + } /* end block */ break; +#endif /* H5_HAVE_PARALLEL */ - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { +#ifdef H5_HAVE_MAP_API + case 'I': /* H5M_iterate_t */ + { + H5M_iterate_t miter = (H5M_iterate_t)HDva_arg(ap, H5M_iterate_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)miter); + } /* end block */ + break; +#endif /* H5_HAVE_MAP_API */ + + case 't': /* H5FD_mem_t */ + { H5FD_mem_t mt = (H5FD_mem_t)HDva_arg(ap, int); switch (mt) { case H5FD_MEM_NOLIST: - HDfprintf(out, "H5FD_MEM_NOLIST"); + H5RS_acat(rs, "H5FD_MEM_NOLIST"); break; case H5FD_MEM_DEFAULT: - HDfprintf(out, "H5FD_MEM_DEFAULT"); + H5RS_acat(rs, "H5FD_MEM_DEFAULT"); break; case H5FD_MEM_SUPER: - HDfprintf(out, "H5FD_MEM_SUPER"); + H5RS_acat(rs, "H5FD_MEM_SUPER"); break; case H5FD_MEM_BTREE: - HDfprintf(out, "H5FD_MEM_BTREE"); + H5RS_acat(rs, "H5FD_MEM_BTREE"); break; case H5FD_MEM_DRAW: - HDfprintf(out, "H5FD_MEM_DRAW"); + H5RS_acat(rs, "H5FD_MEM_DRAW"); break; case H5FD_MEM_GHEAP: - HDfprintf(out, "H5FD_MEM_GHEAP"); + H5RS_acat(rs, "H5FD_MEM_GHEAP"); break; case H5FD_MEM_LHEAP: - HDfprintf(out, "H5FD_MEM_LHEAP"); + H5RS_acat(rs, "H5FD_MEM_LHEAP"); break; case H5FD_MEM_OHDR: - HDfprintf(out, "H5FD_MEM_OHDR"); + H5RS_acat(rs, "H5FD_MEM_OHDR"); break; case H5FD_MEM_NTYPES: - HDfprintf(out, "H5FD_MEM_NTYPES"); + H5RS_acat(rs, "H5FD_MEM_NTYPES"); break; default: - HDfprintf(out, "%ld", (long)mt); + H5RS_asprintf_cat(rs, "%ld", (long)mt); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - goto error; - } /* end switch */ - break; + default: + goto error; + } /* end switch */ + break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'o': /* off_t */ + { off_t offset = HDva_arg(ap, off_t); - HDfprintf(out, "%ld", (long)offset); - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)offset); + } /* end block */ break; - case 'O': - switch (type[1]) { - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'O': + switch (type[1]) { +#ifndef H5_NO_DEPRECATED_SYMBOLS + case 'i': /* H5O_iterate1_t */ + { + H5O_iterate1_t oiter = (H5O_iterate1_t)HDva_arg(ap, H5O_iterate1_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)oiter); + } /* end block */ + break; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + case 'I': /* H5O_iterate2_t */ + { + H5O_iterate2_t oiter2 = (H5O_iterate2_t)HDva_arg(ap, H5O_iterate2_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)oiter2); + } /* end block */ + break; + + case 's': /* H5O_mcdt_search_cb_t */ + { + H5O_mcdt_search_cb_t osrch = + (H5O_mcdt_search_cb_t)HDva_arg(ap, H5O_mcdt_search_cb_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)osrch); + } /* end block */ + break; + + case 't': /* H5O_type_t */ + { H5O_type_t objtype = (H5O_type_t)HDva_arg(ap, int); switch (objtype) { case H5O_TYPE_UNKNOWN: - HDfprintf(out, "H5O_TYPE_UNKNOWN"); + H5RS_acat(rs, "H5O_TYPE_UNKNOWN"); break; case H5O_TYPE_GROUP: - HDfprintf(out, "H5O_TYPE_GROUP"); + H5RS_acat(rs, "H5O_TYPE_GROUP"); break; case H5O_TYPE_DATASET: - HDfprintf(out, "H5O_TYPE_DATASET"); + H5RS_acat(rs, "H5O_TYPE_DATASET"); break; case H5O_TYPE_NAMED_DATATYPE: - HDfprintf(out, "H5O_TYPE_NAMED_DATATYPE"); + H5RS_acat(rs, "H5O_TYPE_NAMED_DATATYPE"); break; case H5O_TYPE_MAP: - HDfprintf(out, "H5O_TYPE_MAP"); + H5RS_acat(rs, "H5O_TYPE_MAP"); break; case H5O_TYPE_NTYPES: - HDfprintf(out, "H5O_TYPE_NTYPES"); + H5RS_acat(rs, "H5O_TYPE_NTYPES"); break; default: - HDfprintf(out, "BADTYPE(%ld)", (long)objtype); + H5RS_asprintf_cat(rs, "BADTYPE(%ld)", (long)objtype); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(S%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(S%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'p': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'p': /* H5P_class_t */ + { hid_t pclass_id = HDva_arg(ap, hid_t); char * class_name = NULL; H5P_genclass_t *pclass; @@ -1879,619 +2131,609 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* (This may generate recursive call to the library... -QAK) */ if (NULL != (pclass = (H5P_genclass_t *)H5I_object(pclass_id)) && NULL != (class_name = H5P_get_class_name(pclass))) { - HDfprintf(out, "%s", class_name); + H5RS_asprintf_cat(rs, "%s", class_name); H5MM_xfree(class_name); } /* end if */ else - HDfprintf(out, "%ld", (long)pclass_id); - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)pclass_id); + } /* end block */ break; - case 'R': - switch (type[1]) { + case 'P': + switch (type[1]) { + case 'c': /* H5P_cls_create_func_t */ + { + H5P_cls_create_func_t pcls_crt = + (H5P_cls_create_func_t)HDva_arg(ap, H5P_cls_create_func_t); - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - hobj_ref_t ref = HDva_arg(ap, hobj_ref_t); + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)pcls_crt); + } /* end block */ + break; - HDfprintf(out, "Reference Object=%a", ref); - } /* end else */ + case 'C': /* H5P_prp_create_func_t */ + { + H5P_prp_create_func_t prp_crt = + (H5P_prp_create_func_t)HDva_arg(ap, H5P_prp_create_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_crt); + } /* end block */ break; - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'D': /* H5P_prp_delete_func_t */ + { + H5P_prp_delete_func_t prp_del = + (H5P_prp_delete_func_t)HDva_arg(ap, H5P_prp_delete_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_del); + } /* end block */ + break; + + case 'G': /* H5P_prp_get_func_t */ + { + H5P_prp_get_func_t prp_get = (H5P_prp_get_func_t)HDva_arg(ap, H5P_prp_get_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_get); + } /* end block */ + break; + + case 'i': /* H5P_iterate_t */ + { + H5P_iterate_t piter = (H5P_iterate_t)HDva_arg(ap, H5P_iterate_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)piter); + } /* end block */ + break; + + case 'l': /* H5P_cls_close_func_t */ + { + H5P_cls_close_func_t pcls_cls = + (H5P_cls_close_func_t)HDva_arg(ap, H5P_cls_close_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)pcls_cls); + } /* end block */ + break; + + case 'L': /* H5P_prp_close_func_t */ + { + H5P_prp_close_func_t prp_cls = + (H5P_prp_close_func_t)HDva_arg(ap, H5P_prp_close_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_cls); + } /* end block */ + break; + + case 'M': /* H5P_prp_compare_func_t */ + { + H5P_prp_compare_func_t prp_cmp = + (H5P_prp_compare_func_t)HDva_arg(ap, H5P_prp_compare_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_cmp); + } /* end block */ + break; + + case 'o': /* H5P_cls_copy_func_t */ + { + H5P_cls_copy_func_t pcls_cpy = + (H5P_cls_copy_func_t)HDva_arg(ap, H5P_cls_copy_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)pcls_cpy); + } /* end block */ + break; + + case 'O': /* H5P_prp_copy_func_t */ + { + H5P_prp_copy_func_t prp_cpy = + (H5P_prp_copy_func_t)HDva_arg(ap, H5P_prp_copy_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_cpy); + } /* end block */ + break; + + case 'S': /* H5P_prp_set_func_t */ + { + H5P_prp_set_func_t prp_set = (H5P_prp_set_func_t)HDva_arg(ap, H5P_prp_set_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_set); + } /* end block */ + break; + + default: + H5RS_asprintf_cat(rs, "BADTYPE(P%c)", type[1]); + goto error; + } /* end switch */ + break; + + case 'R': + switch (type[1]) { + case 'd': /* hdset_reg_ref_t */ + { /* Note! region references are array types */ - HDfprintf(out, "Reference Region"); + H5RS_acat(rs, "Reference Region"); goto error; - } /* end else */ + } /* end block */ break; - case 'r': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'o': /* hobj_ref_t */ + { + hobj_ref_t ref = HDva_arg(ap, hobj_ref_t); + + H5RS_asprintf_cat(rs, "Reference Object=%" PRIuHADDR, ref); + } /* end block */ + break; + + case 'r': /* H5R_ref_t */ + { /* Note! reference types are opaque types */ - HDfprintf(out, "Reference Opaque"); + H5RS_acat(rs, "Reference Opaque"); goto error; - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5R_type_t */ + { H5R_type_t reftype = (H5R_type_t)HDva_arg(ap, int); switch (reftype) { case H5R_BADTYPE: - HDfprintf(out, "H5R_BADTYPE"); + H5RS_acat(rs, "H5R_BADTYPE"); break; case H5R_OBJECT1: - HDfprintf(out, "H5R_OBJECT1"); + H5RS_acat(rs, "H5R_OBJECT1"); break; case H5R_DATASET_REGION1: - HDfprintf(out, "H5R_DATASET_REGION1"); + H5RS_acat(rs, "H5R_DATASET_REGION1"); break; case H5R_OBJECT2: - HDfprintf(out, "H5R_OBJECT2"); + H5RS_acat(rs, "H5R_OBJECT2"); break; case H5R_DATASET_REGION2: - HDfprintf(out, "H5R_DATASET_REGION2"); + H5RS_acat(rs, "H5R_DATASET_REGION2"); break; case H5R_ATTR: - HDfprintf(out, "H5R_ATTR"); + H5RS_acat(rs, "H5R_ATTR"); break; case H5R_MAXTYPE: - HDfprintf(out, "H5R_MAXTYPE"); + H5RS_acat(rs, "H5R_MAXTYPE"); break; default: - HDfprintf(out, "BADTYPE(%ld)", (long)reftype); + H5RS_asprintf_cat(rs, "BADTYPE(%ld)", (long)reftype); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(S%c)", type[1]); - goto error; - } - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(S%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'S': - switch (type[1]) { - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'S': + switch (type[1]) { + case 'c': /* H5S_class_t */ + { H5S_class_t cls = (H5S_class_t)HDva_arg(ap, int); switch (cls) { case H5S_NO_CLASS: - HDfprintf(out, "H5S_NO_CLASS"); + H5RS_acat(rs, "H5S_NO_CLASS"); break; case H5S_SCALAR: - HDfprintf(out, "H5S_SCALAR"); + H5RS_acat(rs, "H5S_SCALAR"); break; case H5S_SIMPLE: - HDfprintf(out, "H5S_SIMPLE"); + H5RS_acat(rs, "H5S_SIMPLE"); break; case H5S_NULL: - HDfprintf(out, "H5S_NULL"); + H5RS_acat(rs, "H5S_NULL"); break; default: - HDfprintf(out, "%ld", (long)cls); + H5RS_asprintf_cat(rs, "%ld", (long)cls); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5S_seloper_t */ + { H5S_seloper_t so = (H5S_seloper_t)HDva_arg(ap, int); switch (so) { case H5S_SELECT_NOOP: - HDfprintf(out, "H5S_NOOP"); + H5RS_acat(rs, "H5S_NOOP"); break; case H5S_SELECT_SET: - HDfprintf(out, "H5S_SELECT_SET"); + H5RS_acat(rs, "H5S_SELECT_SET"); break; case H5S_SELECT_OR: - HDfprintf(out, "H5S_SELECT_OR"); + H5RS_acat(rs, "H5S_SELECT_OR"); break; case H5S_SELECT_AND: - HDfprintf(out, "H5S_SELECT_AND"); + H5RS_acat(rs, "H5S_SELECT_AND"); break; case H5S_SELECT_XOR: - HDfprintf(out, "H5S_SELECT_XOR"); + H5RS_acat(rs, "H5S_SELECT_XOR"); break; case H5S_SELECT_NOTB: - HDfprintf(out, "H5S_SELECT_NOTB"); + H5RS_acat(rs, "H5S_SELECT_NOTB"); break; case H5S_SELECT_NOTA: - HDfprintf(out, "H5S_SELECT_NOTA"); + H5RS_acat(rs, "H5S_SELECT_NOTA"); break; case H5S_SELECT_APPEND: - HDfprintf(out, "H5S_SELECT_APPEND"); + H5RS_acat(rs, "H5S_SELECT_APPEND"); break; case H5S_SELECT_PREPEND: - HDfprintf(out, "H5S_SELECT_PREPEND"); + H5RS_acat(rs, "H5S_SELECT_PREPEND"); break; case H5S_SELECT_INVALID: - HDfprintf(out, "H5S_SELECT_INVALID"); + H5RS_acat(rs, "H5S_SELECT_INVALID"); break; default: - HDfprintf(out, "%ld", (long)so); + H5RS_asprintf_cat(rs, "%ld", (long)so); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5S_sel_type */ + { H5S_sel_type st = (H5S_sel_type)HDva_arg(ap, int); switch (st) { case H5S_SEL_ERROR: - HDfprintf(out, "H5S_SEL_ERROR"); + H5RS_acat(rs, "H5S_SEL_ERROR"); break; case H5S_SEL_NONE: - HDfprintf(out, "H5S_SEL_NONE"); + H5RS_acat(rs, "H5S_SEL_NONE"); break; case H5S_SEL_POINTS: - HDfprintf(out, "H5S_SEL_POINTS"); + H5RS_acat(rs, "H5S_SEL_POINTS"); break; case H5S_SEL_HYPERSLABS: - HDfprintf(out, "H5S_SEL_HYPERSLABS"); + H5RS_acat(rs, "H5S_SEL_HYPERSLABS"); break; case H5S_SEL_ALL: - HDfprintf(out, "H5S_SEL_ALL"); + H5RS_acat(rs, "H5S_SEL_ALL"); break; case H5S_SEL_N: - HDfprintf(out, "H5S_SEL_N"); + H5RS_acat(rs, "H5S_SEL_N"); break; default: - HDfprintf(out, "%ld", (long)st); + H5RS_asprintf_cat(rs, "%ld", (long)st); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(S%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(S%c)", type[1]); + goto error; + } /* end switch */ + break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - const char *str = HDva_arg(ap, const char *); + case 't': /* htri_t */ + { + htri_t tri_var = HDva_arg(ap, htri_t); - HDfprintf(out, "\"%s\"", str); - } /* end else */ + if (tri_var > 0) + H5RS_acat(rs, "TRUE"); + else if (!tri_var) + H5RS_acat(rs, "FALSE"); + else + H5RS_asprintf_cat(rs, "FAIL(%d)", (int)tri_var); + } /* end block */ break; - case 'T': - switch (type[1]) { - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'T': + switch (type[1]) { + case 'c': /* H5T_cset_t */ + { H5T_cset_t cset = (H5T_cset_t)HDva_arg(ap, int); - switch (cset) { - case H5T_CSET_ERROR: - HDfprintf(out, "H5T_CSET_ERROR"); - break; - - case H5T_CSET_ASCII: - HDfprintf(out, "H5T_CSET_ASCII"); - break; - - case H5T_CSET_UTF8: - HDfprintf(out, "H5T_CSET_UTF8"); - break; + H5_trace_args_cset(rs, cset); + } /* end block */ + break; - case H5T_CSET_RESERVED_2: - case H5T_CSET_RESERVED_3: - case H5T_CSET_RESERVED_4: - case H5T_CSET_RESERVED_5: - case H5T_CSET_RESERVED_6: - case H5T_CSET_RESERVED_7: - case H5T_CSET_RESERVED_8: - case H5T_CSET_RESERVED_9: - case H5T_CSET_RESERVED_10: - case H5T_CSET_RESERVED_11: - case H5T_CSET_RESERVED_12: - case H5T_CSET_RESERVED_13: - case H5T_CSET_RESERVED_14: - case H5T_CSET_RESERVED_15: - HDfprintf(out, "H5T_CSET_RESERVED_%ld", (long)cset); - break; + case 'C': /* H5T_conv_t */ + { + H5T_conv_t tconv = (H5T_conv_t)HDva_arg(ap, H5T_conv_t); - default: - HDfprintf(out, "%ld", (long)cset); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)tconv); + } /* end block */ break; - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'd': /* H5T_direction_t */ + { H5T_direction_t direct = (H5T_direction_t)HDva_arg(ap, int); switch (direct) { case H5T_DIR_DEFAULT: - HDfprintf(out, "H5T_DIR_DEFAULT"); + H5RS_acat(rs, "H5T_DIR_DEFAULT"); break; case H5T_DIR_ASCEND: - HDfprintf(out, "H5T_DIR_ASCEND"); + H5RS_acat(rs, "H5T_DIR_ASCEND"); break; case H5T_DIR_DESCEND: - HDfprintf(out, "H5T_DIR_DESCEND"); + H5RS_acat(rs, "H5T_DIR_DESCEND"); break; default: - HDfprintf(out, "%ld", (long)direct); + H5RS_asprintf_cat(rs, "%ld", (long)direct); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* H5T_pers_t */ + { H5T_pers_t pers = (H5T_pers_t)HDva_arg(ap, int); switch (pers) { case H5T_PERS_DONTCARE: - HDfprintf(out, "H5T_PERS_DONTCARE"); + H5RS_acat(rs, "H5T_PERS_DONTCARE"); break; case H5T_PERS_SOFT: - HDfprintf(out, "H5T_PERS_SOFT"); + H5RS_acat(rs, "H5T_PERS_SOFT"); break; case H5T_PERS_HARD: - HDfprintf(out, "H5T_PERS_HARD"); + H5RS_acat(rs, "H5T_PERS_HARD"); break; default: - HDfprintf(out, "%ld", (long)pers); + H5RS_asprintf_cat(rs, "%ld", (long)pers); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'n': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'E': /* H5T_conv_except_func_t */ + { + H5T_conv_except_func_t conv_ex = + (H5T_conv_except_func_t)HDva_arg(ap, H5T_conv_except_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)conv_ex); + } /* end block */ + break; + + case 'n': /* H5T_norm_t */ + { H5T_norm_t norm = (H5T_norm_t)HDva_arg(ap, int); switch (norm) { case H5T_NORM_ERROR: - HDfprintf(out, "H5T_NORM_ERROR"); + H5RS_acat(rs, "H5T_NORM_ERROR"); break; case H5T_NORM_IMPLIED: - HDfprintf(out, "H5T_NORM_IMPLIED"); + H5RS_acat(rs, "H5T_NORM_IMPLIED"); break; case H5T_NORM_MSBSET: - HDfprintf(out, "H5T_NORM_MSBSET"); + H5RS_acat(rs, "H5T_NORM_MSBSET"); break; case H5T_NORM_NONE: - HDfprintf(out, "H5T_NORM_NONE"); + H5RS_acat(rs, "H5T_NORM_NONE"); break; default: - HDfprintf(out, "%ld", (long)norm); + H5RS_asprintf_cat(rs, "%ld", (long)norm); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'o': /* H5T_order_t */ + { H5T_order_t order = (H5T_order_t)HDva_arg(ap, int); switch (order) { case H5T_ORDER_ERROR: - HDfprintf(out, "H5T_ORDER_ERROR"); + H5RS_acat(rs, "H5T_ORDER_ERROR"); break; case H5T_ORDER_LE: - HDfprintf(out, "H5T_ORDER_LE"); + H5RS_acat(rs, "H5T_ORDER_LE"); break; case H5T_ORDER_BE: - HDfprintf(out, "H5T_ORDER_BE"); + H5RS_acat(rs, "H5T_ORDER_BE"); break; case H5T_ORDER_VAX: - HDfprintf(out, "H5T_ORDER_VAX"); + H5RS_acat(rs, "H5T_ORDER_VAX"); break; case H5T_ORDER_MIXED: - HDfprintf(out, "H5T_ORDER_MIXED"); + H5RS_acat(rs, "H5T_ORDER_MIXED"); break; case H5T_ORDER_NONE: - HDfprintf(out, "H5T_ORDER_NONE"); + H5RS_acat(rs, "H5T_ORDER_NONE"); break; default: - HDfprintf(out, "%ld", (long)order); + H5RS_asprintf_cat(rs, "%ld", (long)order); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'p': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'p': /* H5T_pad_t */ + { H5T_pad_t pad = (H5T_pad_t)HDva_arg(ap, int); switch (pad) { case H5T_PAD_ERROR: - HDfprintf(out, "H5T_PAD_ERROR"); + H5RS_acat(rs, "H5T_PAD_ERROR"); break; case H5T_PAD_ZERO: - HDfprintf(out, "H5T_PAD_ZERO"); + H5RS_acat(rs, "H5T_PAD_ZERO"); break; case H5T_PAD_ONE: - HDfprintf(out, "H5T_PAD_ONE"); + H5RS_acat(rs, "H5T_PAD_ONE"); break; case H5T_PAD_BACKGROUND: - HDfprintf(out, "H5T_PAD_BACKGROUND"); + H5RS_acat(rs, "H5T_PAD_BACKGROUND"); break; case H5T_NPAD: - HDfprintf(out, "H5T_NPAD"); + H5RS_acat(rs, "H5T_NPAD"); break; default: - HDfprintf(out, "%ld", (long)pad); + H5RS_asprintf_cat(rs, "%ld", (long)pad); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5T_sign_t */ + { H5T_sign_t sign = (H5T_sign_t)HDva_arg(ap, int); switch (sign) { case H5T_SGN_ERROR: - HDfprintf(out, "H5T_SGN_ERROR"); + H5RS_acat(rs, "H5T_SGN_ERROR"); break; case H5T_SGN_NONE: - HDfprintf(out, "H5T_SGN_NONE"); + H5RS_acat(rs, "H5T_SGN_NONE"); break; case H5T_SGN_2: - HDfprintf(out, "H5T_SGN_2"); + H5RS_acat(rs, "H5T_SGN_2"); break; case H5T_NSGN: - HDfprintf(out, "H5T_NSGN"); + H5RS_acat(rs, "H5T_NSGN"); break; default: - HDfprintf(out, "%ld", (long)sign); + H5RS_asprintf_cat(rs, "%ld", (long)sign); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5T_class_t */ + { H5T_class_t type_class = (H5T_class_t)HDva_arg(ap, int); switch (type_class) { case H5T_NO_CLASS: - HDfprintf(out, "H5T_NO_CLASS"); + H5RS_acat(rs, "H5T_NO_CLASS"); break; case H5T_INTEGER: - HDfprintf(out, "H5T_INTEGER"); + H5RS_acat(rs, "H5T_INTEGER"); break; case H5T_FLOAT: - HDfprintf(out, "H5T_FLOAT"); + H5RS_acat(rs, "H5T_FLOAT"); break; case H5T_TIME: - HDfprintf(out, "H5T_TIME"); + H5RS_acat(rs, "H5T_TIME"); break; case H5T_STRING: - HDfprintf(out, "H5T_STRING"); + H5RS_acat(rs, "H5T_STRING"); break; case H5T_BITFIELD: - HDfprintf(out, "H5T_BITFIELD"); + H5RS_acat(rs, "H5T_BITFIELD"); break; case H5T_OPAQUE: - HDfprintf(out, "H5T_OPAQUE"); + H5RS_acat(rs, "H5T_OPAQUE"); break; case H5T_COMPOUND: - HDfprintf(out, "H5T_COMPOUND"); + H5RS_acat(rs, "H5T_COMPOUND"); break; case H5T_REFERENCE: - HDfprintf(out, "H5T_REFERENCE"); + H5RS_acat(rs, "H5T_REFERENCE"); break; case H5T_ENUM: - HDfprintf(out, "H5T_ENUM"); + H5RS_acat(rs, "H5T_ENUM"); break; case H5T_VLEN: - HDfprintf(out, "H5T_VLEN"); + H5RS_acat(rs, "H5T_VLEN"); break; case H5T_ARRAY: - HDfprintf(out, "H5T_ARRAY"); + H5RS_acat(rs, "H5T_ARRAY"); break; case H5T_NCLASSES: - HDfprintf(out, "H5T_NCLASSES"); + H5RS_acat(rs, "H5T_NCLASSES"); break; default: - HDfprintf(out, "%ld", (long)type_class); + H5RS_asprintf_cat(rs, "%ld", (long)type_class); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'z': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'z': /* H5T_str_t */ + { H5T_str_t str = (H5T_str_t)HDva_arg(ap, int); switch (str) { case H5T_STR_ERROR: - HDfprintf(out, "H5T_STR_ERROR"); + H5RS_acat(rs, "H5T_STR_ERROR"); break; case H5T_STR_NULLTERM: - HDfprintf(out, "H5T_STR_NULLTERM"); + H5RS_acat(rs, "H5T_STR_NULLTERM"); break; case H5T_STR_NULLPAD: - HDfprintf(out, "H5T_STR_NULLPAD"); + H5RS_acat(rs, "H5T_STR_NULLPAD"); break; case H5T_STR_SPACEPAD: - HDfprintf(out, "H5T_STR_SPACEPAD"); + H5RS_acat(rs, "H5T_STR_SPACEPAD"); break; case H5T_STR_RESERVED_3: @@ -2507,1219 +2749,1190 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case H5T_STR_RESERVED_13: case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: - HDfprintf(out, "H5T_STR_RESERVED(%ld)", (long)str); + H5RS_asprintf_cat(rs, "H5T_STR_RESERVED(%ld)", (long)str); break; default: - HDfprintf(out, "%ld", (long)str); + H5RS_asprintf_cat(rs, "%ld", (long)str); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(T%c)", type[1]); - goto error; - } /* end switch */ - break; - - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - htri_t tri_var = HDva_arg(ap, htri_t); - - if (tri_var > 0) - HDfprintf(out, "TRUE"); - else if (!tri_var) - HDfprintf(out, "FALSE"); - else - HDfprintf(out, "FAIL(%d)", (int)tri_var); - } /* end else */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(T%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'U': - switch (type[1]) { - case 'l': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - unsigned long *p = (unsigned long *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%lu", i ? ", " : "", p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'U': + switch (type[1]) { + case 'l': /* unsigned long */ + { unsigned long iul = HDva_arg(ap, unsigned long); - HDfprintf(out, "%lu", iul); + H5RS_asprintf_cat(rs, "%lu", iul); asize[argno] = (hssize_t)iul; - } /* end else */ - break; - - case 'L': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - unsigned long long *p = (unsigned long long *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%llu", i ? ", " : "", p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + } /* end block */ + break; + + case 'L': /* unsigned long long / uint64_t */ + { unsigned long long iull = HDva_arg(ap, unsigned long long); - HDfprintf(out, "%llu", iull); + H5RS_asprintf_cat(rs, "%llu", iull); asize[argno] = (hssize_t)iull; - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(U%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(U%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'V': - switch (type[1]) { - case 'a': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'V': + switch (type[1]) { + case 'a': /* H5VL_attr_get_t */ + { H5VL_attr_get_t get = (H5VL_attr_get_t)HDva_arg(ap, int); switch (get) { case H5VL_ATTR_GET_SPACE: - HDfprintf(out, "H5VL_ATTR_GET_SPACE"); + H5RS_acat(rs, "H5VL_ATTR_GET_SPACE"); break; + case H5VL_ATTR_GET_TYPE: - HDfprintf(out, "H5VL_ATTR_GET_TYPE"); + H5RS_acat(rs, "H5VL_ATTR_GET_TYPE"); break; + case H5VL_ATTR_GET_ACPL: - HDfprintf(out, "H5VL_ATTR_GET_ACPL"); + H5RS_acat(rs, "H5VL_ATTR_GET_ACPL"); break; + case H5VL_ATTR_GET_NAME: - HDfprintf(out, "H5VL_ATTR_GET_NAME"); + H5RS_acat(rs, "H5VL_ATTR_GET_NAME"); break; + case H5VL_ATTR_GET_STORAGE_SIZE: - HDfprintf(out, "H5VL_ATTR_GET_STORAGE_SIZE"); + H5RS_acat(rs, "H5VL_ATTR_GET_STORAGE_SIZE"); break; + case H5VL_ATTR_GET_INFO: - HDfprintf(out, "H5VL_ATTR_GET_INFO"); + H5RS_acat(rs, "H5VL_ATTR_GET_INFO"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'A': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'A': /* H5VL_blob_optional_t */ + { H5VL_blob_optional_t optional = (H5VL_blob_optional_t)HDva_arg(ap, int); - switch (optional) { - default: - HDfprintf(out, "%ld", (long)optional); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)optional); + } /* end block */ break; - case 'b': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'b': /* H5VL_attr_specific_t */ + { H5VL_attr_specific_t specific = (H5VL_attr_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_ATTR_DELETE: - HDfprintf(out, "H5VL_ATTR_DELETE"); + H5RS_acat(rs, "H5VL_ATTR_DELETE"); break; + case H5VL_ATTR_EXISTS: - HDfprintf(out, "H5VL_ATTR_EXISTS"); + H5RS_acat(rs, "H5VL_ATTR_EXISTS"); break; + case H5VL_ATTR_ITER: - HDfprintf(out, "H5VL_ATTR_ITER"); + H5RS_acat(rs, "H5VL_ATTR_ITER"); break; + case H5VL_ATTR_RENAME: - HDfprintf(out, "H5VL_ATTR_RENAME"); + H5RS_acat(rs, "H5VL_ATTR_RENAME"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'B': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'B': /* H5VL_blob_specific_t */ + { H5VL_blob_specific_t specific = (H5VL_blob_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_BLOB_DELETE: - HDfprintf(out, "H5VL_BLOB_DELETE"); + H5RS_acat(rs, "H5VL_BLOB_DELETE"); break; + case H5VL_BLOB_GETSIZE: - HDfprintf(out, "H5VL_BLOB_GETSIZE"); + H5RS_acat(rs, "H5VL_BLOB_GETSIZE"); break; + case H5VL_BLOB_ISNULL: - HDfprintf(out, "H5VL_BLOB_ISNULL"); + H5RS_acat(rs, "H5VL_BLOB_ISNULL"); break; + case H5VL_BLOB_SETNULL: - HDfprintf(out, "H5VL_BLOB_SETNULL"); + H5RS_acat(rs, "H5VL_BLOB_SETNULL"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ - break; - - case 'C': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - H5VL_class_value_t class_val = - (H5VL_class_value_t)HDva_arg(ap, H5VL_class_value_t); - - if (H5_VOL_NATIVE == class_val) - HDfprintf(out, "H5_VOL_NATIVE"); - else - HDfprintf(out, "%ld", (long)class_val); - } /* end else */ + } /* end block */ break; - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'c': /* H5VL_dataset_get_t */ + { H5VL_dataset_get_t get = (H5VL_dataset_get_t)HDva_arg(ap, int); switch (get) { case H5VL_DATASET_GET_SPACE: - HDfprintf(out, "H5VL_DATASET_GET_SPACE"); + H5RS_acat(rs, "H5VL_DATASET_GET_SPACE"); break; + case H5VL_DATASET_GET_SPACE_STATUS: - HDfprintf(out, "H5VL_DATASET_GET_SPACE_STATUS"); + H5RS_acat(rs, "H5VL_DATASET_GET_SPACE_STATUS"); break; + case H5VL_DATASET_GET_TYPE: - HDfprintf(out, "H5VL_DATASET_GET_TYPE"); + H5RS_acat(rs, "H5VL_DATASET_GET_TYPE"); break; + case H5VL_DATASET_GET_DCPL: - HDfprintf(out, "H5VL_DATASET_GET_DCPL"); + H5RS_acat(rs, "H5VL_DATASET_GET_DCPL"); break; + case H5VL_DATASET_GET_DAPL: - HDfprintf(out, "H5VL_DATASET_GET_DAPL"); + H5RS_acat(rs, "H5VL_DATASET_GET_DAPL"); break; + case H5VL_DATASET_GET_STORAGE_SIZE: - HDfprintf(out, "H5VL_DATASET_GET_STORAGE_SIZE"); + H5RS_acat(rs, "H5VL_DATASET_GET_STORAGE_SIZE"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); + case 'C': /* H5VL_class_value_t */ + { + H5VL_class_value_t class_val = + (H5VL_class_value_t)HDva_arg(ap, H5VL_class_value_t); + + if (H5_VOL_NATIVE == class_val) + H5RS_acat(rs, "H5_VOL_NATIVE"); else - HDfprintf(out, "NULL"); - } /* end if */ - else { + H5RS_asprintf_cat(rs, "%ld", (long)class_val); + } /* end block */ + break; + + case 'd': /* H5VL_dataset_specific_t */ + { H5VL_dataset_specific_t specific = (H5VL_dataset_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_DATASET_SET_EXTENT: - HDfprintf(out, "H5VL_DATASET_SET_EXTENT"); + H5RS_acat(rs, "H5VL_DATASET_SET_EXTENT"); break; + case H5VL_DATASET_FLUSH: - HDfprintf(out, "H5VL_DATASET_FLUSH"); + H5RS_acat(rs, "H5VL_DATASET_FLUSH"); break; + case H5VL_DATASET_REFRESH: - HDfprintf(out, "H5VL_DATASET_REFRESH"); + H5RS_acat(rs, "H5VL_DATASET_REFRESH"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* H5VL_datatype_get_t */ + { H5VL_datatype_get_t get = (H5VL_datatype_get_t)HDva_arg(ap, int); switch (get) { case H5VL_DATATYPE_GET_BINARY: - HDfprintf(out, "H5VL_DATATYPE_GET_BINARY"); + H5RS_acat(rs, "H5VL_DATATYPE_GET_BINARY"); break; + case H5VL_DATATYPE_GET_TCPL: - HDfprintf(out, "H5VL_DATATYPE_GET_TCPL"); + H5RS_acat(rs, "H5VL_DATATYPE_GET_TCPL"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'f': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'f': /* H5VL_datatype_specific_t */ + { H5VL_datatype_specific_t specific = (H5VL_datatype_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_DATATYPE_FLUSH: - HDfprintf(out, "H5VL_DATATYPE_FLUSH"); + H5RS_acat(rs, "H5VL_DATATYPE_FLUSH"); break; + case H5VL_DATATYPE_REFRESH: - HDfprintf(out, "H5VL_DATATYPE_REFRESH"); + H5RS_acat(rs, "H5VL_DATATYPE_REFRESH"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'g': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'g': /* H5VL_file_get_t */ + { H5VL_file_get_t get = (H5VL_file_get_t)HDva_arg(ap, int); switch (get) { case H5VL_FILE_GET_CONT_INFO: - HDfprintf(out, "H5VL_FILE_GET_CONT_INFO"); + H5RS_acat(rs, "H5VL_FILE_GET_CONT_INFO"); break; + case H5VL_FILE_GET_FAPL: - HDfprintf(out, "H5VL_FILE_GET_FAPL"); + H5RS_acat(rs, "H5VL_FILE_GET_FAPL"); break; + case H5VL_FILE_GET_FCPL: - HDfprintf(out, "H5VL_FILE_GET_FCPL"); + H5RS_acat(rs, "H5VL_FILE_GET_FCPL"); break; + case H5VL_FILE_GET_FILENO: - HDfprintf(out, "H5VL_FILE_GET_FILENO"); + H5RS_acat(rs, "H5VL_FILE_GET_FILENO"); break; + case H5VL_FILE_GET_INTENT: - HDfprintf(out, "H5VL_FILE_GET_INTENT"); + H5RS_acat(rs, "H5VL_FILE_GET_INTENT"); break; + case H5VL_FILE_GET_NAME: - HDfprintf(out, "H5VL_FILE_GET_NAME"); + H5RS_acat(rs, "H5VL_FILE_GET_NAME"); break; + case H5VL_FILE_GET_OBJ_COUNT: - HDfprintf(out, "H5VL_FILE_GET_OBJ_COUNT"); + H5RS_acat(rs, "H5VL_FILE_GET_OBJ_COUNT"); break; + case H5VL_FILE_GET_OBJ_IDS: - HDfprintf(out, "H5VL_FILE_GET_OBJ_IDS"); + H5RS_acat(rs, "H5VL_FILE_GET_OBJ_IDS"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'h': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'h': /* H5VL_file_specific_t */ + { H5VL_file_specific_t specific = (H5VL_file_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_FILE_FLUSH: - HDfprintf(out, "H5VL_FILE_FLUSH"); + H5RS_acat(rs, "H5VL_FILE_FLUSH"); break; + case H5VL_FILE_REOPEN: - HDfprintf(out, "H5VL_FILE_REOPEN"); + H5RS_acat(rs, "H5VL_FILE_REOPEN"); break; + case H5VL_FILE_MOUNT: - HDfprintf(out, "H5VL_FILE_MOUNT"); + H5RS_acat(rs, "H5VL_FILE_MOUNT"); break; + case H5VL_FILE_UNMOUNT: - HDfprintf(out, "H5VL_FILE_UNMOUNT"); + H5RS_acat(rs, "H5VL_FILE_UNMOUNT"); break; + case H5VL_FILE_IS_ACCESSIBLE: - HDfprintf(out, "H5VL_FILE_IS_ACCESSIBLE"); + H5RS_acat(rs, "H5VL_FILE_IS_ACCESSIBLE"); break; + case H5VL_FILE_DELETE: - HDfprintf(out, "H5VL_FILE_DELETE"); + H5RS_acat(rs, "H5VL_FILE_DELETE"); break; + case H5VL_FILE_IS_EQUAL: - HDfprintf(out, "H5VL_FILE_IS_EQUAL"); + H5RS_acat(rs, "H5VL_FILE_IS_EQUAL"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'i': /* H5VL_group_get_t */ + { H5VL_group_get_t get = (H5VL_group_get_t)HDva_arg(ap, int); switch (get) { case H5VL_GROUP_GET_GCPL: - HDfprintf(out, "H5VL_GROUP_GET_GCPL"); + H5RS_acat(rs, "H5VL_GROUP_GET_GCPL"); break; + case H5VL_GROUP_GET_INFO: - HDfprintf(out, "H5VL_GROUP_GET_INFO"); + H5RS_acat(rs, "H5VL_GROUP_GET_INFO"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'j': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'j': /* H5VL_group_specific_t */ + { H5VL_group_specific_t specific = (H5VL_group_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_GROUP_FLUSH: - HDfprintf(out, "H5VL_GROUP_FLUSH"); + H5RS_acat(rs, "H5VL_GROUP_FLUSH"); break; + case H5VL_GROUP_REFRESH: - HDfprintf(out, "H5VL_GROUP_REFRESH"); + H5RS_acat(rs, "H5VL_GROUP_REFRESH"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'k': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'k': /* H5VL_link_create_type_t */ + { H5VL_link_create_type_t create = (H5VL_link_create_type_t)HDva_arg(ap, int); switch (create) { case H5VL_LINK_CREATE_HARD: - HDfprintf(out, "H5VL_LINK_CREATE_HARD"); + H5RS_acat(rs, "H5VL_LINK_CREATE_HARD"); break; + case H5VL_LINK_CREATE_SOFT: - HDfprintf(out, "H5VL_LINK_CREATE_SOFT"); + H5RS_acat(rs, "H5VL_LINK_CREATE_SOFT"); break; + case H5VL_LINK_CREATE_UD: - HDfprintf(out, "H5VL_LINK_CREATE_UD"); + H5RS_acat(rs, "H5VL_LINK_CREATE_UD"); break; + default: - HDfprintf(out, "%ld", (long)create); + H5RS_asprintf_cat(rs, "%ld", (long)create); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'l': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'l': /* H5VL_link_get_t */ + { H5VL_link_get_t get = (H5VL_link_get_t)HDva_arg(ap, int); switch (get) { case H5VL_LINK_GET_INFO: - HDfprintf(out, "H5VL_LINK_GET_INFO"); + H5RS_acat(rs, "H5VL_LINK_GET_INFO"); break; + case H5VL_LINK_GET_NAME: - HDfprintf(out, "H5VL_LINK_GET_NAME"); + H5RS_acat(rs, "H5VL_LINK_GET_NAME"); break; + case H5VL_LINK_GET_VAL: - HDfprintf(out, "H5VL_LINK_GET_VAL"); + H5RS_acat(rs, "H5VL_LINK_GET_VAL"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'L': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'L': /* H5VL_get_conn_lvl_t */ + { H5VL_get_conn_lvl_t get = (H5VL_get_conn_lvl_t)HDva_arg(ap, int); switch (get) { case H5VL_GET_CONN_LVL_CURR: - HDfprintf(out, "H5VL_GET_CONN_LVL_CURR"); + H5RS_acat(rs, "H5VL_GET_CONN_LVL_CURR"); break; + case H5VL_GET_CONN_LVL_TERM: - HDfprintf(out, "H5VL_GET_CONN_LVL_TERM"); + H5RS_acat(rs, "H5VL_GET_CONN_LVL_TERM"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'm': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'm': /* H5VL_link_specific_t */ + { H5VL_link_specific_t specific = (H5VL_link_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_LINK_DELETE: - HDfprintf(out, "H5VL_LINK_DELETE"); + H5RS_acat(rs, "H5VL_LINK_DELETE"); break; + case H5VL_LINK_EXISTS: - HDfprintf(out, "H5VL_LINK_EXISTS"); + H5RS_acat(rs, "H5VL_LINK_EXISTS"); break; + case H5VL_LINK_ITER: - HDfprintf(out, "H5VL_LINK_ITER"); + H5RS_acat(rs, "H5VL_LINK_ITER"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'n': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'n': /* H5VL_object_get_t */ + { H5VL_object_get_t get = (H5VL_object_get_t)HDva_arg(ap, int); switch (get) { case H5VL_OBJECT_GET_FILE: - HDfprintf(out, "H5VL_OBJECT_GET_FILE"); + H5RS_acat(rs, "H5VL_OBJECT_GET_FILE"); break; + case H5VL_OBJECT_GET_NAME: - HDfprintf(out, "H5VL_OBJECT_GET_NAME"); + H5RS_acat(rs, "H5VL_OBJECT_GET_NAME"); break; + case H5VL_OBJECT_GET_TYPE: - HDfprintf(out, "H5VL_OBJECT_GET_TYPE"); + H5RS_acat(rs, "H5VL_OBJECT_GET_TYPE"); break; + case H5VL_OBJECT_GET_INFO: - HDfprintf(out, "H5VL_OBJECT_GET_INFO"); + H5RS_acat(rs, "H5VL_OBJECT_GET_INFO"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'N': /* H5VL_request_notify_t */ + { + H5VL_request_notify_t vlrnot = + (H5VL_request_notify_t)HDva_arg(ap, H5VL_request_notify_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)vlrnot); + } /* end block */ + break; + + case 'o': /* H5VL_object_specific_t */ + { H5VL_object_specific_t specific = (H5VL_object_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_OBJECT_CHANGE_REF_COUNT: - HDfprintf(out, "H5VL_OBJECT_CHANGE_REF_COUNT"); + H5RS_acat(rs, "H5VL_OBJECT_CHANGE_REF_COUNT"); break; + case H5VL_OBJECT_EXISTS: - HDfprintf(out, "H5VL_OBJECT_EXISTS"); + H5RS_acat(rs, "H5VL_OBJECT_EXISTS"); break; + case H5VL_OBJECT_LOOKUP: - HDfprintf(out, "H5VL_OBJECT_LOOKUP"); + H5RS_acat(rs, "H5VL_OBJECT_LOOKUP"); break; + case H5VL_OBJECT_VISIT: - HDfprintf(out, "H5VL_OBJECT_VISIT"); + H5RS_acat(rs, "H5VL_OBJECT_VISIT"); break; + case H5VL_OBJECT_FLUSH: - HDfprintf(out, "H5VL_OBJECT_FLUSH"); + H5RS_acat(rs, "H5VL_OBJECT_FLUSH"); break; + case H5VL_OBJECT_REFRESH: - HDfprintf(out, "H5VL_OBJECT_REFRESH"); - break; - default: - HDfprintf(out, "%ld", (long)specific); + H5RS_acat(rs, "H5VL_OBJECT_REFRESH"); break; - } /* end switch */ - } /* end else */ - break; - - case 'r': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - H5VL_request_specific_t specific = (H5VL_request_specific_t)HDva_arg(ap, int); - switch (specific) { - case H5VL_REQUEST_WAITANY: - HDfprintf(out, "H5VL_REQUEST_WAITANY"); - break; - case H5VL_REQUEST_WAITSOME: - HDfprintf(out, "H5VL_REQUEST_WAITSOME"); - break; - case H5VL_REQUEST_WAITALL: - HDfprintf(out, "H5VL_REQUEST_WAITALL"); - break; default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5VL_attr_optional_t */ + { H5VL_attr_optional_t optional = (H5VL_attr_optional_t)HDva_arg(ap, int); switch (optional) { #ifndef H5_NO_DEPRECATED_SYMBOLS case H5VL_NATIVE_ATTR_ITERATE_OLD: - HDfprintf(out, "H5VL_NATIVE_ATTR_ITERATE_OLD"); + H5RS_acat(rs, "H5VL_NATIVE_ATTR_ITERATE_OLD"); break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'S': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'S': /* H5VL_subclass_t */ + { H5VL_subclass_t subclass = (H5VL_subclass_t)HDva_arg(ap, int); switch (subclass) { case H5VL_SUBCLS_NONE: - HDfprintf(out, "H5VL_SUBCLS_NONE"); + H5RS_acat(rs, "H5VL_SUBCLS_NONE"); break; + case H5VL_SUBCLS_INFO: - HDfprintf(out, "H5VL_SUBCLS_INFO"); + H5RS_acat(rs, "H5VL_SUBCLS_INFO"); break; + case H5VL_SUBCLS_WRAP: - HDfprintf(out, "H5VL_SUBCLS_WRAP"); + H5RS_acat(rs, "H5VL_SUBCLS_WRAP"); break; + case H5VL_SUBCLS_ATTR: - HDfprintf(out, "H5VL_SUBCLS_ATTR"); + H5RS_acat(rs, "H5VL_SUBCLS_ATTR"); break; + case H5VL_SUBCLS_DATASET: - HDfprintf(out, "H5VL_SUBCLS_DATASET"); + H5RS_acat(rs, "H5VL_SUBCLS_DATASET"); break; + case H5VL_SUBCLS_DATATYPE: - HDfprintf(out, "H5VL_SUBCLS_DATATYPE"); + H5RS_acat(rs, "H5VL_SUBCLS_DATATYPE"); break; + case H5VL_SUBCLS_FILE: - HDfprintf(out, "H5VL_SUBCLS_FILE"); + H5RS_acat(rs, "H5VL_SUBCLS_FILE"); break; + case H5VL_SUBCLS_GROUP: - HDfprintf(out, "H5VL_SUBCLS_GROUP"); + H5RS_acat(rs, "H5VL_SUBCLS_GROUP"); break; + case H5VL_SUBCLS_LINK: - HDfprintf(out, "H5VL_SUBCLS_LINK"); + H5RS_acat(rs, "H5VL_SUBCLS_LINK"); break; + case H5VL_SUBCLS_OBJECT: - HDfprintf(out, "H5VL_SUBCLS_OBJECT"); + H5RS_acat(rs, "H5VL_SUBCLS_OBJECT"); break; + case H5VL_SUBCLS_REQUEST: - HDfprintf(out, "H5VL_SUBCLS_REQUEST"); + H5RS_acat(rs, "H5VL_SUBCLS_REQUEST"); break; + case H5VL_SUBCLS_BLOB: - HDfprintf(out, "H5VL_SUBCLS_BLOB"); + H5RS_acat(rs, "H5VL_SUBCLS_BLOB"); break; + case H5VL_SUBCLS_TOKEN: - HDfprintf(out, "H5VL_SUBCLS_TOKEN"); + H5RS_acat(rs, "H5VL_SUBCLS_TOKEN"); break; + default: - HDfprintf(out, "%ld", (long)subclass); + H5RS_asprintf_cat(rs, "%ld", (long)subclass); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5VL_dataset_optional_t */ + { H5VL_dataset_optional_t optional = (H5VL_dataset_optional_t)HDva_arg(ap, int); switch (optional) { case H5VL_NATIVE_DATASET_FORMAT_CONVERT: - HDfprintf(out, "H5VL_NATIVE_DATASET_FORMAT_CONVERT"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_FORMAT_CONVERT"); break; + case H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE"); break; + case H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE"); break; + case H5VL_NATIVE_DATASET_GET_NUM_CHUNKS: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_NUM_CHUNKS"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_NUM_CHUNKS"); break; + case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX"); break; + case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD"); break; + case H5VL_NATIVE_DATASET_CHUNK_READ: - HDfprintf(out, "H5VL_NATIVE_DATASET_CHUNK_READ"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_CHUNK_READ"); break; + case H5VL_NATIVE_DATASET_CHUNK_WRITE: - HDfprintf(out, "H5VL_NATIVE_DATASET_CHUNK_WRITE"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_CHUNK_WRITE"); break; + case H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE"); break; + case H5VL_NATIVE_DATASET_GET_OFFSET: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_OFFSET"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_OFFSET"); break; + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'u': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'u': /* H5VL_datatype_optional_t */ + { H5VL_datatype_optional_t optional = (H5VL_datatype_optional_t)HDva_arg(ap, int); - switch (optional) { - default: - HDfprintf(out, "%ld", (long)optional); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)optional); + } /* end block */ break; - case 'v': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'v': /* H5VL_file_optional_t */ + { H5VL_file_optional_t optional = (H5VL_file_optional_t)HDva_arg(ap, int); switch (optional) { case H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE: - HDfprintf(out, "H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE"); break; + case H5VL_NATIVE_FILE_GET_FILE_IMAGE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_FILE_IMAGE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_FILE_IMAGE"); break; + case H5VL_NATIVE_FILE_GET_FREE_SECTIONS: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_FREE_SECTIONS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_FREE_SECTIONS"); break; + case H5VL_NATIVE_FILE_GET_FREE_SPACE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_FREE_SPACE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_FREE_SPACE"); break; + case H5VL_NATIVE_FILE_GET_INFO: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_INFO"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_INFO"); break; + case H5VL_NATIVE_FILE_GET_MDC_CONF: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_CONF"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_CONF"); break; + case H5VL_NATIVE_FILE_GET_MDC_HR: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_HR"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_HR"); break; + case H5VL_NATIVE_FILE_GET_MDC_SIZE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_SIZE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_SIZE"); break; + case H5VL_NATIVE_FILE_GET_SIZE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_SIZE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_SIZE"); break; + case H5VL_NATIVE_FILE_GET_VFD_HANDLE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_VFD_HANDLE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_VFD_HANDLE"); break; + case H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE: - HDfprintf(out, "H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE"); break; + case H5VL_NATIVE_FILE_SET_MDC_CONFIG: - HDfprintf(out, "H5VL_NATIVE_FILE_SET_MDC_CONFIG"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_MDC_CONFIG"); break; + case H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO"); break; + case H5VL_NATIVE_FILE_START_SWMR_WRITE: - HDfprintf(out, "H5VL_NATIVE_FILE_START_SWMR_WRITE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_START_SWMR_WRITE"); break; + case H5VL_NATIVE_FILE_START_MDC_LOGGING: - HDfprintf(out, "H5VL_NATIVE_FILE_START_MDC_LOGGING"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_START_MDC_LOGGING"); break; + case H5VL_NATIVE_FILE_STOP_MDC_LOGGING: - HDfprintf(out, "H5VL_NATIVE_FILE_STOP_MDC_LOGGING"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_STOP_MDC_LOGGING"); break; + case H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS"); break; + case H5VL_NATIVE_FILE_FORMAT_CONVERT: - HDfprintf(out, "H5VL_NATIVE_FILE_FORMAT_CONVERT"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_FORMAT_CONVERT"); break; + case H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS: - HDfprintf(out, "H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS"); break; + case H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS"); break; + case H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO"); break; + case H5VL_NATIVE_FILE_GET_EOA: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_EOA"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_EOA"); break; + case H5VL_NATIVE_FILE_INCR_FILESIZE: - HDfprintf(out, "H5VL_NATIVE_FILE_INCR_FILESIZE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_INCR_FILESIZE"); break; + case H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS: - HDfprintf(out, "H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS"); break; + case H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG"); break; + case H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG: - HDfprintf(out, "H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG"); break; + case H5VL_NATIVE_FILE_GET_MPI_ATOMICITY: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MPI_ATOMICITY"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MPI_ATOMICITY"); break; + case H5VL_NATIVE_FILE_SET_MPI_ATOMICITY: - HDfprintf(out, "H5VL_NATIVE_FILE_SET_MPI_ATOMICITY"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_MPI_ATOMICITY"); break; + case H5VL_NATIVE_FILE_POST_OPEN: - HDfprintf(out, "H5VL_NATIVE_FILE_POST_OPEN"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_POST_OPEN"); break; + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'w': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'w': /* H5VL_group_optional_t */ + { H5VL_group_optional_t optional = (H5VL_group_optional_t)HDva_arg(ap, int); switch (optional) { #ifndef H5_NO_DEPRECATED_SYMBOLS case H5VL_NATIVE_GROUP_ITERATE_OLD: - HDfprintf(out, "H5VL_NATIVE_GROUP_ITERATE_OLD"); + H5RS_acat(rs, "H5VL_NATIVE_GROUP_ITERATE_OLD"); break; + case H5VL_NATIVE_GROUP_GET_OBJINFO: - HDfprintf(out, "H5VL_NATIVE_GROUP_GET_OBJINFO"); + H5RS_acat(rs, "H5VL_NATIVE_GROUP_GET_OBJINFO"); break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'x': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'x': /* H5VL_link_optional_t */ + { H5VL_link_optional_t optional = (H5VL_link_optional_t)HDva_arg(ap, int); - switch (optional) { - default: - HDfprintf(out, "%ld", (long)optional); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)optional); + } /* end block */ break; - case 'y': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'y': /* H5VL_object_optional_t */ + { H5VL_object_optional_t optional = (H5VL_object_optional_t)HDva_arg(ap, int); switch (optional) { case H5VL_NATIVE_OBJECT_GET_COMMENT: - HDfprintf(out, "H5VL_NATIVE_OBJECT_GET_COMMENT"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_GET_COMMENT"); break; + case H5VL_NATIVE_OBJECT_SET_COMMENT: - HDfprintf(out, "H5VL_NATIVE_OBJECT_SET_COMMENT"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_SET_COMMENT"); break; + case H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES: - HDfprintf(out, "H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES"); break; + case H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES: - HDfprintf(out, "H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES"); break; + case H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED: - HDfprintf(out, "H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED"); break; + case H5VL_NATIVE_OBJECT_GET_NATIVE_INFO: - HDfprintf(out, "H5VL_NATIVE_OBJECT_GET_NATIVE_INFO"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_GET_NATIVE_INFO"); break; + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'z': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'z': /* H5VL_request_optional_t */ + { H5VL_request_optional_t optional = (H5VL_request_optional_t)HDva_arg(ap, int); - switch (optional) { - default: - HDfprintf(out, "%ld", (long)optional); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)optional); + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(Z%c)", type[1]); - goto error; - } /* end switch */ - break; - - case 'x': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - void **p = (void **)vp; + default: + H5RS_asprintf_cat(rs, "BADTYPE(Z%c)", type[1]); + goto error; + } /* end switch */ + break; - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) { - if (p[i]) - HDfprintf(out, "%s0x%p", (i ? ", " : ""), p[i]); - else - HDfprintf(out, "%sNULL", (i ? ", " : "")); - } /* end for */ - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'x': { /* void / va_list */ vp = HDva_arg(ap, void *); if (vp) - HDfprintf(out, "0x%p", vp); + H5RS_asprintf_cat(rs, "%p", vp); else - HDfprintf(out, "NULL"); - } /* end else */ + H5RS_acat(rs, "NULL"); + } /* end block */ break; - case 'z': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - size_t *p = (size_t *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%Zu", (i ? ", " : ""), p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'z': { size_t size = HDva_arg(ap, size_t); - HDfprintf(out, "%Zu", size); + H5RS_asprintf_cat(rs, "%zu", size); asize[argno] = (hssize_t)size; - } /* end else */ + } /* end block */ break; - case 'Z': - switch (type[1]) { - case 'a': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'Z': + switch (type[1]) { + case 'a': /* H5Z_SO_scale_type_t */ + { H5Z_SO_scale_type_t scale_type = (H5Z_SO_scale_type_t)HDva_arg(ap, int); switch (scale_type) { case H5Z_SO_FLOAT_DSCALE: - HDfprintf(out, "H5Z_SO_FLOAT_DSCALE"); + H5RS_acat(rs, "H5Z_SO_FLOAT_DSCALE"); break; case H5Z_SO_FLOAT_ESCALE: - HDfprintf(out, "H5Z_SO_FLOAT_ESCALE"); + H5RS_acat(rs, "H5Z_SO_FLOAT_ESCALE"); break; case H5Z_SO_INT: - HDfprintf(out, "H5Z_SO_INT"); + H5RS_acat(rs, "H5Z_SO_INT"); break; default: - HDfprintf(out, "%ld", (long)scale_type); + H5RS_asprintf_cat(rs, "%ld", (long)scale_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'c': /* H5Z_class2_t */ + { H5Z_class2_t *filter = HDva_arg(ap, H5Z_class2_t *); - HDfprintf(out, "0x%p", filter); - } /* end else */ + H5RS_asprintf_cat(rs, "%p", (void *)filter); + } /* end block */ break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* H5Z_EDC_t */ + { H5Z_EDC_t edc = (H5Z_EDC_t)HDva_arg(ap, int); if (H5Z_DISABLE_EDC == edc) - HDfprintf(out, "H5Z_DISABLE_EDC"); + H5RS_acat(rs, "H5Z_DISABLE_EDC"); else if (H5Z_ENABLE_EDC == edc) - HDfprintf(out, "H5Z_ENABLE_EDC"); + H5RS_acat(rs, "H5Z_ENABLE_EDC"); else - HDfprintf(out, "%ld", (long)edc); - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)edc); + } /* end block */ break; - case 'f': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'f': /* H5Z_filter_t */ + { H5Z_filter_t id = HDva_arg(ap, H5Z_filter_t); - if (H5Z_FILTER_DEFLATE == id) - HDfprintf(out, "H5Z_FILTER_DEFLATE"); + if (H5Z_FILTER_NONE == id) + H5RS_acat(rs, "H5Z_FILTER_NONE"); + else if (H5Z_FILTER_DEFLATE == id) + H5RS_acat(rs, "H5Z_FILTER_DEFLATE"); + else if (H5Z_FILTER_SHUFFLE == id) + H5RS_acat(rs, "H5Z_FILTER_SHUFFLE"); + else if (H5Z_FILTER_FLETCHER32 == id) + H5RS_acat(rs, "H5Z_FILTER_FLETCHER32"); + else if (H5Z_FILTER_SZIP == id) + H5RS_acat(rs, "H5Z_FILTER_SZIP"); + else if (H5Z_FILTER_NBIT == id) + H5RS_acat(rs, "H5Z_FILTER_NBIT"); + else if (H5Z_FILTER_SCALEOFFSET == id) + H5RS_acat(rs, "H5Z_FILTER_SCALEOFFSET"); else - HDfprintf(out, "%ld", (long)id); - } /* end else */ - break; - - case 's': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - ssize_t *p = (ssize_t *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%Zd", (i ? ", " : ""), p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + H5RS_asprintf_cat(rs, "%ld", (long)id); + } /* end block */ + break; + + case 'F': /* H5Z_filter_func_t */ + { + H5Z_filter_func_t ffunc = (H5Z_filter_func_t)HDva_arg(ap, H5Z_filter_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)ffunc); + } /* end block */ + break; + + case 's': { ssize_t ssize = HDva_arg(ap, ssize_t); - HDfprintf(out, "%Zd", ssize); + H5RS_asprintf_cat(rs, "%zd", ssize); asize[argno] = (hssize_t)ssize; - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(Z%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(Z%c)", type[1]); + goto error; + } /* end switch */ + break; + + case '#': + H5RS_acat(rs, "Unsupported type slipped through!"); + break; + + case '!': + H5RS_acat(rs, "Unknown type slipped through!"); + break; - default: - if (HDisupper(type[0])) - HDfprintf(out, "BADTYPE(%c%c)", type[0], type[1]); - else - HDfprintf(out, "BADTYPE(%c)", type[0]); - goto error; - } /* end switch */ - } /* end for */ + default: + if (HDisupper(type[0])) + H5RS_asprintf_cat(rs, "BADTYPE(%c%c)", type[0], type[1]); + else + H5RS_asprintf_cat(rs, "BADTYPE(%c)", type[0]); + goto error; + } /* end switch */ + } /* end else */ + } /* end for */ + + return SUCCEED; +error: + return FAIL; +} /* end H5_trace_args() */ + +/*------------------------------------------------------------------------- + * Function: H5_trace + * + * Purpose: This function is called whenever an API function is called + * and tracing is turned on. If RETURNING is non-zero then + * the caller is about to return and RETURNING points to the + * time for the corresponding function call event. Otherwise + * we print the function name and the arguments. + * + * The TYPE argument is a string which gives the type of each of + * the following argument pairs. Each type is zero or more + * asterisks (one for each level of indirection, although some + * types have one level of indirection already implied) followed + * by either one letter (lower case) or two letters (first one + * uppercase). + * + * The variable argument list consists of pairs of values. Each + * pair is a string which is the formal argument name in the + * calling function, followed by the argument value. The type + * of the argument value is given by the TYPE string. + * + * Note: The TYPE string is meant to be terse and is generated by a + * separate perl script. + * + * WARNING: DO NOT CALL ANY HDF5 FUNCTION THAT CALLS FUNC_ENTER(). DOING + * SO MAY CAUSE H5_trace() TO BE INVOKED RECURSIVELY OR MAY + * CAUSE LIBRARY INITIALIZATIONS THAT ARE NOT DESIRED. + * + * Return: Execution time for an API call + * + * Programmer: Robb Matzke + * Tuesday, June 16, 1998 + * + *------------------------------------------------------------------------- + */ +double +H5_trace(const double *returning, const char *func, const char *type, ...) +{ + va_list ap; + H5RS_str_t * rs = NULL; + hssize_t i; + FILE * out = H5_debug_g.trace; + static hbool_t is_first_invocation = TRUE; + H5_timer_t function_timer; + H5_timevals_t function_times = {0.0, 0.0, 0.0}; + static H5_timer_t running_timer; + H5_timevals_t running_times; + static int current_depth = 0; + static int last_call_depth = 0; + + /* FUNC_ENTER() should not be called */ + + if (!out) + return 0.0; /* Tracing is off */ + + /* Initialize the timer for this function */ + if (H5_debug_g.ttimes) + H5_timer_init(&function_timer); + + if (H5_debug_g.ttop) { + if (returning) { + if (current_depth > 1) { + --current_depth; + return (double)0.0F; + } + } + else { + if (current_depth > 0) { + /* Do not update last_call_depth */ + current_depth++; + return (double)0.0F; + } + } + } + + /* Get time for event if the trace times flag is set */ + if (is_first_invocation && H5_debug_g.ttimes) { + /* Start the library-wide timer */ + is_first_invocation = FALSE; + H5_timer_init(&running_timer); + H5_timer_start(&running_timer); + } + + /* Start the timer for this function */ + if (H5_debug_g.ttimes) + H5_timer_start(&function_timer); + + /* Create the ref-counted string */ + rs = H5RS_create(NULL); + + /* Print the first part of the line. This is the indication of the + * nesting depth followed by the function name and either start of + * argument list or start of return value. If this call is for a + * function return and no other calls have been made to H5_trace() + * since the one for the function call, then we're continuing + * the same line. */ + if (returning) { + HDassert(current_depth > 0); + --current_depth; + if (current_depth < last_call_depth) { + /* We are at the beginning of a line */ + if (H5_debug_g.ttimes) { + char tmp[320]; + + H5_timer_get_times(function_timer, &function_times); + H5_timer_get_times(running_timer, &running_times); + HDsprintf(tmp, "%.6f", (function_times.elapsed - running_times.elapsed)); + H5RS_asprintf_cat(rs, " %*s ", (int)HDstrlen(tmp), ""); + } + for (i = 0; i < current_depth; i++) + H5RS_aputc(rs, '+'); + H5RS_asprintf_cat(rs, "%*s%s = ", 2 * current_depth, "", func); + } + else + /* Continue current line with return value */ + H5RS_acat(rs, " = "); + } + else { + if (current_depth > last_call_depth) + H5RS_acat(rs, " = \n"); + if (H5_debug_g.ttimes) { + H5_timer_get_times(function_timer, &function_times); + H5_timer_get_times(running_timer, &running_times); + H5RS_asprintf_cat(rs, "@%.6f ", (function_times.elapsed - running_times.elapsed)); + } + for (i = 0; i < current_depth; i++) + H5RS_aputc(rs, '+'); + H5RS_asprintf_cat(rs, "%*s%s(", 2 * current_depth, "", func); + } + + /* Format arguments into the refcounted string */ + HDva_start(ap, type); + H5_trace_args(rs, type, ap); + HDva_end(ap); /* Display event time for return */ if (returning && H5_debug_g.ttimes) { H5_timer_get_times(function_timer, &function_times); H5_timer_get_times(running_timer, &running_times); - HDfprintf(out, " @%.6f [dt=%.6f]", (function_times.elapsed - running_times.elapsed), - (function_times.elapsed - *returning)); - } /* end if */ + H5RS_asprintf_cat(rs, " @%.6f [dt=%.6f]", (function_times.elapsed - running_times.elapsed), + (function_times.elapsed - *returning)); + } -error: - HDva_end(ap); + /* Display generated string */ if (returning) - HDfprintf(out, ";\n"); + H5RS_acat(rs, ";\n"); else { last_call_depth = current_depth++; - HDfprintf(out, ")"); - } /* end else */ + H5RS_acat(rs, ")"); + } + HDfputs(H5RS_get_str(rs), out); HDfflush(out); + H5RS_decr(rs); if (H5_debug_g.ttimes) return function_times.elapsed; else - return 0.0F; + return (double)0.0F; } /* end H5_trace() */ -- cgit v0.12 From 555d6593b714158644f0339f69e18588e5372160 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 6 Apr 2021 03:03:09 -0700 Subject: Fix for (serial) VFD SWMR test failure in pHDF5 --- src/H5Fint.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index 27e187e..e1fa7d1 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1816,15 +1816,15 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) size_t page_buf_size; unsigned page_buf_min_meta_perc = 0; unsigned page_buf_min_raw_perc = 0; - hbool_t set_flag = FALSE; /*set the status_flags in the superblock */ - hbool_t clear = FALSE; /*clear the status_flags */ - hbool_t evict_on_close; /* evict on close value from plist */ + hbool_t set_flag = FALSE; /* Set the status_flags in the superblock */ + hbool_t clear = FALSE; /* Clear the status_flags */ + hbool_t evict_on_close; /* Evict on close value from plist */ hbool_t use_file_locking = TRUE; /* Using file locks? */ - hbool_t ci_load = FALSE; /* whether MDC ci load requested */ - hbool_t ci_write = FALSE; /* whether MDC CI write requested */ - hbool_t file_create = FALSE; /* creating a new file or not */ + hbool_t ci_load = FALSE; /* Whether MDC ci load requested */ + hbool_t ci_write = FALSE; /* Whether MDC CI write requested */ + hbool_t file_create = FALSE; /* Creating a new file or not */ H5F_vfd_swmr_config_t *vfd_swmr_config_ptr = NULL; /* Points to VFD SMWR config info */ - H5F_t * ret_value = NULL; /*actual return value */ + H5F_t * ret_value = NULL; /* Actual return value */ FUNC_ENTER_NOAPI(NULL) @@ -1999,16 +1999,28 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) /* Check if page buffering is enabled */ if (H5P_get(a_plist, H5F_ACS_PAGE_BUFFER_SIZE_NAME, &page_buf_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get page buffer size") + +#ifdef H5_HAVE_PARALLEL +{ + hid_t driver_id = H5I_INVALID_HID; /* VFD ID */ + + /* Get the driver */ + if ((driver_id = H5P_peek_driver(a_plist)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get driver") + /* Temporary: fail file create when page buffering feature is enabled for parallel */ + if (H5FD_MPIO == driver_id) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "page buffering is disabled for MPI-I/O VFD") +} +#endif /* H5_HAVE_PARALLEL */ + if (page_buf_size) { #ifdef H5_HAVE_PARALLEL /* Collective metadata writes are not supported with page buffering */ if (file->shared->coll_md_write) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "collective metadata writes are not supported with page buffering") - - /* Temporary: fail file create when page buffering feature is enabled for parallel */ - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "page buffering is disabled for parallel") #endif /* H5_HAVE_PARALLEL */ + /* Query for other page buffer cache properties */ if (H5P_get(a_plist, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, &page_buf_min_meta_perc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get minimum metadata fraction of page buffer") -- cgit v0.12 From 4857beeb30b0bac6ea5f4467d8c07be9f3ed2ae0 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 6 Apr 2021 04:43:31 -0700 Subject: Better VFD SWMR parallel skip test --- src/H5Fint.c | 18 +++--------------- test/vfd_swmr.c | 11 +++++++---- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index e1fa7d1..7815a47 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1999,28 +1999,16 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) /* Check if page buffering is enabled */ if (H5P_get(a_plist, H5F_ACS_PAGE_BUFFER_SIZE_NAME, &page_buf_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get page buffer size") - -#ifdef H5_HAVE_PARALLEL -{ - hid_t driver_id = H5I_INVALID_HID; /* VFD ID */ - - /* Get the driver */ - if ((driver_id = H5P_peek_driver(a_plist)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get driver") - /* Temporary: fail file create when page buffering feature is enabled for parallel */ - if (H5FD_MPIO == driver_id) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "page buffering is disabled for MPI-I/O VFD") -} -#endif /* H5_HAVE_PARALLEL */ - if (page_buf_size) { #ifdef H5_HAVE_PARALLEL /* Collective metadata writes are not supported with page buffering */ if (file->shared->coll_md_write) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "collective metadata writes are not supported with page buffering") -#endif /* H5_HAVE_PARALLEL */ + /* Temporary: fail file create when page buffering feature is enabled for parallel */ + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "page buffering is disabled for parallel") +#endif /* H5_HAVE_PARALLEL */ /* Query for other page buffer cache properties */ if (H5P_get(a_plist, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, &page_buf_min_meta_perc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get minimum metadata fraction of page buffer") diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c index 9c5899e..304b12a 100644 --- a/test/vfd_swmr.c +++ b/test/vfd_swmr.c @@ -3473,11 +3473,14 @@ main(void) * currently disabled for multi/split drivers. */ if ((0 == HDstrcmp(env_h5_drvr, "multi")) || (0 == HDstrcmp(env_h5_drvr, "split"))) { - - SKIPPED() HDputs("Skip VFD SWMR test because paged aggregation is disabled for multi/split drivers"); HDexit(EXIT_SUCCESS); - } /* end if */ + } + +#ifdef H5_HAVE_PARALLEL + HDputs("Skip VFD SWMR test because paged aggregation is disabled in parallel HDF5"); + HDexit(EXIT_SUCCESS); +#endif /* Set up */ h5_reset(); @@ -3485,7 +3488,7 @@ main(void) if ((fapl = h5_fileaccess()) < 0) { nerrors++; PUTS_ERROR("Can't get VFD-dependent fapl") - } /* end if */ + } nerrors += test_fapl(); -- cgit v0.12 From 17c7cf94755aabd4885a3cbd287e65240ab04b49 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Apr 2021 09:29:27 -0700 Subject: Moves VFD and VOL make check targets to conclude.am --- Makefile.am | 8 ++++---- c++/Makefile.am | 5 ----- config/conclude.am | 13 +++++++++++++ fortran/Makefile.am | 5 ----- hl/Makefile.am | 5 ----- java/Makefile.am | 6 ------ src/H5VLpassthru.h | 2 +- test/Makefile.am | 11 ----------- testpar/Makefile.am | 5 ----- 9 files changed, 18 insertions(+), 42 deletions(-) diff --git a/Makefile.am b/Makefile.am index 975f276..794007c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -190,10 +190,10 @@ trace: # Run tests with different Virtual File Drivers. # Currently, only invoke check-vfd in the test directory. check-vfd: - for d in src utils test; do \ - if test $$d != .; then \ - (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - fi; \ + for d in src utils test; do \ + if test $$d != .; then \ + (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ + fi; \ done # Run tests with different passthrough Virtual Object Layer Connectors. diff --git a/c++/Makefile.am b/c++/Makefile.am index 5d8258b..6a91464 100644 --- a/c++/Makefile.am +++ b/c++/Makefile.am @@ -28,11 +28,6 @@ endif if BUILD_CXX_CONDITIONAL SUBDIRS=src $(TEST_DIR) -# Test with just the native connector, with a single pass-through connector -# and with a doubly-stacked pass-through. -VOL_LIST = native "pass_through under_vol=0;under_info={}" \ - "pass_through under_vol=505;under_info={under_vol=0;under_info={}}" - endif DIST_SUBDIRS = src test examples diff --git a/config/conclude.am b/config/conclude.am index 9b2298c..7d19082 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -270,6 +270,11 @@ build-check-p: $(LIB) $(PROGS) $(chk_TESTS) echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\ fi +VFD_LIST = sec2 stdio core core_paged split multi family +if DIRECT_VFD_CONDITIONAL + VFD_LIST += direct +endif + # Run test with different Virtual File Driver check-vfd: $(LIB) $(PROGS) $(chk_TESTS) @for vfd in $(VFD_LIST) dummy; do \ @@ -282,6 +287,14 @@ check-vfd: $(LIB) $(PROGS) $(chk_TESTS) fi; \ done +# Test with just the native connector, with a single pass-through connector +# and with a doubly-stacked pass-through. +# +# native = 0 +# pass-through = 1 +VOL_LIST = native "pass_through under_vol=0;under_info={}" \ + "pass_through under_vol=1;under_info={under_vol=0;under_info={}}" + # Run test with different passthrough Virtual Object Layer Connector # NOTE: Will only succeed with passthrough VOL connectors that use # the native VOL connector as the terminal connector. diff --git a/fortran/Makefile.am b/fortran/Makefile.am index e48aafe..5b29216 100644 --- a/fortran/Makefile.am +++ b/fortran/Makefile.am @@ -38,11 +38,6 @@ endif if BUILD_FORTRAN_CONDITIONAL SUBDIRS=src $(TESTSERIAL_DIR) $(TESTPARALLEL_DIR) -# Test with just the native connector, with a single pass-through connector -# and with a doubly-stacked pass-through. -VOL_LIST = native "pass_through under_vol=0;under_info={}" \ - "pass_through under_vol=505;under_info={under_vol=0;under_info={}}" - endif # All directories that have Makefiles diff --git a/hl/Makefile.am b/hl/Makefile.am index 80ef66a..9bf209e 100644 --- a/hl/Makefile.am +++ b/hl/Makefile.am @@ -47,11 +47,6 @@ endif if BUILD_HDF5_HL_CONDITIONAL SUBDIRS=src $(TEST_DIR) $(TOOLS_DIR) $(CXX_DIR) $(FORTRAN_DIR) -# Test with just the native connector, with a single pass-through connector -# and with a doubly-stacked pass-through. -VOL_LIST = native "pass_through under_vol=0;under_info={}" \ - "pass_through under_vol=505;under_info={under_vol=0;under_info={}}" - endif DIST_SUBDIRS=src test tools c++ fortran examples diff --git a/java/Makefile.am b/java/Makefile.am index abc7f1d..bb8b426 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -1,6 +1,5 @@ # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including @@ -39,11 +38,6 @@ JAVA_API=yes SUBDIRS=src $(TESTSERIAL_DIR) $(TESTEXAMPLES_DIR) -# Test with just the native connector, with a single pass-through connector -# and with a doubly-stacked pass-through. -VOL_LIST = native "pass_through under_vol=0;under_info={}" \ - "pass_through under_vol=505;under_info={under_vol=0;under_info={}}" - endif include $(top_srcdir)/config/conclude.am diff --git a/src/H5VLpassthru.h b/src/H5VLpassthru.h index 79caca7..ec396cc 100644 --- a/src/H5VLpassthru.h +++ b/src/H5VLpassthru.h @@ -25,7 +25,7 @@ /* Characteristics of the pass-through VOL connector */ #define H5VL_PASSTHRU_NAME "pass_through" -#define H5VL_PASSTHRU_VALUE 505 /* VOL connector ID */ +#define H5VL_PASSTHRU_VALUE 1 /* VOL connector ID */ #define H5VL_PASSTHRU_VERSION 0 /* Pass-through VOL connector info */ diff --git a/test/Makefile.am b/test/Makefile.am index 566eec0..092645f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -173,16 +173,6 @@ vfd_swmr_zoo_reader_SOURCES=vfd_swmr_zoo_writer.c genall5.c vfd_swmr_bigset_reader_SOURCES=vfd_swmr_bigset_writer.c vfd_swmr_group_reader_SOURCES=vfd_swmr_group_writer.c -VFD_LIST = sec2 stdio core core_paged split multi family -if DIRECT_VFD_CONDITIONAL - VFD_LIST += direct -endif - -# Test with just the native connector, with a single pass-through connector -# and with a doubly-stacked pass-through. -VOL_LIST = native "pass_through under_vol=0;under_info={}" \ - "pass_through under_vol=505;under_info={under_vol=0;under_info={}}" - # Additional target for running timing test timings _timings: testmeta @for timing in $(TIMINGS) dummy; do \ @@ -192,7 +182,6 @@ timings _timings: testmeta fi; \ done; - # The flush1 test must run before the flush2 test flush2.chkexe_: flush1.chkexe_ diff --git a/testpar/Makefile.am b/testpar/Makefile.am index eeea2f5..6a8cc2b 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -42,11 +42,6 @@ testphdf5_SOURCES=testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \ # The tests all depend on the hdf5 library and the test library LDADD = $(LIBH5TEST) $(LIBHDF5) -# Test with just the native connector, with a single pass-through connector -# and with a doubly-stacked pass-through. -VOL_LIST = native "pass_through under_vol=0;under_info={}" \ - "pass_through under_vol=505;under_info={under_vol=0;under_info={}}" - # Temporary files # MPItest.h5 is from t_mpi # Para*.h5 are from testphdf -- cgit v0.12 From a96849027a93bd2b8011b763f9e4975676a14965 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Apr 2021 10:13:12 -0700 Subject: Brings thread-safety changes from develop --- src/H5TS.c | 568 ++++++++++++++++++++++++++++++++++++++---------- src/H5TSprivate.h | 53 +++-- src/H5private.h | 51 +++++ src/hdf5.h | 1 + test/ttsafe.c | 4 +- test/ttsafe_attr_vlen.c | 41 ++-- test/ttsafe_cancel.c | 24 +- test/ttsafe_dcreate.c | 2 +- 8 files changed, 568 insertions(+), 176 deletions(-) diff --git a/src/H5TS.c b/src/H5TS.c index 9525843..258c9df 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -11,31 +11,104 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* private headers */ -#include "H5private.h" /*library */ -#include "H5Eprivate.h" /*error handling */ -#include "H5MMprivate.h" /*memory management functions */ +/* + * Purpose: This file contains the framework for ensuring that the global + * library lock is held when an API routine is called. This + * framework works in concert with the FUNC_ENTER_API / FUNC_LEAVE_API + * macros defined in H5private.h. + * + * Note: Because this threadsafety framework operates outside the library, + * it does not use the error stack and only uses the "namecheck only" + * FUNC_ENTER_* / FUNC_LEAVE_* macros. + */ + +/****************/ +/* Module Setup */ +/****************/ + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_THREADSAFE -/* Module specific data structures */ +/****************/ +/* Local Macros */ +/****************/ -/* cancelability structure */ +/******************/ +/* Local Typedefs */ +/******************/ + +/* Cancelability structure */ typedef struct H5TS_cancel_struct { int previous_state; unsigned int cancel_count; } H5TS_cancel_t; +/* Function pointer typedef for thread callback function */ +typedef void *(*H5TS_thread_cb_t)(void *); + +/********************/ +/* Local Prototypes */ +/********************/ +static void H5TS__key_destructor(void *key_val); +static herr_t H5TS__mutex_acquire(H5TS_mutex_t *mutex, unsigned int lock_count, hbool_t *acquired); +static herr_t H5TS__mutex_unlock(H5TS_mutex_t *mutex, unsigned int *lock_count); + +/*********************/ +/* Package Variables */ +/*********************/ + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + /* Global variable definitions */ #ifdef H5_HAVE_WIN_THREADS H5TS_once_t H5TS_first_init_g; -#else /* H5_HAVE_WIN_THREADS */ -H5TS_once_t H5TS_first_init_g = PTHREAD_ONCE_INIT; -#endif /* H5_HAVE_WIN_THREADS */ -H5TS_key_t H5TS_errstk_key_g; +#else +H5TS_once_t H5TS_first_init_g = PTHREAD_ONCE_INIT; +#endif + +/* Thread-local keys, used by other interfaces */ +/* Error stack */ +#ifdef H5_HAVE_WIN_THREADS +H5TS_key_t H5TS_errstk_key_g = TLS_OUT_OF_INDEXES; +#else +H5TS_key_t H5TS_errstk_key_g; +#endif + +#ifdef H5_HAVE_CODESTACK +/* Function stack */ +#ifdef H5_HAVE_WIN_THREADS +H5TS_key_t H5TS_funcstk_key_g = TLS_OUT_OF_INDEXES; +#else H5TS_key_t H5TS_funcstk_key_g; -H5TS_key_t H5TS_apictx_key_g; -H5TS_key_t H5TS_cancel_key_g; +#endif +#endif /* H5_HAVE_CODESTACK */ + +/* API context */ +#ifdef H5_HAVE_WIN_THREADS +H5TS_key_t H5TS_apictx_key_g = TLS_OUT_OF_INDEXES; +#else +H5TS_key_t H5TS_apictx_key_g; +#endif + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Thread-local keys, used in this module */ +/* Thread cancellation state */ +#ifdef H5_HAVE_WIN_THREADS +static H5TS_key_t H5TS_cancel_key_s = TLS_OUT_OF_INDEXES; +#else +static H5TS_key_t H5TS_cancel_key_s; +#endif #ifndef H5_HAVE_WIN_THREADS @@ -64,12 +137,13 @@ static H5TS_key_t H5TS_tid_key; /*-------------------------------------------------------------------------- * NAME - * H5TS_key_destructor + * H5TS__key_destructor * * USAGE - * H5TS_key_destructor() + * H5TS__key_destructor() * * RETURNS + * None * * DESCRIPTION * Frees the memory for a key. Called by each thread as it exits. @@ -82,12 +156,16 @@ static H5TS_key_t H5TS_tid_key; *-------------------------------------------------------------------------- */ static void -H5TS_key_destructor(void *key_val) +H5TS__key_destructor(void *key_val) { + FUNC_ENTER_STATIC_NAMECHECK_ONLY + /* Use HDfree here instead of H5MM_xfree(), to avoid calling the H5CS routines */ if (key_val != NULL) HDfree(key_val); -} + + FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY +} /* end H5TS__key_destructor() */ #ifndef H5_HAVE_WIN_THREADS @@ -114,10 +192,10 @@ H5TS_tid_destructor(void *_v) return; /* TBD use an atomic CAS */ - pthread_mutex_lock(&H5TS_tid_mtx); + HDpthread_mutex_lock(&H5TS_tid_mtx); tid->next = H5TS_tid_next_free; H5TS_tid_next_free = tid; - pthread_mutex_unlock(&H5TS_tid_mtx); + HDpthread_mutex_unlock(&H5TS_tid_mtx); } /*-------------------------------------------------------------------------- @@ -137,8 +215,8 @@ H5TS_tid_destructor(void *_v) static void H5TS_tid_init(void) { - pthread_mutex_init(&H5TS_tid_mtx, NULL); - pthread_key_create(&H5TS_tid_key, H5TS_tid_destructor); + HDpthread_mutex_init(&H5TS_tid_mtx, NULL); + HDpthread_key_create(&H5TS_tid_key, H5TS_tid_destructor); } /*-------------------------------------------------------------------------- @@ -168,7 +246,7 @@ H5TS_tid_init(void) uint64_t H5TS_thread_id(void) { - H5TS_tid_t *tid = pthread_getspecific(H5TS_tid_key); + H5TS_tid_t *tid = HDpthread_getspecific(H5TS_tid_key); H5TS_tid_t proto_tid; /* An ID is already assigned. */ @@ -182,20 +260,19 @@ H5TS_thread_id(void) * point `tid` at `proto_tid` if we need to allocate some * memory. */ - pthread_mutex_lock(&H5TS_tid_mtx); + HDpthread_mutex_lock(&H5TS_tid_mtx); if ((tid = H5TS_tid_next_free) != NULL) H5TS_tid_next_free = tid->next; else if (H5TS_tid_next_id != UINT64_MAX) { tid = &proto_tid; tid->id = ++H5TS_tid_next_id; } - pthread_mutex_unlock(&H5TS_tid_mtx); + HDpthread_mutex_unlock(&H5TS_tid_mtx); /* If a prototype ID record was established, copy it to the heap. */ - if (tid == &proto_tid) { + if (tid == &proto_tid) if ((tid = HDmalloc(sizeof(*tid))) != NULL) *tid = proto_tid; - } if (tid == NULL) return 0; @@ -204,7 +281,7 @@ H5TS_thread_id(void) * to it. */ tid->next = NULL; - if (pthread_setspecific(H5TS_tid_key, tid) != 0) { + if (HDpthread_setspecific(H5TS_tid_key, tid) != 0) { H5TS_tid_destructor(tid); return 0; } @@ -237,6 +314,8 @@ H5TS_pthread_first_thread_init(void) H5_g.H5_libinit_g = FALSE; /* Library hasn't been initialized */ H5_g.H5_libterm_g = FALSE; /* Library isn't being shutdown */ + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + #ifdef H5_HAVE_WIN32_API #ifdef PTW32_STATIC_LIB pthread_win32_process_attach_np(); @@ -244,27 +323,116 @@ H5TS_pthread_first_thread_init(void) #endif /* initialize global API mutex lock */ - pthread_mutex_init(&H5_g.init_lock.atomic_lock, NULL); - pthread_cond_init(&H5_g.init_lock.cond_var, NULL); + HDpthread_mutex_init(&H5_g.init_lock.atomic_lock, NULL); + HDpthread_cond_init(&H5_g.init_lock.cond_var, NULL); H5_g.init_lock.lock_count = 0; + HDpthread_mutex_init(&H5_g.init_lock.atomic_lock2, NULL); + H5_g.init_lock.attempt_lock_count = 0; + /* Initialize integer thread identifiers. */ H5TS_tid_init(); /* initialize key for thread-specific error stacks */ - pthread_key_create(&H5TS_errstk_key_g, H5TS_key_destructor); + HDpthread_key_create(&H5TS_errstk_key_g, H5TS__key_destructor); +#ifdef H5_HAVE_CODESTACK /* initialize key for thread-specific function stacks */ - pthread_key_create(&H5TS_funcstk_key_g, H5TS_key_destructor); + HDpthread_key_create(&H5TS_funcstk_key_g, H5TS__key_destructor); +#endif /* H5_HAVE_CODESTACK */ /* initialize key for thread-specific API contexts */ - pthread_key_create(&H5TS_apictx_key_g, H5TS_key_destructor); + HDpthread_key_create(&H5TS_apictx_key_g, H5TS__key_destructor); /* initialize key for thread cancellability mechanism */ - pthread_key_create(&H5TS_cancel_key_g, H5TS_key_destructor); -} + HDpthread_key_create(&H5TS_cancel_key_s, H5TS__key_destructor); + + FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY +} /* end H5TS_pthread_first_thread_init() */ +#endif /* H5_HAVE_WIN_THREADS */ + +/*-------------------------------------------------------------------------- + * Function: H5TS__mutex_acquire + * + * Purpose: Attempts to acquire a mutex lock, without blocking + * + * Note: On success, the 'acquired' flag indicates if the HDF5 library + * global lock was acquired. + * + * Note: The Windows threads code is very likely bogus. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 27, 2019 + * + *-------------------------------------------------------------------------- + */ +static herr_t +H5TS__mutex_acquire(H5TS_mutex_t *mutex, unsigned int lock_count, hbool_t *acquired) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC_NAMECHECK_ONLY + +#ifdef H5_HAVE_WIN_THREADS + EnterCriticalSection(&mutex->CriticalSection); + *acquired = TRUE; +#else /* H5_HAVE_WIN_THREADS */ + /* Attempt to acquire the mutex lock */ + if (0 == HDpthread_mutex_lock(&mutex->atomic_lock)) { + pthread_t my_thread_id = HDpthread_self(); + + /* Check if locked already */ + if (mutex->lock_count) { + /* Check for this thread already owning the lock */ + if (HDpthread_equal(my_thread_id, mutex->owner_thread)) { + /* Already owned by self - increment count */ + mutex->lock_count += lock_count; + *acquired = TRUE; + } /* end if */ + else + *acquired = FALSE; + } /* end if */ + else { + /* Take ownership of the mutex */ + mutex->owner_thread = my_thread_id; + mutex->lock_count = lock_count; + *acquired = TRUE; + } /* end else */ + + if (0 != HDpthread_mutex_unlock(&mutex->atomic_lock)) + ret_value = -1; + } /* end if */ + else + ret_value = -1; #endif /* H5_HAVE_WIN_THREADS */ + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) +} /* end H5TS__mutex_acquire() */ + +/*-------------------------------------------------------------------------- + * Function: H5TSmutex_acquire + * + * Purpose: Attempts to acquire the HDF5 library global lock + * + * Note: On success, the 'acquired' flag indicates if the HDF5 library + * global lock was acquired. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 27, 2019 + * + *-------------------------------------------------------------------------- + */ +herr_t +H5TSmutex_acquire(unsigned int lock_count, hbool_t *acquired){ + FUNC_ENTER_API_NAMECHECK_ONLY + + FUNC_LEAVE_API_NAMECHECK_ONLY(H5TS__mutex_acquire(&H5_g.init_lock, lock_count, acquired))} +/* end H5TSmutex_acquire() */ + /*-------------------------------------------------------------------------- * NAME * H5TS_mutex_lock @@ -273,7 +441,7 @@ H5TS_pthread_first_thread_init(void) * H5TS_mutex_lock(&mutex_var) * * RETURNS - * 0 on success and non-zero on error. + * Non-negative on success / Negative on failure * * DESCRIPTION * Recursive lock semantics for HDF5 (locking) - @@ -285,35 +453,105 @@ H5TS_pthread_first_thread_init(void) * *-------------------------------------------------------------------------- */ -herr_t -H5TS_mutex_lock(H5TS_mutex_t *mutex) +herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex) { + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + #ifdef H5_HAVE_WIN_THREADS EnterCriticalSection(&mutex->CriticalSection); - return 0; #else /* H5_HAVE_WIN_THREADS */ - herr_t ret_value = pthread_mutex_lock(&mutex->atomic_lock); + /* Acquire the "attempt" lock, increment the attempt lock count, release the lock */ + ret_value = HDpthread_mutex_lock(&mutex->atomic_lock2); + if (ret_value) + HGOTO_DONE(ret_value); + mutex->attempt_lock_count++; + ret_value = HDpthread_mutex_unlock(&mutex->atomic_lock2); + if (ret_value) + HGOTO_DONE(ret_value); + /* Acquire the library lock */ + ret_value = HDpthread_mutex_lock(&mutex->atomic_lock); if (ret_value) - return ret_value; + HGOTO_DONE(ret_value); - if (mutex->lock_count && pthread_equal(pthread_self(), mutex->owner_thread)) { + /* Check if this thread already owns the lock */ + if (mutex->lock_count && HDpthread_equal(HDpthread_self(), mutex->owner_thread)) /* already owned by self - increment count */ mutex->lock_count++; - } else { - /* if owned by other thread, wait for condition signal */ + /* Wait until the lock is released by current owner thread */ while (mutex->lock_count) - pthread_cond_wait(&mutex->cond_var, &mutex->atomic_lock); + HDpthread_cond_wait(&mutex->cond_var, &mutex->atomic_lock); /* After we've received the signal, take ownership of the mutex */ - mutex->owner_thread = pthread_self(); + mutex->owner_thread = HDpthread_self(); mutex->lock_count = 1; - } + } /* end else */ - return pthread_mutex_unlock(&mutex->atomic_lock); + /* Release the library lock */ + ret_value = HDpthread_mutex_unlock(&mutex->atomic_lock); + +done: #endif /* H5_HAVE_WIN_THREADS */ -} + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) +} /* end H5TS_mutex_lock() */ + +/*-------------------------------------------------------------------------- + * NAME + * H5TS__mutex_unlock + * + * USAGE + * H5TS__mutex_unlock(&mutex_var, &lock_count) + * + * RETURNS + * Non-negative on success / Negative on failure + * + * DESCRIPTION + * Recursive lock semantics for HDF5 (unlocking) - + * Reset the lock and return the current lock count + * + * PROGRAMMER: Houjun Tang + * Nov 3, 2020 + * + *-------------------------------------------------------------------------- + */ +static herr_t +H5TS__mutex_unlock(H5TS_mutex_t *mutex, unsigned int *lock_count) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + +#ifdef H5_HAVE_WIN_THREADS + /* Releases ownership of the specified critical section object. */ + LeaveCriticalSection(&mutex->CriticalSection); +#else /* H5_HAVE_WIN_THREADS */ + + /* Reset the lock count for this thread */ + ret_value = HDpthread_mutex_lock(&mutex->atomic_lock); + if (ret_value) + HGOTO_DONE(ret_value); + *lock_count = mutex->lock_count; + mutex->lock_count = 0; + ret_value = HDpthread_mutex_unlock(&mutex->atomic_lock); + + /* If the lock count drops to zero, signal the condition variable, to + * wake another thread. + */ + if (mutex->lock_count == 0) { + int err; + + err = HDpthread_cond_signal(&mutex->cond_var); + if (err != 0) + ret_value = err; + } /* end if */ + +done: +#endif /* H5_HAVE_WIN_THREADS */ + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) +} /* H5TS__mutex_unlock */ /*-------------------------------------------------------------------------- * NAME @@ -323,7 +561,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) * H5TS_mutex_unlock(&mutex_var) * * RETURNS - * 0 on success and non-zero on error. + * Non-negative on success / Negative on failure * * DESCRIPTION * Recursive lock semantics for HDF5 (unlocking) - @@ -338,33 +576,102 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) herr_t H5TS_mutex_unlock(H5TS_mutex_t *mutex) { + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + #ifdef H5_HAVE_WIN_THREADS /* Releases ownership of the specified critical section object. */ LeaveCriticalSection(&mutex->CriticalSection); - return 0; #else /* H5_HAVE_WIN_THREADS */ - herr_t ret_value = pthread_mutex_lock(&mutex->atomic_lock); + /* Decrement the lock count for this thread */ + ret_value = HDpthread_mutex_lock(&mutex->atomic_lock); if (ret_value) - return ret_value; - + HGOTO_DONE(ret_value); mutex->lock_count--; + ret_value = HDpthread_mutex_unlock(&mutex->atomic_lock); - ret_value = pthread_mutex_unlock(&mutex->atomic_lock); - + /* If the lock count drops to zero, signal the condition variable, to + * wake another thread. + */ if (mutex->lock_count == 0) { int err; - err = pthread_cond_signal(&mutex->cond_var); + err = HDpthread_cond_signal(&mutex->cond_var); if (err != 0) ret_value = err; } /* end if */ - return ret_value; +done: #endif /* H5_HAVE_WIN_THREADS */ + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_mutex_unlock */ /*-------------------------------------------------------------------------- + * Function: H5TSmutex_get_attempt_count + * + * Purpose: Get the current count of the global lock attempt + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Houjun Tang + * June 24, 2019 + * + *-------------------------------------------------------------------------- + */ +herr_t +H5TSmutex_get_attempt_count(unsigned int *count) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API_NAMECHECK_ONLY + +#ifdef H5_HAVE_WIN_THREADS + /* Add Win32 equivalent here when async is supported */ +#else /* H5_HAVE_WIN_THREADS */ + ret_value = HDpthread_mutex_lock(&H5_g.init_lock.atomic_lock2); + if (ret_value) + HGOTO_DONE(ret_value); + + *count = H5_g.init_lock.attempt_lock_count; + + ret_value = HDpthread_mutex_unlock(&H5_g.init_lock.atomic_lock2); + if (ret_value) + HGOTO_DONE(ret_value); + +done: +#endif /* H5_HAVE_WIN_THREADS */ + FUNC_LEAVE_API_NAMECHECK_ONLY(ret_value) +} /* end H5TSmutex_get_attempt_count() */ + +/*-------------------------------------------------------------------------- + * Function: H5TSmutex_release + * + * Purpose: Releases the HDF5 library global lock + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 27, 2019 + * + *-------------------------------------------------------------------------- + */ +herr_t +H5TSmutex_release(unsigned int *lock_count) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API_NAMECHECK_ONLY + + *lock_count = 0; + if (0 != H5TS__mutex_unlock(&H5_g.init_lock, lock_count)) + ret_value = -1; + + FUNC_LEAVE_API_NAMECHECK_ONLY(ret_value) +} /* end H5TSmutex_release() */ + +/*-------------------------------------------------------------------------- * NAME * H5TS_cancel_count_inc * @@ -372,15 +679,15 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) * H5TS_cancel_count_inc() * * RETURNS - * 0 on success non-zero error code on error. + * Non-negative on success / Negative on failure * * DESCRIPTION - * Creates a cancelation counter for a thread if it is the first time + * Creates a cancellation counter for a thread if it is the first time * the thread is entering the library. * * if counter value is zero, then set cancelability type of the thread * to PTHREAD_CANCEL_DISABLE as thread is entering the library and store - * the previous cancelability type into cancelation counter. + * the previous cancelability type into cancellation counter. * Increase the counter value by 1. * * PROGRAMMER: Chee Wai LEE @@ -391,15 +698,20 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) herr_t H5TS_cancel_count_inc(void) { -#ifdef H5_HAVE_WIN_THREADS - /* unsupported; just return 0 */ - return SUCCEED; -#else /* H5_HAVE_WIN_THREADS */ +#ifndef H5_HAVE_WIN_THREADS H5TS_cancel_t *cancel_counter; - herr_t ret_value = SUCCEED; +#endif /* H5_HAVE_WIN_THREADS */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NAMECHECK_ONLY - cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); +#ifdef H5_HAVE_WIN_THREADS + /* unsupported */ +#else /* H5_HAVE_WIN_THREADS */ + /* Acquire the thread's cancellation counter */ + cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_s); + /* Check if it's created yet */ if (!cancel_counter) { /* * First time thread calls library - create new counter and associate @@ -409,24 +721,31 @@ H5TS_cancel_count_inc(void) * order to avoid codestack calls. */ cancel_counter = (H5TS_cancel_t *)HDcalloc(1, sizeof(H5TS_cancel_t)); - - if (!cancel_counter) { - HERROR(H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed"); - return FAIL; - } - - ret_value = pthread_setspecific(H5TS_cancel_key_g, (void *)cancel_counter); - } - + if (NULL == cancel_counter) + HGOTO_DONE(FAIL); + + /* Set the thread's cancellation counter with the new object */ + ret_value = HDpthread_setspecific(H5TS_cancel_key_s, (void *)cancel_counter); + if (ret_value) { + HDfree(cancel_counter); + HGOTO_DONE(FAIL); + } /* end if */ + } /* end if */ + + /* Check if thread entering library */ if (cancel_counter->cancel_count == 0) - /* thread entering library */ - ret_value = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cancel_counter->previous_state); + /* Set cancellation state to 'disable', and remember previous state */ + ret_value = HDpthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cancel_counter->previous_state); + /* Increment # of times the library API was re-entered, to avoid resetting + * previous cancellation state until the final API routine is returning. + */ ++cancel_counter->cancel_count; - return ret_value; +done: #endif /* H5_HAVE_WIN_THREADS */ -} + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) +} /* end H5TS_cancel_count_inc() */ /*-------------------------------------------------------------------------- * NAME @@ -440,7 +759,7 @@ H5TS_cancel_count_inc(void) * * DESCRIPTION * If counter value is one, then set cancelability type of the thread - * to the previous cancelability type stored in the cancelation counter. + * to the previous cancelability type stored in the cancellation counter. * (the thread is leaving the library). * * Decrement the counter value by 1. @@ -453,23 +772,30 @@ H5TS_cancel_count_inc(void) herr_t H5TS_cancel_count_dec(void) { +#ifndef H5_HAVE_WIN_THREADS + H5TS_cancel_t *cancel_counter; +#endif /* H5_HAVE_WIN_THREADS */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + #ifdef H5_HAVE_WIN_THREADS - /* unsupported; will just return 0 */ - return SUCCEED; + /* unsupported */ #else /* H5_HAVE_WIN_THREADS */ - register H5TS_cancel_t *cancel_counter; - herr_t ret_value = SUCCEED; - - cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); + /* Acquire the thread's cancellation counter */ + cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_s); + /* Check for leaving last API routine */ if (cancel_counter->cancel_count == 1) - ret_value = pthread_setcancelstate(cancel_counter->previous_state, NULL); + /* Reset to previous thread cancellation state, if last API */ + ret_value = HDpthread_setcancelstate(cancel_counter->previous_state, NULL); + /* Decrement cancellation counter */ --cancel_counter->cancel_count; - - return ret_value; #endif /* H5_HAVE_WIN_THREADS */ -} + + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) +} /* end H5TS_cancel_count_dec() */ #ifdef H5_HAVE_WIN_THREADS /*-------------------------------------------------------------------------- @@ -489,6 +815,8 @@ H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) { BOOL ret_value = TRUE; + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + /* Initialize the critical section (can't fail) */ InitializeCriticalSection(&H5_g.init_lock.CriticalSection); @@ -504,11 +832,9 @@ H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) if (TLS_OUT_OF_INDEXES == (H5TS_apictx_key_g = TlsAlloc())) ret_value = FALSE; - return ret_value; + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_win32_process_enter() */ -#endif /* H5_HAVE_WIN_THREADS */ -#ifdef H5_HAVE_WIN_THREADS /*-------------------------------------------------------------------------- * NAME * H5TS_win32_thread_enter @@ -526,6 +852,8 @@ H5TS_win32_thread_enter(void) { herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + /* Currently a placeholder function. TLS setup is performed * elsewhere in the library. * @@ -534,11 +862,9 @@ H5TS_win32_thread_enter(void) * is used. */ - return ret_value; + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_win32_thread_enter() */ -#endif /* H5_HAVE_WIN_THREADS */ -#ifdef H5_HAVE_WIN_THREADS /*-------------------------------------------------------------------------- * NAME * H5TS_win32_process_exit @@ -554,6 +880,7 @@ H5TS_win32_thread_enter(void) void H5TS_win32_process_exit(void) { + FUNC_ENTER_NOAPI_NAMECHECK_ONLY /* Windows uses a different thread local storage mechanism which does * not support auto-freeing like pthreads' keys. @@ -566,17 +893,18 @@ H5TS_win32_process_exit(void) DeleteCriticalSection(&H5_g.init_lock.CriticalSection); /* Clean up per-process thread local storage */ - TlsFree(H5TS_errstk_key_g); + if (H5TS_errstk_key_g != TLS_OUT_OF_INDEXES) + TlsFree(H5TS_errstk_key_g); #ifdef H5_HAVE_CODESTACK - TlsFree(H5TS_funcstk_key_g); + if (H5TS_funcstk_key_g != TLS_OUT_OF_INDEXES) + TlsFree(H5TS_funcstk_key_g); #endif /* H5_HAVE_CODESTACK */ - TlsFree(H5TS_apictx_key_g); + if (H5TS_apictx_key_g != TLS_OUT_OF_INDEXES) + TlsFree(H5TS_apictx_key_g); - return; + FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY } /* H5TS_win32_process_exit() */ -#endif /* H5_HAVE_WIN_THREADS */ -#ifdef H5_HAVE_WIN_THREADS /*-------------------------------------------------------------------------- * NAME * H5TS_win32_thread_exit @@ -595,6 +923,8 @@ H5TS_win32_thread_exit(void) LPVOID lpvData; herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + /* Windows uses a different thread local storage mechanism which does * not support auto-freeing like pthreads' keys. * @@ -604,21 +934,27 @@ H5TS_win32_thread_exit(void) */ /* Clean up per-thread thread local storage */ - lpvData = TlsGetValue(H5TS_errstk_key_g); - if (lpvData) - LocalFree((HLOCAL)lpvData); + if (H5TS_errstk_key_g != TLS_OUT_OF_INDEXES) { + lpvData = TlsGetValue(H5TS_errstk_key_g); + if (lpvData) + LocalFree((HLOCAL)lpvData); + } #ifdef H5_HAVE_CODESTACK - lpvData = TlsGetValue(H5TS_funcstk_key_g); - if (lpvData) - LocalFree((HLOCAL)lpvData); + if (H5TS_funcstk_key_g != TLS_OUT_OF_INDEXES) { + lpvData = TlsGetValue(H5TS_funcstk_key_g); + if (lpvData) + LocalFree((HLOCAL)lpvData); + } #endif /* H5_HAVE_CODESTACK */ - lpvData = TlsGetValue(H5TS_apictx_key_g); - if (lpvData) - LocalFree((HLOCAL)lpvData); + if (H5TS_apictx_key_g != TLS_OUT_OF_INDEXES) { + lpvData = TlsGetValue(H5TS_apictx_key_g); + if (lpvData) + LocalFree((HLOCAL)lpvData); + } - return ret_value; + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_win32_thread_exit() */ #endif /* H5_HAVE_WIN_THREADS */ @@ -638,12 +974,13 @@ H5TS_win32_thread_exit(void) *-------------------------------------------------------------------------- */ H5TS_thread_t -H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) +H5TS_create_thread(H5TS_thread_cb_t func, H5TS_attr_t *attr, void *udata) { H5TS_thread_t ret_value; -#ifdef H5_HAVE_WIN_THREADS + FUNC_ENTER_NOAPI_NAMECHECK_ONLY +#ifdef H5_HAVE_WIN_THREADS /* When calling C runtime functions, you should use _beginthread or * _beginthreadex instead of CreateThread. Threads created with * CreateThread risk being killed in low-memory situations. Since we @@ -658,12 +995,11 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) #else /* H5_HAVE_WIN_THREADS */ - pthread_create(&ret_value, attr, (void *(*)(void *))func, udata); + HDpthread_create(&ret_value, attr, (void *(*)(void *))func, udata); #endif /* H5_HAVE_WIN_THREADS */ - return ret_value; - + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_create_thread */ #endif /* H5_HAVE_THREADSAFE */ diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index a0cb353..6f9f1c0 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -26,9 +26,7 @@ #ifdef H5_HAVE_THREADSAFE /* Public headers needed by this file */ -#ifdef LATER -#include "H5TSpublic.h" /*Public API prototypes */ -#endif /* LATER */ +#include "H5TSpublic.h" /* Public API prototypes */ #ifdef H5_HAVE_WIN_THREADS @@ -38,6 +36,8 @@ typedef struct H5TS_mutex_struct { CRITICAL_SECTION CriticalSection; } H5TS_mutex_t; + +/* Portability wrappers around Windows Threads types */ typedef CRITICAL_SECTION H5TS_mutex_simple_t; typedef HANDLE H5TS_thread_t; typedef HANDLE H5TS_attr_t; @@ -50,7 +50,7 @@ typedef INIT_ONCE H5TS_once_t; #define H5TS_SCOPE_PROCESS 0 #define H5TS_CALL_CONV WINAPI -/* Functions */ +/* Portability function aliases */ #define H5TS_get_thread_local_value(key) TlsGetValue(key) #define H5TS_set_thread_local_value(key, value) TlsSetValue(key, value) #define H5TS_attr_init(attr_ptr) 0 @@ -79,7 +79,12 @@ typedef struct H5TS_mutex_struct { pthread_mutex_t atomic_lock; /* lock for atomicity of new mechanism */ pthread_cond_t cond_var; /* condition variable */ unsigned int lock_count; + + pthread_mutex_t atomic_lock2; /* lock for attempt_lock_count */ + unsigned int attempt_lock_count; } H5TS_mutex_t; + +/* Portability wrappers around pthread types */ typedef pthread_t H5TS_thread_t; typedef pthread_attr_t H5TS_attr_t; typedef pthread_mutex_t H5TS_mutex_simple_t; @@ -91,7 +96,7 @@ typedef pthread_once_t H5TS_once_t; #define H5TS_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS #define H5TS_CALL_CONV /* unused - Windows only */ -/* Functions */ +/* Portability function aliases */ #define H5TS_get_thread_local_value(key) pthread_getspecific(key) #define H5TS_set_thread_local_value(key, value) pthread_setspecific(key, value) #define H5TS_attr_init(attr_ptr) pthread_attr_init((attr_ptr)) @@ -101,31 +106,31 @@ typedef pthread_once_t H5TS_once_t; #define H5TS_mutex_init(mutex) pthread_mutex_init(mutex, NULL) #define H5TS_mutex_lock_simple(mutex) pthread_mutex_lock(mutex) #define H5TS_mutex_unlock_simple(mutex) pthread_mutex_unlock(mutex) + +/* Pthread-only routines */ H5_DLL uint64_t H5TS_thread_id(void); +H5_DLL void H5TS_pthread_first_thread_init(void); #endif /* H5_HAVE_WIN_THREADS */ -/* External global variables */ -extern H5TS_once_t H5TS_first_init_g; -extern H5TS_key_t H5TS_errstk_key_g; -extern H5TS_key_t H5TS_funcstk_key_g; -extern H5TS_key_t H5TS_apictx_key_g; - -#if defined c_plusplus || defined __cplusplus -extern "C" { -#endif /* c_plusplus || __cplusplus */ - -H5_DLL void H5TS_pthread_first_thread_init(void); -H5_DLL herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex); -H5_DLL herr_t H5TS_mutex_unlock(H5TS_mutex_t *mutex); -H5_DLL herr_t H5TS_cancel_count_inc(void); -H5_DLL herr_t H5TS_cancel_count_dec(void); +/* Library-scope global variables */ +extern H5TS_once_t H5TS_first_init_g; /* Library initialization */ +extern H5TS_key_t H5TS_errstk_key_g; /* Error stacks */ +#ifdef H5_HAVE_CODESTACK +extern H5TS_key_t H5TS_funcstk_key_g; /* Function stacks */ +#endif /* H5_HAVE_CODESTACK */ +extern H5TS_key_t H5TS_apictx_key_g; /* API contexts */ + +/* Library-scope routines */ +/* (Only used within H5private.h macros) */ +H5_DLL herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex); +H5_DLL herr_t H5TS_mutex_unlock(H5TS_mutex_t *mutex); +H5_DLL herr_t H5TS_cancel_count_inc(void); +H5_DLL herr_t H5TS_cancel_count_dec(void); + +/* Testing routines */ H5_DLL H5TS_thread_t H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata); -#if defined c_plusplus || defined __cplusplus -} -#endif /* c_plusplus || __cplusplus */ - #else /* H5_HAVE_THREADSAFE */ #define H5TS_thread_id() ((uint64_t)0) diff --git a/src/H5private.h b/src/H5private.h index 4c77a98..3ccd14f 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1258,6 +1258,57 @@ typedef off_t h5_stat_size_t; #ifndef HDprintf #define HDprintf(...) HDfprintf(stdout, __VA_ARGS__) #endif /* HDprintf */ +#ifndef HDpthread_attr_destroy +#define HDpthread_attr_destroy(A) pthread_attr_destroy(A) +#endif /* HDpthread_attr_destroy */ +#ifndef HDpthread_attr_init +#define HDpthread_attr_init(A) pthread_attr_init(A) +#endif /* HDpthread_attr_init */ +#ifndef HDpthread_attr_setscope +#define HDpthread_attr_setscope(A, S) pthread_attr_setscope(A, S) +#endif /* HDpthread_attr_setscope */ +#ifndef HDpthread_cond_init +#define HDpthread_cond_init(C, A) pthread_cond_init(C, A) +#endif /* HDpthread_cond_init */ +#ifndef HDpthread_cond_signal +#define HDpthread_cond_signal(C) pthread_cond_signal(C) +#endif /* HDpthread_cond_signal */ +#ifndef HDpthread_cond_wait +#define HDpthread_cond_wait(C, M) pthread_cond_wait(C, M) +#endif /* HDpthread_cond_wait */ +#ifndef HDpthread_create +#define HDpthread_create(R, A, F, U) pthread_create(R, A, F, U) +#endif /* HDpthread_create */ +#ifndef HDpthread_equal +#define HDpthread_equal(T1, T2) pthread_equal(T1, T2) +#endif /* HDpthread_equal */ +#ifndef HDpthread_getspecific +#define HDpthread_getspecific(K) pthread_getspecific(K) +#endif /* HDpthread_getspecific */ +#ifndef HDpthread_join +#define HDpthread_join(T, V) pthread_join(T, V) +#endif /* HDpthread_join */ +#ifndef HDpthread_key_create +#define HDpthread_key_create(K, D) pthread_key_create(K, D) +#endif /* HDpthread_key_create */ +#ifndef HDpthread_mutex_init +#define HDpthread_mutex_init(M, A) pthread_mutex_init(M, A) +#endif /* HDpthread_mutex_init */ +#ifndef HDpthread_mutex_lock +#define HDpthread_mutex_lock(M) pthread_mutex_lock(M) +#endif /* HDpthread_mutex_lock */ +#ifndef HDpthread_mutex_unlock +#define HDpthread_mutex_unlock(M) pthread_mutex_unlock(M) +#endif /* HDpthread_mutex_unlock */ +#ifndef HDpthread_self +#define HDpthread_self() pthread_self() +#endif /* HDpthread_self */ +#ifndef HDpthread_setcancelstate +#define HDpthread_setcancelstate(N, O) pthread_setcancelstate(N, O) +#endif /* HDpthread_setcancelstate */ +#ifndef HDpthread_setspecific +#define HDpthread_setspecific(K, V) pthread_setspecific(K, V) +#endif /* HDpthread_setspecific */ #ifndef HDputc #define HDputc(C, F) putc(C, F) #endif /* HDputc*/ diff --git a/src/hdf5.h b/src/hdf5.h index c19e8aa..2e7caf9 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -37,6 +37,7 @@ #include "H5Rpublic.h" /* References */ #include "H5Spublic.h" /* Dataspaces */ #include "H5Tpublic.h" /* Datatypes */ +#include "H5TSpublic.h" /* Thread-safety */ #include "H5VLpublic.h" /* Virtual Object Layer */ #include "H5Zpublic.h" /* Data filters */ diff --git a/test/ttsafe.c b/test/ttsafe.c index ef5ec3c..067a715 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -70,8 +70,6 @@ tts_is_threadsafe(void) if (is_ts != should_be) TestErrPrintf("Thread-safety value incorrect - test failed\n"); - - return; } /* Routine to generate attribute names for numeric values */ @@ -134,7 +132,7 @@ main(int argc, char *argv[]) TestSummary(); /* Clean up test files, if allowed */ - if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) + if (GetTestCleanup() && !HDgetenv("HDF5_NOCLEANUP")) TestCleanup(); /* Release test infrastructure */ diff --git a/test/ttsafe_attr_vlen.c b/test/ttsafe_attr_vlen.c index f9ca1f8..ecd0aa6 100644 --- a/test/ttsafe_attr_vlen.c +++ b/test/ttsafe_attr_vlen.c @@ -54,15 +54,15 @@ void *tts_attr_vlen_thread(void *); void tts_attr_vlen(void) { - pthread_t threads[NUM_THREADS] = {0}; /* Thread declaration */ - hid_t fid = H5I_INVALID_HID; /* File ID */ - hid_t gid = H5I_INVALID_HID; /* Group ID */ - hid_t atid = H5I_INVALID_HID; /* Datatype ID for attribute */ - hid_t asid = H5I_INVALID_HID; /* Dataspace ID for attribute */ - hid_t aid = H5I_INVALID_HID; /* The attribute ID */ - char * string_attr = "2.0"; /* The attribute data */ - int ret; /* Return value */ - int i; /* Local index variable */ + H5TS_thread_t threads[NUM_THREADS] = {0}; /* Thread declaration */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t atid = H5I_INVALID_HID; /* Datatype ID for attribute */ + hid_t asid = H5I_INVALID_HID; /* Dataspace ID for attribute */ + hid_t aid = H5I_INVALID_HID; /* The attribute ID */ + const char * string_attr = "2.0"; /* The attribute data */ + int ret; /* Return value */ + int i; /* Local index variable */ /* Create the HDF5 test file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -106,26 +106,27 @@ tts_attr_vlen(void) CHECK(ret, H5I_INVALID_HID, "H5Tclose"); /* Start multiple threads and execute tts_attr_vlen_thread() for each thread */ - for (i = 0; i < NUM_THREADS; i++) - pthread_create(&threads[i], NULL, tts_attr_vlen_thread, NULL); + for (i = 0; i < NUM_THREADS; i++) { + threads[i] = H5TS_create_thread(tts_attr_vlen_thread, NULL, NULL); + } /* Wait for the threads to end */ for (i = 0; i < NUM_THREADS; i++) - pthread_join(threads[i], NULL); + H5TS_wait_for_thread(threads[i]); } /* end tts_attr_vlen() */ /* Start execution for each thread */ void * -tts_attr_vlen_thread(void *client_data) +tts_attr_vlen_thread(void H5_ATTR_UNUSED *client_data) { - hid_t fid = H5I_INVALID_HID; /* File ID */ - hid_t gid = H5I_INVALID_HID; /* Group ID */ - hid_t aid = H5I_INVALID_HID; /* Attribute ID */ - hid_t atid = H5I_INVALID_HID; /* Datatype ID for the attribute */ - char * string_attr_check; /* The attribute data being read */ - char * string_attr = "2.0"; /* The expected attribute data */ - herr_t ret; /* Return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t atid = H5I_INVALID_HID; /* Datatype ID for the attribute */ + char * string_attr_check; /* The attribute data being read */ + const char *string_attr = "2.0"; /* The expected attribute data */ + herr_t ret; /* Return value */ /* Open the test file */ fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT); diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index de235c8..acaa9d6 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -65,46 +65,46 @@ tts_cancel(void) /* make thread scheduling global */ ret = pthread_attr_init(&attribute); - assert(ret == 0); + HDassert(ret == 0); #ifdef H5_HAVE_SYSTEM_SCOPE_THREADS ret = pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); - assert(ret == 0); + HDassert(ret == 0); #endif /* H5_HAVE_SYSTEM_SCOPE_THREADS */ /* Initialize mutex & condition variables */ ret = pthread_mutex_init(&mutex, NULL); - assert(ret == 0); + HDassert(ret == 0); ret = pthread_cond_init(&cond, NULL); - assert(ret == 0); + HDassert(ret == 0); /* * Create a hdf5 file using H5F_ACC_TRUNC access, default file * creation plist and default file access plist */ cancel_file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(cancel_file >= 0); + HDassert(cancel_file >= 0); ret = pthread_create(&childthread, &attribute, tts_cancel_thread, NULL); - assert(ret == 0); + HDassert(ret == 0); tts_cancel_barrier(); ret = pthread_cancel(childthread); - assert(ret == 0); + HDassert(ret == 0); dataset = H5Dopen2(cancel_file, DATASETNAME, H5P_DEFAULT); - assert(dataset >= 0); + HDassert(dataset >= 0); ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buffer); - assert(ret >= 0); + HDassert(ret >= 0); if (buffer != 11) TestErrPrintf("operation unsuccessful with value at %d instead of 11\n", buffer); ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(cancel_file); - assert(ret >= 0); + HDassert(ret >= 0); /* Destroy the thread attribute */ ret = pthread_attr_destroy(&attribute); - assert(ret == 0); + HDassert(ret == 0); } /* end tts_cancel() */ void * diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c index 1d10ad5..6243f5e 100644 --- a/test/ttsafe_dcreate.c +++ b/test/ttsafe_dcreate.c @@ -140,7 +140,7 @@ tts_dcreate_creator(void *_thread_data) hsize_t dimsf[1]; /* dataset dimensions */ struct thread_info thread_data; - memcpy(&thread_data, _thread_data, sizeof(struct thread_info)); + HDmemcpy(&thread_data, _thread_data, sizeof(struct thread_info)); /* define dataspace for dataset */ dimsf[0] = 1; -- cgit v0.12 From b7dc1ef6f4c9e8a3e1dd4ee18f2dafcd763c21c1 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Apr 2021 10:20:03 -0700 Subject: Fixes MANIFEST and missing H5TSpublic.h file --- MANIFEST | 55 ++++++++++++++++++++++++++++--------------------------- src/H5TSpublic.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 27 deletions(-) create mode 100644 src/H5TSpublic.h diff --git a/MANIFEST b/MANIFEST index 12ffa30..7d1c463 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1008,6 +1008,7 @@ ./src/H5Tvlen.c ./src/H5TS.c ./src/H5TSprivate.h +./src/H5TSpublic.h ./src/H5VL.c ./src/H5VLcallback.c ./src/H5VLconnector.h @@ -1077,9 +1078,9 @@ ./test/be_extlink2.h5 ./test/big.c ./test/bittests.c +./test/btree2.c ./test/btree_idx_1_6.h5 ./test/btree_idx_1_8.h5 -./test/btree2.c ./test/cache.c ./test/cache_api.c ./test/cache_common.c @@ -1098,13 +1099,15 @@ ./test/direct_chunk.c ./test/dsets.c ./test/dt_arith.c -./test/dtypes.c ./test/dtransform.c +./test/dtypes.c ./test/earray.c ./test/efc.c ./test/enc_dec_plist.c ./test/enc_dec_plist_cross_platform.c ./test/enum.c +./test/err_compat.c +./test/error_test.c ./test/evict_on_close.c ./test/extend.c ./test/external.c @@ -1112,25 +1115,21 @@ ./test/external_common.h ./test/external_env.c ./test/external_fname.h -./test/error_test.c -./test/err_compat.c -./test/filter_error.h5 -./test/links_env.c ./test/family_v16_00000.h5 ./test/family_v16_00001.h5 ./test/family_v16_00002.h5 ./test/family_v16_00003.h5 ./test/farray.c ./test/fheap.c -./test/filespace_1_8.h5 -./test/filespace_1_6.h5 -./test/freespace.c -./test/filenotclosed.c ./test/file_image.c ./test/file_image_core_test.h5 -./test/fill_old.h5 +./test/filenotclosed.c +./test/filespace_1_6.h5 +./test/filespace_1_8.h5 ./test/fill18.h5 +./test/fill_old.h5 ./test/fillval.c +./test/filter_error.h5 ./test/filter_fail.c ./test/filter_plugin.c ./test/filter_plugin1_dsets.c @@ -1140,10 +1139,9 @@ ./test/flush1.c ./test/flush2.c ./test/flushrefresh.c +./test/freespace.c ./test/fsm_aggr_nopersist.h5 ./test/fsm_aggr_persist.h5 -./test/genall5.c -./test/genall5.h ./test/gen_bad_offset.c ./test/gen_bad_ohdr.c ./test/gen_bad_compound.c @@ -1170,6 +1168,8 @@ ./test/gen_sizes_lheap.c ./test/gen_specmetaread.c ./test/gen_udlinks.c +./test/genall5.c +./test/genall5.h ./test/getname.c ./test/gheap.c ./test/group_old.h5 @@ -1189,6 +1189,7 @@ ./test/le_extlink2.h5 ./test/lheap.c ./test/links.c +./test/links_env.c ./test/memleak_H5O_dtype_decode_helper_H5Odtype.h5 ./test/mergemsg.h5 ./test/mf.c @@ -1202,15 +1203,15 @@ ./test/ntypes.c ./test/null_vol_connector.c ./test/null_vol_connector.h -./test/ohdr.c ./test/objcopy.c ./test/objcopy_ref.c +./test/ohdr.c ./test/page_buffer.c ./test/paged_nopersist.h5 ./test/paged_persist.h5 +./test/pool.c ./test/reserved.c ./test/ros3.c -./test/pool.c ./test/s3comms.c ./test/set_extent.c # ====distribute this for now. See HDFFV-8236==== @@ -1238,31 +1239,31 @@ ./test/tattr.c ./test/tbad_msg_count.h5 ./test/tbogus.h5 -./test/tchecksum.c ./test/tcheck_version.c +./test/tchecksum.c ./test/tconfig.c ./test/tcoords.c +./test/test_filter_plugin.sh.in +./test/test_filters_be.h5 +./test/test_filters_le.h5 +./test/test_usecases.sh.in +./test/test_vol_plugin.sh.in ./test/testabort_fail.sh.in ./test/testcheck_version.sh.in -./test/testexternal_env.sh.in ./test/testerror.sh.in -./test/testlinks_env.sh.in -./test/test_filter_plugin.sh.in -./test/test_filters_le.h5 -./test/test_filters_be.h5 +./test/testexternal_env.sh.in ./test/testflushrefresh.sh.in ./test/testframe.c ./test/testhdf5.c ./test/testhdf5.h ./test/testlibinfo.sh.in -./test/test_mirror.sh.in -./test/test_usecases.sh.in -./test/test_vol_plugin.sh.in +./test/testlinks_env.sh.in ./test/testmeta.c +./test/test_mirror.sh.in ./test/testswmr.sh.in +./test/testvds_env.sh.in ./test/testvdsswmr.sh.in ./test/testvfdswmr.sh.in -./test/testvds_env.sh.in ./test/tfile.c ./test/tgenprop.c ./test/th5o.c @@ -1278,7 +1279,6 @@ ./test/tmisc.c ./test/tmtimen.h5 ./test/tmtimeo.h5 -./test/ttime.c ./test/trefer.c ./test/trefer_deprec.c ./test/trefer_shutdown.c @@ -1287,6 +1287,7 @@ ./test/tsizeslheap.h5 ./test/tskiplist.c ./test/tsohm.c +./test/ttime.c ./test/ttst.c ./test/ttsafe.c ./test/ttsafe.h @@ -1301,12 +1302,12 @@ ./test/twriteorder.c ./test/unlink.c ./test/unregister.c +./test/use.h ./test/use_append_chunk.c ./test/use_append_chunk_mirror.c ./test/use_append_mchunks.c ./test/use_common.c ./test/use_disable_mdc_flushes.c -./test/use.h ./test/vds.c ./test/vds_env.c ./test/vds_swmr.h diff --git a/src/H5TSpublic.h b/src/H5TSpublic.h new file mode 100644 index 0000000..41213f9 --- /dev/null +++ b/src/H5TSpublic.h @@ -0,0 +1,52 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * This file contains public declarations for the H5TS (threadsafety) module. + */ + +#ifndef H5TSpublic_H +#define H5TSpublic_H + +/* Public headers needed by this file */ +#include "H5public.h" /* Generic Functions */ + +/*****************/ +/* Public Macros */ +/*****************/ + +/*******************/ +/* Public Typedefs */ +/*******************/ + +/********************/ +/* Public Variables */ +/********************/ + +/*********************/ +/* Public Prototypes */ +/*********************/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* HDF5 global library lock routines */ +H5_DLL herr_t H5TSmutex_acquire(unsigned int lock_count, hbool_t *acquired); +H5_DLL herr_t H5TSmutex_release(unsigned int *lock_count); +H5_DLL herr_t H5TSmutex_get_attempt_count(unsigned int *count); + +#ifdef __cplusplus +} +#endif + +#endif /* H5TSpublic_H */ -- cgit v0.12 From dfc2a0993c076387d96f08e812e6eb9a84e4b778 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Apr 2021 11:25:39 -0700 Subject: Brings H5module.h from develop and fixes Autotools badness --- MANIFEST | 5 +- java/src/Makefile.am | 1 - java/src/jni/Makefile.am | 1 - java/test/Makefile.am | 6 - src/CMakeLists.txt | 47 +++- src/H5.c | 201 ++++++++++++++--- src/H5checksum.c | 37 +++- src/H5dbg.c | 26 ++- src/H5err.txt | 2 + src/H5module.h | 34 +++ src/H5public.h | 567 ++++++++++++++++++++++++++++++++++++++++++----- src/H5system.c | 1 + src/H5timer.c | 1 + tools/Makefile.am | 5 - 14 files changed, 814 insertions(+), 120 deletions(-) create mode 100644 src/H5module.h diff --git a/MANIFEST b/MANIFEST index 7d1c463..c93d5ac 100644 --- a/MANIFEST +++ b/MANIFEST @@ -554,6 +554,7 @@ ./src/H5err.txt ./src/H5detect.c ./src/H5make_libsettings.c +./src/H5module.h ./src/H5mpi.c ./src/H5overflow.txt ./src/H5private.h @@ -946,8 +947,6 @@ ./src/H5Rpkg.h ./src/H5Rprivate.h ./src/H5Rpublic.h -./src/H5UC.c -./src/H5UCprivate.h ./src/H5RS.c ./src/H5RSmodule.h ./src/H5RSprivate.h @@ -1009,6 +1008,8 @@ ./src/H5TS.c ./src/H5TSprivate.h ./src/H5TSpublic.h +./src/H5UC.c +./src/H5UCprivate.h ./src/H5VL.c ./src/H5VLcallback.c ./src/H5VLconnector.h diff --git a/java/src/Makefile.am b/java/src/Makefile.am index ce9e7dc..98630e6 100644 --- a/java/src/Makefile.am +++ b/java/src/Makefile.am @@ -1,6 +1,5 @@ # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am index 96973d4..bf086d2 100644 --- a/java/src/jni/Makefile.am +++ b/java/src/jni/Makefile.am @@ -1,6 +1,5 @@ # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/java/test/Makefile.am b/java/test/Makefile.am index e953c6b..83b4188 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -1,6 +1,5 @@ # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including @@ -84,11 +83,6 @@ noinst_DATA = $(jarfile) .PHONY: classes -# Test with just the native connector, with a single pass-through connector -# and with a doubly-stacked pass-through. -VOL_LIST = native "pass_through under_vol=0;under_info={}" \ - "pass_through under_vol=505;under_info={under_vol=0;under_info={}}" - check_SCRIPTS = junit.sh TEST_SCRIPT = $(check_SCRIPTS) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a189f1b..1cceb87 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -651,6 +651,7 @@ set (H5TS_SOURCES ${HDF5_SRC_DIR}/H5TS.c ) set (H5TS_HDRS + ${HDF5_SRC_DIR}/H5TSpublic.h ) IDE_GENERATED_PROPERTIES ("H5TS" "${H5TS_HDRS}" "${H5TS_SOURCES}" ) @@ -726,6 +727,47 @@ set (H5Z_HDRS ) IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SOURCES}" ) +set (H5_MODULE_HEADERS + ${HDF5_SRC_DIR}/H5module.h + ${HDF5_SRC_DIR}/H5Amodule.h + ${HDF5_SRC_DIR}/H5ACmodule.h + ${HDF5_SRC_DIR}/H5Bmodule.h + ${HDF5_SRC_DIR}/H5B2module.h + ${HDF5_SRC_DIR}/H5Cmodule.h + ${HDF5_SRC_DIR}/H5CXmodule.h + ${HDF5_SRC_DIR}/H5Dmodule.h + ${HDF5_SRC_DIR}/H5Emodule.h + ${HDF5_SRC_DIR}/H5EAmodule.h + ${HDF5_SRC_DIR}/H5ESmodule.h + ${HDF5_SRC_DIR}/H5Fmodule.h + ${HDF5_SRC_DIR}/H5FAmodule.h + ${HDF5_SRC_DIR}/H5FDdrvr_module.h + ${HDF5_SRC_DIR}/H5FDmodule.h + ${HDF5_SRC_DIR}/H5FLmodule.h + ${HDF5_SRC_DIR}/H5FSmodule.h + ${HDF5_SRC_DIR}/H5Gmodule.h + ${HDF5_SRC_DIR}/H5HFmodule.h + ${HDF5_SRC_DIR}/H5HGmodule.h + ${HDF5_SRC_DIR}/H5HLmodule.h + ${HDF5_SRC_DIR}/H5Imodule.h + ${HDF5_SRC_DIR}/H5Lmodule.h + ${HDF5_SRC_DIR}/H5Mmodule.h + ${HDF5_SRC_DIR}/H5MFmodule.h + ${HDF5_SRC_DIR}/H5MPmodule.h + ${HDF5_SRC_DIR}/H5Omodule.h + ${HDF5_SRC_DIR}/H5Pmodule.h + ${HDF5_SRC_DIR}/H5PBmodule.h + ${HDF5_SRC_DIR}/H5PLmodule.h + ${HDF5_SRC_DIR}/H5Rmodule.h + ${HDF5_SRC_DIR}/H5RSmodule.h + ${HDF5_SRC_DIR}/H5Smodule.h + ${HDF5_SRC_DIR}/H5SLmodule.h + ${HDF5_SRC_DIR}/H5SMmodule.h + ${HDF5_SRC_DIR}/H5Tmodule.h + ${HDF5_SRC_DIR}/H5VLmodule.h + ${HDF5_SRC_DIR}/H5Zmodule.h +) + set (common_SRCS ${H5_SOURCES} ${H5A_SOURCES} @@ -809,6 +851,7 @@ set (H5_PUBLIC_HEADERS ${H5S_HDRS} ${H5SM_HDRS} ${H5T_HDRS} + ${H5TS_HDRS} ${H5VL_HDRS} ${H5Z_HDRS} ) @@ -982,7 +1025,7 @@ if (HDF5_GENERATE_HEADERS) ) message(STATUS ${SCRIPT_OUTPUT}) else () - message (STATUS "Cannot generate headers - perl not found") + message (WARNING "Cannot generate headers - perl not found") endif () endif () @@ -1157,7 +1200,7 @@ if (NOT ONLY_SHARED_LIBS) set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2) - add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) + add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS}) target_include_directories (${HDF5_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>;$" diff --git a/src/H5.c b/src/H5.c index 0a572a7..06332fa 100644 --- a/src/H5.c +++ b/src/H5.c @@ -14,6 +14,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ @@ -43,18 +44,28 @@ /* Package Typedefs */ /********************/ +/* Node for list of 'atclose' routines to invoke at library shutdown */ +typedef struct H5_atclose_node_t { + H5_atclose_func_t func; /* Function to invoke */ + void * ctx; /* Context to pass to function */ + struct H5_atclose_node_t *next; /* Pointer to next node in list */ +} H5_atclose_node_t; + /********************/ /* Local Prototypes */ /********************/ -static void H5_debug_mask(const char *); +static void H5__debug_mask(const char *); #ifdef H5_HAVE_PARALLEL -static int H5_mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *flag); +static int H5__mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *flag); #endif /*H5_HAVE_PARALLEL*/ /*********************/ /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ /*****************************/ @@ -84,6 +95,39 @@ H5_debug_t H5_debug_g; /* debugging info */ /* Local Variables */ /*******************/ +/* Linked list of registered 'atclose' functions to invoke at library shutdown */ +static H5_atclose_node_t *H5_atclose_head = NULL; + +/* Declare a free list to manage the H5_atclose_node_t struct */ +H5FL_DEFINE_STATIC(H5_atclose_node_t); + +/*-------------------------------------------------------------------------- +NAME + H5__init_package -- Initialize interface-specific information +USAGE + herr_t H5__init_package() +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. +--------------------------------------------------------------------------*/ +herr_t +H5__init_package(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Run the library initialization routine, if it hasn't already ran */ + if (!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { + if (H5_init_library() < 0) + HGOTO_ERROR(H5E_LIB, H5E_CANTINIT, FAIL, "unable to initialize library") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5__init_package() */ + /*-------------------------------------------------------------------------- * NAME * H5_init_library -- Initialize library-global information @@ -103,6 +147,11 @@ H5_init_library(void) { herr_t ret_value = SUCCEED; + /* Set the 'library initialized' flag as early as possible, to avoid + * possible re-entrancy. + */ + H5_INIT_GLOBAL = TRUE; + FUNC_ENTER_NOAPI(FAIL) #ifdef H5_HAVE_PARALLEL @@ -132,7 +181,7 @@ H5_init_library(void) int key_val; if (MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval( - MPI_COMM_NULL_COPY_FN, (MPI_Comm_delete_attr_function *)H5_mpi_delete_cb, + MPI_COMM_NULL_COPY_FN, (MPI_Comm_delete_attr_function *)H5__mpi_delete_cb, &key_val, NULL))) HMPI_GOTO_ERROR(FAIL, "MPI_Comm_create_keyval failed", mpi_code) @@ -228,8 +277,8 @@ H5_init_library(void) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize vol interface") /* Debugging? */ - H5_debug_mask("-all"); - H5_debug_mask(HDgetenv("HDF5_DEBUG")); + H5__debug_mask("-all"); + H5__debug_mask(HDgetenv("HDF5_DEBUG")); done: FUNC_LEAVE_NOAPI(ret_value) @@ -273,6 +322,28 @@ H5_term_library(void) /* Check if we should display error output */ (void)H5Eget_auto2(H5E_DEFAULT, &func, NULL); + /* Iterate over the list of 'atclose' callbacks that have been registered */ + if (H5_atclose_head) { + H5_atclose_node_t *curr_atclose; /* Current 'atclose' node */ + + /* Iterate over all 'atclose' nodes, making callbacks */ + curr_atclose = H5_atclose_head; + while (curr_atclose) { + H5_atclose_node_t *tmp_atclose; /* Temporary pointer to 'atclose' node */ + + /* Invoke callback, providing context */ + (*curr_atclose->func)(curr_atclose->ctx); + + /* Advance to next node and free this one */ + tmp_atclose = curr_atclose; + curr_atclose = curr_atclose->next; + H5FL_FREE(H5_atclose_node_t, tmp_atclose); + } /* end while */ + + /* Reset list head, in case library is re-initialized */ + H5_atclose_head = NULL; + } /* end if */ + /* * Terminate each interface. The termination functions return a positive * value if they do something that might affect some other interface in a @@ -564,12 +635,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5get_free_list_sizes(size_t *reg_size, size_t *arr_size, size_t *blk_size, size_t *fac_size) +H5get_free_list_sizes(size_t *reg_size /*out*/, size_t *arr_size /*out*/, size_t *blk_size /*out*/, + size_t *fac_size /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "*z*z*z*z", reg_size, arr_size, blk_size, fac_size); + H5TRACE4("e", "xxxx", reg_size, arr_size, blk_size, fac_size); /* Call the free list function to actually get the sizes */ if (H5FL_get_free_list_sizes(reg_size, arr_size, blk_size, fac_size) < 0) @@ -604,12 +676,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5get_alloc_stats(H5_alloc_stats_t *stats) +H5get_alloc_stats(H5_alloc_stats_t *stats /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*Ha", stats); + H5TRACE1("e", "x", stats); /* Call the internal allocation stat routine to get the values */ if (H5MM_get_alloc_stats(stats) < 0) @@ -620,7 +692,7 @@ done: } /* end H5get_alloc_stats() */ /*------------------------------------------------------------------------- - * Function: H5_debug_mask + * Function: H5__debug_mask * * Purpose: Set runtime debugging flags according to the string S. The * string should contain file numbers and package names @@ -643,7 +715,7 @@ done: *------------------------------------------------------------------------- */ static void -H5_debug_mask(const char *s) +H5__debug_mask(const char *s) { FILE * stream = stderr; char pkg_name[32], *rest; @@ -724,15 +796,12 @@ H5_debug_mask(const char *s) s++; } /* end if-else */ } /* end while */ - - return; - -} /* end H5_debug_mask() */ +} /* end H5__debug_mask() */ #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5_mpi_delete_cb + * Function: H5__mpi_delete_cb * * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 * library when the communicator is destroyed, i.e. on MPI_Finalize. @@ -742,8 +811,8 @@ H5_debug_mask(const char *s) *------------------------------------------------------------------------- */ static int -H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, - int H5_ATTR_UNUSED *flag) +H5__mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, + int H5_ATTR_UNUSED *flag) { H5_term_library(); return MPI_SUCCESS; @@ -767,12 +836,12 @@ H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H *------------------------------------------------------------------------- */ herr_t -H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum) +H5get_libversion(unsigned *majnum /*out*/, unsigned *minnum /*out*/, unsigned *relnum /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*Iu*Iu*Iu", majnum, minnum, relnum); + H5TRACE3("e", "xxx", majnum, minnum, relnum); /* Set the version information */ if (majnum) @@ -890,7 +959,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) HDstrncat(lib_str, "-", (size_t)1); HDstrncat(lib_str, substr, (sizeof(lib_str) - HDstrlen(lib_str)) - 1); } /* end if */ - if (HDstrcmp(lib_str, H5_lib_vers_info_g)) { + if (HDstrcmp(lib_str, H5_lib_vers_info_g) != 0) { HDfputs("Warning! Library version information error.\n" "The HDF5 library version information are not " "consistent in its source code.\nThis is NOT a fatal error " @@ -937,6 +1006,45 @@ done: } /* end H5open() */ /*------------------------------------------------------------------------- + * Function: H5atclose + * + * Purpose: Register a callback for the library to invoke when it's + * closing. Callbacks are invoked in LIFO order. + * + * Return: Non-negative on success/Negative on failure + * + *------------------------------------------------------------------------- + */ +herr_t +H5atclose(H5_atclose_func_t func, void *ctx) +{ + H5_atclose_node_t *new_atclose; /* New 'atclose' node */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "Hc*x", func, ctx); + + /* Check arguments */ + if (NULL == func) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL func pointer") + + /* Allocate space for the 'atclose' node */ + if (NULL == (new_atclose = H5FL_MALLOC(H5_atclose_node_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate 'atclose' node") + + /* Set up 'atclose' node */ + new_atclose->func = func; + new_atclose->ctx = ctx; + + /* Connector to linked-list of 'atclose' nodes */ + new_atclose->next = H5_atclose_head; + H5_atclose_head = new_atclose; + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5atclose() */ + +/*------------------------------------------------------------------------- * Function: H5close * * Purpose: Terminate the library and release all resources. @@ -1073,23 +1181,58 @@ H5free_memory(void *mem) *------------------------------------------------------------------------- */ herr_t -H5is_library_threadsafe(hbool_t *is_ts) +H5is_library_threadsafe(hbool_t *is_ts /*out*/) { - FUNC_ENTER_API_NOINIT - H5TRACE1("e", "*b", is_ts); + herr_t ret_value = SUCCEED; /* Return value */ - HDassert(is_ts); + FUNC_ENTER_API_NOINIT + H5TRACE1("e", "x", is_ts); - /* At this time, it is impossible for this to fail. */ + if (is_ts) { #ifdef H5_HAVE_THREADSAFE - *is_ts = TRUE; + *is_ts = TRUE; #else /* H5_HAVE_THREADSAFE */ - *is_ts = FALSE; + *is_ts = FALSE; #endif /* H5_HAVE_THREADSAFE */ + } + else + ret_value = FAIL; - FUNC_LEAVE_API_NOINIT(SUCCEED) + FUNC_LEAVE_API_NOINIT(ret_value) } /* end H5is_library_threadsafe() */ +/*------------------------------------------------------------------------- + * Function: H5is_library_terminating + * + * Purpose: Checks to see if the library is shutting down. + * + * Note: Useful for plugins to detect when the library is terminating. + * For example, a VOL connector could check if a "file close" + * callback was the result of the library shutdown process, or + * an API action from the application. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5is_library_terminating(hbool_t *is_terminating /*out*/) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API_NOINIT + H5TRACE1("e", "x", is_terminating); + + HDassert(is_terminating); + + if (is_terminating) + *is_terminating = H5_TERM_GLOBAL; + else + ret_value = FAIL; + + FUNC_LEAVE_API_NOINIT(ret_value) +} /* end H5is_library_terminating() */ + #if defined(H5_HAVE_THREADSAFE) && defined(H5_BUILT_AS_DYNAMIC_LIB) && defined(H5_HAVE_WIN32_API) && \ defined(H5_HAVE_WIN_THREADS) /*------------------------------------------------------------------------- diff --git a/src/H5checksum.c b/src/H5checksum.c index 7daf8b8..0cd7745 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -15,7 +15,7 @@ * * Created: H5checksum.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal code for computing fletcher32 checksums * @@ -25,6 +25,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ @@ -141,7 +142,7 @@ H5_checksum_fletcher32(const void *_data, size_t _len) } /* end H5_checksum_fletcher32() */ /*------------------------------------------------------------------------- - * Function: H5_checksum_crc_make_table + * Function: H5__checksum_crc_make_table * * Purpose: Compute the CRC table for the CRC checksum algorithm * @@ -153,12 +154,12 @@ H5_checksum_fletcher32(const void *_data, size_t _len) *------------------------------------------------------------------------- */ static void -H5_checksum_crc_make_table(void) +H5__checksum_crc_make_table(void) { uint32_t c; /* Checksum for each byte value */ unsigned n, k; /* Local index variables */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Compute the checksum for each possible byte value */ for (n = 0; n < 256; n++) { @@ -173,10 +174,10 @@ H5_checksum_crc_make_table(void) H5_crc_table_computed = TRUE; FUNC_LEAVE_NOAPI_VOID -} /* end H5_checksum_crc_make_table() */ +} /* end H5__checksum_crc_make_table() */ /*------------------------------------------------------------------------- - * Function: H5_checksum_crc_make_table + * Function: H5__checksum_crc_update * * Purpose: Update a running CRC with the bytes buf[0..len-1]--the CRC * should be initialized to all 1's, and the transmitted value @@ -191,22 +192,22 @@ H5_checksum_crc_make_table(void) *------------------------------------------------------------------------- */ static uint32_t -H5_checksum_crc_update(uint32_t crc, const uint8_t *buf, size_t len) +H5__checksum_crc_update(uint32_t crc, const uint8_t *buf, size_t len) { size_t n; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Initialize the CRC table if necessary */ if (!H5_crc_table_computed) - H5_checksum_crc_make_table(); + H5__checksum_crc_make_table(); /* Update the CRC with the results from this buffer */ for (n = 0; n < len; n++) crc = H5_crc_table[(crc ^ buf[n]) & 0xff] ^ (crc >> 8); FUNC_LEAVE_NOAPI(crc) -} /* end H5_checksum_crc_update() */ +} /* end H5__checksum_crc_update() */ /*------------------------------------------------------------------------- * Function: H5_checksum_crc @@ -234,7 +235,8 @@ H5_checksum_crc(const void *_data, size_t len) HDassert(_data); HDassert(len > 0); - FUNC_LEAVE_NOAPI(H5_checksum_crc_update((uint32_t)0xffffffffL, (const uint8_t *)_data, len) ^ 0xffffffffL) + FUNC_LEAVE_NOAPI(H5__checksum_crc_update((uint32_t)0xffffffffL, (const uint8_t *)_data, len) ^ + 0xffffffffL) } /* end H5_checksum_crc() */ /* @@ -378,7 +380,7 @@ uint32_t H5_checksum_lookup3(const void *key, size_t length, uint32_t initval) { const uint8_t *k = (const uint8_t *)key; - uint32_t a, b, c; /* internal state */ + uint32_t a, b, c = 0; /* internal state */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -413,36 +415,47 @@ H5_checksum_lookup3(const void *key, size_t length, uint32_t initval) { case 12: c += ((uint32_t)k[11]) << 24; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 11: c += ((uint32_t)k[10]) << 16; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 10: c += ((uint32_t)k[9]) << 8; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 9: c += k[8]; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 8: b += ((uint32_t)k[7]) << 24; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 7: b += ((uint32_t)k[6]) << 16; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 6: b += ((uint32_t)k[5]) << 8; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 5: b += k[4]; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 4: a += ((uint32_t)k[3]) << 24; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 3: a += ((uint32_t)k[2]) << 16; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 2: a += ((uint32_t)k[1]) << 8; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 1: a += k[0]; diff --git a/src/H5dbg.c b/src/H5dbg.c index b332fd1..5af6525 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5dbg.c - * Mar 4 2006 - * Quincey Koziol + * Created: H5dbg.c + * Mar 4 2006 + * Quincey Koziol * - * Purpose: Generic debugging routines + * Purpose: Generic debugging routines * *------------------------------------------------------------------------- */ @@ -25,11 +25,12 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ /****************/ /* Local Macros */ @@ -56,14 +57,14 @@ /*******************/ /*------------------------------------------------------------------------- - * Function: H5_buffer_dump + * Function: H5_buffer_dump * - * Purpose: Dumps a buffer of memory in an octal dump form + * Purpose: Dumps a buffer of memory in an octal dump form * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Mar 4 2006 + * Programmer: Quincey Koziol + * Mar 4 2006 * *------------------------------------------------------------------------- */ @@ -91,7 +92,7 @@ H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, const uint8_t *mark for (u = 0; u < buf_size; u += 16) { uint8_t c; - HDfprintf(stream, "%*s %8d: ", indent, "", u + buf_offset); + HDfprintf(stream, "%*s %8zu: ", indent, "", u + buf_offset); /* Print the hex values */ for (v = 0; v < 16; v++) { @@ -105,6 +106,7 @@ H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, const uint8_t *mark } /* end if */ else HDfprintf(stream, " "); + if (7 == v) HDfputc(' ', stream); } /* end for */ @@ -117,12 +119,14 @@ H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, const uint8_t *mark HDfputc(' ', stream); else { c = buf[buf_offset + u + v]; + if (HDisprint(c)) HDfputc(c, stream); else HDfputc('.', stream); } /* end else */ } /* end if */ + if (7 == v) HDfputc(' ', stream); } /* end for */ diff --git a/src/H5err.txt b/src/H5err.txt index a902991..24e9b2a 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -46,6 +46,7 @@ MAJOR, H5E_ARGS, Invalid arguments to routine MAJOR, H5E_RESOURCE, Resource unavailable MAJOR, H5E_INTERNAL, Internal error (too specific to document in detail) +MAJOR, H5E_LIB, General library infrastructure MAJOR, H5E_FILE, File accessibility MAJOR, H5E_IO, Low-level I/O MAJOR, H5E_FUNC, Function entry/exit @@ -102,6 +103,7 @@ SECTION, FSPACE, Free space errors SECTION, PIPELINE, I/O pipeline errors SECTION, SYSTEM, System level errors SECTION, PLUGIN, Plugin errors +SECTION, MAP, Map related errors SECTION, NONE, No error # Minor errors diff --git a/src/H5module.h b/src/H5module.h new file mode 100644 index 0000000..64081bf --- /dev/null +++ b/src/H5module.h @@ -0,0 +1,34 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: This file contains declarations which define macros for the + * H5 package. Including this header means that the source file + * is part of the H5 package. + */ +#ifndef H5module_H +#define H5module_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5_MODULE +#define H5_MY_PKG H5 +#define H5_MY_PKG_ERR H5E_LIB +#define H5_MY_PKG_INIT YES + +/**\defgroup H5 H5 + * \brief General Library Functions + * \todo Describe concisely what the functions in this module are about. + */ + +#endif /* H5module_H */ diff --git a/src/H5public.h b/src/H5public.h index 206fdc9..2fb4407 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -20,34 +20,34 @@ /* Include files for public use... */ /* * Since H5pubconf.h is a generated header file, it is messy to try - * to put a #ifndef _H5pubconf_H ... #endif guard in it. + * to put a #ifndef H5pubconf_H ... #endif guard in it. * HDF5 has set an internal rule that it is being included here. * Source files should NOT include H5pubconf.h directly but include - * it via H5public.h. The #ifndef _H5public_H guard above would + * it via H5public.h. The #ifndef H5public_H guard above would * prevent repeated include. */ -#include "H5pubconf.h" /*from configure */ +#include "H5pubconf.h" /* From configure */ /* API Version macro wrapper definitions */ #include "H5version.h" #ifdef H5_HAVE_FEATURES_H -#include /*for setting POSIX, BSD, etc. compatibility */ +#include /* For setting POSIX, BSD, etc. compatibility */ #endif #ifdef H5_HAVE_SYS_TYPES_H #include #endif #ifdef H5_STDC_HEADERS -#include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ -#include /*for variadic functions in H5VLpublic.h */ +#include /* For H5T_NATIVE_CHAR defn in H5Tpublic.h */ +#include /* For variadic functions in H5VLpublic.h */ #endif #ifndef __cplusplus #ifdef H5_HAVE_STDINT_H -#include /*for C9x types */ +#include /* For C9x types */ #endif #else #ifdef H5_HAVE_STDINT_H_CXX -#include /*for C9x types when include from C++ */ +#include /* For C9x types (when included from C++) */ #endif #endif #ifdef H5_HAVE_INTTYPES_H @@ -61,7 +61,7 @@ #define MPICH_SKIP_MPICXX 1 #define OMPI_SKIP_MPICXX 1 #include -#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ +#ifndef MPI_FILE_NULL /* MPIO may be defined in mpi.h already */ #include #endif #endif @@ -91,12 +91,15 @@ extern "C" { #define H5_GCC_DIAG_ON(x) #endif +/* Macro to hide a symbol from further preprocessor substitutions */ +#define H5_NO_EXPAND(x) (x) + /* Version numbers */ -#define H5_VERS_MAJOR 1 /* For major interface/format changes */ -#define H5_VERS_MINOR 13 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ - /* Empty string for real releases. */ +#define H5_VERS_MAJOR 1 /* For major interface/format changes */ +#define H5_VERS_MINOR 13 /* For minor interface/format changes */ +#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ +/* Empty string for real releases. */ #define H5_VERS_INFO "HDF5 library version: 1.13.0" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE) @@ -117,8 +120,8 @@ extern "C" { * The negative failure value is most commonly -1, but don't bet on it. The * proper way to detect failure is something like: * - * if((dset = H5Dopen2(file, name)) < 0) - * fprintf(stderr, "unable to open the requested dataset\n"); + * if((dset = H5Dopen2(file, name)) < 0) + * fprintf(stderr, "unable to open the requested dataset\n"); */ typedef int herr_t; @@ -129,13 +132,13 @@ typedef int herr_t; * (false), positive (true), or negative (failure). The proper way to test * for truth from a htri_t function is: * - * if ((retval = H5Tcommitted(type))>0) { - * printf("data type is committed\n"); - * } else if (!retval) { - * printf("data type is not committed\n"); - * } else { - * printf("error determining whether data type is committed\n"); - * } + * if ((retval = H5Tcommitted(type)) > 0) { + * printf("data type is committed\n"); + * } else if (!retval) { + * printf("data type is not committed\n"); + * } else { + * printf("error determining whether data type is committed\n"); + * } */ #ifdef H5_HAVE_STDBOOL_H #include @@ -295,15 +298,21 @@ typedef unsigned long uint32_t; #error "nothing appropriate for uint32_t" #endif -/* Common iteration orders */ +//! [H5_iter_order_t_snip] + +/** + * Common iteration orders + */ typedef enum { - H5_ITER_UNKNOWN = -1, /* Unknown order */ - H5_ITER_INC, /* Increasing order */ - H5_ITER_DEC, /* Decreasing order */ - H5_ITER_NATIVE, /* No particular order, whatever is fastest */ - H5_ITER_N /* Number of iteration orders */ + H5_ITER_UNKNOWN = -1, /**< Unknown order */ + H5_ITER_INC, /**< Increasing order */ + H5_ITER_DEC, /**< Decreasing order */ + H5_ITER_NATIVE, /**< No particular order, whatever is fastest */ + H5_ITER_N /**< Number of iteration orders */ } H5_iter_order_t; +//! [H5_iter_order_t_snip] + /* Iteration callback values */ /* (Actually, any positive value will cause the iterator to stop and pass back * that positive value to the function that called the iterator) @@ -312,25 +321,39 @@ typedef enum { #define H5_ITER_CONT (0) #define H5_ITER_STOP (1) -/* +//! [H5_index_t_snip] + +/** * The types of indices on links in groups/attributes on objects. * Primarily used for " by index" routines and for iterating over * links in groups/attributes on objects. */ typedef enum H5_index_t { - H5_INDEX_UNKNOWN = -1, /* Unknown index type */ - H5_INDEX_NAME, /* Index on names */ - H5_INDEX_CRT_ORDER, /* Index on creation order */ - H5_INDEX_N /* Number of indices defined */ + H5_INDEX_UNKNOWN = -1, /**< Unknown index type */ + H5_INDEX_NAME, /**< Index on names */ + H5_INDEX_CRT_ORDER, /**< Index on creation order */ + H5_INDEX_N /**< Number of indices defined */ } H5_index_t; -/* +//! [H5_index_t_snip] + +/** * Storage info struct used by H5O_info_t and H5F_info_t */ +//! [H5_ih_info_t_snip] typedef struct H5_ih_info_t { - hsize_t index_size; /* btree and/or list */ + hsize_t index_size; /**< btree and/or list */ hsize_t heap_size; } H5_ih_info_t; +//! [H5_ih_info_t_snip] + +/** + * The maximum size allowed for tokens + * \details Tokens are unique and permanent identifiers that are + * used to reference HDF5 objects in a container. This allows + * for 128-bit tokens + */ +#define H5O_MAX_TOKEN_SIZE (16) static inline const char * htri_to_string(htri_t v) @@ -343,46 +366,488 @@ htri_to_string(htri_t v) return "true"; } -/* Tokens are unique and permanent identifiers that are - * used to reference HDF5 objects in a container. */ - -/* The maximum size allowed for tokens */ -#define H5O_MAX_TOKEN_SIZE (16) /* Allows for 128-bit tokens */ +//! [H5O_token_t_snip] +/** + * \internal (Hoisted here, since it's used by both the + * H5Lpublic.h and H5Opublic.h headers) */ /* Type for object tokens */ /* (Hoisted here, since it's used by both the H5Lpublic.h and H5Opublic.h headers) */ typedef struct H5O_token_t { uint8_t __data[H5O_MAX_TOKEN_SIZE]; } H5O_token_t; -/* +//! [H5O_token_t_snip] + +/** * Allocation statistics info struct */ typedef struct H5_alloc_stats_t { - unsigned long long total_alloc_bytes; /* Running count of total # of bytes allocated */ - size_t curr_alloc_bytes; /* Current # of bytes allocated */ - size_t peak_alloc_bytes; /* Peak # of bytes allocated */ - size_t max_block_size; /* Largest block allocated */ - size_t total_alloc_blocks_count; /* Running count of total # of blocks allocated */ - size_t curr_alloc_blocks_count; /* Current # of blocks allocated */ - size_t peak_alloc_blocks_count; /* Peak # of blocks allocated */ + unsigned long long total_alloc_bytes; /**< Running count of total # of bytes allocated */ + size_t curr_alloc_bytes; /**< Current # of bytes allocated */ + size_t peak_alloc_bytes; /**< Peak # of bytes allocated */ + size_t max_block_size; /**< Largest block allocated */ + size_t total_alloc_blocks_count; /**< Running count of total # of blocks allocated */ + size_t curr_alloc_blocks_count; /**< Current # of blocks allocated */ + size_t peak_alloc_blocks_count; /**< Peak # of blocks allocated */ } H5_alloc_stats_t; +/** + * Library shutdown callback, used by H5atclose(). + */ +typedef void (*H5_atclose_func_t)(void *ctx); + /* Functions in H5.c */ +/** + * \ingroup H5 + * \brief Initializes the HDF5 library + * \return \herr_t + * + * \details H5open() initializes the HDF5 library. + * + * \details When the HDF5 library is used in a C application, the library is + * automatically initialized when the first HDf5 function call is + * issued. If one finds that an HDF5 library function is failing + * inexplicably, H5open() can be called first. It is safe to call + * H5open() before an application issues any other function calls to + * the HDF5 library as there are no damaging side effects in calling + * it more than once. + */ H5_DLL herr_t H5open(void); +/** + * \ingroup H5 + * \brief Registers a callback for the library to invoke when it's closing. + * \param[in] func The function pointer to invoke + * \param[in] ctx Context to pass to \p func when invoked + * \return \herr_t + * + * \details H5atclose() registers a callback that the HDF5 library will invoke + * when closing. The full capabilities of the HDF5 library are + * available to callbacks invoked through this mechanism, library + * shutdown will only begin in earnest when all callbacks have been + * invoked and have returned. + * + * Registered callbacks are invoked in LIFO order, similar to the + * Standard C 'atexit' routine. For example, if 'func1' is registered, + * then 'func2', when the library is closing 'func2' will + * be invoked first, then 'func1'. + * + * The \p ctx pointer will be passed to \p func when it's invoked. + * NULL is allowed for \p ctx. + * + * If the HDF5 library is initialized and closed more than once, the + * \p func callback must be registered within each open/close cycle. + * + * \since 1.12.1 + */ +H5_DLL herr_t H5atclose(H5_atclose_func_t func, void *ctx); +/** + * \ingroup H5 + * \brief Flushes all data to disk, closes all open objects, and releases memory + * \return \herr_t + * + * \details H5close() flushes all data to disk, closes all open HDF5 objects, + * and cleans up all memory used by the HDF5 library. This function is + * generally called when the application calls exit(), but may be + * called earlier in the event of an emergency shutdown or out of a + * desire to free all resources used by the HDF5 library. + */ H5_DLL herr_t H5close(void); +/** + * \ingroup H5 + * \brief Instructs library not to install atexit() cleanup routine + * \return \herr_t + * + * \details H5dont_atexit() indicates to the library that an atexit() cleanup + * routine should not be installed. The major purpose for using this + * function is in situations where the library is dynamically linked + * into an application and is un-linked from the application before + * exit() gets called. In those situations, a routine installed with + * atexit() would jump to a routine which was no longer in memory, + * causing errors. + * + * \attention In order to be effective, this routine \Emph{must} be called + * before any other HDF5 function calls, and must be called each + * time the library is loaded/linked into the application (the first + * time and after it's been un-loaded). + */ H5_DLL herr_t H5dont_atexit(void); +/** + * \ingroup H5 + * \brief Garbage collects on all free-lists of all types + * \return \herr_t + * + * \details H5garbage_collect() walks through all garbage collection routines + * of the library, freeing any unused memory. + * + * It is not required that H5garbage_collect() be called at any + * particular time; it is only necessary in certain situations where + * the application has performed actions that cause the library to + * allocate many objects. The application should call + * H5garbage_collect() if it eventually releases those objects and + * wants to reduce the memory used by the library from the peak usage + * required. + * + * \note The library automatically garbage collects all the free lists when the + * application ends. + */ H5_DLL herr_t H5garbage_collect(void); +/** + * \ingroup H5 + * \brief Sets free-list size limits + * + * \param[in] reg_global_lim The cumulative limit, in bytes, on memory used for + * all regular free lists (Default: 1MB) + * \param[in] reg_list_lim The limit, in bytes, on memory used for each regular + * free list (Default: 64KB) + * \param[in] arr_global_lim The cumulative limit, in bytes, on memory used for + * all array free lists (Default: 4MB) + * \param[in] arr_list_lim The limit, in bytes, on memory used for each array + * free list (Default: 256KB) + * \param[in] blk_global_lim The cumulative limit, in bytes, on memory used for + * all block free lists and, separately, for all + * factory free lists (Default: 16MB) + * \param[in] blk_list_lim The limit, in bytes, on memory used for each block + * or factory free list (Default: 1MB) + * \return \herr_t + * + * \details H5set_free_list_limits() sets size limits on all types of free + * lists. The HDF5 library uses free lists internally to manage + * memory. The types of free lists used are as follows: + * \li Regular free lists manage memory for single internal data + * structures. + * \li Array free lists manage memory for arrays of internal + * data structures. + * \li Block free lists manage memory for arbitrarily-sized blocks + * of bytes. + * \li Factory free lists manage memory for fixed-size blocks of + * bytes. + * + * The parameters specify global and per-list limits; for example, \p + * reg_global_limit and \p reg_list_limit limit the accumulated size + * of all regular free lists and the size of each individual regular + * free list, respectively. Therefore, if an application sets a 1Mb + * limit on each of the global lists, up to 4Mb of total storage might + * be allocated, 1Mb for each of the regular, array, block, and + * factory type lists. + * + * The settings specified for block free lists are duplicated for + * factory free lists. Therefore, increasing the global limit on block + * free lists by x bytes will increase the potential free list memory + * usage by 2x bytes. + * + * Using a value of -1 for a limit means that no limit is set for the + * specified type of free list. + * + * \version 1.8.3 Function changed in this release to set factory free list + * memory limits. + * + * \since 1.6.0 + */ H5_DLL herr_t H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); +/** + * \ingroup H5 + * \brief Gets the current size of the free lists used to manage memory + * + * \param[out] reg_size The current size of all "regular" free list memory used + * \param[out] arr_size The current size of all "array" free list memory used + * \param[out] blk_size The current size of all "block" free list memory used + * \param[out] fac_size The current size of all "factory" free list memory used + * \return \herr_t + * + * \details H5get_free_list_sizes() obtains the current size of the different + * kinds of free lists that the library uses to manage memory. The + * free list sizes can be set with H5set_free_list_limits() and + * garbage collected with H5garbage_collect(). These lists are global + * for the entire library. + * + * \since 1.12.1 + */ H5_DLL herr_t H5get_free_list_sizes(size_t *reg_size, size_t *arr_size, size_t *blk_size, size_t *fac_size); +/** + * \ingroup H5 + * \brief Gets the memory allocation statistics for the library + * + * \param[out] stats Memory allocation statistics + * \return \herr_t + * + * \details H5get_alloc_stats() gets the memory allocation statistics for the + * library, if the \c --enable-memory-alloc-sanity-check option was + * given when building the library. Applications can check whether + * this option was enabled detecting if the + * \c H5_MEMORY_ALLOC_SANITY_CHECK macro is defined. This option is + * enabled by default for debug builds of the library and disabled by + * default for non-debug builds. If the option is not enabled, all the + * values returned with be 0. These statistics are global for the + * entire library, but do not include allocations from chunked dataset + * I/O filters or non-native VOL connectors. + * + * \since 1.12.1 + */ H5_DLL herr_t H5get_alloc_stats(H5_alloc_stats_t *stats); +/** + * \ingroup H5 + * \brief Returns the HDF library release number + * + * \param[out] majnum The major version number of the library + * \param[out] minnum The minor version number of the library + * \param[out] relnum The release version number of the library + * \return \herr_t + * + * \details H5get_libversion() retrieves the major, minor, and release numbers + * of the version of the HDF5 library which is linked to the + * application. + * + */ H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum); +/** + * \ingroup H5 + * \brief Verifies that HDF5 library versions are consistent + * + * \param[in] majnum HDF5 library major version number + * \param[in] minnum HDF5 library minor version number + * \param[in] relnum HDF5 library release number + * \return \herr_t + * + * \details H5check_version() verifies that the version of the HDF5 library + * with which an application was compiled, as indicated by the passed + * parameters, matches the version of the HDF5 library against which + * the application is currently linked. + * + * \p majnum is the major version number of the HDF library with which + * the application was compiled, \p minnum is the minor version + * number, and \p relnum is the release number. Consider the following + * example: + * + * An official HDF5 release is labelled as follows: + * HDF5 Release \Code{\.\.\}\n + * For example, in HDF5 Release 1.8.5: + * \li 1 is the major version number, \p majnum. + * \li 8 is the minor version number, \p minnum. + * \li 5 is the release number, \p relnum. + * + * As stated above, H5check_version() first verifies that the version + * of the HDF5 library with which an application was compiled matches + * the version of the HDF5 library against which the application is + * currently linked. If this check fails, H5check_version() causes the + * application to abort (by means of a standard C abort() call) and + * prints information that is usually useful for debugging. This + * precaution is is taken to avoid the risks of data corruption or + * segmentation faults. + * + * The most common cause of this failure is that an application was + * compiled with one version of HDF5 and is dynamically linked with a + * different version different version. + * + * If the above test passes, H5check_version() proceeds to verify the + * consistency of additional library version information. This is + * designed to catch source code inconsistencies that do not normally + * cause failures; if this check reveals an inconsistency, an + * informational warning is printed but the application is allowed to + * run. + * + */ H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum); +/** + * \ingroup H5 + * \brief Checks whether the HDF5 library is closing. + * \param[out] is_terminating Flag indicating whether library is shutting down + * \return \herr_t + * + * \details H5is_library_terminating() queries whether the HDF5 library is in + * the process of shutting down. The \p is_terminating flag will only + * be set to TRUE after shutdown starts, it will be FALSE before the + * library has been initialized, while the library is initialized, and + * after it has been closed. The value of \p is_terminating is + * undefined if this routine fails. + * + * \since 1.12.1 + */ +H5_DLL herr_t H5is_library_terminating(hbool_t *is_terminating); +/** + * \ingroup H5 + * \brief Determines whether the HDF5 library was built with the thread-safety + * feature enabled + * + * \param[out] is_ts Boolean value indicating whether the library was built + * with thread-safety enabled + * \return \herr_t + * + * \details The HDF5 library, although not internally multi-threaded, can be + * built with a thread-safety feature enabled that protects internal + * data structures with a mutex. In certain circumstances, it may be + * useful to determine, at run-time, whether the linked HDF5 library + * was built with the thread-safety feature enabled. + */ H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); +/** + * \ingroup H5 + * \brief Frees memory allocated by the HDF5 library + * + * \param[in] mem Buffer to be freed. Can be NULL + * \return \herr_t + * + * \details H5free_memory() frees memory that has been allocated by the caller + * with H5allocate_memory() or by the HDF5 library on behalf of the + * caller. + * + * H5Tget_member_name() provides an example of memory allocation on + * behalf of the caller: The function returns a buffer containing the + * name of a compound datatype member. It is the caller’s + * responsibility to eventually free that buffer with H5free_memory(). + * + * \attention It is especially important to use this function to free memory + * allocated by the library on Windows. The C standard library is + * implemented in dynamic link libraries (DLLs) known as the C + * run-time (CRT). Each version of Visual Studio comes with two CRT + * DLLs (debug and release) and allocating and freeing across DLL + * boundaries can cause resource leaks and subtle bugs due to heap + * corruption.\n + * Only use this function to free memory allocated by the HDF5 + * Library. It will generally not be safe to use this function to + * free memory allocated by any other means.\n + * Even when using this function, it is still best to ensure that + * all components of a C application are built with the same version + * of Visual Studio and build (debug or release) and thus linked + * against the same CRT. + * + * \see H5allocate_memory(), H5resize_memory() + * + * \since 1.8.13 + * + */ H5_DLL herr_t H5free_memory(void *mem); -H5_DLL void * H5allocate_memory(size_t size, hbool_t clear); -H5_DLL void * H5resize_memory(void *mem, size_t size); +/** + * \ingroup H5 + * \brief Frees memory allocated by the HDF5 library + * + * \param[in] size The size in bytes of the buffer to be allocated + * \param[in] clear Flag whether the new buffer is to be initialized with 0 + * + * \return On success, returns pointer to newly allocated buffer or returns + * NULL if size is 0 (zero).\n + * Returns NULL on failure. + * + * \details H5allocate_memory() allocates a memory buffer of size bytes that + * will later be freed internally by the HDF5 library. + * + * The boolean \p clear parameter specifies whether the buffer should + * be initialized. If clear is \c TRUE, all bits in the buffer are to be + * set to 0 (zero); if clear is \c FALSE, the buffer will not be + * initialized. + * + * This function is intended to have the semantics of malloc() and + * calloc(). However, unlike malloc() and calloc() which allow for a + * "special" pointer to be returned instead of NULL, this function + * always returns NULL on failure or when size is set to 0 (zero). + * + * \note At this time, the only intended use for this function is to allocate + * memory that will be returned to the library as a data buffer from a + * third-party filter. + * + * \attention To avoid heap corruption, allocated memory should be freed using + * the same library that initially allocated it. In most cases, the + * HDF5 API uses resources that are allocated and freed either + * entirely by the user or entirely by the library, so this is not a + * problem. In rare cases, however, HDF5 API calls will free memory + * that the user allocated. This function allows the user to safely + * allocate this memory.\n + * It is particularly important to use this function to allocate + * memory in Microsoft Windows environments. In Windows, the C + * standard library is implemented in dynamic link libraries (DLLs) + * known as the C run-time (CRT). Each version of Visual Studio + * comes with multiple versions of the CRT DLLs (debug, release, et + * cetera) and allocating and freeing memory across DLL boundaries + * can cause resource leaks and subtle bugs due to heap corruption.\n + * Even when using this function, it is best where possible to + * ensure that all components of a C application are built with the + * same version of Visual Studio and configuration (Debug or + * Release), and thus linked against the same CRT.\n + * Use this function only to allocate memory inside third-party HDF5 + * filters. It will generally not be safe to use this function to + * allocate memory for any other purpose. + * + * \see H5free_memory(), H5resize_memory() + * + * \since 1.8.15 + * + */ +H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); +/** + * \ingroup H5 + * \brief Resizes and, if required, re-allocates memory that will later be + * freed internally by the HDF5 library + * + * \param[in] mem Pointer to a buffer to be resized. May be NULL + * \param[in] size New size of the buffer, in bytes + + * + * \return On success, returns pointer to resized or reallocated buffer + * or returns NULL if size is 0 (zero).\n + * Returns NULL on failure. + * + * \details H5resize_memory() takes a pointer to an existing buffer and resizes + * the buffer to match the value in \p size. If necessary, the buffer + * is reallocated. If \p size is 0, the buffer is released. + * + * The input buffer must either be NULL or have been allocated by + * H5allocate_memory() since the input buffer may be freed by the + * library. + * + * For certain behaviors, the pointer \p mem may be passed in as NULL. + * + * This function is intended to have the semantics of realloc(): + * + * + * + * + * + * + * + * + * + * + *
\Code{H5resize_memory(buffer, size)}Resizes buffer. Returns pointer to resized buffer.
\Code{H5resize_memory(NULL, size)}Allocates memory using HDF5 Library allocator. + * Returns pointer to new buffer
\Code{H5resize_memory(buffer, 0)}Frees memory using HDF5 Library allocator. + * Returns NULL.
\Code{H5resize_memory(NULL, 0)}Returns NULL (undefined in C standard).
+ * + * Unlike realloc(), which allows for a "special pointer to be + * returned instead of NULL, this function always returns NULL on + * failure or when size is 0 (zero). + * + * \note At this time, the only intended use for this function is to resize or + * reallocate memory that will be returned to the library (and eventually + * to the user) as a data buffer from a third-party HDF5 filter. + * + * \attention To avoid heap corruption, allocated memory should be freed using + * the same library that initially allocated it. In most cases, the + * HDF5 API uses resources that are allocated and freed either + * entirely by the user or entirely by the library, so this is not a + * problem. In rare cases, however, HDF5 API calls will free memory + * that the user allocated. This function allows the user to safely + * allocate this memory.\n + * It is particularly important to use this function to resize + * memory on Microsoft Windows systems. In Windows, the C standard + * library is implemented in dynamic link libraries (DLLs) known as + * the C run-time (CRT). Each version of Visual Studio comes with + * multiple versions of the CRT DLLs (debug, release, et cetera) and + * allocating and freeing memory across DLL boundaries can cause + * resource leaks and subtle bugs due to heap corruption.\n + * Even when using this function, it is still best to ensure that + * all components of a C application are built with the same version + * of Visual Studio and the same configuration (Debug or Release), + * and thus linked against the same CRT.\n + * Only use this function to resize memory inside third-party HDF5 + * filters. It will generally not be safe to use this function to + * resize memory for any other purpose. + * + * \see H5allocate_memory(), H5free_memory() + * + * \since 1.8.15 + * + */ +H5_DLL void *H5resize_memory(void *mem, size_t size); #ifdef __cplusplus } diff --git a/src/H5system.c b/src/H5system.c index 65053ab..e7fe422 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -25,6 +25,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ diff --git a/src/H5timer.c b/src/H5timer.c index ac3a01e..54a3365 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -24,6 +24,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ diff --git a/tools/Makefile.am b/tools/Makefile.am index 3fe282e..f3c47c7 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -30,9 +30,4 @@ CONFIG=ordered # All subdirectories SUBDIRS=lib src $(TESTSERIAL_DIR) -# Test with just the native connector, with a single pass-through connector -# and with a doubly-stacked pass-through. -VOL_LIST = native "pass_through under_vol=0;under_info={}" \ - "pass_through under_vol=505;under_info={under_vol=0;under_info={}}" - include $(top_srcdir)/config/conclude.am -- cgit v0.12 From 85cbe79836c9b9efd050c8ad0db4db5b40fec6d6 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Apr 2021 11:29:32 -0700 Subject: Brings (trivial) skip list changes from develop --- src/H5SL.c | 114 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 64 insertions(+), 50 deletions(-) diff --git a/src/H5SL.c b/src/H5SL.c index 1502007..166019b 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -563,10 +563,10 @@ struct H5SL_t { }; /* Static functions */ -static H5SL_node_t *H5SL_new_node(void *item, const void *key, uint32_t hashval); -static H5SL_node_t *H5SL_insert_common(H5SL_t *slist, void *item, const void *key); -static herr_t H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); -static herr_t H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); +static H5SL_node_t *H5SL__new_node(void *item, const void *key, uint32_t hashval); +static H5SL_node_t *H5SL__insert_common(H5SL_t *slist, void *item, const void *key); +static herr_t H5SL__release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); +static herr_t H5SL__close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); /* Package initialization variable */ hbool_t H5_PKG_INIT_VAR = FALSE; @@ -675,11 +675,11 @@ H5SL_term_package(void) /*-------------------------------------------------------------------------- NAME - H5SL_new_node + H5SL__new_node PURPOSE Create a new skip list node of level 0 USAGE - H5SL_node_t *H5SL_new_node(item,key,hasval) + H5SL_node_t *H5SL__new_node(item,key,hasval) void *item; IN: Pointer to item info for node void *key; IN: Pointer to key info for node uint32_t hashval; IN: Hash value for node @@ -696,11 +696,11 @@ H5SL_term_package(void) REVISION LOG --------------------------------------------------------------------------*/ static H5SL_node_t * -H5SL_new_node(void *item, const void *key, uint32_t hashval) +H5SL__new_node(void *item, const void *key, uint32_t hashval) { H5SL_node_t *ret_value = NULL; /* New skip list node */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate the node */ if (NULL == (ret_value = (H5SL_node_t *)H5FL_MALLOC(H5SL_node_t))) @@ -720,15 +720,15 @@ H5SL_new_node(void *item, const void *key, uint32_t hashval) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_new_node() */ +} /* end H5SL__new_node() */ /*-------------------------------------------------------------------------- NAME - H5SL_insert_common + H5SL__insert_common PURPOSE Common code for inserting an object into a skip list USAGE - H5SL_node_t *H5SL_insert_common(slist,item,key) + H5SL_node_t *H5SL__insert_common(slist,item,key) H5SL_t *slist; IN/OUT: Pointer to skip list void *item; IN: Item to insert void *key; IN: Key for item to insert @@ -744,14 +744,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5SL_node_t * -H5SL_insert_common(H5SL_t *slist, void *item, const void *key) +H5SL__insert_common(H5SL_t *slist, void *item, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - H5SL_node_t *prev; /* Node before the new node */ - uint32_t hashval = 0; /* Hash value for key */ - H5SL_node_t *ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + H5SL_node_t *prev; /* Node before the new node */ + uint32_t hashval = 0; /* Hash value for key */ + H5SL_node_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(slist); @@ -813,7 +813,7 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) slist->curr_level = 0; /* Create new node of level 0 */ - if (NULL == (x = H5SL_new_node(item, key, hashval))) + if (NULL == (x = H5SL__new_node(item, key, hashval))) HGOTO_ERROR(H5E_SLIST, H5E_NOSPACE, NULL, "can't create new skip list node") /* Update the links */ @@ -835,15 +835,15 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_insert_common() */ +} /* end H5SL__insert_common() */ /*-------------------------------------------------------------------------- NAME - H5SL_release_common + H5SL__release_common PURPOSE Release all nodes from a skip list, optionally calling a 'free' operator USAGE - herr_t H5SL_release_common(slist,op,opdata) + herr_t H5SL__release_common(slist,op,opdata) H5SL_t *slist; IN/OUT: Pointer to skip list to release nodes H5SL_operator_t op; IN: Callback function to free item & key void *op_data; IN/OUT: Pointer to application data for callback @@ -862,12 +862,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) +H5SL__release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) { H5SL_node_t *node, *next_node; /* Pointers to skip list nodes */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(slist); @@ -908,15 +908,15 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_release_common() */ +} /* end H5SL__release_common() */ /*-------------------------------------------------------------------------- NAME - H5SL_close_common + H5SL__close_common PURPOSE Close a skip list, deallocating it and potentially freeing all its nodes. USAGE - herr_t H5SL_close_common(slist,op,opdata) + herr_t H5SL__close_common(slist,op,opdata) H5SL_t *slist; IN/OUT: Pointer to skip list to close H5SL_operator_t op; IN: Callback function to free item & key void *op_data; IN/OUT: Pointer to application data for callback @@ -934,11 +934,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) +H5SL__close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(slist); @@ -947,7 +947,7 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Free skip list nodes */ - if (H5SL_release_common(slist, op, op_data) < 0) + if (H5SL__release_common(slist, op, op_data) < 0) HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") /* Release header node */ @@ -960,7 +960,7 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_close_common() */ +} /* end H5SL__close_common() */ /*-------------------------------------------------------------------------- NAME @@ -1006,7 +1006,7 @@ H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp) new_slist->safe_iterating = FALSE; /* Allocate the header node */ - if (NULL == (header = H5SL_new_node(NULL, NULL, (uint32_t)ULONG_MAX))) + if (NULL == (header = H5SL__new_node(NULL, NULL, (uint32_t)ULONG_MAX))) HGOTO_ERROR(H5E_SLIST, H5E_NOSPACE, NULL, "can't create new skip list node") /* Initialize header node's forward pointer */ @@ -1106,7 +1106,7 @@ H5SL_insert(H5SL_t *slist, void *item, const void *key) /* (Pre-condition) */ /* Insert item into skip list */ - if (H5SL_insert_common(slist, item, key) == NULL) + if (NULL == H5SL__insert_common(slist, item, key)) HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, FAIL, "can't create new skip list node") done: @@ -1155,7 +1155,7 @@ H5SL_add(H5SL_t *slist, void *item, const void *key) /* (Pre-condition) */ /* Insert item into skip list */ - if ((ret_value = H5SL_insert_common(slist, item, key)) == NULL) + if (NULL == (ret_value = H5SL__insert_common(slist, item, key))) HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, NULL, "can't create new skip list node") done: @@ -1378,9 +1378,9 @@ done: void * H5SL_search(H5SL_t *slist, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ - void * ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + uint32_t hashval = 0; /* Hash value for key */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1676,9 +1676,9 @@ done: H5SL_node_t * H5SL_find(H5SL_t *slist, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ - H5SL_node_t *ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + uint32_t hashval = 0; /* Hash value for key */ + H5SL_node_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2215,7 +2215,9 @@ H5SL_iterate(H5SL_t *slist, H5SL_operator_t op, void *op_data) herr_t H5SL_release(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(slist); @@ -2227,9 +2229,11 @@ H5SL_release(H5SL_t *slist) /* (Pre-condition) */ /* Free skip list nodes */ - H5SL_release_common(slist, NULL, NULL); /* always succeeds */ + if (H5SL__release_common(slist, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_release() */ /*-------------------------------------------------------------------------- @@ -2263,7 +2267,9 @@ H5SL_release(H5SL_t *slist) herr_t H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(slist); @@ -2275,9 +2281,11 @@ H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Free skip list nodes */ - H5SL_release_common(slist, op, op_data); /* always succeeds */ + if (H5SL__release_common(slist, op, op_data) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_free() */ /*-------------------------------------------------------------------------- @@ -2491,7 +2499,7 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -2500,8 +2508,10 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Close skip list */ - (void)H5SL_close_common(slist, op, op_data); /* always succeeds */ + if (H5SL__close_common(slist, op, op_data) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list") +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_destroy() */ @@ -2527,7 +2537,9 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) herr_t H5SL_close(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -2536,7 +2548,9 @@ H5SL_close(H5SL_t *slist) /* (Pre-condition) */ /* Close skip list */ - (void)H5SL_close_common(slist, NULL, NULL); /* always succeeds */ + if (H5SL__close_common(slist, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list") - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_close() */ -- cgit v0.12 From 1a75bc504f09d5926b1996fb96ddc9d620a7216e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Apr 2021 12:26:09 -0700 Subject: Brings inline changes from develop --- src/H5Oshared.h | 16 +++---- src/H5VMprivate.h | 129 +++++++++++++++++++++++++++++++++++------------------- src/H5private.h | 35 ++------------- 3 files changed, 96 insertions(+), 84 deletions(-) diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 0e774cf..f164db3 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -44,7 +44,7 @@ * *------------------------------------------------------------------------- */ -static H5_INLINE void * +static inline void * H5O_SHARED_DECODE(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p) { @@ -103,7 +103,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_ENCODE(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg) { const H5O_shared_t *sh_mesg = @@ -158,7 +158,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_INLINE size_t +static inline size_t H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg) { const H5O_shared_t *sh_mesg = @@ -211,7 +211,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_DELETE(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ @@ -262,7 +262,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_LINK(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ @@ -312,7 +312,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_INLINE void * +static inline void * H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata) { @@ -375,7 +375,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const void *mesg_src, H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info) { @@ -445,7 +445,7 @@ done: * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_DEBUG(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_shared_t *sh_mesg = diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index b7e32a3..2fea2fc 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -19,9 +19,9 @@ #define H5VMprivate_H /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ /* Vector-Vector sequence operation callback */ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len, void *udata); @@ -130,6 +130,10 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_s * elements in an array and array dimensions are always of type * size_t. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: Product of elements * * Failure: 1 if N is zero @@ -137,11 +141,9 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_s * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ -static H5_INLINE hsize_t H5_ATTR_UNUSED +static inline hsize_t H5_ATTR_UNUSED H5VM_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; @@ -163,6 +165,10 @@ done: * * Purpose: Determines if all elements of a vector are zero. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: TRUE if all elements are zero, * FALSE otherwise * @@ -171,11 +177,9 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ -static H5_INLINE htri_t H5_ATTR_UNUSED +static inline htri_t H5_ATTR_UNUSED H5VM_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value = TRUE; /* Return value */ @@ -198,6 +202,10 @@ done: * * Purpose: Determines if all elements of a vector are zero. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: TRUE if all elements are zero, * FALSE otherwise * @@ -206,11 +214,9 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ -static H5_INLINE htri_t H5_ATTR_UNUSED +static inline htri_t H5_ATTR_UNUSED H5VM_vector_zerop_s(int n, const hssize_t *v) { htri_t ret_value = TRUE; /* Return value */ @@ -234,6 +240,10 @@ done: * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: -1 if V1 is less than V2 * 0 if they are equal * 1 if V1 is greater than V2 @@ -243,11 +253,9 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ -static H5_INLINE int H5_ATTR_UNUSED +static inline int H5_ATTR_UNUSED H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value = 0; /* Return value */ @@ -275,25 +283,27 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM_vector_cmp_s + * Function: H5VM_vector_cmp_s * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: -1 if V1 is less than V2 * 0 if they are equal * 1 if V1 is greater than V2 * * Failure: 0 if N is zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 8, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ -static H5_INLINE int H5_ATTR_UNUSED +static inline int H5_ATTR_UNUSED H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value = 0; /* Return value */ @@ -325,16 +335,18 @@ done: * * Purpose: Increments V1 by V2 * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: void * * Programmer: Robb Matzke * Monday, October 13, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ -static H5_INLINE void H5_ATTR_UNUSED +static inline void H5_ATTR_UNUSED H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) { while (n--) @@ -343,14 +355,17 @@ H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) /* Lookup table for general log2(n) routine */ static const unsigned char LogTable256[] = { - 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}; + /* clang-clang-format off */ + 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 + /* clang-clang-format on */ +}; /*------------------------------------------------------------------------- * Function: H5VM_log2_gen @@ -364,6 +379,10 @@ static const unsigned char LogTable256[] = { * The version on the web-site is for 32-bit quantities and this * version has been extended for 64-bit quantities. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: log2(n) (always - no failure condition) * * Programmer: Quincey Koziol @@ -371,7 +390,7 @@ static const unsigned char LogTable256[] = { * *------------------------------------------------------------------------- */ -static H5_INLINE unsigned H5_ATTR_UNUSED +static inline unsigned H5_ATTR_UNUSED H5VM_log2_gen(uint64_t n) { unsigned r; /* r will be log2(n) */ @@ -409,6 +428,10 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = {0, 1, 28, 2, 29, 14, * This is from the "Bit Twiddling Hacks" at: * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: log2(n) (always - no failure condition) * * Programmer: Quincey Koziol @@ -416,7 +439,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = {0, 1, 28, 2, 29, 14, * *------------------------------------------------------------------------- */ -static H5_INLINE H5_ATTR_PURE unsigned +static inline H5_ATTR_PURE unsigned H5VM_log2_of2(uint32_t n) { #ifndef NDEBUG @@ -426,17 +449,21 @@ H5VM_log2_of2(uint32_t n) } /* H5VM_log2_of2() */ /*------------------------------------------------------------------------- - * Function: H5VM_power2up + * Function: H5VM_power2up * - * Purpose: Round up a number to the next power of 2 + * Purpose: Round up a number to the next power of 2 * - * Return: Return the number which is a power of 2 + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. * - * Programmer: Vailin Choi; Nov 2014 + * Return: Return the number which is a power of 2 + * + * Programmer: Vailin Choi; Nov 2014 * *------------------------------------------------------------------------- */ -static H5_INLINE H5_ATTR_CONST hsize_t +static inline H5_ATTR_CONST hsize_t H5VM_power2up(hsize_t n) { hsize_t ret_value = 1; /* Return value */ @@ -457,6 +484,10 @@ H5VM_power2up(hsize_t n) * Purpose: Determine the # of bytes needed to encode values within a * range from 0 to a given limit * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Number of bytes needed * * Programmer: Quincey Koziol @@ -464,7 +495,7 @@ H5VM_power2up(hsize_t n) * *------------------------------------------------------------------------- */ -static H5_INLINE unsigned H5_ATTR_UNUSED +static inline unsigned H5_ATTR_UNUSED H5VM_limit_enc_size(uint64_t limit) { return (H5VM_log2_gen(limit) / 8) + 1; @@ -478,13 +509,17 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, * * Purpose: Determine the value of the n'th bit in a buffer. * - * Note: No range checking on is performed! + * Note: No range checking on is performed! * - * Note #2: Bits are sequentially stored in the buffer, starting with bit + * Note #2: Bits are sequentially stored in the buffer, starting with bit * offset 0 in the first byte's high-bit position, proceeding down * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: TRUE/FALSE * * Programmer: Quincey Koziol @@ -492,7 +527,7 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, * *------------------------------------------------------------------------- */ -static H5_INLINE hbool_t H5_ATTR_UNUSED +static inline hbool_t H5_ATTR_UNUSED H5VM_bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ @@ -504,13 +539,17 @@ H5VM_bit_get(const unsigned char *buf, size_t offset) * * Purpose: Set/reset the n'th bit in a buffer. * - * Note: No range checking on is performed! + * Note: No range checking on is performed! * - * Note #2: Bits are sequentially stored in the buffer, starting with bit + * Note #2: Bits are sequentially stored in the buffer, starting with bit * offset 0 in the first byte's high-bit position, proceeding down * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: None * * Programmer: Quincey Koziol @@ -518,7 +557,7 @@ H5VM_bit_get(const unsigned char *buf, size_t offset) * *------------------------------------------------------------------------- */ -static H5_INLINE void H5_ATTR_UNUSED +static inline void H5_ATTR_UNUSED H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) { /* Set/reset the appropriate bit in the buffer */ diff --git a/src/H5private.h b/src/H5private.h index 3ccd14f..16291ca 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -197,23 +197,6 @@ #endif /*H5_HAVE_WIN32_API*/ -/* Various ways that inline functions can be declared */ -#if defined(H5_HAVE___INLINE__) -/* GNU (alternative form) */ -#define H5_INLINE __inline__ -#elif defined(H5_HAVE___INLINE) -/* Visual Studio */ -#define H5_INLINE __inline -#elif defined(H5_HAVE_INLINE) -/* GNU, C++ - * Use "inline" as a last resort on the off-chance that there will - * be C++ problems. - */ -#define H5_INLINE inline -#else -#define H5_INLINE -#endif /* inline choices */ - #ifndef F_OK #define F_OK 00 #define W_OK 02 @@ -305,23 +288,14 @@ * Note that Solaris Studio supports attribute, but does not support the * attributes we use. * + * When using H5_ATTR_FALLTHROUGH, you should also include a comment that + * says FALLTHROUGH to reduce warnings on compilers that don't use + * attributes but do respect fall-through comments. + * * H5_ATTR_CONST is redefined in tools/h5repack/dynlib_rpk.c to quiet * gcc warnings (it has to use the public API and can't include this * file). Be sure to update that file if the #ifdefs change here. */ -#ifdef __cplusplus -#define H5_ATTR_FORMAT(X, Y, Z) /*void*/ -#define H5_ATTR_UNUSED /*void*/ -#define H5_ATTR_DEPRECATED_USED /*void*/ -#define H5_ATTR_NDEBUG_UNUSED /*void*/ -#define H5_ATTR_DEBUG_API_USED /*void*/ -#define H5_ATTR_PARALLEL_UNUSED /*void*/ -#define H5_ATTR_PARALLEL_USED /*void*/ -#define H5_ATTR_NORETURN /*void*/ -#define H5_ATTR_CONST /*void*/ -#define H5_ATTR_PURE /*void*/ -#define H5_ATTR_FALLTHROUGH /*void*/ -#else /* __cplusplus */ #if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C) #define H5_ATTR_FORMAT(X, Y, Z) __attribute__((format(X, Y, Z))) #define H5_ATTR_UNUSED __attribute__((unused)) @@ -368,7 +342,6 @@ #define H5_ATTR_PURE /*void*/ #define H5_ATTR_FALLTHROUGH /*void*/ #endif -#endif /* __cplusplus */ /* * Networking headers used by the mirror VFD and related tests and utilities. -- cgit v0.12 From 2f4152d02dbe55c158fa0ceb91ce8fb1a5a47bd3 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Apr 2021 14:32:08 -0700 Subject: Brings many parallel changes from develop --- src/H5Clog_json.c | 2 +- src/H5Clog_trace.c | 2 +- src/H5Cmpio.c | 111 ++++---------- src/H5FDmpi.c | 37 ----- src/H5FDmpio.c | 430 +++++++++++++++++++++++++++++------------------------ src/H5FDprivate.h | 28 ++-- src/H5Fmpi.c | 62 +------- src/H5Fprivate.h | 2 - src/H5Pfapl.c | 273 ++++++++++++++-------------------- src/H5mpi.c | 30 ++-- src/H5public.h | 1 - 11 files changed, 413 insertions(+), 565 deletions(-) diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c index 6d048f1..731d741 100644 --- a/src/H5Clog_json.c +++ b/src/H5Clog_json.c @@ -173,7 +173,7 @@ H5C__json_write_log_message(H5C_log_json_udata_t *json_udata) /* Write the log message and flush */ n_chars = HDstrlen(json_udata->message); - if ((int)n_chars != HDfprintf(json_udata->outfile, json_udata->message)) + if ((int)n_chars != HDfprintf(json_udata->outfile, "%s", json_udata->message)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message") HDmemset((void *)(json_udata->message), 0, (size_t)(n_chars * sizeof(char))); diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c index 8c79d7b..c30f79e 100644 --- a/src/H5Clog_trace.c +++ b/src/H5Clog_trace.c @@ -168,7 +168,7 @@ H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata) /* Write the log message and flush */ n_chars = HDstrlen(trace_udata->message); - if ((int)n_chars != HDfprintf(trace_udata->outfile, trace_udata->message)) + if ((int)n_chars != HDfprintf(trace_udata->outfile, "%s", trace_udata->message)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message") HDmemset((void *)(trace_udata->message), 0, (size_t)(n_chars * sizeof(char))); diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index d26c508..12dde12 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -105,9 +105,9 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned * * We construct the table as follows. Let: * - * n = num_candidates / mpi_size; + * n = num_candidates / mpi_size; * - * m = num_candidates % mpi_size; + * m = num_candidates % mpi_size; * * Now allocate an array of integers of length mpi_size + 1, * and call this array candidate_assignment_table. @@ -127,10 +127,10 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned * Once the table is constructed, we determine the first and * last entry this process is to flush as follows: * - * first_entry_to_flush = candidate_assignment_table[mpi_rank] + * first_entry_to_flush = candidate_assignment_table[mpi_rank] * * last_entry_to_flush = - * candidate_assignment_table[mpi_rank + 1] - 1; + * candidate_assignment_table[mpi_rank + 1] - 1; * * With these values determined, we simply scan through the * candidate list, marking all entries in the range @@ -737,7 +737,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr * of the pre_serialize / serialize routines, this may * cease to be the case -- requiring a review of this * point. - * JRM -- 4/7/15 + * JRM -- 4/7/15 */ entries_cleared = 0; entries_examined = 0; @@ -885,15 +885,16 @@ H5C__collective_write(H5F_t *f) { H5AC_t * cache_ptr; H5FD_mpio_xfer_t orig_xfer_mode = H5FD_MPIO_COLLECTIVE; + void * base_buf; int count; int * length_array = NULL; MPI_Aint * buf_array = NULL; MPI_Aint * offset_array = NULL; - MPI_Datatype btype; - hbool_t btype_created = FALSE; - MPI_Datatype ftype; - hbool_t ftype_created = FALSE; + MPI_Datatype btype = MPI_BYTE; + MPI_Datatype ftype = MPI_BYTE; int mpi_code; + char unused = 0; /* Unused, except for non-NULL pointer value */ + size_t buf_count; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -908,20 +909,17 @@ H5C__collective_write(H5F_t *f) if (H5CX_get_io_xfer_mode(&orig_xfer_mode) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + /* Set transfer mode */ + if (H5CX_set_io_xfer_mode(H5FD_MPIO_COLLECTIVE) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") + /* Get number of entries in collective write list */ count = (int)H5SL_count(cache_ptr->coll_write_list); - if (count > 0) { - H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE; H5SL_node_t * node; H5C_cache_entry_t *entry_ptr; - void * base_buf; int i; - /* Set new transfer mode */ - if (H5CX_set_io_xfer_mode(xfer_mode) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") - /* Allocate arrays */ if (NULL == (length_array = (int *)H5MM_malloc((size_t)count * sizeof(int)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, @@ -948,7 +946,6 @@ H5C__collective_write(H5F_t *f) node = H5SL_next(node); i = 1; while (node) { - if (NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") @@ -966,9 +963,6 @@ H5C__collective_write(H5F_t *f) if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, buf_array, MPI_BYTE, &btype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) - - btype_created = TRUE; - if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&btype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) @@ -976,74 +970,27 @@ H5C__collective_write(H5F_t *f) if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, offset_array, MPI_BYTE, &ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) - - ftype_created = TRUE; - if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - /* Pass buf type, file type to the file driver */ - if (H5CX_set_mpi_coll_datatypes(btype, ftype) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") - - /* Write data */ - /* - * At present the page buffer is disabled in the parallel case, and - * thus VFD SWMR can't be used either. Thus, for now, there is - * no point in setting the page buffer hints. - * - * More to the point, since we are actually writing a derived type - * containing multiple metadata cache entries, we couldn't set it - * to a meaningful value. - * - * When we enable the page buffer in parallel, we will have to - * revisit this. - * JRM -- 3/30/20 - */ - if (H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, (size_t)1, base_buf) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to write entries collectively") - + /* MPI count to write */ + buf_count = 1; } /* end if */ else { - MPI_Status mpi_stat; - MPI_File * mpi_fh_p; - MPI_File mpi_fh; - MPI_Info * info_p; - MPI_Info info; - - /* This should be rewritten to call H5F_block_write, with the correct - * buffer and file datatypes (null ones). -QAK, 2018/02/21 - */ - if (H5F_get_mpi_handle(f, (MPI_File **)&mpi_fh_p) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't get mpi file handle") + /* Set non-NULL pointer for I/O operation */ + base_buf = &unused; - mpi_fh = *(MPI_File *)mpi_fh_p; - - if (H5F_get_mpi_info(f, &info_p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file info") - - info = *info_p; - - /* just to match up with the 1st MPI_File_set_view from - * H5FD_mpio_write() - */ - if (MPI_SUCCESS != - (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) + /* MPI count to write */ + buf_count = 0; + } /* end else */ - /* just to match up with MPI_File_write_at_all from H5FD_mpio_write() */ - HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); - if (MPI_SUCCESS != - (mpi_code = MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, NULL, 0, MPI_BYTE, &mpi_stat))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) + /* Pass buf type, file type to the file driver */ + if (H5CX_set_mpi_coll_datatypes(btype, ftype) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") - /* just to match up with the 2nd MPI_File_set_view (reset) in - * H5FD_mpio_write() - */ - if (MPI_SUCCESS != - (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) - } /* end else */ + /* Write data */ + if (H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, buf_count, base_buf) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "unable to write entries collectively") done: /* Free arrays */ @@ -1052,9 +999,9 @@ done: offset_array = (MPI_Aint *)H5MM_xfree(offset_array); /* Free MPI Types */ - if (btype_created && MPI_SUCCESS != (mpi_code = MPI_Type_free(&btype))) + if (MPI_BYTE != btype && MPI_SUCCESS != (mpi_code = MPI_Type_free(&btype))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - if (ftype_created && MPI_SUCCESS != (mpi_code = MPI_Type_free(&ftype))) + if (MPI_BYTE != ftype && MPI_SUCCESS != (mpi_code = MPI_Type_free(&ftype))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) /* Reset transfer mode in API context, if changed */ diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 32c899d..048b8f3 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -136,43 +136,6 @@ done: } /* end H5FD_mpi_get_comm() */ /*------------------------------------------------------------------------- - * Function: H5FD_get_mpi_info - * - * Purpose: Retrieves the file's mpi info - * - * Return: Success: SUCCEED - * - * Failure: FAIL - * - * Programmer: John Mainzer - * 4/4/17 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -herr_t -H5FD_get_mpi_info(H5FD_t *file, void **mpi_info) -{ - const H5FD_class_mpi_t *cls; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(file); - cls = (const H5FD_class_mpi_t *)(file->cls); - HDassert(cls); - HDassert(cls->get_mpi_info); /* All MPI drivers must implement this */ - - /* Dispatch to driver */ - if ((ret_value = (cls->get_mpi_info)(file, mpi_info)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_mpi_info request failed") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_get_mpi_info() */ - -/*------------------------------------------------------------------------- * Function: H5FD_mpi_MPIOff_to_haddr * * Purpose: Convert an MPI_Offset value to haddr_t. diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index b8bfae8..9dbd443 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -42,7 +42,7 @@ static hid_t H5FD_MPIO_g = 0; /* Whether to allow collective I/O operations */ -/* (Value can be set from environment variable also) */ +/* (Can be changed by setting "HDF5_MPI_OPT_TYPES" environment variable to '0' or '1') */ hbool_t H5FD_mpi_opt_types_g = TRUE; /* @@ -89,7 +89,6 @@ static herr_t H5FD__mpio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closin static int H5FD__mpio_mpi_rank(const H5FD_t *_file); static int H5FD__mpio_mpi_size(const H5FD_t *_file); static MPI_Comm H5FD__mpio_communicator(const H5FD_t *_file); -static herr_t H5FD__mpio_get_info(H5FD_t *_file, void **mpi_info); /* The MPIO file driver information */ static const H5FD_class_mpi_t H5FD_mpio_g = { @@ -131,28 +130,30 @@ static const H5FD_class_mpi_t H5FD_mpio_g = { }, /* End of superclass information */ H5FD__mpio_mpi_rank, /*get_rank */ H5FD__mpio_mpi_size, /*get_size */ - H5FD__mpio_communicator, /*get_comm */ - H5FD__mpio_get_info /*get_info */ + H5FD__mpio_communicator /*get_comm */ }; #ifdef H5FDmpio_DEBUG -/* Flags to control debug actions in H5Fmpio. - * Meant to be indexed by characters. - * - * 'c' show result of MPI_Get_count after read - * 'r' show read offset and size - * 't' trace function entry and exit - * 'w' show write offset and size +/* Flags to control debug actions in the MPI-IO VFD. + * (Meant to be indexed by characters) + * + * These flags can be set with either (or both) the environment variable + * "H5FD_mpio_Debug" set to a string containing one or more characters + * (flags) or by setting them as a string value for the + * "H5F_mpio_debug_key" MPI Info key. + * + * Supported characters in 'H5FD_mpio_Debug' string: + * 't' trace function entry and exit + * 'r' show read offset and size + * 'w' show write offset and size + * '0'-'9' only show output from a single MPI rank (ranks 0-9 supported) */ -static int H5FD_mpio_Debug[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static int H5FD_mpio_debug_flags_s[256]; +static int H5FD_mpio_debug_rank_s = -1; + +/* Indicate if this rank should output tracing info */ +#define H5FD_MPIO_TRACE_THIS_RANK(file) \ + (H5FD_mpio_debug_rank_s < 0 || H5FD_mpio_debug_rank_s == (file)->mpi_rank) #endif /*-------------------------------------------------------------------------- @@ -184,6 +185,41 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FD__init_package() */ +#ifdef H5FDmpio_DEBUG + +/*--------------------------------------------------------------------------- + * Function: H5FD__mpio_parse_debug_str + * + * Purpose: Parse a string for debugging flags + * + * Returns: N/A + * + * Programmer: Quincey Koziol + * Wednesday, Aug 12, 2020 + * + *--------------------------------------------------------------------------- + */ +static void +H5FD__mpio_parse_debug_str(const char *s) +{ + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(s); + + /* Set debug mask */ + while (*s) { + if ((int)(*s) >= (int)'0' && (int)(*s) <= (int)'9') + H5FD_mpio_debug_rank_s = ((int)*s) - (int)'0'; + else + H5FD_mpio_debug_flags_s[(int)*s]++; + s++; + } /* end while */ + + FUNC_LEAVE_NOAPI_VOID +} /* end H5FD__mpio_parse_debug_str() */ +#endif /* H5FDmpio_DEBUG */ + /*------------------------------------------------------------------------- * Function: H5FD_mpio_init * @@ -201,11 +237,8 @@ done: hid_t H5FD_mpio_init(void) { -#ifdef H5FDmpio_DEBUG static int H5FD_mpio_Debug_inited = 0; -#endif /* H5FDmpio_DEBUG */ - const char *s; /* String for environment variables */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(H5I_INVALID_HID) @@ -213,28 +246,27 @@ H5FD_mpio_init(void) if (H5I_VFL != H5I_get_type(H5FD_MPIO_g)) H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g, sizeof(H5FD_class_mpi_t), FALSE); - /* Allow MPI buf-and-file-type optimizations? */ - s = HDgetenv("HDF5_MPI_OPT_TYPES"); - if (s && HDisdigit(*s)) { - long env_val = HDstrtol(s, NULL, 0); - H5FD_mpi_opt_types_g = (0 == env_val) ? FALSE : TRUE; - } + if (!H5FD_mpio_Debug_inited) { + const char *s; /* String for environment variables */ + + /* Allow MPI buf-and-file-type optimizations? */ + s = HDgetenv("HDF5_MPI_OPT_TYPES"); + if (s && HDisdigit(*s)) + H5FD_mpi_opt_types_g = (0 == HDstrtol(s, NULL, 0)) ? FALSE : TRUE; #ifdef H5FDmpio_DEBUG - if (!H5FD_mpio_Debug_inited) { + /* Clear the flag buffer */ + HDmemset(H5FD_mpio_debug_flags_s, 0, sizeof(H5FD_mpio_debug_flags_s)); + /* Retrieve MPI-IO debugging environment variable */ s = HDgetenv("H5FD_mpio_Debug"); - if (s) { - /* Set debug mask */ - while (*s) { - H5FD_mpio_Debug[(int)*s]++; - s++; - } /* end while */ - } /* end if */ - H5FD_mpio_Debug_inited++; - } /* end if */ + if (s) + H5FD__mpio_parse_debug_str(s); #endif /* H5FDmpio_DEBUG */ + H5FD_mpio_Debug_inited++; + } /* end if */ + /* Set return value */ ret_value = H5FD_MPIO_g; @@ -658,30 +690,27 @@ herr_t H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; - int mpi_code; /* MPI return code */ - int temp_flag; - herr_t ret_value = SUCCEED; +#ifdef H5FDmpio_DEBUG + hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); +#endif + int mpi_code; /* MPI return code */ + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Entering\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank); #endif - if (FALSE == flag) - temp_flag = 0; - else - temp_flag = 1; - /* set atomicity value */ - if (MPI_SUCCESS != (mpi_code = MPI_File_set_atomicity(file->f, temp_flag))) + if (MPI_SUCCESS != (mpi_code = MPI_File_set_atomicity(file->f, (int)(flag != FALSE)))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_atomicity", mpi_code) done: #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Leaving\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -703,15 +732,18 @@ herr_t H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; - int mpi_code; /* MPI return code */ int temp_flag; - herr_t ret_value = SUCCEED; +#ifdef H5FDmpio_DEBUG + hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); +#endif + int mpi_code; /* MPI return code */ + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Entering\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank); #endif /* Get atomicity value */ @@ -725,8 +757,8 @@ H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag) done: #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Leaving\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -753,26 +785,23 @@ done: static H5FD_t * H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { - H5FD_mpio_t * file = NULL; - MPI_File fh; - hbool_t file_opened = FALSE; /* Flag to indicate that the file was successfully opened */ - int mpi_amode; - int mpi_rank; /* MPI rank of this process */ - int mpi_size; /* Total number of MPI processes */ - int mpi_code; /* MPI return code */ - MPI_Offset size; - H5P_genplist_t *plist; /* Property list pointer */ - MPI_Comm comm = MPI_COMM_NULL; - MPI_Info info = MPI_INFO_NULL; - H5FD_t * ret_value = NULL; /* Return value */ - - FUNC_ENTER_STATIC - + H5FD_mpio_t * file = NULL; /* VFD File struct for new file */ + H5P_genplist_t *plist; /* Property list pointer */ + MPI_Comm comm = MPI_COMM_NULL; /* MPI Communicator, from plist */ + MPI_Info info = MPI_INFO_NULL; /* MPI Info, from plist */ + MPI_File fh; /* MPI file handle */ + hbool_t file_opened = FALSE; /* Flag to indicate that the file was successfully opened */ + int mpi_amode; /* MPI file access flags */ + int mpi_rank = INT_MAX; /* MPI rank of this process */ + int mpi_size; /* Total number of MPI processes */ + MPI_Offset file_size; /* File size (of existing files) */ #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Entering - name = \"%s\", flags = 0x%x, fapl_id = %d, maxaddr = %lu\n", FUNC, - name, flags, (int)fapl_id, (unsigned long)maxaddr); + hbool_t H5FD_mpio_debug_t_flag = FALSE; #endif + int mpi_code; /* MPI return code */ + H5FD_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_STATIC /* Get a pointer to the fapl */ if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -784,6 +813,20 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR if (H5P_get(plist, H5F_ACS_MPI_PARAMS_INFO_NAME, &info) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get MPI info object") + /* Get the MPI rank of this process and the total number of processes */ + if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank))) + HMPI_GOTO_ERROR(NULL, "MPI_Comm_rank failed", mpi_code) + if (MPI_SUCCESS != (mpi_code = MPI_Comm_size(comm, &mpi_size))) + HMPI_GOTO_ERROR(NULL, "MPI_Comm_size failed", mpi_code) + +#ifdef H5FDmpio_DEBUG + H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && + (H5FD_mpio_debug_rank_s < 0 || H5FD_mpio_debug_rank_s == mpi_rank)); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Entering - name = \"%s\", flags = 0x%x, fapl_id = %d, maxaddr = %lu\n", + FUNC, mpi_rank, name, flags, (int)fapl_id, (unsigned long)maxaddr); +#endif + /* Convert HDF5 flags to MPI-IO flags */ /* Some combinations are illegal; let MPI-IO figure it out */ mpi_amode = (flags & H5F_ACC_RDWR) ? MPI_MODE_RDWR : MPI_MODE_RDONLY; @@ -799,26 +842,15 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR int flag; MPI_Info_get(info, H5F_MPIO_DEBUG_KEY, sizeof(debug_str) - 1, debug_str, &flag); - if (flag) { - int i; - - HDfprintf(stdout, "H5FD_mpio debug flags = '%s'\n", debug_str); - for (i = 0; debug_str[i] /*end of string*/ && i < 128 /*just in case*/; ++i) - H5FD_mpio_Debug[(int)debug_str[i]] = 1; - } /* end if */ - } /* end if */ + if (flag) + H5FD__mpio_parse_debug_str(debug_str); + } /* end if */ #endif if (MPI_SUCCESS != (mpi_code = MPI_File_open(comm, name, mpi_amode, info, &fh))) HMPI_GOTO_ERROR(NULL, "MPI_File_open failed", mpi_code) file_opened = TRUE; - /* Get the MPI rank of this process and the total number of processes */ - if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank))) - HMPI_GOTO_ERROR(NULL, "MPI_Comm_rank failed", mpi_code) - if (MPI_SUCCESS != (mpi_code = MPI_Comm_size(comm, &mpi_size))) - HMPI_GOTO_ERROR(NULL, "MPI_Comm_size failed", mpi_code) - /* Build the return value and initialize it */ if (NULL == (file = (H5FD_mpio_t *)H5MM_calloc(sizeof(H5FD_mpio_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -829,17 +861,17 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR file->mpi_size = mpi_size; /* Only processor p0 will get the filesize and broadcast it. */ - if (mpi_rank == 0) { - if (MPI_SUCCESS != (mpi_code = MPI_File_get_size(fh, &size))) + if (mpi_rank == 0) + if (MPI_SUCCESS != (mpi_code = MPI_File_get_size(fh, &file_size))) HMPI_GOTO_ERROR(NULL, "MPI_File_get_size failed", mpi_code) - } /* end if */ /* Broadcast file size */ - if (MPI_SUCCESS != (mpi_code = MPI_Bcast(&size, (int)sizeof(MPI_Offset), MPI_BYTE, 0, comm))) + if (MPI_SUCCESS != (mpi_code = MPI_Bcast(&file_size, (int)sizeof(MPI_Offset), MPI_BYTE, 0, comm))) HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mpi_code) /* Determine if the file should be truncated */ - if (size && (flags & H5F_ACC_TRUNC)) { + if (file_size && (flags & H5F_ACC_TRUNC)) { + /* Truncate the file */ if (MPI_SUCCESS != (mpi_code = MPI_File_set_size(fh, (MPI_Offset)0))) HMPI_GOTO_ERROR(NULL, "MPI_File_set_size failed", mpi_code) @@ -848,11 +880,11 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR HMPI_GOTO_ERROR(NULL, "MPI_Barrier failed", mpi_code) /* File is zero size now */ - size = 0; + file_size = 0; } /* end if */ /* Set the size of the file (from library's perspective) */ - file->eof = H5FD_mpi_MPIOff_to_haddr(size); + file->eof = H5FD_mpi_MPIOff_to_haddr(file_size); file->local_eof = file->eof; /* Set return value */ @@ -871,8 +903,8 @@ done: } /* end if */ #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Leaving\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, mpi_rank); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -894,14 +926,18 @@ static herr_t H5FD__mpio_close(H5FD_t *_file) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; - int mpi_code; /* MPI return code */ - herr_t ret_value = SUCCEED; /* Return value */ +#ifdef H5FDmpio_DEBUG + hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + int mpi_rank = file->mpi_rank; +#endif + int mpi_code; /* MPI return code */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Entering\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank); #endif /* Sanity checks */ @@ -909,7 +945,7 @@ H5FD__mpio_close(H5FD_t *_file) HDassert(H5FD_MPIO == file->pub.driver_id); /* MPI_File_close sets argument to MPI_FILE_NULL */ - if (MPI_SUCCESS != (mpi_code = MPI_File_close(&(file->f) /*in,out*/))) + if (MPI_SUCCESS != (mpi_code = MPI_File_close(&(file->f)))) HMPI_GOTO_ERROR(FAIL, "MPI_File_close failed", mpi_code) /* Clean up other stuff */ @@ -919,8 +955,8 @@ H5FD__mpio_close(H5FD_t *_file) done: #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Leaving\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, mpi_rank); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -952,7 +988,7 @@ H5FD__mpio_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out *flags |= H5FD_FEAT_HAS_MPI; /* This driver uses MPI */ *flags |= H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */ *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default - VFD */ + VFD */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -1114,7 +1150,6 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU H5FD_mpio_t *file = (H5FD_mpio_t *)_file; MPI_Offset mpi_off; MPI_Status mpi_stat; /* Status from I/O operation */ - int mpi_code; /* mpi return code */ MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */ int size_i; /* Integer copy of 'size' to read */ #if MPI_VERSION >= 3 @@ -1130,13 +1165,18 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU #endif hbool_t use_view_this_time = FALSE; hbool_t rank0_bcast = FALSE; /* If read-with-rank0-and-bcast flag was used */ - herr_t ret_value = SUCCEED; +#ifdef H5FDmpio_DEBUG + hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + hbool_t H5FD_mpio_debug_r_flag = (H5FD_mpio_debug_flags_s[(int)'r'] && H5FD_MPIO_TRACE_THIS_RANK(file)); +#endif + int mpi_code; /* MPI return code */ + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Entering\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank); #endif /* Sanity checks */ @@ -1155,8 +1195,9 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i") #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'r']) - HDfprintf(stdout, "%s: mpi_off = %ld size_i = %d\n", FUNC, (long)mpi_off, size_i); + if (H5FD_mpio_debug_r_flag) + HDfprintf(stderr, "%s: (%d) mpi_off = %ld size_i = %d\n", FUNC, file->mpi_rank, (long)mpi_off, + size_i); #endif /* Only look for MPI views for raw data transfers */ @@ -1202,8 +1243,8 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU H5FD_mpio_collective_opt_t coll_opt_mode; #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'r']) - HDfprintf(stdout, "%s: using MPIO collective mode\n", FUNC); + if (H5FD_mpio_debug_r_flag) + HDfprintf(stderr, "%s: (%d) using MPIO collective mode\n", FUNC, file->mpi_rank); #endif /* Get the collective_opt property to check whether the application wants to do IO individually. */ if (H5CX_get_mpio_coll_opt(&coll_opt_mode) < 0) @@ -1211,14 +1252,14 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU if (coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'r']) - HDfprintf(stdout, "%s: doing MPI collective IO\n", FUNC); + if (H5FD_mpio_debug_r_flag) + HDfprintf(stderr, "%s: (%d) doing MPI collective IO\n", FUNC, file->mpi_rank); #endif /* Check whether we should read from rank 0 and broadcast to other ranks */ if (H5CX_get_mpio_rank0_bcast()) { #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'r']) - HDfprintf(stdout, "%s: doing read-rank0-and-MPI_Bcast\n", FUNC); + if (H5FD_mpio_debug_r_flag) + HDfprintf(stderr, "%s: (%d) doing read-rank0-and-MPI_Bcast\n", FUNC, file->mpi_rank); #endif /* Indicate path we've taken */ rank0_bcast = TRUE; @@ -1231,16 +1272,19 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU if (MPI_SUCCESS != (mpi_code = MPI_Bcast(buf, size_i, buf_type, 0, file->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code) } /* end if */ - else if (MPI_SUCCESS != - (mpi_code = MPI_File_read_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) + else + /* Perform collective read operation */ + if (MPI_SUCCESS != + (mpi_code = MPI_File_read_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at_all failed", mpi_code) } /* end if */ else { #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'r']) - HDfprintf(stdout, "%s: doing MPI independent IO\n", FUNC); + if (H5FD_mpio_debug_r_flag) + HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", FUNC, file->mpi_rank); #endif + /* Perform independent read operation */ if (MPI_SUCCESS != (mpi_code = MPI_File_read_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code) @@ -1253,8 +1297,16 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU H5FD_mpi_native_g, file->info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) } /* end if */ - else if (MPI_SUCCESS != (mpi_code = MPI_File_read_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code) + else { +#ifdef H5FDmpio_DEBUG + if (H5FD_mpio_debug_r_flag) + HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", FUNC, file->mpi_rank); +#endif + + /* Perform independent read operation */ + if (MPI_SUCCESS != (mpi_code = MPI_File_read_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code) + } /* end else */ /* Only retrieve bytes read if this rank _actually_ participated in I/O */ if (!rank0_bcast || (rank0_bcast && file->mpi_rank == 0)) { @@ -1274,7 +1326,11 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU * of the data. (QAK - 2019/1/2) */ if (rank0_bcast) - if (MPI_SUCCESS != MPI_Bcast(&bytes_read, 1, MPI_LONG_LONG, 0, file->comm)) +#if MPI_VERSION >= 3 + if (MPI_SUCCESS != MPI_Bcast(&bytes_read, 1, MPI_COUNT, 0, file->comm)) +#else + if (MPI_SUCCESS != MPI_Bcast(&bytes_read, 1, MPI_INT, 0, file->comm)) +#endif HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", 0) /* Get the type's size */ @@ -1300,8 +1356,8 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU done: #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Leaving\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -1336,7 +1392,6 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h MPI_Offset mpi_off; MPI_Status mpi_stat; /* Status from I/O operation */ MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */ - int mpi_code; /* MPI return code */ #if MPI_VERSION >= 3 MPI_Count bytes_written; MPI_Count type_size; /* MPI datatype used for I/O's size */ @@ -1350,13 +1405,18 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h hbool_t use_view_this_time = FALSE; hbool_t derived_type = FALSE; H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */ - herr_t ret_value = SUCCEED; +#ifdef H5FDmpio_DEBUG + hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); + hbool_t H5FD_mpio_debug_w_flag = (H5FD_mpio_debug_flags_s[(int)'w'] && H5FD_MPIO_TRACE_THIS_RANK(file)); +#endif + int mpi_code; /* MPI return code */ + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Entering\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank); #endif /* Sanity checks */ @@ -1376,8 +1436,9 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h size_i = (int)size; #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'w']) - HDfprintf(stdout, "%s: mpi_off = %ld size_i = %d\n", FUNC, (long)mpi_off, size_i); + if (H5FD_mpio_debug_w_flag) + HDfprintf(stderr, "%s: (%d) mpi_off = %ld size_i = %d\n", FUNC, file->mpi_rank, (long)mpi_off, + size_i); #endif /* Get the transfer mode from the API context */ @@ -1432,8 +1493,8 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h H5FD_mpio_collective_opt_t coll_opt_mode; #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'w']) - HDfprintf(stdout, "%s: using MPIO collective mode\n", FUNC); + if (H5FD_mpio_debug_w_flag) + HDfprintf(stderr, "%s: (%d) using MPIO collective mode\n", FUNC, file->mpi_rank); #endif /* Get the collective_opt property to check whether the application wants to do IO individually. */ @@ -1442,8 +1503,8 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h if (coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'w']) - HDfprintf(stdout, "%s: doing MPI collective IO\n", FUNC); + if (H5FD_mpio_debug_w_flag) + HDfprintf(stderr, "%s: (%d) doing MPI collective IO\n", FUNC, file->mpi_rank); #endif /* Perform collective write operation */ if (MPI_SUCCESS != @@ -1454,9 +1515,10 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h if (type != H5FD_MEM_DRAW) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "Metadata Coll opt property should be collective at this point") + #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'w']) - HDfprintf(stdout, "%s: doing MPI independent IO\n", FUNC); + if (H5FD_mpio_debug_w_flag) + HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", FUNC, file->mpi_rank); #endif /* Perform independent write operation */ if (MPI_SUCCESS != @@ -1469,11 +1531,18 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h H5FD_mpi_native_g, file->info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) } /* end if */ - else if (MPI_SUCCESS != - (mpi_code = MPI_File_write_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code) + else { +#ifdef H5FDmpio_DEBUG + if (H5FD_mpio_debug_w_flag) + HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", FUNC, file->mpi_rank); +#endif - /* How many bytes were actually written? */ + /* Perform independent write operation */ + if (MPI_SUCCESS != (mpi_code = MPI_File_write_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code) + } /* end else */ + + /* How many bytes were actually written? */ #if MPI_VERSION >= 3 if (MPI_SUCCESS != (mpi_code = MPI_Get_elements_x(&mpi_stat, buf_type, &bytes_written))) #else @@ -1512,8 +1581,8 @@ done: MPI_Type_free(&buf_type); #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Leaving, proc %d: ret_value = %d\n", FUNC, file->mpi_rank, ret_value); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Leaving: ret_value = %d\n", FUNC, file->mpi_rank, ret_value); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -1535,14 +1604,17 @@ static herr_t H5FD__mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_mpio_t *file = (H5FD_mpio_t *)_file; - int mpi_code; /* mpi return code */ - herr_t ret_value = SUCCEED; +#ifdef H5FDmpio_DEBUG + hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); +#endif + int mpi_code; /* mpi return code */ + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Entering\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank); #endif /* Sanity checks */ @@ -1556,8 +1628,8 @@ H5FD__mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) done: #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Leaving\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -1570,13 +1642,14 @@ done: * * This is a little sticky in the mpio case, as it is not * easy for us to track the current EOF by extracting it from - * write calls. + * write calls, since other ranks could have written to the + * file beyond the local EOF. * - * Instead, we first check to see if the eoa has changed since + * Instead, we first check to see if the EOA has changed since * the last call to this function. If it has, we call * MPI_File_get_size() to determine the current EOF, and * only call MPI_File_set_size() if this value disagrees - * with the current eoa. + * with the current EOA. * * Return: SUCCEED/FAIL * @@ -1588,14 +1661,17 @@ done: static herr_t H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { - H5FD_mpio_t *file = (H5FD_mpio_t *)_file; - herr_t ret_value = SUCCEED; + H5FD_mpio_t *file = (H5FD_mpio_t *)_file; +#ifdef H5FDmpio_DEBUG + hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file)); +#endif + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Entering\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Entering\n", FUNC, file->mpi_rank); #endif /* Sanity checks */ @@ -1663,8 +1739,8 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR done: #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - HDfprintf(stdout, "%s: Leaving\n", FUNC); + if (H5FD_mpio_debug_t_flag) + HDfprintf(stderr, "%s: (%d) Leaving\n", FUNC, file->mpi_rank); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -1750,34 +1826,4 @@ H5FD__mpio_communicator(const H5FD_t *_file) FUNC_LEAVE_NOAPI(file->comm) } /* end H5FD__mpio_communicator() */ - -/*------------------------------------------------------------------------- - * Function: H5FD__mpio_get_info - * - * Purpose: Returns the file info of MPIO file driver. - * - * Returns: Non-negative if succeed or negative if fails. - * - * Programmer: John Mainzer - * April 4, 2017 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5FD__mpio_get_info(H5FD_t *_file, void **mpi_info) -{ - H5FD_mpio_t *file = (H5FD_mpio_t *)_file; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_STATIC - - if (!mpi_info) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mpi info not valid") - - *mpi_info = &(file->info); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD__mpio_get_info() */ - #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 1e405d2..adf900a 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -22,13 +22,13 @@ #include "H5FDpublic.h" /* Private headers needed by this file */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5Pprivate.h" /* Property lists */ /* * The MPI drivers are needed because there are * places where we check for things that aren't handled by these drivers. */ -#include "H5FDmpi.h" /* MPI-based file drivers */ +#include "H5FDmpi.h" /* MPI-based file drivers */ /**************************/ /* Library Private Macros */ @@ -260,11 +260,10 @@ vfd_swmr_pageno_to_mdf_idx_entry(H5FD_vfd_swmr_idx_entry_t *idx, uint32_t nentri /* Sub-class the H5FD_class_t to add more specific functions for MPI-based VFDs */ typedef struct H5FD_class_mpi_t { - H5FD_class_t super; /* Superclass information & methods */ - int (*get_rank)(const H5FD_t *file); /* Get the MPI rank of a process */ - int (*get_size)(const H5FD_t *file); /* Get the MPI size of a communicator */ - MPI_Comm (*get_comm)(const H5FD_t *file); /* Get the communicator for a file */ - herr_t (*get_mpi_info)(H5FD_t *file, void **mpi_info); /* get MPI_Info for a file */ + H5FD_class_t super; /* Superclass information & methods */ + int (*get_rank)(const H5FD_t *file); /* Get the MPI rank of a process */ + int (*get_size)(const H5FD_t *file); /* Get the MPI size of a communicator */ + MPI_Comm (*get_comm)(const H5FD_t *file); /* Get the communicator for a file */ } H5FD_class_mpi_t; #endif @@ -289,10 +288,16 @@ typedef struct { /* Define default file image info */ #define H5FD_DEFAULT_FILE_IMAGE_INFO \ { \ - /* file image buffer */ NULL, /* buffer size */ 0, \ - { /* Callbacks */ \ - /* image_malloc */ NULL, /* image_memcpy */ NULL, /* image_realloc */ NULL, \ - /* image_free */ NULL, /* udata_copy */ NULL, /* udata_free */ NULL, /* udata */ NULL, \ + NULL, /* file image buffer */ \ + 0, /* buffer size */ \ + { /* Callbacks */ \ + NULL, /* image_malloc */ \ + NULL, /* image_memcpy */ \ + NULL, /* image_realloc */ \ + NULL, /* image_free */ \ + NULL, /* udata_copy */ \ + NULL, /* udata_free */ \ + NULL, /* udata */ \ } \ } @@ -377,7 +382,6 @@ H5_DLL herr_t H5FD_get_mpio_atomicity(H5FD_t *file, hbool_t *flag); H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file); H5_DLL int H5FD_mpi_get_size(const H5FD_t *file); H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file); -H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void **file_info); #endif /* H5_HAVE_PARALLEL */ #endif /* H5FDprivate_H */ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 652c9cc..4b5283e 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -15,7 +15,7 @@ * * Created: H5Fmpi.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: MPI-related routines. * @@ -68,35 +68,6 @@ /*******************/ #ifdef H5_HAVE_PARALLEL - -/*------------------------------------------------------------------------- - * Function: H5F_get_mpi_handle - * - * Purpose: Retrieves MPI File handle. - * - * Return: Success: The size (positive) - * Failure: Negative - * - *------------------------------------------------------------------------- - */ -herr_t -H5F_get_mpi_handle(const H5F_t *f, MPI_File **f_handle) -{ - herr_t ret_value = SUCCEED; - hid_t fapl_id = H5I_INVALID_HID; - - FUNC_ENTER_NOAPI(FAIL) - - HDassert(f && f->shared); - - /* Dispatch to driver */ - if ((ret_value = H5FD_get_vfd_handle(f->shared->lf, fapl_id, (void **)f_handle)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file handle") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_get_mpi_handle() */ - /*------------------------------------------------------------------------- * Function: H5F_mpi_get_rank * @@ -336,13 +307,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag) +H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag /*out*/) { H5VL_object_t *vol_obj = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL); - H5TRACE2("e", "i*b", file_id, flag); + H5TRACE2("e", "ix", file_id, flag); /* Get the file object */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -420,31 +391,4 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_mpi_retrieve_comm */ - -/*------------------------------------------------------------------------- - * Function: H5F_get_mpi_info - * - * Purpose: Retrieves MPI File info. - * - * Return: Success: The size (positive) - * Failure: Negative - * - *------------------------------------------------------------------------- - */ -herr_t -H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI(FAIL) - - HDassert(f && f->shared); - - /* Dispatch to driver */ - if ((ret_value = H5FD_get_mpi_info(f->shared->lf, (void **)f_info)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file info") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_get_mpi_info() */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index d661829..0c4c51d 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -978,13 +978,11 @@ H5_DLL herr_t H5F_eoa_dirty(H5F_t *f); /* Parallel I/O (i.e. MPI) related routines */ #ifdef H5_HAVE_PARALLEL -H5_DLL herr_t H5F_get_mpi_handle(const H5F_t *f, MPI_File **f_handle); H5_DLL int H5F_mpi_get_rank(const H5F_t *f); H5_DLL MPI_Comm H5F_mpi_get_comm(const H5F_t *f); H5_DLL int H5F_shared_mpi_get_size(const H5F_shared_t *f_sh); H5_DLL int H5F_mpi_get_size(const H5F_t *f); H5_DLL herr_t H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm); -H5_DLL herr_t H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info); H5_DLL herr_t H5F_get_mpi_atomicity(H5F_t *file, hbool_t *flag); H5_DLL herr_t H5F_set_mpi_atomicity(H5F_t *file, hbool_t flag); #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index e2db3e4..b521232 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -209,12 +209,12 @@ /* Definition for 'mdc log location' flag */ #define H5F_ACS_MDC_LOG_LOCATION_SIZE sizeof(char *) #define H5F_ACS_MDC_LOG_LOCATION_DEF NULL /* default is no log location */ -#define H5F_ACS_MDC_LOG_LOCATION_ENC H5P_facc_mdc_log_location_enc -#define H5F_ACS_MDC_LOG_LOCATION_DEC H5P_facc_mdc_log_location_dec -#define H5F_ACS_MDC_LOG_LOCATION_DEL H5P_facc_mdc_log_location_del -#define H5F_ACS_MDC_LOG_LOCATION_COPY H5P_facc_mdc_log_location_copy -#define H5F_ACS_MDC_LOG_LOCATION_CMP H5P_facc_mdc_log_location_cmp -#define H5F_ACS_MDC_LOG_LOCATION_CLOSE H5P_facc_mdc_log_location_close +#define H5F_ACS_MDC_LOG_LOCATION_ENC H5P__facc_mdc_log_location_enc +#define H5F_ACS_MDC_LOG_LOCATION_DEC H5P__facc_mdc_log_location_dec +#define H5F_ACS_MDC_LOG_LOCATION_DEL H5P__facc_mdc_log_location_del +#define H5F_ACS_MDC_LOG_LOCATION_COPY H5P__facc_mdc_log_location_copy +#define H5F_ACS_MDC_LOG_LOCATION_CMP H5P__facc_mdc_log_location_cmp +#define H5F_ACS_MDC_LOG_LOCATION_CLOSE H5P__facc_mdc_log_location_close /* Definition for 'start metadata cache logging on access' flag */ #define H5F_ACS_START_MDC_LOG_ON_ACCESS_SIZE sizeof(hbool_t) #define H5F_ACS_START_MDC_LOG_ON_ACCESS_DEF FALSE @@ -366,12 +366,12 @@ static herr_t H5P__facc_vfd_swmr_config_enc(const void *value, void **_pp, size_ static herr_t H5P__facc_vfd_swmr_config_dec(const void **_pp, void *value); /* Metadata cache log location property callbacks */ -static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size); -static herr_t H5P_facc_mdc_log_location_dec(const void **_pp, void *value); -static herr_t H5P_facc_mdc_log_location_del(hid_t prop_id, const char *name, size_t size, void *value); -static herr_t H5P_facc_mdc_log_location_copy(const char *name, size_t size, void *value); -static int H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t size); -static herr_t H5P_facc_mdc_log_location_close(const char *name, size_t size, void *value); +static herr_t H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__facc_mdc_log_location_dec(const void **_pp, void *value); +static herr_t H5P__facc_mdc_log_location_del(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__facc_mdc_log_location_copy(const char *name, size_t size, void *value); +static int H5P__facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t size); +static herr_t H5P__facc_mdc_log_location_close(const char *name, size_t size, void *value); /* Metadata cache image property callbacks */ static int H5P__facc_cache_image_config_cmp(const void *_config1, const void *_config2, @@ -1573,13 +1573,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) +H5Pget_family_offset(hid_t fapl_id, hsize_t *offset /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*h", fapl_id, offset); + H5TRACE2("e", "ix", fapl_id, offset); /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) @@ -1651,13 +1651,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) +H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Mt", fapl_id, type); + H5TRACE2("e", "ix", fapl_id, type); /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) @@ -1745,13 +1745,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_cache(hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) +H5Pget_cache(hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nslots /*out*/, size_t *rdcc_nbytes /*out*/, + double *rdcc_w0 /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*Is*z*z*d", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); + H5TRACE5("e", "i*Isxxx", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -1838,23 +1839,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) +H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*CC", plist_id, config_ptr); + H5TRACE2("e", "ix", plist_id, config); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* validate the config_ptr */ - if (config_ptr == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") - - if (config_ptr->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION) + /* validate the config ptr */ + if (config == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config ptr on entry.") + if (config->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown image config version.") /* If we ever support multiple versions of H5AC_cache_config_t, we @@ -1863,7 +1863,7 @@ H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) */ /* Get the current initial metadata cache resize configuration */ - if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config_ptr) < 0) + if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get metadata cache initial image config") done: @@ -1919,7 +1919,7 @@ done: * Purpose: Retrieve the metadata cache initial resize configuration * from the target FAPL. * - * Observe that the function will fail if config_ptr is + * Observe that the function will fail if config is * NULL, or if config_ptr->version specifies an unknown * version of H5AC_cache_config_t. * @@ -1931,23 +1931,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) +H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Cc", plist_id, config_ptr); + H5TRACE2("e", "ix", plist_id, config); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* validate the config_ptr */ - if (config_ptr == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") - - if (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) + /* validate the config ptr */ + if (config == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config ptr on entry.") + if (config->version != H5AC__CURR_CACHE_CONFIG_VERSION) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown config version.") /* If we ever support multiple versions of H5AC_cache_config_t, we @@ -1956,7 +1955,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) */ /* Get the current initial metadata cache resize configuration */ - if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, config_ptr) < 0) + if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, config) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get metadata cache initial resize config") done: @@ -1985,13 +1984,6 @@ done: * Programmer: Quincey Koziol * June, 1999 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2026,13 +2018,6 @@ done: * Programmer: Quincey Koziol * June, 1999 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2067,8 +2052,6 @@ done: * Programmer: Raymond Lu * November, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2102,18 +2085,16 @@ done: * Programmer: Raymond Lu * November, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree) +H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Fd", plist_id, degree); + H5TRACE2("e", "ix", plist_id, degree); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2146,13 +2127,6 @@ done: * Programmer: Quincey Koziol * Friday, August 25, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2187,13 +2161,6 @@ done: * Programmer: Quincey Koziol * Friday, August 29, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2239,13 +2206,6 @@ done: * Programmer: Quincey Koziol * Thursday, September 21, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2280,13 +2240,6 @@ done: * Programmer: Quincey Koziol * Thursday, September 21, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2331,8 +2284,6 @@ done: * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2367,8 +2318,6 @@ done: * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2510,7 +2459,6 @@ H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high) /* Check args */ if (low < 0 || low > H5F_LIBVER_LATEST) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "low bound is not valid") - if (high < 0 || high > H5F_LIBVER_LATEST) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "high bound is not valid") @@ -2562,15 +2510,13 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low /*out*/, H5F_libver_t *hi HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Get values */ - if (low) { + if (low) if (H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, low) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get low bound for library format versions") - } - if (high) { + if (high) if (H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, high) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get high bound for library format versions") - } done: FUNC_LEAVE_API(ret_value) @@ -2630,13 +2576,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size) +H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", plist_id, efc_size); + H5TRACE2("e", "ix", plist_id, efc_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2735,22 +2681,22 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_image * - * Purpose: If the file image exists and buf_ptr_ptr is not NULL, + * Purpose: If the file image exists and buf is not NULL, * allocate a buffer of the correct size, copy the image into * the new buffer, and return the buffer to the caller in - * *buf_ptr_ptr. Do this using the file image callbacks + * *buf. Do this using the file image callbacks * if defined. * * NB: It is the responsibility of the caller to free the - * buffer whose address is returned in *buf_ptr_ptr. Do + * buffer whose address is returned in *buf. Do * this using free if the file image callbacks are not * defined, or with whatever method is appropriate if * the callbacks are defined. * - * If buf_ptr_ptr is not NULL, and no image exists, set - * *buf_ptr_ptr to NULL. + * If buf is not NULL, and no image exists, set + * *buf to NULL. * - * If buf_len_ptr is not NULL, set *buf_len_ptr equal + * If buf_len is not NULL, set *buf_len equal * to the length of the file image if it exists, and * to 0 if it does not. * @@ -2762,14 +2708,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) +H5Pget_file_image(hid_t fapl_id, void **buf /*out*/, size_t *buf_len /*out*/) { H5P_genplist_t * fapl; /* Property list pointer */ H5FD_file_image_info_t image_info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i**x*z", fapl_id, buf_ptr_ptr, buf_len_ptr); + H5TRACE3("e", "ixx", fapl_id, buf, buf_len); /* Get the plist structure */ if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -2784,11 +2730,11 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) ((image_info.buffer == NULL) && (image_info.size == 0))); /* Set output size */ - if (buf_len_ptr != NULL) - *buf_len_ptr = image_info.size; + if (buf_len != NULL) + *buf_len = image_info.size; /* Duplicate the image if desired, using callbacks if available */ - if (buf_ptr_ptr != NULL) { + if (buf != NULL) { void *copy_ptr = NULL; /* Copy of memory image */ if (image_info.buffer != NULL) { @@ -2813,7 +2759,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) H5MM_memcpy(copy_ptr, image_info.buffer, image_info.size); } /* end if */ - *buf_ptr_ptr = copy_ptr; + *buf = copy_ptr; } /* end if */ done: @@ -2898,7 +2844,7 @@ done: } /* end H5Pset_file_image_callbacks() */ /*------------------------------------------------------------------------- - * Function: H5Pget_file_image_callbacks + * Function: H5Pget_file_image_callbacks * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and @@ -2913,14 +2859,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr) +H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks /*out*/) { H5P_genplist_t * fapl; /* Property list pointer */ H5FD_file_image_info_t info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*DI", fapl_id, callbacks_ptr); + H5TRACE2("e", "ix", fapl_id, callbacks); /* Get the plist structure */ if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -2933,17 +2879,17 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* verify file image field consistency */ HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); - /* verify that callbacks_ptr is not NULL */ - if (NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + /* verify that callbacks is not NULL */ + if (NULL == callbacks) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks ptr") /* Transfer values to parameters */ - *callbacks_ptr = info.callbacks; + *callbacks = info.callbacks; /* Copy udata if it exists */ if (info.callbacks.udata != NULL) { HDassert(info.callbacks.udata_copy); - if ((callbacks_ptr->udata = info.callbacks.udata_copy(info.callbacks.udata)) == 0) + if ((callbacks->udata = info.callbacks.udata_copy(info.callbacks.udata)) == 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy udata") } /* end if */ @@ -4358,14 +4304,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) +H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func /*out*/, void **udata /*out*/) { H5P_genplist_t * plist; /* Property list pointer */ H5F_object_flush_t flush_info; herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*FF**x", plist_id, func, udata); + H5TRACE3("e", "ixx", plist_id, func, udata); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -4445,15 +4391,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled, char *location, size_t *location_size, - hbool_t *start_on_access) +H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled /*out*/, char *location /*out*/, + size_t *location_size /*out*/, hbool_t *start_on_access /*out*/) { - H5P_genplist_t *plist; /* Property list pointer */ - char * location_ptr; /* Pointer to location string */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + char * location_ptr = NULL; /* Pointer to location string */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*b*s*z*b", plist_id, is_enabled, location, location_size, start_on_access); + H5TRACE5("e", "ixxxx", plist_id, is_enabled, location, location_size, start_on_access); /* Get the property list structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -4482,14 +4428,14 @@ H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled, char *location, size *location_size = HDstrlen(location_ptr) + 1; else *location_size = 0; - } + } /* end if */ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_mdc_log_options() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_enc + * Function: H5P__facc_mdc_log_location_enc * * Purpose: Callback routine which is called whenever the metadata * cache log location property in the file access property @@ -4501,7 +4447,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) +H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) { const char *log_location = *(const char *const *)value; uint8_t ** pp = (uint8_t **)_pp; @@ -4509,7 +4455,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) uint64_t enc_value; unsigned enc_size; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -4538,10 +4484,10 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) *size += len; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_enc() */ +} /* end H5P__facc_mdc_log_location_enc() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_dec + * Function: H5P__facc_mdc_log_location_dec * * Purpose: Callback routine which is called whenever the metadata * cache log location property in the file access property @@ -4553,7 +4499,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_dec(const void **_pp, void *_value) +H5P__facc_mdc_log_location_dec(const void **_pp, void *_value) { char ** log_location = (char **)_value; const uint8_t **pp = (const uint8_t **)_pp; @@ -4562,7 +4508,7 @@ H5P_facc_mdc_log_location_dec(const void **_pp, void *_value) unsigned enc_size; /* Size of encoded property */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pp); HDassert(*pp); @@ -4591,10 +4537,10 @@ H5P_facc_mdc_log_location_dec(const void **_pp, void *_value) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_facc_mdc_log_location_dec() */ +} /* end H5P__facc_mdc_log_location_dec() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_del + * Function: H5P__facc_mdc_log_location_del * * Purpose: Frees memory used to store the metadata cache log location. * @@ -4603,20 +4549,20 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, - size_t H5_ATTR_UNUSED size, void *value) +H5P__facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, + size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); H5MM_xfree(*(void **)value); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_del() */ +} /* end H5P__facc_mdc_log_location_del() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_copy + * Function: H5P__facc_mdc_log_location_copy * * Purpose: Creates a copy of the metadata cache log location string. * @@ -4625,19 +4571,19 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +H5P__facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); *(char **)value = H5MM_xstrdup(*(const char **)value); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_copy() */ +} /* end H5P__facc_mdc_log_location_copy() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_cmp + * Function: H5P__facc_mdc_log_location_cmp * * Purpose: Callback routine which is called whenever the metadata * cache log location property in the file creation property @@ -4647,14 +4593,14 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U * *------------------------------------------------------------------------- */ -static int -H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) +static H5_ATTR_PURE int +H5P__facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) { const char *pref1 = *(const char *const *)value1; const char *pref2 = *(const char *const *)value2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if (NULL == pref1 && NULL != pref2) HGOTO_DONE(1); @@ -4665,10 +4611,10 @@ H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t H5_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_facc_mdc_log_location_cmp() */ +} /* end H5P__facc_mdc_log_location_cmp() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_close + * Function: H5P__facc_mdc_log_location_close * * Purpose: Frees memory used to store the metadata cache log location * string @@ -4678,16 +4624,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +H5P__facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); H5MM_xfree(*(void **)value); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_close() */ +} /* end H5P__facc_mdc_log_location_close() */ /*------------------------------------------------------------------------- * Function: H5Pset_evict_on_close @@ -4756,13 +4702,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close) +H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close /*out*/) { H5P_genplist_t *plist; /* property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", fapl_id, evict_on_close); + H5TRACE2("e", "ix", fapl_id, evict_on_close); /* Compare the property list's class against the other class */ if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) @@ -5017,12 +4963,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective) +H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective /*out*/) { herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", plist_id, is_collective); + H5TRACE2("e", "ix", plist_id, is_collective); /* Compare the property list's class against the other class */ /* (Dataset, group, attribute, and named datype access property lists @@ -5106,13 +5052,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mpi_params(hid_t plist_id, MPI_Comm *comm, MPI_Info *info) +H5Pget_mpi_params(hid_t plist_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*Mc*Mi", plist_id, comm, info); + H5TRACE3("e", "ixx", plist_id, comm, info); /* Make sure that the property list is a fapl */ if (TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) @@ -5556,13 +5502,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective) +H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", plist_id, is_collective); + H5TRACE2("e", "ix", plist_id, is_collective); /* Compare the property list's class against the other class */ if (TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) @@ -5643,13 +5589,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc) +H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size /*out*/, unsigned *min_meta_perc /*out*/, + unsigned *min_raw_perc /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*z*Iu*Iu", plist_id, buf_size, min_meta_perc, min_raw_perc); + H5TRACE4("e", "ixxx", plist_id, buf_size, min_meta_perc, min_raw_perc); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -5861,13 +5808,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_vol_id(hid_t plist_id, hid_t *vol_id) +H5Pget_vol_id(hid_t plist_id, hid_t *vol_id /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*i", plist_id, vol_id); + H5TRACE2("e", "ix", plist_id, vol_id); /* Get property list for ID */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) @@ -5943,13 +5890,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_vol_info(hid_t plist_id, void **vol_info) +H5Pget_vol_info(hid_t plist_id, void **vol_info /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i**x", plist_id, vol_info); + H5TRACE2("e", "ix", plist_id, vol_info); /* Get property list for ID */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) diff --git a/src/H5mpi.c b/src/H5mpi.c index a83fdac..9749721 100644 --- a/src/H5mpi.c +++ b/src/H5mpi.c @@ -25,7 +25,7 @@ /****************/ /* Local Macros */ /****************/ -#define TWO_GIG_LIMIT (1 << 31) +#define TWO_GIG_LIMIT INT32_MAX #ifndef H5_MAX_MPI_COUNT #define H5_MAX_MPI_COUNT (1 << 30) #endif @@ -33,7 +33,7 @@ /*******************/ /* Local Variables */ /*******************/ -static hsize_t bigio_count = H5_MAX_MPI_COUNT; +static hsize_t bigio_count_g = H5_MAX_MPI_COUNT; /*------------------------------------------------------------------------- * Function: H5_mpi_set_bigio_count @@ -42,7 +42,7 @@ static hsize_t bigio_count = H5_MAX_MPI_COUNT; * when we utilize derived datatypes. This is of * particular interest for allowing nightly testing * - * Return: The current/previous value of bigio_count. + * Return: The current/previous value of bigio_count_g. * * Programmer: Richard Warren, March 10, 2017 * @@ -51,10 +51,10 @@ static hsize_t bigio_count = H5_MAX_MPI_COUNT; hsize_t H5_mpi_set_bigio_count(hsize_t new_count) { - hsize_t orig_count = bigio_count; + hsize_t orig_count = bigio_count_g; if ((new_count > 0) && (new_count < (hsize_t)TWO_GIG_LIMIT)) { - bigio_count = new_count; + bigio_count_g = new_count; } return orig_count; } /* end H5_mpi_set_bigio_count() */ @@ -63,9 +63,9 @@ H5_mpi_set_bigio_count(hsize_t new_count) * Function: H5_mpi_get_bigio_count * * Purpose: Allow other HDF5 library functions to access - * the current value for bigio_count. + * the current value for bigio_count_g. * - * Return: The current/previous value of bigio_count. + * Return: The current/previous value of bigio_count_g. * * Programmer: Richard Warren, October 7, 2019 * @@ -74,7 +74,7 @@ H5_mpi_set_bigio_count(hsize_t new_count) hsize_t H5_mpi_get_bigio_count(void) { - return bigio_count; + return bigio_count_g; } /*------------------------------------------------------------------------- @@ -210,7 +210,7 @@ H5_mpi_comm_free(MPI_Comm *comm) HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "comm pointer cannot be NULL") /* Free the communicator */ - if (MPI_COMM_NULL != *comm) + if (MPI_COMM_WORLD != *comm && MPI_COMM_NULL != *comm) MPI_Comm_free(comm); *comm = MPI_COMM_NULL; @@ -471,8 +471,8 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat FUNC_ENTER_NOAPI(FAIL) /* Calculate how many Big MPI datatypes are needed to represent the buffer */ - num_big_types = (int)(num_elements / bigio_count); - leftover = (hsize_t)num_elements - (hsize_t)num_big_types * bigio_count; + num_big_types = (int)(num_elements / bigio_count_g); + leftover = (hsize_t)num_elements - (hsize_t)num_big_types * bigio_count_g; H5_CHECKED_ASSIGN(remaining_bytes, int, leftover, hsize_t); /* Create a contiguous datatype of size equal to the largest @@ -481,11 +481,11 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat * use type_hvector to create the type with the displacement provided */ if (0 == stride_bytes) { - if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)bigio_count, old_type, &inner_type))) + if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)bigio_count_g, old_type, &inner_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) } /* end if */ else if (MPI_SUCCESS != - (mpi_code = MPI_Type_create_hvector((int)bigio_count, 1, stride_bytes, old_type, &inner_type))) + (mpi_code = MPI_Type_create_hvector((int)bigio_count_g, 1, stride_bytes, old_type, &inner_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) /* Create a contiguous datatype of the buffer (minus the remaining < 2GB part) @@ -510,7 +510,7 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) } /* end if */ else if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector( - (int)(num_elements - (hsize_t)num_big_types * bigio_count), 1, + (int)(num_elements - (hsize_t)num_big_types * bigio_count_g), 1, stride_bytes, old_type, &leftover_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) @@ -529,7 +529,7 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat block_len[0] = 1; block_len[1] = 1; disp[0] = 0; - disp[1] = (old_extent + stride_bytes) * num_big_types * (MPI_Aint)bigio_count; + disp[1] = (old_extent + stride_bytes) * num_big_types * (MPI_Aint)bigio_count_g; if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(2, block_len, disp, type, new_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) diff --git a/src/H5public.h b/src/H5public.h index 2fb4407..8aadddc 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -372,7 +372,6 @@ htri_to_string(htri_t v) * \internal (Hoisted here, since it's used by both the * H5Lpublic.h and H5Opublic.h headers) */ /* Type for object tokens */ -/* (Hoisted here, since it's used by both the H5Lpublic.h and H5Opublic.h headers) */ typedef struct H5O_token_t { uint8_t __data[H5O_MAX_TOKEN_SIZE]; } H5O_token_t; -- cgit v0.12 From ce39d7501c58427add05aba62956acb84a6f56da Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Apr 2021 17:35:30 -0700 Subject: Brings H5CX_pop() changes from develop --- src/H5Atest.c | 2 +- src/H5CX.c | 40 ++++++++------- src/H5CXprivate.h | 2 +- src/H5Ftest.c | 4 +- src/H5Gtest.c | 24 ++++----- src/H5Itest.c | 9 ++-- src/H5Otest.c | 16 +++--- src/H5VLint.c | 6 +-- src/H5private.h | 6 +-- test/accum.c | 12 ++--- test/accum_swmr_reader.c | 4 +- test/app_ref.c | 2 +- test/big.c | 104 +++++++++++++++++++------------------- test/btree2.c | 30 +++++------ test/cache.c | 6 +-- test/cache_tagging.c | 111 +++++++++++++++++++++-------------------- test/dsets.c | 117 +++++++++++++++++++++++-------------------- test/earray.c | 127 ++++++++++++++--------------------------------- test/efc.c | 4 +- test/farray.c | 6 +-- test/fheap.c | 14 +++--- test/freespace.c | 4 +- test/gheap.c | 14 +++--- test/lheap.c | 10 ++-- test/mf.c | 4 +- test/ohdr.c | 20 ++++---- test/page_buffer.c | 5 +- test/unregister.c | 4 +- testpar/t_cache.c | 84 +++++++++++-------------------- testpar/t_file.c | 8 +-- tools/src/misc/h5debug.c | 12 ++--- 31 files changed, 369 insertions(+), 442 deletions(-) diff --git a/src/H5Atest.c b/src/H5Atest.c index 62d608e..6537a9d 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -136,7 +136,7 @@ H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5CX.c b/src/H5CX.c index f3a5eef..cff06f6 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -422,7 +422,7 @@ typedef struct H5CX_fapl_cache_t { static H5CX_node_t **H5CX__get_context(void); #endif /* H5_HAVE_THREADSAFE */ static void H5CX__push_common(H5CX_node_t *cnode); -static H5CX_node_t *H5CX__pop_common(void); +static H5CX_node_t *H5CX__pop_common(hbool_t update_dxpl_props); /*********************/ /* Package Variables */ @@ -678,7 +678,7 @@ H5CX_term_package(void) /* Pop the top context node from the stack */ /* (Can't check for errors, as rest of library is shut down) */ - cnode = H5CX__pop_common(); + cnode = H5CX__pop_common(FALSE); /* Free the context node */ /* (Allocated with HDmalloc() in H5CX_push_special() ) */ @@ -932,9 +932,11 @@ H5CX_retrieve_state(H5CX_state_t **api_state) /* Keep a reference to the current VOL wrapping context */ (*api_state)->vol_wrap_ctx = (*head)->ctx.vol_wrap_ctx; - if (NULL != (*api_state)->vol_wrap_ctx) + if (NULL != (*api_state)->vol_wrap_ctx) { + HDassert((*head)->ctx.vol_wrap_ctx_valid); if (H5VL_inc_vol_wrapper((*api_state)->vol_wrap_ctx) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTINC, FAIL, "can't increment refcount on VOL wrapping context") + } /* end if */ /* Keep a copy of the VOL connector property, if there is one */ if ((*head)->ctx.vol_connector_prop_valid && (*head)->ctx.vol_connector_prop.connector_id > 0) { @@ -1023,6 +1025,8 @@ H5CX_restore_state(const H5CX_state_t *api_state) /* Restore the VOL wrapper context */ (*head)->ctx.vol_wrap_ctx = api_state->vol_wrap_ctx; + if (NULL != (*head)->ctx.vol_wrap_ctx) + (*head)->ctx.vol_wrap_ctx_valid = TRUE; /* Restore the VOL connector info */ if (api_state->vol_connector_prop.connector_id) { @@ -3559,7 +3563,7 @@ done: *------------------------------------------------------------------------- */ static H5CX_node_t * -H5CX__pop_common(void) +H5CX__pop_common(hbool_t update_dxpl_props) { H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ @@ -3575,21 +3579,23 @@ H5CX__pop_common(void) HDassert(head && *head); /* Check for cached DXPL properties to return to application */ + if (update_dxpl_props) { #ifdef H5_HAVE_PARALLEL - H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) - H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) - H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) - H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) + H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) + H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) + H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) + H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) - H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) - H5CX_SET_PROP(H5D_XFER_COLL_RANK0_BCAST_NAME, mpio_coll_rank0_bcast) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) + H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) + H5CX_SET_PROP(H5D_XFER_COLL_RANK0_BCAST_NAME, mpio_coll_rank0_bcast) #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ #endif /* H5_HAVE_PARALLEL */ + } /* end if */ /* Pop the top context node from the stack */ ret_value = (*head); @@ -3614,7 +3620,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5CX_pop(void) +H5CX_pop(hbool_t update_dxpl_props) { H5CX_node_t *cnode; /* Context node */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3622,7 +3628,7 @@ H5CX_pop(void) FUNC_ENTER_NOAPI(FAIL) /* Perform common operations and get top context from stack */ - if (NULL == (cnode = H5CX__pop_common())) + if (NULL == (cnode = H5CX__pop_common(update_dxpl_props))) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error getting API context node") /* Free the context node */ diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index f9289cb..c500356 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -63,7 +63,7 @@ typedef struct H5CX_state_t { /* Library private routines */ #ifndef H5private_H H5_DLL herr_t H5CX_push(void); -H5_DLL herr_t H5CX_pop(void); +H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); #endif /* H5private_H */ H5_DLL void H5CX_push_special(void); H5_DLL hbool_t H5CX_is_def_dxpl(void); diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 03b613c..b76c579 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -118,7 +118,7 @@ H5F__get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, size_t *mesg_coun HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve shared message count") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -162,7 +162,7 @@ H5F__check_cached_stab_test(hid_t file_id) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 81adc86..0d21f22 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, October 17, 2005 * * Purpose: Group testing functions. @@ -178,7 +178,7 @@ H5G__is_empty_test(hid_t gid) } /* end if */ done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -245,7 +245,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) } /* end if */ done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -301,7 +301,7 @@ H5G__has_stab_test(hid_t gid) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -376,7 +376,7 @@ H5G__is_new_dense_test(hid_t gid) } /* end if */ done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -469,7 +469,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if (bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -522,7 +522,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't query local heap size") done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -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 @@ -633,7 +633,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign } /* end else */ done: - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Itest.c b/src/H5Itest.c index defc587..6f2c03a 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -11,10 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol - * Tuesday, July 27, 2010 - * - * Purpose: ID testing functions. +/* + * H5Itest.c - ID testing functions */ /****************/ @@ -28,7 +26,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ @@ -105,7 +102,7 @@ done: if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) HDONE_ERROR(H5E_ATOM, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, (-1), "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Otest.c b/src/H5Otest.c index 0c7fb69..48bc77f 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, December 4, 2006 * * Purpose: Object header testing functions. @@ -128,7 +128,7 @@ H5O__is_attr_dense_test(hid_t oid) done: if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -230,7 +230,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -327,7 +327,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -431,7 +431,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -667,7 +667,7 @@ H5O__msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) done: if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) @@ -778,8 +778,8 @@ H5O__msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) done: if (oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O__msg_get_chunkno_test() */ +} /* H5O__msg_move_to_new_chunk_test() */ diff --git a/src/H5VLint.c b/src/H5VLint.c index b7ea708..289dfef 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -222,7 +222,7 @@ H5VL__init_package(void) FUNC_ENTER_PACKAGE - /* Initialize the atom group for the VL IDs */ + /* Initialize the ID group for the VL IDs */ if (H5I_register_type(H5I_VOL_CLS) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to initialize H5VL interface") @@ -710,7 +710,7 @@ H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ /* Register VOL object as _object_ type, for future object API calls */ if ((ret_value = H5I_register(type, vol_obj, app_ref)) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize handle") + HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register handle") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2022,7 +2022,7 @@ H5VL_reset_lib_state(void) FUNC_ENTER_NOAPI(FAIL) /* Pop the API context off the stack */ - if (H5CX_pop() < 0) + if (H5CX_pop(FALSE) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't pop API context") done: diff --git a/src/H5private.h b/src/H5private.h index 16291ca..0e824c8 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2165,7 +2165,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ /* Forward declaration of H5CXpush() / H5CXpop() */ /* (Including H5CXprivate.h creates bad circular dependencies - QAK, 3/18/2018) */ H5_DLL herr_t H5CX_push(void); -H5_DLL herr_t H5CX_pop(void); +H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); #ifndef NDEBUG #define FUNC_ENTER_CHECK_NAME(asrt) \ @@ -2568,7 +2568,7 @@ H5_DLL herr_t H5CX_pop(void); #define FUNC_LEAVE_API(ret_value) \ VFD_SWMR_LEAVE(ret_value); \ FUNC_LEAVE_API_COMMON(ret_value); \ - (void)H5CX_pop(); \ + (void)H5CX_pop(TRUE); \ H5_POP_FUNC \ if (err_occurred) \ (void)H5E_dump_api_stack(TRUE); \ @@ -2580,7 +2580,7 @@ H5_DLL herr_t H5CX_pop(void); /* Use this macro when VFD SWMR EOT is not used on leaving an API function */ #define FUNC_LEAVE_API_NO_EOT(ret_value) \ FUNC_LEAVE_API_COMMON(ret_value); \ - (void)H5CX_pop(); \ + (void)H5CX_pop(TRUE); \ H5_POP_FUNC \ if (err_occurred) \ (void)H5E_dump_api_stack(TRUE); \ diff --git a/test/accum.c b/test/accum.c index d7d7e4d..c3346bc 100644 --- a/test/accum.c +++ b/test/accum.c @@ -139,7 +139,7 @@ main(void) nerrors += test_random_write(f); /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -160,7 +160,7 @@ main(void) error: if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); HDputs("*** TESTS FAILED ***"); return 1; @@ -1964,8 +1964,8 @@ test_random_write(H5F_t *f) /* Choose random # seed */ seed = (unsigned)HDtime(NULL); #if 0 - /* seed = (unsigned)1155438845; */ - HDfprintf(stderr, "Random # seed was: %u\n", seed); +/* seed = (unsigned)1155438845; */ +HDfprintf(stderr, "Random # seed was: %u\n", seed); #endif HDsrandom(seed); @@ -2303,7 +2303,7 @@ test_swmr_write_big(hbool_t newest_format) FAIL_STACK_ERROR; /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -2321,7 +2321,7 @@ error: H5Fclose(fid); if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); H5Pclose(fapl); diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index ffa81e5..ce0e830 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -98,7 +98,7 @@ main(void) FAIL_STACK_ERROR; /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -113,7 +113,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); return EXIT_FAILURE; } /* end main() */ diff --git a/test/app_ref.c b/test/app_ref.c index daf3efa..09cfb72 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, August 14, 2008 * * Purpose: Tests closing the library after reference counts have been diff --git a/test/big.c b/test/big.c index 75b4dec..989e4bc 100644 --- a/test/big.c +++ b/test/big.c @@ -93,17 +93,17 @@ static int test_family(hid_t fapl); static hsize_t values_used[WRT_N]; /*------------------------------------------------------------------------- - * Function: randll + * Function: randll * - * Purpose: Create a random long long value. - * Ensures that a write at this value doesn't overlap any - * previous write. + * Purpose: Create a random long long value. + * Ensures that a write at this value doesn't overlap any + * previous write. * - * Return: Success: Random value + * Return: Success: Random value * - * Failure: Random value which overlaps another write + * Failure: Random value which overlaps another write * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * * Modifications: @@ -141,17 +141,17 @@ randll(hsize_t limit, int current_index) } /*------------------------------------------------------------------------- - * Function: is_sparse + * Function: is_sparse * - * Purpose: Determines if the file system of the current working - * directory supports holes. + * Purpose: Determines if the file system of the current working + * directory supports holes. * - * Return: Success: Non-zero if holes are supported; zero - * otherwise. + * Return: Success: Non-zero if holes are supported; zero + * otherwise. * - * Failure: zero + * Failure: zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, July 15, 1998 * * Modifications: @@ -184,17 +184,17 @@ is_sparse(void) } /*------------------------------------------------------------------------- - * Function: supports_big + * Function: supports_big * - * Purpose: Determines if the file system of the current working - * directory supports big files. + * Purpose: Determines if the file system of the current working + * directory supports big files. * - * Return: Success: Non-zero if big files are supported; zero - * otherwise. + * Return: Success: Non-zero if big files are supported; zero + * otherwise. * - * Failure: zero + * Failure: zero * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, April 18, 2007 * * Modifications: @@ -254,17 +254,17 @@ error: } /*------------------------------------------------------------------------- - * Function: enough_room + * Function: enough_room * - * Purpose: Tries to create a bunch of sparse files to see if quotas will - * get in the way. Some systems also have problems opening - * enough files and we'll check that too. + * Purpose: Tries to create a bunch of sparse files to see if quotas will + * get in the way. Some systems also have problems opening + * enough files and we'll check that too. * - * Return: Success: Non-zero + * Return: Success: Non-zero * - * Failure: zero + * Failure: zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, August 6, 1998 * * Modifications: @@ -322,20 +322,20 @@ done: H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- - * Function: writer + * Function: writer * - * Purpose: Creates a *big* dataset. + * Purpose: Creates a *big* dataset. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: >0 + * Failure: >0 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 8, 1998 * * Modifications: - * Robb Matzke, 15 Jul 1998 - * Addresses are written to the file DNAME instead of stdout. + * Robb Matzke, 15 Jul 1998 + * Addresses are written to the file DNAME instead of stdout. * *------------------------------------------------------------------------- */ @@ -475,15 +475,15 @@ error: } /*------------------------------------------------------------------------- - * Function: reader + * Function: reader * - * Purpose: Reads some data from random locations in the dataset. + * Purpose: Reads some data from random locations in the dataset. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: >0 + * Failure: >0 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, April 10, 1998 * * Modifications: @@ -583,13 +583,13 @@ error: } /*------------------------------------------------------------------------- - * Function: usage + * Function: usage * - * Purpose: Print command usage + * Purpose: Print command usage * - * Return: void + * Return: void * - * Programmer: Albert Chent + * Programmer: Albert Chent * Mar 28, 2002 * * Modifications: @@ -747,22 +747,22 @@ error: } /* end test_family() */ /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, April 10, 1998 * * Modifications: - * Albert Cheng, 2002/03/28 - * Added command option -fsize. - * Albert Cheng, 2002/04/19 - * Added command option -c. + * Albert Cheng, 2002/03/28 + * Added command option -fsize. + * Albert Cheng, 2002/04/19 + * Added command option -c. * * Raymond Lu, 2007/05/25 * Added similar tests for SEC2 and STDIO drivers. diff --git a/test/btree2.c b/test/btree2.c index 48564cb..f18b65c 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, February 1, 2005 */ #include "h5test.h" @@ -4964,10 +4964,10 @@ test_update_lots(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t /* Initialize random number seed */ curr_time = HDtime(NULL); -#ifdef QAK - curr_time = 1451342093; - HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); -#endif /* QAK */ +#if 0 +curr_time = 1451342093; +HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); +#endif HDsrandom((unsigned)curr_time); /* @@ -8670,10 +8670,10 @@ test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cpara /* Initialize random number seed */ curr_time = HDtime(NULL); -#ifdef QAK - curr_time = 1163537969; - HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); -#endif /* QAK */ +#if 0 +curr_time = 1163537969; +HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); +#endif HDsrandom((unsigned)curr_time); /* @@ -8706,8 +8706,8 @@ test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cpara TEST_ERROR /* Check for VFD which stores data in multiple files */ - single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family")); + single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0); if (single_file_vfd) { /* Make a copy of the file in memory, in order to speed up deletion testing */ @@ -10082,21 +10082,21 @@ main(void) nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; if (nerrors) goto error; - puts("All v2 B-tree tests passed."); + HDputs("All v2 B-tree tests passed."); h5_cleanup(FILENAME, fapl); return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { @@ -10105,7 +10105,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); return 1; } /* end main() */ diff --git a/test/cache.c b/test/cache.c index 44ee222..c7b2a25 100644 --- a/test/cache.c +++ b/test/cache.c @@ -42024,8 +42024,6 @@ check_stats__smoke_check_1(H5F_t *file_ptr) /* reset cache min clean size to its expected value */ cache_ptr->min_clean_size = (1 * 1024 * 1024); - return; - } /* check_stats__smoke_check_1() */ #endif /* H5C_COLLECT_CACHE_STATS */ @@ -42415,7 +42413,7 @@ takedown_cache(H5F_t *file_ptr, hbool_t dump_stats, hbool_t dump_detailed_stats) } /* Pop API context */ - H5CX_pop(); + H5CX_pop(FALSE); if ((!try_core_file_driver) || (core_file_driver_failed)) { @@ -42433,8 +42431,6 @@ takedown_cache(H5F_t *file_ptr, hbool_t dump_stats, hbool_t dump_detailed_stats) } } - return; - } /* takedown_cache() */ /*------------------------------------------------------------------------- diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 3ed9a81..bcddd5a 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -434,8 +434,8 @@ check_file_creation_tags(hid_t fcpl_id, int type) /* Variable Declarations */ hid_t fid = -1; /* File Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose test outout */ -#endif + int verbose = FALSE; /* verbose test outout */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; haddr_t sbe_tag = 0; @@ -539,10 +539,10 @@ check_file_open_tags(hid_t fcpl, int type) hid_t fid = -1; /* File Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif - hid_t fapl = -1; /* File access prop list */ - haddr_t root_tag; /* Root Group Tag */ - haddr_t sbe_tag; /* Sblock Extension Tag */ +#endif /* NDEBUG */ + hid_t fapl = -1; /* File access prop list */ + haddr_t root_tag; /* Root Group Tag */ + haddr_t sbe_tag; /* Sblock Extension Tag */ /* Testing Macro */ TESTING("tag application during file open"); @@ -668,8 +668,8 @@ check_group_creation_tags(void) hid_t fid = -1; /* File Identifier */ hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */ haddr_t g_tag; /* Group Tag */ @@ -791,8 +791,8 @@ check_multi_group_creation_tags(void) hid_t fid = -1; /* File Identifier */ hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ char gname[16]; /* group name buffer */ int i = 0; /* iterator */ hid_t fapl = -1; /* File access prop list */ @@ -943,8 +943,8 @@ check_link_iteration_tags(void) hid_t sid = -1; /* Group Identifier */ hid_t did = -1; /* Group Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ int i = 0; /* iterator */ haddr_t root_tag = 0; /* Root Group Tag Value */ char dsetname[500]; /* Name of dataset */ @@ -1085,8 +1085,8 @@ check_dense_attribute_tags(void) hid_t did = -1; /* Group Identifier */ hid_t dcpl = -1; /* Group Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ int i = 0; /* iterator */ hid_t fapl = -1; /* File access property list */ haddr_t d_tag = 0; /* Dataset tag value */ @@ -1315,8 +1315,8 @@ check_group_open_tags(void) hid_t fid = -1; /* File Identifier */ hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file output */ -#endif + int verbose = FALSE; /* verbose file output */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; @@ -1446,8 +1446,8 @@ check_attribute_creation_tags(hid_t fcpl, int type) hid_t gid = -1; /* Group Identifier */ hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; /* Root group tag */ haddr_t g_tag = 0; @@ -1611,8 +1611,8 @@ check_attribute_open_tags(hid_t fcpl, int type) hid_t gid = -1; /* Group Identifier */ hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; haddr_t g_tag = 0; @@ -1778,8 +1778,8 @@ check_attribute_rename_tags(hid_t fcpl, int type) hid_t aid = -1; /* Attribute Identifier */ hid_t sid = -1; /* Dataset Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ int * data = NULL; /* data buffer */ int i, j, k = 0; /* iterators */ hid_t fapl = -1; /* File access prop list */ @@ -1991,8 +1991,8 @@ check_attribute_delete_tags(hid_t fcpl, int type) hid_t aid = -1; /* Attribute Identifier */ hid_t sid = -1; /* Dataset Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ int * data = NULL; /* data buffer */ int i, j, k = 0; /* iterators */ hid_t fapl = -1; /* File access prop list */ @@ -2182,8 +2182,8 @@ check_dataset_creation_tags(hid_t fcpl, int type) hid_t did = -1; /* Dataset Identifier */ hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -2342,8 +2342,8 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) hid_t did = -1; /* Dataset Identifier */ hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -2508,8 +2508,8 @@ check_dataset_open_tags(void) hid_t did = -1; /* Dataset Identifier */ hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -2660,8 +2660,8 @@ check_dataset_write_tags(void) hid_t did = -1; /* Dataset Identifier */ hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -2827,8 +2827,8 @@ check_attribute_write_tags(hid_t fcpl, int type) hid_t aid = -1; /* Attribute Identifier */ hid_t sid = -1; /* Dataset Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ int * data = NULL; /* data buffer */ int i, j, k = 0; /* iterators */ hid_t fapl = -1; /* File access prop list */ @@ -3013,8 +3013,8 @@ check_dataset_read_tags(void) hid_t did = -1; /* Dataset Identifier */ hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -3175,8 +3175,8 @@ check_dataset_size_retrieval(void) hid_t did = -1; /* Dataset Identifier */ hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -3339,8 +3339,8 @@ check_dataset_extend_tags(void) hid_t did = -1; /* Dataset Identifier */ hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -3501,8 +3501,8 @@ check_object_info_tags(void) hid_t fid = -1; /* File Identifier */ hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file output */ -#endif + int verbose = FALSE; /* verbose file output */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; @@ -3636,8 +3636,8 @@ check_object_copy_tags(void) hid_t fid = -1; /* File Identifier */ hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file output */ -#endif + int verbose = FALSE; /* verbose file output */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; @@ -3786,8 +3786,8 @@ check_link_removal_tags(hid_t fcpl, int type) hid_t sid = -1; /* Dataspace Identifier */ hid_t gid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -3975,8 +3975,8 @@ check_link_getname_tags(void) hid_t sid = -1; /* Dataspace Identifier */ hid_t gid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -4152,8 +4152,8 @@ check_external_link_creation_tags(void) hid_t fid2 = -1; /* File Identifier */ hid_t gid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; @@ -4279,8 +4279,8 @@ check_external_link_open_tags(void) hid_t gid = -1; /* Dataspace Identifier */ hid_t xid = -1; /* Dataspace Identifier */ #ifndef NDEBUG - int verbose = FALSE; /* verbose file outout */ -#endif + int verbose = FALSE; /* verbose file outout */ +#endif /* NDEBUG */ H5O_native_info_t ninfo; /* Native object info struct */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; @@ -4511,7 +4511,7 @@ check_invalid_tag_application(void) TEST_ERROR; /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) TEST_ERROR api_ctx_pushed = FALSE; @@ -4531,10 +4531,11 @@ check_invalid_tag_application(void) #if H5C_DO_TAGGING_SANITY_CHECKS error: if (api_ctx_pushed) - H5CX_pop(); -#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ + H5CX_pop(FALSE); return 1; +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ + } /* check_invalid_tag_application */ /*------------------------------------------------------------------------- diff --git a/test/dsets.c b/test/dsets.c index ece862b..5452e8d 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 9, 1997 * * Purpose: Tests the dataset interface (H5D) @@ -373,13 +373,13 @@ test_create(hid_t file) dims[0] = 256; dims[1] = 512; space = H5Screate_simple(2, dims, NULL); - assert(space >= 0); + HDassert(space >= 0); /* Create a small data space for compact dataset */ small_dims[0] = 16; small_dims[1] = 8; small_space = H5Screate_simple(2, small_dims, NULL); - assert(space >= 0); + HDassert(space >= 0); /* * Create a dataset using the default dataset creation properties. We're @@ -448,13 +448,13 @@ test_create(hid_t file) * layout. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - assert(create_parms >= 0); + HDassert(create_parms >= 0); /* Attempt to create a dataset with invalid chunk sizes */ csize[0] = dims[0] * 2; csize[1] = dims[1] * 2; status = H5Pset_chunk(create_parms, 2, csize); - assert(status >= 0); + HDassert(status >= 0); H5E_BEGIN_TRY { dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, create_parms, @@ -470,7 +470,7 @@ test_create(hid_t file) csize[0] = 5; csize[1] = 100; status = H5Pset_chunk(create_parms, 2, csize); - assert(status >= 0); + HDassert(status >= 0); dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, create_parms, H5P_DEFAULT); @@ -492,11 +492,11 @@ test_create(hid_t file) * Create a compact dataset, then close it. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - assert(create_parms >= 0); + HDassert(create_parms >= 0); status = H5Pset_layout(create_parms, H5D_COMPACT); - assert(status >= 0); + HDassert(status >= 0); status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); - assert(status >= 0); + HDassert(status >= 0); dataset = H5Dcreate2(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT, create_parms, H5P_DEFAULT); @@ -540,7 +540,8 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) TESTING("simple I/O"); /* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */ - if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { + if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0) { h5_fixname(FILENAME[4], fapl, filename, sizeof filename); /* Set up data array */ @@ -568,7 +569,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) /* Create a small conversion buffer to test strip mining */ tconv_buf = HDmalloc((size_t)1000); xfer = H5Pcreate(H5P_DATASET_XFER); - assert(xfer >= 0); + HDassert(xfer >= 0); if (H5Pset_buffer(xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error; @@ -700,7 +701,8 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TESTING("dataset offset with user block"); /* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */ - if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { + if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0) { h5_fixname(FILENAME[2], fapl, filename, sizeof filename); /* Set up data array */ @@ -3053,7 +3055,7 @@ test_missing_filter(hid_t file) #endif /* H5_HAVE_FILTER_DEFLATE */ /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -3062,7 +3064,7 @@ test_missing_filter(hid_t file) error: if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); return FAIL; } /* end test_missing_filter() */ @@ -3224,7 +3226,7 @@ test_nbit_int(hid_t file) /* Initialize data, assuming size of long long >= size of int */ for (i = 0; i < (size_t)size[0]; i++) for (j = 0; j < (size_t)size[1]; j++) { - power = HDpow(2.0f, (double)(precision - 1)); + power = HDpow(2.0, (double)(precision - 1)); orig_data[i][j] = (int)(((long long)HDrandom() % (long long)power) << offset); /* even-numbered values are negtive */ @@ -3601,7 +3603,7 @@ test_nbit_array(hid_t file) for (j = 0; j < (size_t)size[1]; j++) for (m = 0; m < (size_t)adims[0]; m++) for (n = 0; n < (size_t)adims[1]; n++) { - power = HDpow(2.0F, (double)precision); + power = HDpow(2.0, (double)precision); orig_data[i][j][m][n] = (unsigned int)(((long long)HDrandom() % (long long)power) << offset); } /* end for */ @@ -3797,11 +3799,11 @@ test_nbit_compound(hid_t file) /* Initialize data, assuming size of long long >= size of member datatypes */ for (i = 0; i < (size_t)size[0]; i++) for (j = 0; j < (size_t)size[1]; j++) { - power = HDpow(2.0F, (double)(precision[0] - 1)); + power = HDpow(2.0, (double)(precision[0] - 1)); orig_data[i][j].i = (int)(((long long)HDrandom() % (long long)power) << offset[0]); - power = HDpow(2.0F, (double)(precision[1] - 1)); + power = HDpow(2.0, (double)(precision[1] - 1)); orig_data[i][j].c = (char)(((long long)HDrandom() % (long long)power) << offset[1]); - power = HDpow(2.0F, (double)(precision[2] - 1)); + power = HDpow(2.0, (double)(precision[2] - 1)); orig_data[i][j].s = (short)(((long long)HDrandom() % (long long)power) << offset[2]); orig_data[i][j].f = float_val[i][j]; @@ -4079,32 +4081,32 @@ test_nbit_compound_2(hid_t file) /* Initialize data, assuming size of long long >= size of member datatypes */ for (i = 0; i < (size_t)size[0]; i++) for (j = 0; j < (size_t)size[1]; j++) { - power = HDpow(2.0F, (double)(precision[0] - 1)); + power = HDpow(2.0, (double)(precision[0] - 1)); orig_data[i][j].a.i = (int)(((long long)HDrandom() % (long long)power) << offset[0]); - power = HDpow(2.0F, (double)(precision[1] - 1)); + power = HDpow(2.0, (double)(precision[1] - 1)); orig_data[i][j].a.c = (char)(((long long)HDrandom() % (long long)power) << offset[1]); - power = HDpow(2.0F, (double)(precision[2] - 1)); - orig_data[i][j].a.s = (short)(-((long long)HDrandom() % (long long)power) << offset[2]); + power = HDpow(2.0, (double)(precision[2] - 1)); + orig_data[i][j].a.s = (short)(-(((long long)HDrandom() % (long long)power) << offset[2])); orig_data[i][j].a.f = float_val[i][j]; - power = HDpow(2.0F, (double)precision[3]); + power = HDpow(2.0, (double)precision[3]); orig_data[i][j].v = (unsigned int)(((long long)HDrandom() % (long long)power) << offset[3]); for (m = 0; m < (size_t)array_dims[0]; m++) for (n = 0; n < (size_t)array_dims[1]; n++) { - power = HDpow(2.0F, (double)(precision[4] - 1)); + power = HDpow(2.0, (double)(precision[4] - 1)); orig_data[i][j].b[m][n] = (char)(((long long)HDrandom() % (long long)power) << offset[4]); } /* end for */ for (m = 0; m < (size_t)array_dims[0]; m++) for (n = 0; n < (size_t)array_dims[1]; n++) { - power = HDpow(2.0F, (double)(precision[0] - 1)); + power = HDpow(2.0, (double)(precision[0] - 1)); orig_data[i][j].d[m][n].i = - (int)(-((long long)HDrandom() % (long long)power) << offset[0]); - power = HDpow(2.0F, (double)(precision[1] - 1)); + (int)(-(((long long)HDrandom() % (long long)power) << offset[0])); + power = HDpow(2.0, (double)(precision[1] - 1)); orig_data[i][j].d[m][n].c = (char)(((long long)HDrandom() % (long long)power) << offset[1]); - power = HDpow(2.0F, (double)(precision[2] - 1)); + power = HDpow(2.0, (double)(precision[2] - 1)); orig_data[i][j].d[m][n].s = (short)(((long long)HDrandom() % (long long)power) << offset[2]); orig_data[i][j].d[m][n].f = float_val[i][j]; @@ -4335,7 +4337,7 @@ test_nbit_compound_3(hid_t file) /* Initialize data */ for (i = 0; i < (size_t)size[0]; i++) { - power = HDpow(2.0F, 17.0F - 1.0F); + power = HDpow(2.0, 17.0 - 1.0); HDmemset(&orig_data[i], 0, sizeof(orig_data[i])); orig_data[i].i = (int)(HDrandom() % (long)power); HDstrcpy(orig_data[i].str, "fixed-length C string"); @@ -4379,9 +4381,9 @@ test_nbit_compound_3(hid_t file) /* Check that the values read are the same as the values written */ for (i = 0; i < (size_t)size[0]; i++) { - if (new_data[i].i != orig_data[i].i || strcmp(new_data[i].str, orig_data[i].str) != 0 || - strcmp(new_data[i].vl_str, orig_data[i].vl_str) != 0 || new_data[i].v.len != orig_data[i].v.len || - new_data[i].r != orig_data[i].r) { + if (new_data[i].i != orig_data[i].i || HDstrcmp(new_data[i].str, orig_data[i].str) != 0 || + HDstrcmp(new_data[i].vl_str, orig_data[i].vl_str) != 0 || + new_data[i].v.len != orig_data[i].v.len || new_data[i].r != orig_data[i].r) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu\n", (unsigned long)i); @@ -4524,7 +4526,7 @@ test_nbit_int_size(hid_t file) */ for (i = 0; i < DSET_DIM1; i++) for (j = 0; j < DSET_DIM2; j++) { - power = HDpow(2.0F, (double)(precision - 1)); + power = HDpow(2.0, (double)(precision - 1)); orig[i][j] = HDrandom() % (int)power << offset; } @@ -5188,7 +5190,7 @@ test_scaleoffset_float(hid_t file) /* Check that the values read are the same as the values written */ for (i = 0; i < (size_t)size[0]; i++) { for (j = 0; j < (size_t)size[1]; j++) { - if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0F, -3.0F)) { + if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0, -3.0)) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -5334,7 +5336,7 @@ test_scaleoffset_float_2(hid_t file) /* Check that the values read are the same as the values written */ for (j = 0; j < (size_t)size[1]; j++) { - if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0F, -3.0F)) { + if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0, -3.0)) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -5455,7 +5457,7 @@ test_scaleoffset_double(hid_t file) /* Check that the values read are the same as the values written */ for (i = 0; i < (size_t)size[0]; i++) { for (j = 0; j < (size_t)size[1]; j++) { - if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0F, -7.0F)) { + if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0, -7.0)) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -5601,7 +5603,7 @@ test_scaleoffset_double_2(hid_t file) /* Check that the values read are the same as the values written */ for (j = 0; j < (size_t)size[1]; j++) { - if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0F, -7.0F)) { + if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0, -7.0)) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -6916,6 +6918,7 @@ error: static herr_t test_filter_delete(hid_t file) { +#ifdef H5_HAVE_FILTER_DEFLATE H5Z_filter_t filtn; /* filter identification number */ hid_t dsid = -1; /* dataset ID */ hid_t sid = -1; /* dataspace ID */ @@ -6927,6 +6930,7 @@ test_filter_delete(hid_t file) unsigned flags; /* flags for filter */ herr_t ret; /* generic return value */ int i; +#endif TESTING("filter deletion"); @@ -7031,9 +7035,7 @@ test_filter_delete(hid_t file) goto error; PASSED(); -#else - SKIPPED(); -#endif + return SUCCEED; error: @@ -7046,6 +7048,10 @@ error: } H5E_END_TRY; return FAIL; +#else + SKIPPED(); + return SUCCEED; +#endif } /* end test_filter_delete() */ /*------------------------------------------------------------------------- @@ -7689,9 +7695,9 @@ error: static H5_ATTR_CONST long gcd(long l0, long r0) { - long magnitude, remainder; - bool negative = ((l0 < 0) != (r0 < 0)); - long l = HDlabs(l0), r = HDlabs(r0); + long magnitude, remainder; + hbool_t negative = ((l0 < 0) != (r0 < 0)); + long l = HDlabs(l0), r = HDlabs(r0); do { if (l < r) { @@ -7781,7 +7787,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) TESTING(testname); - assert(NPOINTS < 100); + HDassert(NPOINTS < 100); h5_fixname(FILENAME[6], fapl, filename, sizeof filename); @@ -8303,13 +8309,13 @@ test_deprec(hid_t file) dims[0] = 256; dims[1] = 512; space = H5Screate_simple(2, dims, NULL); - assert(space >= 0); + HDassert(space >= 0); /* Create a small data space for compact dataset */ small_dims[0] = 16; small_dims[1] = 8; small_space = H5Screate_simple(2, small_dims, NULL); - assert(space >= 0); + HDassert(space >= 0); /* * Create a dataset using the default dataset creation properties. We're @@ -8368,7 +8374,7 @@ test_deprec(hid_t file) * layout. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - assert(create_parms >= 0); + HDassert(create_parms >= 0); /* Add the deflate filter, if available */ #if defined H5_HAVE_FILTER_DEFLATE @@ -8404,7 +8410,7 @@ test_deprec(hid_t file) csize[0] = dims[0] * 2; csize[1] = dims[1] * 2; status = H5Pset_chunk(create_parms, 2, csize); - assert(status >= 0); + HDassert(status >= 0); H5E_BEGIN_TRY { dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms); @@ -8419,7 +8425,7 @@ test_deprec(hid_t file) csize[0] = 5; csize[1] = 100; status = H5Pset_chunk(create_parms, 2, csize); - assert(status >= 0); + HDassert(status >= 0); if ((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms)) < 0) goto error; @@ -8444,11 +8450,11 @@ test_deprec(hid_t file) * Create a compact dataset, then close it. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - assert(create_parms >= 0); + HDassert(create_parms >= 0); status = H5Pset_layout(create_parms, H5D_COMPACT); - assert(status >= 0); + HDassert(status >= 0); status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); - assert(status >= 0); + HDassert(status >= 0); if ((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_COMPACT, H5T_NATIVE_DOUBLE, small_space, create_parms)) < 0) @@ -12393,6 +12399,9 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl) TESTING("Version 2 B-tree chunk index header flush dependencies handled correctly"); + /* Initialize struct */ + HDmemset(&info, 0, sizeof(info)); + /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. */ @@ -15074,7 +15083,7 @@ main(void) envval = "nomatch"; /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") != 0 && HDstrcmp(envval, "multi") != 0); /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); diff --git a/test/earray.c b/test/earray.c index 8a8993c..fc0b87e 100644 --- a/test/earray.c +++ b/test/earray.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, June 17, 2008 */ #include "h5test.h" @@ -122,7 +122,7 @@ typedef struct earray_iter_t { hsize_t cnt); /* Initialize/allocate iterator private info */ hssize_t (*next)(void *info); /* Get the next element to test */ hssize_t (*max_elem)(const void *info); /* Get the max. element set */ - int (*state)(void *_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, + int (*state)(void *in_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, earray_state_t *state, hsize_t idx); /* Get the state of the extensible array */ herr_t (*term)(void *info); /* Shutdown/free iterator private info */ } earray_iter_t; @@ -382,11 +382,6 @@ check_stats(const H5EA_t *ea, const earray_state_t *state) TEST_ERROR } /* end if */ #endif /* NOT_YET */ -#ifdef QAK - HDfprintf(stderr, "nelmts = %Hu, total EA size = %Hu\n", earray_stats.stored.nelmts, - (earray_stats.computed.hdr_size + earray_stats.computed.index_blk_size + - earray_stats.stored.super_blk_size + earray_stats.stored.data_blk_size)); -#endif /* QAK */ /* All tests passed */ return (0); @@ -557,12 +552,6 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr) if (H5EA_close(ea) < 0) FAIL_STACK_ERROR -#ifdef QAK - HDfprintf(stderr, "ea_addr = %a\n", ea_addr); - H5Fflush(file, H5F_SCOPE_GLOBAL); - HDsystem("cp earray.h5 earray.h5.save"); -#endif /* QAK */ - /* Delete array */ if (H5EA_delete(f, ea_addr, NULL) < 0) FAIL_STACK_ERROR @@ -789,7 +778,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE } #else /* NDEBUG */ SKIPPED(); - puts(" Not tested when assertions are disabled"); + HDputs(" Not tested when assertions are disabled"); #endif /* NDEBUG */ /* @@ -1326,9 +1315,9 @@ eiter_fw_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_para *------------------------------------------------------------------------- */ static hssize_t -eiter_fw_next(void *_eiter) +eiter_fw_next(void *in_eiter) { - eiter_fw_t *eiter = (eiter_fw_t *)_eiter; + eiter_fw_t *eiter = (eiter_fw_t *)in_eiter; hssize_t ret_val; /* Sanity check */ @@ -1354,9 +1343,9 @@ eiter_fw_next(void *_eiter) *------------------------------------------------------------------------- */ static H5_ATTR_PURE hssize_t -eiter_fw_max(const void *_eiter) +eiter_fw_max(const void *in_eiter) { - const eiter_fw_t *eiter = (const eiter_fw_t *)_eiter; + const eiter_fw_t *eiter = (const eiter_fw_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1379,10 +1368,10 @@ eiter_fw_max(const void *_eiter) *------------------------------------------------------------------------- */ static int -eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, +eiter_fw_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, earray_state_t *state, hsize_t idx) { - eiter_fw_t *eiter = (eiter_fw_t *)_eiter; + eiter_fw_t *eiter = (eiter_fw_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1407,21 +1396,8 @@ eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_para /* (same eqn. as in H5EA__dblock_sblk_idx()) */ sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); -#ifdef QAK - HDfprintf(stderr, "idx = %Hu, tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", idx, sblk_idx, - tparam->sblk_info[sblk_idx].ndblks, tparam->sblk_info[sblk_idx].dblk_nelmts, - tparam->sblk_info[sblk_idx].start_idx, tparam->sblk_info[sblk_idx].start_dblk); -#endif /* QAK */ - - state->nelmts = EA_NELMTS(cparam, tparam, idx, sblk_idx); -#ifdef QAK - HDfprintf(stderr, "state->nelmts = %Hu\n", state->nelmts); -#endif /* QAK */ - + state->nelmts = EA_NELMTS(cparam, tparam, idx, sblk_idx); state->ndata_blks = EA_NDATA_BLKS(cparam, tparam, idx, sblk_idx); -#ifdef QAK - HDfprintf(stderr, "state->ndata_blks = %Hu\n", state->ndata_blks); -#endif /* QAK */ /* Check if we have any super blocks yet */ if (tparam->sblk_info[sblk_idx].ndblks >= cparam->sup_blk_min_data_ptrs) { @@ -1430,9 +1406,6 @@ eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_para eiter->base_sblk_idx = sblk_idx; state->nsuper_blks = (sblk_idx - eiter->base_sblk_idx) + 1; -#ifdef QAK - HDfprintf(stderr, "state->nsuper_blks = %Hu\n", state->nsuper_blks); -#endif /* QAK */ } /* end if */ else state->nsuper_blks = 0; @@ -1542,9 +1515,9 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, hs *------------------------------------------------------------------------- */ static hssize_t -eiter_rv_next(void *_eiter) +eiter_rv_next(void *in_eiter) { - eiter_rv_t *eiter = (eiter_rv_t *)_eiter; + eiter_rv_t *eiter = (eiter_rv_t *)in_eiter; hssize_t ret_val; /* Sanity check */ @@ -1570,9 +1543,9 @@ eiter_rv_next(void *_eiter) *------------------------------------------------------------------------- */ static H5_ATTR_PURE hssize_t -eiter_rv_max(const void *_eiter) +eiter_rv_max(const void *in_eiter) { - const eiter_rv_t *eiter = (const eiter_rv_t *)_eiter; + const eiter_rv_t *eiter = (const eiter_rv_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1595,10 +1568,10 @@ eiter_rv_max(const void *_eiter) *------------------------------------------------------------------------- */ static int -eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, +eiter_rv_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, earray_state_t *state, hsize_t idx) { - eiter_rv_t *eiter = (eiter_rv_t *)_eiter; + eiter_rv_t *eiter = (eiter_rv_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1641,40 +1614,18 @@ eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_para loc_sblk_idx = H5VM_log2_gen( (uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); } /* end else */ -#ifdef QAK - HDfprintf( - stderr, - "idx = %Hu, loc_idx = %Hu, eiter->max_sblk_idx = %u, idx_sblk_idx = %u, loc_sblk_idx = %u\n", idx, - loc_idx, eiter->max_sblk_idx, idx_sblk_idx, loc_sblk_idx); - HDfprintf(stderr, "tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", idx_sblk_idx, - tparam->sblk_info[idx_sblk_idx].ndblks, tparam->sblk_info[idx_sblk_idx].dblk_nelmts, - tparam->sblk_info[idx_sblk_idx].start_idx, tparam->sblk_info[idx_sblk_idx].start_dblk); - HDfprintf(stderr, "tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", eiter->max_sblk_idx, - tparam->sblk_info[eiter->max_sblk_idx].ndblks, - tparam->sblk_info[eiter->max_sblk_idx].dblk_nelmts, - tparam->sblk_info[eiter->max_sblk_idx].start_idx, - tparam->sblk_info[eiter->max_sblk_idx].start_dblk); -#endif /* QAK */ if (idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) idx_nelmts = (hsize_t)cparam->idx_blk_elmts; else idx_nelmts = EA_NELMTS(cparam, tparam, loc_idx, loc_sblk_idx); state->nelmts = (eiter->max_nelmts - idx_nelmts) + cparam->idx_blk_elmts; -#ifdef QAK - HDfprintf(stderr, "eiter->max_nelmts = %Hu, idx_nelmts = %Hu, state->nelmts = %Hu\n", - eiter->max_nelmts, idx_nelmts, state->nelmts); -#endif /* QAK */ if (idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) idx_ndata_blks = 0; else idx_ndata_blks = EA_NDATA_BLKS(cparam, tparam, loc_idx, loc_sblk_idx); state->ndata_blks = eiter->max_ndata_blks - idx_ndata_blks; -#ifdef QAK - HDfprintf(stderr, "eiter->max_ndata_blks = %Hu, idx_ndata_blks = %Hu, state->ndata_blks = %Hu\n", - eiter->max_ndata_blks, idx_ndata_blks, state->ndata_blks); -#endif /* QAK */ /* Check if we have any super blocks yet */ if (tparam->sblk_info[eiter->max_sblk_idx].ndblks >= cparam->sup_blk_min_data_ptrs) { @@ -1682,10 +1633,6 @@ eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_para state->nsuper_blks = (eiter->max_sblk_idx - idx_sblk_idx) + 1; else state->nsuper_blks = (eiter->max_sblk_idx - eiter->idx_blk_nsblks) + 1; -#ifdef QAK - HDfprintf(stderr, "eiter->idx_blk_nsblks = %Hu, state->nsuper_blks = %Hu\n", - eiter->idx_blk_nsblks, state->nsuper_blks); -#endif /* QAK */ } /* end if */ } /* end else */ @@ -1798,9 +1745,9 @@ eiter_rnd_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par *------------------------------------------------------------------------- */ static hssize_t -eiter_rnd_next(void *_eiter) +eiter_rnd_next(void *in_eiter) { - eiter_rnd_t *eiter = (eiter_rnd_t *)_eiter; + eiter_rnd_t *eiter = (eiter_rnd_t *)in_eiter; hssize_t ret_val; /* Sanity check */ @@ -1831,9 +1778,9 @@ eiter_rnd_next(void *_eiter) *------------------------------------------------------------------------- */ static H5_ATTR_PURE hssize_t -eiter_rnd_max(const void *_eiter) +eiter_rnd_max(const void *in_eiter) { - const eiter_rnd_t *eiter = (const eiter_rnd_t *)_eiter; + const eiter_rnd_t *eiter = (const eiter_rnd_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1856,9 +1803,9 @@ eiter_rnd_max(const void *_eiter) *------------------------------------------------------------------------- */ static int -eiter_rnd_term(void *_eiter) +eiter_rnd_term(void *in_eiter) { - eiter_rnd_t *eiter = (eiter_rnd_t *)_eiter; + eiter_rnd_t *eiter = (eiter_rnd_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -2012,9 +1959,9 @@ eiter_cyc_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par *------------------------------------------------------------------------- */ static hssize_t -eiter_cyc_next(void *_eiter) +eiter_cyc_next(void *in_eiter) { - eiter_cyc_t *eiter = (eiter_cyc_t *)_eiter; + eiter_cyc_t *eiter = (eiter_cyc_t *)in_eiter; hssize_t ret_val; /* Sanity check */ @@ -2047,9 +1994,9 @@ eiter_cyc_next(void *_eiter) *------------------------------------------------------------------------- */ static H5_ATTR_PURE hssize_t -eiter_cyc_max(const void *_eiter) +eiter_cyc_max(const void *in_eiter) { - const eiter_cyc_t *eiter = (const eiter_cyc_t *)_eiter; + const eiter_cyc_t *eiter = (const eiter_cyc_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -2072,9 +2019,9 @@ eiter_cyc_max(const void *_eiter) *------------------------------------------------------------------------- */ static int -eiter_cyc_term(void *_eiter) +eiter_cyc_term(void *in_eiter) { - eiter_cyc_t *eiter = (eiter_cyc_t *)_eiter; + eiter_cyc_t *eiter = (eiter_cyc_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -2505,12 +2452,12 @@ main(void) switch (curr_test) { /* "Normal" testing parameters */ case EARRAY_TEST_NORMAL: - puts("Testing with normal parameters"); + HDputs("Testing with normal parameters"); break; /* "Re-open array" testing parameters */ case EARRAY_TEST_REOPEN: - puts("Testing with reopen array flag set"); + HDputs("Testing with reopen array flag set"); tparam.reopen_array = EARRAY_TEST_REOPEN; break; @@ -2539,31 +2486,31 @@ main(void) switch (curr_iter) { /* "Forward" testing parameters */ case EARRAY_ITER_FW: - puts("Testing with forward iteration"); + HDputs("Testing with forward iteration"); tparam.eiter = &ea_iter_fw; break; /* "Reverse" testing parameters */ case EARRAY_ITER_RV: - puts("Testing with reverse iteration"); + HDputs("Testing with reverse iteration"); tparam.eiter = &ea_iter_rv; break; /* "Random" testing parameters */ case EARRAY_ITER_RND: - puts("Testing with random iteration"); + HDputs("Testing with random iteration"); tparam.eiter = &ea_iter_rnd; break; /* "Random #2" testing parameters */ case EARRAY_ITER_RND2: - puts("Testing with random #2 iteration"); + HDputs("Testing with random #2 iteration"); tparam.eiter = &ea_iter_rnd2; break; /* "Cyclic" testing parameters */ case EARRAY_ITER_CYC: - puts("Testing with cyclic iteration"); + HDputs("Testing with cyclic iteration"); tparam.eiter = &ea_iter_cyc; break; @@ -2630,7 +2577,7 @@ main(void) nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -2653,7 +2600,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); return 1; } /* end main() */ diff --git a/test/efc.c b/test/efc.c index 1e702aa..e61eb1b 100644 --- a/test/efc.c +++ b/test/efc.c @@ -2704,7 +2704,7 @@ main(void) nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0); /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -2731,7 +2731,7 @@ error: H5E_END_TRY if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); for (i = 0; i < N_FILENAMES; i++) { HDfree(filename[i]); diff --git a/test/farray.c b/test/farray.c index 6ce534d..81f839f 100644 --- a/test/farray.c +++ b/test/farray.c @@ -492,7 +492,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE } #else /* NDEBUG */ SKIPPED(); - puts(" Not tested when assertions are disabled"); + HDputs(" Not tested when assertions are disabled"); #endif /* NDEBUG */ /* @@ -1782,7 +1782,7 @@ main(void) nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -1805,7 +1805,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); HDexit(EXIT_FAILURE); } /* end main() */ diff --git a/test/fheap.c b/test/fheap.c index 2c888a2..e8cde89 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Friday, February 24, 2006 */ #include "h5test.h" @@ -20,9 +20,9 @@ * This file needs to access private datatypes from the H5HF package. * This file also needs to access the fractal heap testing code. */ -#define H5HF_FRIEND /*suppress error about including H5HFpkg */ +#define H5HF_FRIEND /*suppress error about including H5HFpkg */ #define H5HF_TESTING -#include "H5HFpkg.h" /* Fractal heaps */ +#include "H5HFpkg.h" /* Fractal heaps */ #define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING @@ -30,9 +30,9 @@ /* Other private headers that this test requires */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Max. testfile name length */ #define FHEAP_FILENAME_LEN 1024 @@ -17061,7 +17061,7 @@ main(void) TEST_ERROR /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -17087,7 +17087,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); return 1; } /* end main() */ diff --git a/test/freespace.c b/test/freespace.c index 00b76b2..52fd097 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -2902,7 +2902,7 @@ main(void) HDputs("All free-space tests passed."); /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -2918,7 +2918,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); HDexit(EXIT_FAILURE); } /* main() */ diff --git a/test/gheap.c b/test/gheap.c index 64117f3..95594ee 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Purpose: Tests the global heap. The global heap is the set of all @@ -42,9 +42,9 @@ nerrors++; \ if (nerrors <= GHEAP_REPEATED_ERR_LIM) { \ H5_FAILED(); \ - puts(MSG); \ + HDputs(MSG); \ if (nerrors == GHEAP_REPEATED_ERR_LIM) \ - puts(" Suppressing further errors..."); \ + HDputs(" Suppressing further errors..."); \ } /* end if */ \ } /* end GHEAP_REPEATED_ERR */ @@ -129,7 +129,7 @@ test_1(hid_t fapl) HDputs(" Unable to read object"); nerrors++; } - else if (HDmemcmp(in, out, size)) { + else if (HDmemcmp(in, out, size) != 0) { H5_FAILED(); HDputs(" Value read doesn't match value written"); nerrors++; @@ -229,7 +229,7 @@ test_2(hid_t fapl) HDputs(" Unable to read object"); nerrors++; } - else if (memcmp(in, out, size)) { + else if (HDmemcmp(in, out, size) != 0) { H5_FAILED(); HDputs(" Value read doesn't match value written"); nerrors++; @@ -604,7 +604,7 @@ main(void) HDputs("All global heap tests passed."); /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -619,7 +619,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); HDputs("*** TESTS FAILED ***"); HDexit(EXIT_FAILURE); diff --git a/test/lheap.c b/test/lheap.c index 8b522fe..9bbacbe 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * * Purpose: Test local heaps used by symbol tables (groups). @@ -103,7 +103,7 @@ main(void) if (j > 4) buf[j] = '\0'; - if (UFAIL == (obj[i] = H5HL_insert(f, heap, strlen(buf) + 1, buf))) { + if (UFAIL == (obj[i] = H5HL_insert(f, heap, HDstrlen(buf) + 1, buf))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -155,7 +155,7 @@ main(void) goto error; } - if (strcmp(s, buf)) { + if (HDstrcmp(s, buf) != 0) { H5_FAILED(); HDprintf(" i=%d, heap offset=%lu\n", i, (unsigned long)(obj[i])); HDprintf(" got: \"%s\"\n", s); @@ -201,7 +201,7 @@ main(void) TEST_ERROR /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -219,7 +219,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); return EXIT_FAILURE; } diff --git a/test/mf.c b/test/mf.c index 910fd7c..c53b6f1 100644 --- a/test/mf.c +++ b/test/mf.c @@ -9242,7 +9242,7 @@ main(void) h5_cleanup(FILENAME, fapl); /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -9262,7 +9262,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); return (1); } /* main() */ diff --git a/test/ohdr.c b/test/ohdr.c index 9235f5a..7801b7a 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Tuesday, November 24, 1998 */ #include "h5test.h" @@ -788,7 +788,7 @@ count_attributes(hid_t dset_id) * On success, stores size in `size_out` pointer. */ static herr_t -_oh_getsize(hid_t did, hsize_t *size_out) +oh_getsize(hid_t did, hsize_t *size_out) { H5O_native_info_t ninfo; @@ -811,9 +811,9 @@ oh_compare(hid_t did1, hid_t did2) hsize_t space1 = 0; hsize_t space2 = 0; - if (FAIL == _oh_getsize(did1, &space1)) + if (FAIL == oh_getsize(did1, &space1)) return -1; - if (FAIL == _oh_getsize(did2, &space2)) + if (FAIL == oh_getsize(did2, &space2)) return -2; if (space1 < space2) @@ -915,7 +915,7 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id) /* Read the data back and verify */ if (H5Aread(aid, H5T_NATIVE_CHAR, out_buf) < 0) TEST_ERROR; - if (HDstrcmp(in_buf, out_buf)) + if (HDstrcmp(in_buf, out_buf) != 0) TEST_ERROR; /* modify the string attribute */ @@ -930,7 +930,7 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id) /* Read the data back and verify */ if (H5Aread(aid, H5T_NATIVE_CHAR, out_buf) < 0) TEST_ERROR; - if (HDstrcmp(in_buf, out_buf)) + if (HDstrcmp(in_buf, out_buf) != 0) TEST_ERROR; /* Close */ @@ -1761,8 +1761,8 @@ main(void) env_h5_drvr = "nomatch"; /* Check for VFD which stores data in multiple files */ - single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family")); + single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0); /* Reset library */ h5_reset(); @@ -2034,7 +2034,7 @@ main(void) TEST_ERROR /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -2051,7 +2051,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); return 1; } /* end main() */ diff --git a/test/page_buffer.c b/test/page_buffer.c index 1d5d893..f21c568 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -4182,7 +4182,7 @@ main(void) goto error; /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -4200,8 +4200,7 @@ error: H5E_END_TRY; if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); HDexit(EXIT_FAILURE); - } /* main() */ diff --git a/test/unregister.c b/test/unregister.c index c6da4df..803f8373 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -301,7 +301,7 @@ main(void) HDprintf("All filter unregistration tests passed.\n"); /* Pop API context */ - if (api_ctx_pushed && H5CX_pop() < 0) + if (api_ctx_pushed && H5CX_pop(FALSE) < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; @@ -312,7 +312,7 @@ error: HDprintf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); HDexit(EXIT_FAILURE); } /* end main() */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index c73d032..a8b6d47 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -1253,7 +1253,7 @@ reset_server_counters(void) success = FALSE; nerrors++; if (verbose) { - HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%ld).\n", world_mpi_rank, FUNC, + HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%d).\n", world_mpi_rank, FUNC, actual_total_reads, total_reads); } } @@ -1263,7 +1263,7 @@ reset_server_counters(void) success = FALSE; nerrors++; if (verbose) { - HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%ld).\n", world_mpi_rank, FUNC, + HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%d).\n", world_mpi_rank, FUNC, actual_total_writes, total_writes); } } @@ -1661,7 +1661,7 @@ serve_write_request(struct mssg_t *mssg_ptr) nerrors++; success = FALSE; if (verbose) { - HDfprintf(stdout, "%d:%s: data[i].len = %Zu != mssg->len = %d.\n", world_mpi_rank, FUNC, + HDfprintf(stdout, "%d:%s: data[i].len = %zu != mssg->len = %d.\n", world_mpi_rank, FUNC, data[target_index].len, mssg_ptr->len); } } @@ -1790,11 +1790,11 @@ serve_total_writes_request(struct mssg_t *mssg_ptr) if (success) { - HDfprintf(stdout, "%d request total writes %ld.\n", (int)(mssg_ptr->src), total_writes); + HDfprintf(stdout, "%d request total writes %d.\n", (int)(mssg_ptr->src), total_writes); } else { - HDfprintf(stdout, "%d request total writes %ld -- FAILED.\n", (int)(mssg_ptr->src), total_writes); + HDfprintf(stdout, "%d request total writes %d -- FAILED.\n", (int)(mssg_ptr->src), total_writes); } } @@ -1860,11 +1860,11 @@ serve_total_reads_request(struct mssg_t *mssg_ptr) if (success) { - HDfprintf(stdout, "%d request total reads %ld.\n", (int)(mssg_ptr->src), total_reads); + HDfprintf(stdout, "%d request total reads %d.\n", (int)(mssg_ptr->src), total_reads); } else { - HDfprintf(stdout, "%d request total reads %ld -- FAILED.\n", (int)(mssg_ptr->src), total_reads); + HDfprintf(stdout, "%d request total reads %d -- FAILED.\n", (int)(mssg_ptr->src), total_reads); } } @@ -4181,7 +4181,7 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr) } /* Pop API context */ - H5CX_pop(); + H5CX_pop(FALSE); if (success) { @@ -4393,7 +4393,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes) nerrors++; success = FALSE; if (verbose) { - HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx writes mismatch (%ld/%ld).\n", world_mpi_rank, + HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx writes mismatch (%d/%d).\n", world_mpi_rank, FUNC, (long long)addr, reported_entry_writes, expected_entry_writes); } } @@ -4485,8 +4485,8 @@ verify_total_reads(int expected_total_reads) nerrors++; success = FALSE; if (verbose) { - HDfprintf(stdout, "%d:%s: reported/expected total reads mismatch (%ld/%ld).\n", - world_mpi_rank, FUNC, reported_total_reads, expected_total_reads); + HDfprintf(stdout, "%d:%s: reported/expected total reads mismatch (%ld/%d).\n", world_mpi_rank, + FUNC, reported_total_reads, expected_total_reads); } } } @@ -6513,15 +6513,15 @@ trace_file_check(int metadata_write_strategy) HDfprintf(stdout, "%d:%s: Unexpected data in trace file line %d.\n", world_mpi_rank, FUNC, i); if (expected_line_len == 0) { - HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n", world_mpi_rank, FUNC, + HDfprintf(stdout, "%d:%s: expected = \"%s\" %zu\n", world_mpi_rank, FUNC, "", expected_line_len); - HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n", world_mpi_rank, FUNC, buffer, + HDfprintf(stdout, "%d:%s: actual = \"%s\" %zu\n", world_mpi_rank, FUNC, buffer, actual_line_len); } if (actual_line_len == 0) { - HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n", world_mpi_rank, FUNC, + HDfprintf(stdout, "%d:%s: expected = \"%s\" %zu\n", world_mpi_rank, FUNC, (*expected_output)[i], expected_line_len); - HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n", world_mpi_rank, FUNC, + HDfprintf(stdout, "%d:%s: actual = \"%s\" %zu\n", world_mpi_rank, FUNC, "", actual_line_len); } } @@ -6537,9 +6537,9 @@ trace_file_check(int metadata_write_strategy) if (verbose) { HDfprintf(stdout, "%d:%s: Unexpected data in trace file line %d.\n", world_mpi_rank, FUNC, i); - HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n", world_mpi_rank, FUNC, + HDfprintf(stdout, "%d:%s: expected = \"%s\" %zu\n", world_mpi_rank, FUNC, (*expected_output)[i], expected_line_len); - HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n", world_mpi_rank, FUNC, buffer, + HDfprintf(stdout, "%d:%s: actual = \"%s\" %zu\n", world_mpi_rank, FUNC, buffer, actual_line_len); } } @@ -6868,28 +6868,20 @@ main(int argc, char **argv) * hang in the atexit post processing in which it may try to make MPI * calls. By then, MPI calls may not work. */ - if (H5dont_atexit() < 0) { + if (H5dont_atexit() < 0) HDprintf("%d:Failed to turn off atexit processing. Continue.\n", mpi_rank); - }; + H5open(); express_test = do_express_test(); -#if 0 /* JRM */ - express_test = 0; -#endif /* JRM */ - if (express_test) { - + if (express_test) virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES; - } - else { - + else virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES; - } #ifdef H5_HAVE_MPE - if (MAINPROCESS) { + if (MAINPROCESS) HDprintf(" Tests compiled for MPE.\n"); - } virt_num_data_entries = MPE_VIRT_NUM_DATA_ENTIES; #endif /* H5_HAVE_MPE */ @@ -6902,11 +6894,8 @@ main(int argc, char **argv) } if (mpi_size < 3) { - - if (MAINPROCESS) { - + if (MAINPROCESS) HDprintf(" Need at least 3 processes. Exiting.\n"); - } goto finish; } @@ -6924,27 +6913,22 @@ main(int argc, char **argv) /* setup file access property list with the world communicator */ if (FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS))) { nerrors++; - if (verbose) { + if (verbose) HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n", world_mpi_rank, FUNC); - } } if (H5Pset_fapl_mpio(fapl, world_mpi_comm, MPI_INFO_NULL) < 0) { - nerrors++; - if (verbose) { + if (verbose) HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 1.\n", world_mpi_rank, FUNC); - } } /* fix the file names */ for (u = 0; u < sizeof(FILENAME) / sizeof(FILENAME[0]) - 1; ++u) { if (h5_fixname(FILENAME[u], fapl, filenames[u], sizeof(filenames[u])) == NULL) { - nerrors++; - if (verbose) { + if (verbose) HDfprintf(stdout, "%d:%s: h5_fixname() failed.\n", world_mpi_rank, FUNC); - } break; } } @@ -6952,9 +6936,8 @@ main(int argc, char **argv) /* close the fapl before we set it up again */ if (H5Pclose(fapl) < 0) { nerrors++; - if (verbose) { + if (verbose) HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n", world_mpi_rank, FUNC); - } } /* now create the fapl again, excluding the server process. */ @@ -6963,32 +6946,25 @@ main(int argc, char **argv) /* setup file access property list */ if (FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS))) { nerrors++; - if (verbose) { + if (verbose) HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n", world_mpi_rank, FUNC); - } } if (H5Pset_fapl_mpio(fapl, file_mpi_comm, MPI_INFO_NULL) < 0) { - nerrors++; - if (verbose) { + if (verbose) HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n", world_mpi_rank, FUNC); - } } } setup_rand(); max_nerrors = get_max_nerrors(); - if (max_nerrors != 0) { /* errors in setup -- no point in continuing */ - - if (world_mpi_rank == 0) { - + if (world_mpi_rank == 0) HDfprintf(stdout, "Errors in test initialization. Exiting.\n"); - } goto finish; } diff --git a/testpar/t_file.c b/testpar/t_file.c index d948804..ec8726f 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -288,7 +288,7 @@ test_page_buffer_access(void) /* Pop API context */ if (api_ctx_pushed) { - ret = H5CX_pop(); + ret = H5CX_pop(FALSE); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } @@ -422,7 +422,7 @@ test_page_buffer_access(void) /* Pop API context */ if (api_ctx_pushed) { - ret = H5CX_pop(); + ret = H5CX_pop(FALSE); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } @@ -579,7 +579,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str /* Pop API context */ if (api_ctx_pushed) { - ret = H5CX_pop(); + ret = H5CX_pop(FALSE); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } @@ -743,7 +743,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, hsize_t /* Pop API context */ if (api_ctx_pushed) { - ret = H5CX_pop(); + ret = H5CX_pop(FALSE); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index b38c92f..ae5b0e5 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -15,7 +15,7 @@ * * Created: debug.c * Jul 18 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Debugs an existing HDF5 file at a low level. * @@ -67,7 +67,6 @@ * Return: Non-NULL on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -149,7 +148,6 @@ get_H5B2_class(const uint8_t *sig) * Return: Non-NULL on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -191,7 +189,6 @@ get_H5EA_class(const uint8_t *sig) * Return: Non-NULL on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -233,7 +230,6 @@ get_H5FA_class(const uint8_t *sig) * Failure: exit (non-zero) * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- @@ -250,8 +246,8 @@ main(int argc, char *argv[]) haddr_t extra[10]; uint8_t sig[H5F_SIGNATURE_LEN]; size_t u; - H5E_auto2_t func; - void * edata; + H5E_auto2_t func = NULL; + void * edata = NULL; hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t status = SUCCEED; int exit_value = 0; @@ -825,7 +821,7 @@ done: /* Pop API context */ if (api_ctx_pushed) - H5CX_pop(); + H5CX_pop(FALSE); H5Eset_auto2(H5E_DEFAULT, func, edata); -- cgit v0.12 From 94ecd14100c226ae16ba8e6122e8a025b408f360 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 7 Apr 2021 19:07:31 -0700 Subject: Brings many CMake changes from develop --- CMakeFilters.cmake | 30 +++- CMakeInstallation.cmake | 40 +++-- CMakeLists.txt | 135 +++++++++++------ CMakePlugins.cmake | 56 +++++++ CTestConfig.cmake | 2 +- MANIFEST | 7 + c++/examples/CMakeLists.txt | 22 ++- c++/src/CMakeLists.txt | 25 +++- c++/test/CMakeLists.txt | 13 +- config/cmake/ConfigureChecks.cmake | 25 +++- config/cmake/H5pubconf.h.in | 28 +++- config/cmake/HDF5PluginCache.cmake | 29 ++++ config/cmake/HDF5PluginMacros.cmake | 108 ++++++++++++++ config/cmake/HDF5UseFortran.cmake | 44 ++++-- config/cmake/HDF5_Examples_options.cmake | 4 + config/cmake/HDFCXXCompilerFlags.cmake | 8 + config/cmake/HDFCompilerFlags.cmake | 14 ++ config/cmake/HDFFortranCompilerFlags.cmake | 16 +- config/cmake/README.txt.cmake.in | 12 ++ config/cmake/cacheinit.cmake | 128 +++++++++++++++- config/cmake/fileCompareTest.cmake | 27 ++-- config/cmake/hdf5-config-version.cmake.in | 2 +- config/cmake/hdf5-config.cmake.in | 1 + config/cmake/jrunTest.cmake | 6 +- config/cmake/jvolTest.cmake | 6 +- config/cmake/scripts/HDF5config.cmake | 7 +- config/cmake/scripts/HDF5options.cmake | 2 + config/cmake_ext_mod/ConfigureChecks.cmake | 76 ++++++---- config/cmake_ext_mod/FindSZIP.cmake | 4 +- config/cmake_ext_mod/HDFCXXTests.cpp | 56 ------- config/cmake_ext_mod/HDFLibMacros.cmake | 15 +- config/cmake_ext_mod/HDFMacros.cmake | 51 +++++-- config/cmake_ext_mod/HDFTests.c | 2 +- config/cmake_ext_mod/HDFUseCXX.cmake | 17 ++- config/cmake_ext_mod/HDFUseFortran.cmake | 16 +- config/cmake_ext_mod/grepTest.cmake | 14 +- config/cmake_ext_mod/runTest.cmake | 6 +- config/libhdf5.pc.in | 14 ++ config/sanitizer/formatting.cmake | 92 ++++++++++++ config/sanitizer/tools.cmake | 9 +- doc/branches-explained.md | 41 ++++++ doc/contributing.md | 86 +++++++++++ examples/CMakeLists.txt | 18 ++- fortran/examples/CMakeLists.txt | 12 +- fortran/src/CMakeLists.txt | 39 +++-- fortran/test/CMakeLists.txt | 21 ++- hl/CMakeLists.txt | 6 +- hl/c++/examples/CMakeLists.txt | 9 +- hl/c++/src/CMakeLists.txt | 24 ++- hl/c++/test/CMakeLists.txt | 9 +- hl/examples/CMakeLists.txt | 9 +- hl/fortran/src/CMakeLists.txt | 69 ++++++++- hl/src/CMakeLists.txt | 29 +++- hl/src/H5LTparse.y | 104 ++++++------- hl/test/CMakeLists.txt | 36 ++++- hl/tools/gif2h5/CMakeLists.txt | 39 ++++- hl/tools/h5watch/CMakeLists.txt | 42 +++++- java/CMakeLists.txt | 10 +- java/examples/Makefile.am | 1 - java/examples/datasets/CMakeLists.txt | 2 +- java/examples/datasets/Makefile.am | 1 - java/examples/datatypes/CMakeLists.txt | 2 +- java/examples/datatypes/Makefile.am | 1 - java/examples/groups/CMakeLists.txt | 2 +- java/examples/groups/JavaGroupExample.sh.in | 1 - java/examples/groups/Makefile.am | 1 - java/examples/intro/CMakeLists.txt | 2 +- java/examples/intro/Makefile.am | 1 - java/src/jni/CMakeLists.txt | 9 +- java/test/CMakeLists.txt | 6 +- java/test/junit.sh.in | 1 - src/CMakeLists.txt | 81 ++++++---- test/CMakeLists.txt | 220 +++++++++++++++++++++++++--- test/CMakePassthroughVOLTests.cmake | 4 +- test/CMakeTests.cmake | 17 ++- test/H5srcdir.h | 6 +- testpar/CMakeLists.txt | 22 ++- tools/lib/CMakeLists.txt | 17 ++- tools/libtest/CMakeLists.txt | 9 +- tools/src/h5copy/CMakeLists.txt | 15 +- tools/src/h5diff/CMakeLists.txt | 21 ++- tools/src/h5dump/CMakeLists.txt | 25 +++- tools/src/h5format_convert/CMakeLists.txt | 15 +- tools/src/h5import/CMakeLists.txt | 19 ++- tools/src/h5jam/CMakeLists.txt | 21 ++- tools/src/h5ls/CMakeLists.txt | 15 +- tools/src/h5repack/CMakeLists.txt | 16 +- tools/src/h5stat/CMakeLists.txt | 15 +- tools/src/misc/CMakeLists.txt | 33 ++++- tools/test/h5copy/CMakeLists.txt | 19 ++- tools/test/h5diff/CMakeLists.txt | 18 ++- tools/test/h5dump/CMakeLists.txt | 18 ++- tools/test/h5dump/CMakeTests.cmake | 2 +- tools/test/h5format_convert/CMakeLists.txt | 18 ++- tools/test/h5import/CMakeLists.txt | 9 +- tools/test/h5jam/CMakeLists.txt | 21 ++- tools/test/h5ls/CMakeLists.txt | 10 +- tools/test/h5repack/CMakeLists.txt | 26 +++- tools/test/h5repack/CMakeTests.cmake | 46 +++++- tools/test/h5stat/CMakeLists.txt | 9 +- tools/test/misc/CMakeLists.txt | 36 ++++- tools/test/misc/vds/CMakeLists.txt | 13 +- tools/test/perform/CMakeLists.txt | 129 ++++++++++++---- utils/mirror_vfd/CMakeLists.txt | 30 +++- 104 files changed, 2211 insertions(+), 566 deletions(-) create mode 100644 CMakePlugins.cmake create mode 100644 config/cmake/HDF5PluginCache.cmake create mode 100644 config/cmake/HDF5PluginMacros.cmake create mode 100644 config/libhdf5.pc.in create mode 100644 config/sanitizer/formatting.cmake create mode 100644 doc/branches-explained.md create mode 100644 doc/contributing.md diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index b3df96d..d5f801e 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -12,6 +12,8 @@ option (USE_LIBAEC "Use AEC library as SZip Filter" OFF) include (ExternalProject) +include (FetchContent) + #option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO") set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)") set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) @@ -30,7 +32,9 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) if (NOT EXISTS "${ZLIB_URL}") set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE) - message (STATUS "Filter ZLIB file ${ZLIB_URL} not found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter ZLIB file ${ZLIB_URL} not found") + endif () endif () set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) if (USE_LIBAEC) @@ -38,7 +42,9 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT endif () if (NOT EXISTS "${SZIP_URL}") set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE) - message (STATUS "Filter SZIP file ${SZIP_URL} not found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter SZIP file ${SZIP_URL} not found") + endif () endif () else () set (ZLIB_USE_EXTERNAL 0) @@ -74,7 +80,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) set (H5_HAVE_LIBZ 1) - message (STATUS "Filter ZLIB is built") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter ZLIB is built") + endif () else () message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") endif () @@ -90,7 +98,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) endif () set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) - message (STATUS "Filter ZLIB is ON") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter ZLIB is ON") + endif () endif () #----------------------------------------------------------------------------- @@ -120,9 +130,13 @@ if (HDF5_ENABLE_SZIP_SUPPORT) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) set (H5_HAVE_LIBSZ 1) - message (STATUS "Filter SZIP is built") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter SZIP is built") + endif () if (USE_LIBAEC) - message (STATUS "... with library AEC") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "... with library AEC") + endif () set (SZ_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME}) else () set (SZ_PACKAGE_NAME ${SZIP_PACKAGE_NAME}) @@ -133,7 +147,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) endif () set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) - message (STATUS "Filter SZIP is ON") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter SZIP is ON") + endif () if (H5_HAVE_FILTER_SZIP) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") endif () diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 05c2765..bff0c49 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -53,7 +53,7 @@ endif () #----------------------------------------------------------------------------- set (HDF5_INCLUDES_BUILD_TIME ${HDF5_SRC_DIR} ${HDF5_CPP_SRC_DIR} ${HDF5_HL_SRC_DIR} - ${HDF5_TOOLS_SRC_DIR} ${HDF5_BINARY_DIR} + ${HDF5_TOOLS_SRC_DIR} ${HDF5_SRC_BINARY_DIR} ) #----------------------------------------------------------------------------- @@ -128,10 +128,10 @@ else () endif () configure_file ( ${HDF_RESOURCES_DIR}/libhdf5.settings.cmake.in - ${HDF5_BINARY_DIR}/libhdf5.settings ESCAPE_QUOTES @ONLY + ${HDF5_SRC_BINARY_DIR}/libhdf5.settings ESCAPE_QUOTES @ONLY ) install ( - FILES ${HDF5_BINARY_DIR}/libhdf5.settings + FILES ${HDF5_SRC_BINARY_DIR}/libhdf5.settings DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries ) @@ -189,7 +189,7 @@ HDF_README_PROPERTIES(HDF5_BUILD_FORTRAN) #----------------------------------------------------------------------------- # Configure the COPYING.txt file for the windows binary package #----------------------------------------------------------------------------- -if (WIN32 OR MINGW) +if (WIN32) configure_file (${HDF5_SOURCE_DIR}/COPYING ${HDF5_BINARY_DIR}/COPYING.txt @ONLY) endif () @@ -208,7 +208,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${HDF5_SOURCE_DIR}/release_docs/COPYING ${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt ) - if (WIN32 OR MINGW) + if (WIN32) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt @@ -222,7 +222,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt ${HDF5_SOURCE_DIR}/release_docs/INSTALL ) - if (WIN32 OR MINGW) + if (WIN32) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt @@ -249,19 +249,6 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) endif () endif () -if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - if (CMAKE_HOST_UNIX) - set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" - CACHE PATH "Install path prefix, prepended onto install directories." FORCE) - else () - GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) - set (CMAKE_INSTALL_PREFIX - "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" - CACHE PATH "Install path prefix, prepended onto install directories." FORCE) - set (CMAKE_GENERIC_PROGRAM_FILES) - endif () -endif () - #----------------------------------------------------------------------------- # Set the cpack variables #----------------------------------------------------------------------------- @@ -278,7 +265,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_VERSION_PATCH "") if (EXISTS "${HDF5_SOURCE_DIR}/release_docs") set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") + set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") endif () set (CPACK_PACKAGE_RELOCATABLE TRUE) @@ -290,7 +277,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.bmp") set (CPACK_GENERATOR "TGZ") - if (WIN32 OR MINGW) + if (WIN32) set (CPACK_GENERATOR "ZIP") if (NSIS_EXECUTABLE) @@ -455,7 +442,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut if (HDF5_PACKAGE_EXTLIBS) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - if (WIN32 OR MINGW) + if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/") else () set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") @@ -464,7 +451,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut endif () endif () if (SZIP_FOUND AND SZIP_USE_EXTERNAL) - if (WIN32 OR MINGW) + if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;ALL;/") else () set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") @@ -472,6 +459,13 @@ The HDF5 data model, file format, API, library, and tools are open and distribut set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") endif () endif () + if (PLUGIN_FOUND AND PLUGIN_USE_EXTERNAL) + if (WIN32) + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PLUGIN_BINARY_DIR};PLUGIN;ALL;/") + else () + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PLUGIN_BINARY_DIR};PLUGIN;libraries;/") + endif () + endif () endif () endif () diff --git a/CMakeLists.txt b/CMakeLists.txt index b6e0044..e34830b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,9 +42,8 @@ set (CMAKE_IGNORE_EOL "--ignore-eol") if (CMAKE_VERSION VERSION_LESS "3.14.0") set (CMAKE_IGNORE_EOL "") if (WIN32) - message (FATAL_ERROR "Windows builds requires a minimum of CMake 3.14") + message (FATAL_ERROR "Windows builds require a minimum of CMake 3.14") endif() -else () endif () #----------------------------------------------------------------------------- @@ -72,6 +71,13 @@ mark_as_advanced (HDF5_EXTERNAL_LIB_PREFIX) # If the parent project needs to install hdf libraries, but avoid # name conflicts with system versions, then a prefix may be added # to ensure that the correct versions configured are used. +set (HDF5_LIB_INFIX "" CACHE STRING "Use infix for custom library naming.") +mark_as_advanced (HDF5_LIB_INFIX) +# HDF5_LIB_INFIX : +# This infix is added to all library names after 'hdf5'. +# e.g. the infix '_openmpi' results in the library name 'libhdf5_openmpi.so' +# This name is used in packages on debian based systems. +# (see https://packages.debian.org/jessie/amd64/libhdf5-openmpi-8/filelist) # # HDF5_INSTALL_BIN_DIR, HDF5_INSTALL_LIB_DIR, HDF5_INSTALL_INCLUDE_DIR, HDF5_INSTALL_DATA_DIR : # Customize the 'bin', 'lib', 'include', and 'share' installation directories. @@ -131,20 +137,20 @@ mark_as_advanced (ALLOW_UNSUPPORTED) #----------------------------------------------------------------------------- # Set the core names of all the libraries #----------------------------------------------------------------------------- -set (HDF5_LIB_CORENAME "hdf5") -set (HDF5_TEST_LIB_CORENAME "hdf5_test") -set (HDF5_CPP_LIB_CORENAME "hdf5_cpp") -set (HDF5_HL_LIB_CORENAME "hdf5_hl") -set (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp") -set (HDF5_TOOLS_LIB_CORENAME "hdf5_tools") -set (HDF5_UTILS_LIB_CORENAME "hdf5_utils") -set (HDF5_F90_LIB_CORENAME "hdf5_fortran") -set (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub") -set (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran") -set (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub") -set (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran") -set (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub") -set (HDF5_JAVA_JNI_LIB_CORENAME "hdf5_java") +set (HDF5_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}") +set (HDF5_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test") +set (HDF5_CPP_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_cpp") +set (HDF5_HL_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl") +set (HDF5_HL_CPP_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_cpp") +set (HDF5_TOOLS_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_tools") +set (HDF5_UTILS_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_utils") +set (HDF5_F90_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_fortran") +set (HDF5_F90_C_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_f90cstub") +set (HDF5_F90_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test_fortran") +set (HDF5_F90_C_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test_f90cstub") +set (HDF5_HL_F90_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_fortran") +set (HDF5_HL_F90_C_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_f90cstub") +set (HDF5_JAVA_JNI_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_java") set (HDF5_JAVA_HDF5_LIB_CORENAME "jarhdf5") set (HDF5_JAVA_TEST_LIB_CORENAME "jartest5") @@ -204,6 +210,7 @@ set (HDF5_HL_F90_C_LIBSH_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-shared") #----------------------------------------------------------------------------- # Define some CMake variables for use later in the project #----------------------------------------------------------------------------- +set (HDF_CONFIG_DIR ${HDF5_SOURCE_DIR}/config) set (HDF_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake) set (HDF_RESOURCES_EXT_DIR ${HDF5_SOURCE_DIR}/config/cmake_ext_mod) set (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) @@ -236,9 +243,11 @@ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MINOR ${_h5public_h_contents}) string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" "\\1" H5_VERS_RELEASE ${_h5public_h_contents}) -string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*)\".*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._-]*)\".*$" "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents}) -#message (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") +endif () #----------------------------------------------------------------------------- # parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO @@ -251,7 +260,9 @@ string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_LIB_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_LIB_SOVERS_MAJOR ${H5_LIB_SOVERS_INTERFACE}-${H5_LIB_SOVERS_RELEASE}) -message (STATUS "SOVERSION: ${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION: ${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") +endif () string (REGEX MATCH ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_TOOLS_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_TOOLS_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" @@ -261,7 +272,9 @@ if (H5_TOOLS_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_TOOLS_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) - message (STATUS "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") + endif () endif () string (REGEX MATCH ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_CXX_SOVERS_EXISTS) @@ -272,7 +285,9 @@ if (H5_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) - message (STATUS "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") + endif () endif () string (REGEX MATCH ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_F_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_F_SOVERS_EXISTS) @@ -283,7 +298,9 @@ if (H5_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) - message (STATUS "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") + endif () endif () string (REGEX MATCH ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_HL_SOVERS_EXISTS) @@ -294,7 +311,9 @@ if (H5_HL_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) - message (STATUS "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") + endif () endif () string (REGEX MATCH ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_HL_CXX_SOVERS_EXISTS) @@ -305,7 +324,9 @@ if (H5_HL_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) - message (STATUS "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") + endif () endif () string (REGEX MATCH ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_F_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_HL_F_SOVERS_EXISTS) @@ -316,7 +337,9 @@ if (H5_HL_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) - message (STATUS "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") + endif () endif () string (REGEX MATCH ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_JAVA_SOVERS_EXISTS ${_lt_vers_am_contents}) if(H5_JAVA_SOVERS_EXISTS) @@ -327,7 +350,9 @@ if(H5_JAVA_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_JAVA_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_JAVA_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_JAVA_SOVERS_MAJOR ${H5_JAVA_SOVERS_INTERFACE}-${H5_JAVA_SOVERS_RELEASE}) - message (STATUS "SOVERSION_JAVA: ${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_JAVA: ${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") + endif () endif () #----------------------------------------------------------------------------- @@ -339,9 +364,11 @@ set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}" set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") if (H5_VERS_SUBRELEASE) - set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}.${H5_VERS_SUBRELEASE}") + set (HDF5_RELEASE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") else () set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") + set (HDF5_RELEASE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") endif () set (HDF5_LIB_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") set (HDF5_LIB_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") @@ -407,6 +434,7 @@ include (${HDF_RESOURCES_EXT_DIR}/HDFMacros.cmake) HDF_DIR_PATHS(${HDF5_PACKAGE_NAME}) include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake) +include (${HDF_RESOURCES_DIR}/HDF5PluginMacros.cmake) include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) #----------------------------------------------------------------------------- @@ -495,6 +523,9 @@ endif () if (HDF5_ENABLE_SANITIZERS) include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake) endif () +if (HDF5_ENABLE_FORMATTERS) + include (${HDF5_SOURCE_DIR}/config/sanitizer/formatting.cmake) +endif () #----------------------------------------------------------------------------- # Option to use code coverage @@ -566,12 +597,15 @@ endif () # Certain systems may add /Debug or /Release to output paths # and we need to call the executable from inside the CMake configuration #----------------------------------------------------------------------------- -set (EXE_EXT "") -if (WIN32 OR MINGW) - set (EXE_EXT ".exe") - add_compile_definitions (_BIND_TO_CURRENT_VCLIBS_VERSION=1 _CRT_SECURE_NO_WARNINGS _CONSOLE) +if (WIN32) + add_compile_definitions (_CRT_SECURE_NO_WARNINGS) + if (MSVC) + add_compile_definitions (_BIND_TO_CURRENT_VCLIBS_VERSION=1 _CONSOLE) + endif () endif () +option (HDF5_MINGW_STATIC_GCC_LIBS "Statically link libgcc/libstdc++" OFF) + if (MSVC) set (CMAKE_MFC_FLAG 0) set (WIN_COMPILE_FLAGS "") @@ -579,7 +613,7 @@ if (MSVC) endif () set (MAKE_SYSTEM) -if (CMAKE_BUILD_TOOL MATCHES "make") +if (CMAKE_MAKE_PROGRAM MATCHES "make") set (MAKE_SYSTEM 1) endif () @@ -771,40 +805,52 @@ endif () option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF) if (HDF5_ENABLE_THREADSAFE) # check for unsupported options - if (WIN32 OR MINGW) - message (STATUS " **** thread-safety option not supported with static library **** ") - message (STATUS " **** thread-safety option will not be used building static library **** ") + if (WIN32) + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** thread-safety option not supported with static library **** ") + message (VERBOSE " **** thread-safety option will not be used building static library **** ") + endif () endif () if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** parallel and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported parallel and thread-safety options **** ") + endif () endif () endif () if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Fortran and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported Fortran and thread-safety options **** ") + endif () endif () endif () if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** C++ and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported C++ and thread-safety options **** ") + endif () endif () endif () if (HDF5_BUILD_HL_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** HL and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported HL and thread-safety options **** ") + endif () endif () endif () if (H5_HAVE_IOEO) - message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") + endif () set (H5_HAVE_WIN_THREADS 1) else () if (NOT H5_HAVE_PTHREAD_H) @@ -1032,16 +1078,15 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported Parallel and C++ options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported Parallel and C++ options **** ") + endif () endif () endif () include (${HDF_RESOURCES_EXT_DIR}/HDFUseCXX.cmake) include (${HDF_RESOURCES_DIR}/HDFCXXCompilerFlags.cmake) - if (CMAKE_NO_STD_NAMESPACE) - set (H5_NO_STD 1) - endif () add_subdirectory (c++) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") @@ -1075,7 +1120,7 @@ endif () #----------------------------------------------------------------------------- # Generate the H5pubconf.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -configure_file (${HDF_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY) +configure_file (${HDF_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_SRC_BINARY_DIR}/H5pubconf.h @ONLY) #----------------------------------------------------------------------------- # Options for use by cross compiling and toolchains diff --git a/CMakePlugins.cmake b/CMakePlugins.cmake new file mode 100644 index 0000000..16fb874 --- /dev/null +++ b/CMakePlugins.cmake @@ -0,0 +1,56 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://www.hdfgroup.org/licenses. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +include (ExternalProject) +#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO") +set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)") +set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + option (PLUGIN_USE_EXTERNAL "Use External Library Building for filter PLUGIN" 1) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + set (PLUGIN_URL ${PLUGIN_GIT_URL} CACHE STRING "Path to PLUGIN git repository") + set (PLUGIN_BRANCH ${PLUGIN_GIT_BRANCH}) + elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (NOT TGZPATH) + set (TGZPATH ${HDF5_SOURCE_DIR}) + endif () + set (PLUGIN_URL ${TGZPATH}/${PLUGIN_TGZ_NAME}) + if (NOT EXISTS "${PLUGIN_URL}") + set (HDF5_ENABLE_PLUGIN_SUPPORT OFF CACHE BOOL "" FORCE) + message (STATUS "Filter PLUGIN file ${PLUGIN_URL} not found") + endif () + else () + set (PLUGIN_USE_EXTERNAL 0) + endif () +endif () + +#----------------------------------------------------------------------------- +# Option for PLUGIN support +#----------------------------------------------------------------------------- +option (HDF5_ENABLE_PLUGIN_SUPPORT "Enable PLUGIN Filters" OFF) +if (HDF5_ENABLE_PLUGIN_SUPPORT) + if (NOT PLUGIN_USE_EXTERNAL) + find_package (PLUGIN NAMES ${PLUGIN_PACKAGE_NAME}${HDF_PACKAGE_EXT}) + if (NOT PLUGIN_FOUND) + find_package (PLUGIN) # Legacy find + endif () + endif () + if (NOT PLUGIN_FOUND) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + EXTERNAL_PLUGIN_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) + message (STATUS "Filter PLUGIN is built") + else () + message (FATAL_ERROR " PLUGIN is Required for PLUGIN support in HDF5") + endif () + endif () + message (STATUS "Filter PLUGIN is ON") +endif () diff --git a/CTestConfig.cmake b/CTestConfig.cmake index b85b0c3..85df0b8 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -18,7 +18,7 @@ set (CTEST_PROJECT_NAME "HDF5") set (CTEST_NIGHTLY_START_TIME "18:00:00 CST") -set (CTEST_DROP_METHOD "http") +set (CTEST_DROP_METHOD "https") if (CTEST_DROP_SITE_INIT) set (CTEST_DROP_SITE "${CTEST_DROP_SITE_INIT}") else () diff --git a/MANIFEST b/MANIFEST index c93d5ac..3c31fde 100644 --- a/MANIFEST +++ b/MANIFEST @@ -135,6 +135,7 @@ ./config/ibm-flags ./config/intel-fflags ./config/intel-flags +./config/libhdf5.pc.in ./config/linux-gnu ./config/linux-gnuaout ./config/linux-gnueabihf @@ -197,6 +198,7 @@ ./config/site-specific/BlankForm +./doc/branches-explained.md ./doc/SWMR_Example.png ./doc/SWMRdataflow.png ./doc/VFD_SWMR_Punch_List.md @@ -205,6 +207,7 @@ ./doc/VFD_SWMR_RFC_2020-02-03.docx ./doc/vfd-swmr-user-guide.md ./doc/code-conventions.md +./doc/contributing.md ./examples/Attributes.txt ./examples/Makefile.am @@ -3481,6 +3484,8 @@ ./config/cmake/HDFFortranCompilerFlags.cmake ./config/cmake/HDF5_Process_Flex_Files.cmake ./config/cmake/HDF5Macros.cmake +./config/cmake/HDF5PluginMacros.cmake +./config/cmake/HDF5PluginCache.cmake ./config/cmake/HDF5UseFortran.cmake ./config/cmake/jrunTest.cmake ./config/cmake/jvolTest.cmake @@ -3528,6 +3533,7 @@ ./CMakeLists.txt ./CMakeFilters.cmake ./CMakeInstallation.cmake +./CMakePlugins.cmake ./CTestConfig.cmake ./UserMacros.cmake ./c++/CMakeLists.txt @@ -3641,6 +3647,7 @@ # CMake-specific Sanitizer Scripts ./config/sanitizer/code-coverage.cmake +./config/sanitizer/formatting.cmake ./config/sanitizer/sanitizers.cmake ./config/sanitizer/tools.cmake ./config/sanitizer/LICENSE diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 890d22d..c50315f 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -34,38 +34,52 @@ set (tutr_examples foreach (example ${examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) else () TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - if (MINGW) + if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) target_link_options (${HDF5_CPP_LIBSH_TARGET} PRIVATE -static-libgcc -static-libstdc++ ) endif () endif () set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_CPP_EXAMPLES_${example}_FORMAT cpp_ex_${example}) + endif () endforeach () foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) else () TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - if (MINGW) + if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) target_link_options (${HDF5_CPP_LIBSH_TARGET} PRIVATE -static-libgcc -static-libstdc++ ) endif () endif () set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_CPP_EXAMPLES_${example}_FORMAT cpp_ex_${example}) + endif () endforeach () if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 058f457..8608c67 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -5,7 +5,7 @@ project (HDF5_CPP_SRC CXX) # Generate configure file #----------------------------------------------------------------------------- configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in - ${HDF5_BINARY_DIR}/H5cxx_pubconf.h + ${HDF5_SRC_BINARY_DIR}/H5cxx_pubconf.h ) #----------------------------------------------------------------------------- @@ -87,7 +87,7 @@ set (CPP_HDRS if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) target_include_directories (${HDF5_CPP_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_CPP_LIB_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") @@ -105,7 +105,7 @@ endif () if (BUILD_SHARED_LIBS) add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS}) target_include_directories (${HDF5_CPP_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_CPP_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") @@ -117,7 +117,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_CPP_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET} ) - if (MINGW) + if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) target_link_options (${HDF5_CPP_LIBSH_TARGET} PRIVATE -static-libgcc -static-libstdc++ ) @@ -129,6 +129,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_CPP_SRC_FORMAT ${HDF5_CPP_LIB_TARGET}) + else () + clang_format (HDF5_CPP_SRC_FORMAT ${HDF5_CPP_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- install ( @@ -183,11 +194,11 @@ if (BUILD_SHARED_LIBS) set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_CPP_LIB_CORENAME}") endif () -set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}") -set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index ca2295e..1255e39 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -37,8 +37,8 @@ set (CPP_TEST_SOURCES set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ) -target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ${HDF5_CPP_TEST_SOURCE_DIR}/h5cpputil.h) +target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(cpp_testhdf5 PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_compile_definitions(cpp_testhdf5 PRIVATE $<$:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings @@ -49,7 +49,7 @@ if (NOT BUILD_SHARED_LIBS) else () TARGET_C_PROPERTIES (cpp_testhdf5 SHARED) target_link_libraries (cpp_testhdf5 PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET}) - if (MINGW) + if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) target_link_options (${HDF5_CPP_LIBSH_TARGET} PRIVATE -static-libgcc -static-libstdc++ ) @@ -57,6 +57,13 @@ else () endif () set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_CPP_TEST_cpp_testhdf5_FORMAT cpp_testhdf5) +endif () + if (HDF5_TEST_CPP AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 4e31b38..0d82668 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -165,14 +165,18 @@ if (NOT WINDOWS) add_definitions ("-D_GNU_SOURCE") else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif () else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) @@ -192,7 +196,7 @@ option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF) list (APPEND LINK_LIBS ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) INCLUDE_DIRECTORIES (${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) else () - message (STATUS "The Read-Only S3 VFD was requested but cannot be built.\nPlease check that openssl and cURL are available on your\nsystem, and/or re-configure without option HDF5_ENABLE_ROS3_VFD.") + message (WARNING "The Read-Only S3 VFD was requested but cannot be built.\nPlease check that openssl and cURL are available on your\nsystem, and/or re-configure without option HDF5_ENABLE_ROS3_VFD.") endif () endif () @@ -209,7 +213,7 @@ if (H5FD_ENABLE_MIRROR_VFD) ${HDF_PREFIX}_HAVE_FORK) set (${HDF_PREFIX}_HAVE_MIRROR_VFD 1) else() - message(STATUS "The socket-based Mirror VFD was requested but cannot be built. System prerequisites are not met.") + message(WARNING "The socket-based Mirror VFD was requested but cannot be built. System prerequisites are not met.") endif() endif() @@ -235,7 +239,6 @@ endif () #----------------------------------------------------------------------------- macro (H5ConversionTests TEST msg) if (NOT DEFINED ${TEST}) - # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_DIR}/ConversionTests.c @@ -245,17 +248,23 @@ macro (H5ConversionTests TEST msg) if (${TEST}_COMPILE) if (${TEST}_RUN MATCHES 0) set (${TEST} 1 CACHE INTERNAL ${msg}) - message (STATUS "${msg}... yes") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... yes") + endif () else () set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif () else () set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 62cfcab..bf24776 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -26,9 +26,6 @@ /* Define if using a Windows compiler (i.e. Visual Studio) */ #cmakedefine H5_HAVE_VISUAL_STUDIO @H5_HAVE_VISUAL_STUDIO@ -/* Define if building universal (internal helper macro) */ -#cmakedefine H5_AC_APPLE_UNIVERSAL_BUILD @H5_AC_APPLE_UNIVERSAL_BUILD@ - /* Define if C++ compiler recognizes offsetof */ #cmakedefine H5_CXX_HAVE_OFFSETOF @CXX_HAVE_OFFSETOF@ @@ -524,7 +521,7 @@ #cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ /* Define to enable internal memory allocation sanity checking. */ -/* #cmakedefine H5_MEMORY_ALLOC_SANITY_CHECK @H5_MEMORY_ALLOC_SANITY_CHECK@ ** Define in CMakeLists.txt */ +#cmakedefine H5_MEMORY_ALLOC_SANITY_CHECK @H5_MEMORY_ALLOC_SANITY_CHECK@ /* Define if we can violate pointer alignment restrictions */ #cmakedefine H5_NO_ALIGNMENT_RESTRICTIONS @H5_NO_ALIGNMENT_RESTRICTIONS@ @@ -614,6 +611,7 @@ #cmakedefine H5_SIZEOF_INT_LEAST8_T @H5_SIZEOF_INT_LEAST8_T@ #if !defined(__APPLE__) + /* The size of `size_t', as computed by sizeof. */ #cmakedefine H5_SIZEOF_SIZE_T @H5_SIZEOF_SIZE_T@ @@ -623,8 +621,17 @@ /* The size of `long', as computed by sizeof. */ #cmakedefine H5_SIZEOF_LONG @H5_SIZEOF_LONG@ +/* The size of `long double', as computed by sizeof. */ +#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + #else - # if defined(__LP64__) && __LP64__ + + /* On Apple, to support Universal Binaries (where multiple CPU + architectures exist in one library/executable), we can't assume + the machine doing the compiling has the same endianness or type + sizes as all the various architectures (PowerPC, Intel, ARM). */ + + # if defined(__LP64__) && __LP64__ #define H5_SIZEOF_LONG 8 #define H5_SIZEOF_SIZE_T 8 #define H5_SIZEOF_SSIZE_T 8 @@ -634,10 +641,15 @@ #define H5_SIZEOF_SSIZE_T 4 # endif -#endif + # if defined(__i386__) || defined(__x86_64__) + #define H5_SIZEOF_LONG_DOUBLE 16 + # elif defined(__aarch64__) + #define H5_SIZEOF_LONG_DOUBLE 8 + # else + #cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + # endif -/* The size of `long double', as computed by sizeof. */ -#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ +#endif /* Define size of long long and/or __int64 bit integer type only if the type exists. */ diff --git a/config/cmake/HDF5PluginCache.cmake b/config/cmake/HDF5PluginCache.cmake new file mode 100644 index 0000000..3b085dd --- /dev/null +++ b/config/cmake/HDF5PluginCache.cmake @@ -0,0 +1,29 @@ +# This is the CMakeCache file. + +######################## +# EXTERNAL cache entries +######################## + +# examples are the tests for plugins +set (H5PL_BUILD_TESTING ON CACHE BOOL "Enable h5pl testing" FORCE) +set (BUILD_EXAMPLES ON CACHE BOOL "Build h5pl Examples" FORCE) + +set (HDF5_HDF5_HEADER "h5pubconf.h" CACHE STRING "Name of HDF5 header" FORCE) +set (HDF5_LINK_LIBS ${HDF5_LIBSH_TARGET} CACHE STRING "hdf5 target" FORCE) +#set (HDF5_INCLUDE_DIR $ CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_INCLUDE_DIR "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_INCLUDE_DIRS "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "hdf5 build folder" FORCE) + +set (HDF5_DUMP_EXECUTABLE $ CACHE STRING "hdf5 h5dump target" FORCE) +set (HDF5_REPACK_EXECUTABLE $ CACHE STRING "hdf5 h5repack target" FORCE) + +set (H5PL_ALLOW_EXTERNAL_SUPPORT "${HDF5_ALLOW_EXTERNAL_SUPPORT}" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) + +set (H5PL_GIT_URL "https://github.com/HDFGroup/hdf5_plugins.git" CACHE STRING "Use plugins from HDF repository" FORCE) +set (H5PL_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (H5PL_TGZ_NAME "${PLUGIN_TGZ_NAME}" CACHE STRING "Use plugins from compressed file" FORCE) + +set (PL_PACKAGE_NAME "${PLUGIN_PACKAGE_NAME}" CACHE STRING "Name of plugins package" FORCE) +set (H5PL_CPACK_ENABLE OFF CACHE BOOL "Enable the CPACK include and components" FORCE) diff --git a/config/cmake/HDF5PluginMacros.cmake b/config/cmake/HDF5PluginMacros.cmake new file mode 100644 index 0000000..4e05399 --- /dev/null +++ b/config/cmake/HDF5PluginMacros.cmake @@ -0,0 +1,108 @@ +#------------------------------------------------------------------------------- +# Plugins must be built SHARED +#------------------------------------------------------------------------------- +macro (EXTERNAL_PLUGIN_LIBRARY compress_type) + if (${compress_type} MATCHES "GIT") + FetchContent_Declare (PLUGIN + GIT_REPOSITORY ${PLUGIN_URL} + GIT_TAG ${PLUGIN_BRANCH} + ) + elseif (${compress_type} MATCHES "TGZ") + FetchContent_Declare (PLUGIN + URL ${PLUGIN_URL} + URL_HASH "" + ) + endif () + FetchContent_GetProperties(PLUGIN) + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + endif () + if(NOT PLUGIN_POPULATED) + FetchContent_Populate(PLUGIN) + include (${HDF_RESOURCES_DIR}/HDF5PluginCache.cmake) + set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + add_subdirectory(${plugin_SOURCE_DIR} ${plugin_BINARY_DIR}) + if (ENABLE_BLOSC) + add_dependencies (h5blosc ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_blosc ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_blosc PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_BSHUF) + add_dependencies (h5bshuf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_bshuf ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_bshuf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_BZIP2) + add_dependencies (h5bz2 ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_bzip2 ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_bzip2 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_JPEG) + add_dependencies (h5jpeg ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_jpeg ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_jpeg PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_LZ4) + add_dependencies (h5lz4 ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_lz4 ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_lz4 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_LZF) + add_dependencies (h5lzf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_lzf ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_lzf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_MAFISC) + add_dependencies (h5mafisc ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_mafisc ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_mafisc PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_SZF) + add_dependencies (h5szf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_sz ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_sz PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_ZFP) + add_dependencies (h5zfp ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_zfp ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_zfp PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + endif () + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + endif () + set (PLUGIN_BINARY_DIR "${plugin_BINARY_DIR}") + set (PLUGIN_SOURCE_DIR "${plugin_SOURCE_DIR}") + set (PLUGIN_LIBRARY "PLUGIN") + set (PLUGIN_FOUND 1) +endmacro () + +#------------------------------------------------------------------------------- +macro (FILTER_OPTION plname) + string(TOLOWER ${plname} PLUGIN_NAME) + option (ENABLE_${plname} "Enable Library Building for ${plname} plugin" ON) + if (ENABLE_${plname}) + option (HDF_${plname}_USE_EXTERNAL "Use External Library Building for ${PLUGIN_NAME} plugin" 0) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + set (HDF_${plname}_USE_EXTERNAL 1 CACHE BOOL "Use External Library Building for ${PLUGIN_NAME} plugin" FORCE) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + set (HDF_${plname}_URL ${HDF_${plname}_GIT_URL}) + set (HDF_${plname}_BRANCH ${HDF_${plname}_GIT_BRANCH}) + elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (NOT TGZPATH) + set (TGZPATH ${H5PL_SOURCE_DIR}) + endif () + set (HDF_${plname}_URL ${TGZPATH}/${HDF_${plname}_TGZ_NAME}) + endif () + endif () + add_subdirectory (${plname}) + set_global_variable (H5PL_LIBRARIES_TO_EXPORT "${H5PL_LIBRARIES_TO_EXPORT};${H5${plname}_LIBRARIES_TO_EXPORT}") + endif () +endmacro () + +#------------------------------------------------------------------------------- +macro (PACKAGE_PLUGIN_LIBRARY compress_type) + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") + message (STATUS "Filter PLUGIN is to be packaged") + endif () +endmacro () diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 1dd8203..003f24f 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -41,7 +41,9 @@ else () # so this one is used. #----------------------------------------------------------------------------- macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 RETURN_VAR) - message (STATUS "Detecting Fortran ${FUNCTION_NAME}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Detecting Fortran ${FUNCTION_NAME}") + endif () file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 "${SOURCE_CODE}" @@ -55,18 +57,24 @@ macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 if (${COMPILE_RESULT_VAR}) set(${RETURN_VAR} ${RUN_RESULT_VAR}) if (${RUN_RESULT_VAR} MATCHES 0) - message (STATUS "Testing Fortran ${FUNCTION_NAME} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION_NAME} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION_NAME} exists passed\n" ) else () - message (STATUS "Testing Fortran ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION_NAME} - Fail") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION_NAME} exists failed: ${RUN_RESULT_VAR}\n" ) endif () else () - message (STATUS "Compiling Fortran ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Compiling Fortran ${FUNCTION_NAME} - Fail") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION_NAME} compiles failed: ${COMPILE_RESULT_VAR}\n" ) @@ -281,7 +289,9 @@ string (REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") set (PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") -message (STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +endif () # ********** # REALS # ********** @@ -442,7 +452,9 @@ else () # so this one is used. #----------------------------------------------------------------------------- macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) - message (STATUS "Detecting C ${FUNCTION_NAME}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Detecting C ${FUNCTION_NAME}") + endif () if (HDF5_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") @@ -462,22 +474,28 @@ macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) set (${RETURN_VAR} ${OUTPUT_VAR}) - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message (STATUS "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message (STATUS "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #endif () if (${COMPILE_RESULT_VAR}) if (${RUN_RESULT_VAR} MATCHES 1) set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") - message (STATUS "Testing C ${FUNCTION_NAME} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing C ${FUNCTION_NAME} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n" "${OUTPUT_VAR}\n\n" ) else () - message (STATUS "Testing C ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing C ${FUNCTION_NAME} - Fail") + endif () set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n" diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake index 9fd367a..b639b19 100644 --- a/config/cmake/HDF5_Examples_options.cmake +++ b/config/cmake/HDF5_Examples_options.cmake @@ -18,6 +18,7 @@ #### HDF_BUILD_CXX:BOOL=OFF ### #### HDF_BUILD_FORTRAN:BOOL=OFF ### #### HDF_BUILD_JAVA:BOOL=OFF ### +#### HDF_BUILD_FILTERS:BOOL=OFF ### #### BUILD_TESTING:BOOL=OFF ### #### HDF_ENABLE_PARALLEL:BOOL=OFF ### #### HDF_ENABLE_THREADSAFE:BOOL=OFF ### @@ -41,6 +42,9 @@ ### enable JAVA builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") +### enable FILTERS builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FILTERS:BOOL=ON") + ############################################################################################# ### enable parallel program builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON") diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index ef06090..757692c 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -30,6 +30,14 @@ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") endif () + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () endif () endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 18f8d01..add40bb 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -32,6 +32,20 @@ if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) + #----------------------------------------------------------------------------- + # Option to allow the user to enable build extended diagnostics + # + # This should NOT be on by default as it can cause process issues. + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_BUILD_DIAGS "Enable color and URL extended diagnostic messages" OFF) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () endif () endif () diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index d133069..8b631ad 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -10,7 +10,9 @@ # help@hdfgroup.org. # -message (STATUS "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") +endif () #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings @@ -43,6 +45,14 @@ endif () #----------------------------------------------------------------------------- # HDF5 library compile options #----------------------------------------------------------------------------- +if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () +endif () #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so @@ -64,7 +74,9 @@ if (NOT MSVC AND NOT MINGW) elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") list (APPEND HDF5_CMAKE_Fortran_FLAGS "-Mfreeform" "-Mdclchk" "-Mstandard" "-Mallocatable=03") endif () - message (STATUS "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") + endif () if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 3afebc2..f621515 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -17,6 +17,18 @@ The contents of this directory are: README.txt - This file @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@ - HDF5 Install Package +This binary was built with the ZLIB and SZIP/Libaec external libraries and are +included for convenience. Libaec is an unrestricted open-source replacement for SZIP +(version 1.0.4, Encoder ENABLED). + +The official ZLIB and SZIP/Libaec pages are at: + + ZLIB: https://git.savannah.gnu.org/cgit/gzip.git/ + https://git.savannah.gnu.org/cgit/gzip.git/tree/COPYING + SZIP/Libaec: https://gitlab.dkrz.de/k202009/libaec + https://gitlab.dkrz.de/k202009/libaec/-/blob/master/Copyright.txt + + Installation =========================================================================== 1. Execute @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@ diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 8abd01e..fc85277 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -40,11 +40,12 @@ set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) +set (HDF5_MINGW_STATIC_GCC_LIBS ON CACHE BOOL "Statically link libgcc/libstdc++" FORCE) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) - set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed file" FORCE) set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) @@ -52,3 +53,128 @@ set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) set (LIBAEC_PACKAGE_NAME "libaec" CACHE STRING "Name of AEC SZIP package" FORCE) set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) + +####################### +# filter plugin options +####################### +set (PLUGIN_TGZ_NAME "hdf5_plugins.tar.gz" CACHE STRING "Use PLUGINS from compressed file" FORCE) + +set (PLUGIN_PACKAGE_NAME "pl" CACHE STRING "Name of PLUGIN package" FORCE) + +############ +# bitshuffle +########### + +set (BSHUF_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/bitshuffle.git" CACHE STRING "Use BSHUF from HDF repository" FORCE) +set (BSHUF_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (BSHUF_TGZ_NAME "bitshuffle.tar.gz" CACHE STRING "Use BSHUF from compressed file" FORCE) + +set (BSHUF_PACKAGE_NAME "bshuf" CACHE STRING "Name of BSHUF package" FORCE) + +####### +# blosc +####### + +set (BLOSC_GIT_URL "https://github.com/Blosc/c-blosc.git" CACHE STRING "Use BLOSC from Github" FORCE) +set (BLOSC_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (BLOSC_TGZ_NAME "c-blosc.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE) + +set (BLOSC_PACKAGE_NAME "blosc" CACHE STRING "Name of BLOSC package" FORCE) + +set (ZLIB_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/zlib.git" CACHE STRING "Use ZLIB from HDF repo" FORCE) +set (ZLIB_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + +set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + +####### +# bzip2 +###### +# +set (BZ2_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/bzip2.git" CACHE STRING "Use BZ2 from HDF repository" FORCE) +set (BZ2_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (BZ2_TGZ_NAME "BZ2.tar.gz" CACHE STRING "Use BZ2 from compressed file" FORCE) + +set (BZ2_PACKAGE_NAME "bz2" CACHE STRING "Name of BZ2 package" FORCE) + +####### +# fpzip +####### + +set (FPZIP_GIT_URL "https://https://github.com/LLNL/fpzip" CACHE STRING "Use FPZIP from github repository" FORCE) +set (FPZIP_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (FPZIP_TGZ_NAME "fpzip.tar.gz" CACHE STRING "Use FPZIP from compressed file" FORCE) + +set (FPZIP_PACKAGE_NAME "fpzip" CACHE STRING "Name of FPZIP package" FORCE) + +###### +# jpeg +###### + +set (JPEG_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/jpeg.git" CACHE STRING "Use JPEG from HDF repository" FORCE) +set (JPEG_GIT_BRANCH "jpeg9c" CACHE STRING "" FORCE) + +#set (JPEG_TGZ_NAME "JPEG9c.tar.gz" CACHE STRING "Use JPEG from compressed file" FORCE) +set (JPEG_TGZ_NAME "JPEG.tar.gz" CACHE STRING "Use JPEG from compressed file" FORCE) + +set (JPEG_PACKAGE_NAME "jpeg" CACHE STRING "Name of JPEG package" FORCE) + +###### +# lz4 +###### + +set (BUILD_LZ4_LIBRARY_SOURCE ON CACHE BOOL "build the lz4 library within the plugin" FORCE) + +set (LZ4_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/lz4.git" CACHE STRING "Use LZ4 from HDF repository" FORCE) +set (LZ4_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (LZ4_TGZ_NAME "lz4.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) + +set (LZ4_PACKAGE_NAME "lz4" CACHE STRING "Name of LZ4 package" FORCE) + +###### +# lzf +###### + +set (LZF_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/lzf.git" CACHE STRING "Use LZF from HDF repository" FORCE) +set (LZF_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (LZF_TGZ_NAME "lzf.tar.gz" CACHE STRING "Use LZF from compressed file" FORCE) + +set (LZF_PACKAGE_NAME "lzf" CACHE STRING "Name of LZF package" FORCE) + +######## +# mafisc +######## + +#set (BUILD_MAFISC_LIBRARY_SOURCE OFF CACHE BOOL "build the mafisc library within the plugin" FORCE) + +#set (MAFISC_PACKAGE_NAME "mafisc" CACHE STRING "Name of MAFISC package" FORCE) + +###### +# szf +###### + +set (SZF_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ from github repository" FORCE) +set (SZF_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (SZF_TGZ_NAME "szf.tar.gz" CACHE STRING "Use SZ from compressed file" FORCE) + +set (SZF_PACKAGE_NAME "szf" CACHE STRING "Name of SZ package" FORCE) + +###### +# zfp +###### + +set (ZFP_GIT_URL "https://github.com/LLNL/zfp.git" CACHE STRING "Use ZFP from Github" FORCE) +set (ZFP_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (ZFP_TGZ_NAME "zfp.tar.gz" CACHE STRING "Use ZFP from compressed file" FORCE) + +set (ZFP_PACKAGE_NAME "zfp" CACHE STRING "Name of ZFP package" FORCE) + diff --git a/config/cmake/fileCompareTest.cmake b/config/cmake/fileCompareTest.cmake index 2bbeecc..4a8dc09 100644 --- a/config/cmake/fileCompareTest.cmake +++ b/config/cmake/fileCompareTest.cmake @@ -24,9 +24,6 @@ endif () if (NOT TEST_FUNCTION) message (FATAL_ERROR "Require TEST_FUNCTION (LT,LTEQ,EQ,GTEQ,GT) to be defined") endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () set (TEST_ONE_SIZE 0) set (TEST_TWO_SIZE 0) @@ -53,7 +50,9 @@ if (TEST_STRINGS STREQUAL "YES") RESULT_VARIABLE TEST_RESULT ) - message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}-${TEST_O_STRING_LEN}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}-${TEST_O_STRING_LEN}") + endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (FATAL_ERROR "Failed: The output of ${TEST_FOLDER}/${TEST_ONEFILE} did not match ${TEST_FOLDER}/${TEST_TWOFILE}.\n${TEST_ERROR}") @@ -66,31 +65,41 @@ else () file (SIZE ${TEST_FOLDER}/${TEST_TWOFILE} TEST_TWO_SIZE) if (TEST_FUNCTION MATCHES "LT") if (TEST_ONE_SIZE LESS TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT less ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "LTEQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSES "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "EQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "GTEQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "GT") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT greater ${TEST_FOLDER}/${TEST_TWOFILE}") endif () diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 8e93dc6..20ce630 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -33,7 +33,7 @@ else() endif() if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND - (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR)) + (PACKAGE_FIND_VERSION_MINOR STRLESS_EQUAL CVF_VERSION_MINOR)) set(PACKAGE_VERSION_COMPATIBLE TRUE) else() set(PACKAGE_VERSION_COMPATIBLE FALSE) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index b262aeb..4d02c9c 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -39,6 +39,7 @@ set (${HDF5_PACKAGE_NAME}_BUILD_JAVA @HDF5_BUILD_JAVA@) set (${HDF5_PACKAGE_NAME}_BUILD_TOOLS @HDF5_BUILD_TOOLS@) set (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) set (${HDF5_PACKAGE_NAME}_ENABLE_THREADSAFE @HDF5_ENABLE_THREADSAFE@) +set (${HDF5_PACKAGE_NAME}_ENABLE_PLUGIN_SUPPORT @HDF5_ENABLE_PLUGIN_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 722cd19..2ca1b75 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -49,7 +49,7 @@ endif () message (STATUS "COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=${LOG_LEVEL} -Djava.library.path=\"${TEST_LIBRARY_DIRECTORY}\" -cp \"${TEST_CLASSPATH}\" ${TEST_ARGS} ${TEST_PROGRAM} ${ARGN}") -if (WIN32 OR MINGW) +if (WIN32) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -131,7 +131,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -202,7 +202,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/cmake/jvolTest.cmake b/config/cmake/jvolTest.cmake index aafb8a0..b12c358 100644 --- a/config/cmake/jvolTest.cmake +++ b/config/cmake/jvolTest.cmake @@ -54,7 +54,7 @@ message (STATUS "USING ${TEST_VOL} ON COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.sl set (ENV{HDF5_VOL_CONNECTOR} "${TEST_VOL}") -if (WIN32 OR MINGW) +if (WIN32) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -136,7 +136,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list(LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -207,7 +207,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list(LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 7005d3a..08e38e8 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -21,6 +21,7 @@ cmake_minimum_required (VERSION 3.12) # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: +# MinGW * MinGW Makefiles # Unix * Unix Makefiles # VS2019 * Visual Studio 16 2019 # VS201964 * Visual Studio 16 2019 @@ -167,7 +168,11 @@ if (NOT DEFINED HPC) ## Set the following to unique id your computer ## set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () - set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + if (MINGW) + set (CTEST_CMAKE_GENERATOR "MinGW Makefiles") + else () + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + endif () ## Set the following to unique id your computer ## if (APPLE) set (CTEST_SITE "MAC.XXXX") diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index d880988..7133e6c 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -57,7 +57,9 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") ### ext libs on system #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO") +#set(ENV{ZLIB_ROOT} "some_location") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") +#set(ENV{SZIP_ROOT} "some_location") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") ### disable using ext zlib diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index c401cf6..4b11f51 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -22,21 +22,6 @@ include (CheckVariableExists) include (TestBigEndian) include (CheckStructHasMember) -#----------------------------------------------------------------------------- -# APPLE/Darwin setup -#----------------------------------------------------------------------------- -if (APPLE) - list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) - if (ARCH_LENGTH GREATER 1) - set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) - message (FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" - "due to technical reasons. The best approach would be build each architecture in separate directories" - "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" - "variable has been set to a blank value which will build the default architecture for this system.") - endif () - set (${HDF_PREFIX}_AC_APPLE_UNIVERSAL_BUILD 0) -endif () - # Check for Darwin (not just Apple - we also want to catch OpenDarwin) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set (${HDF_PREFIX}_HAVE_DARWIN 1) @@ -69,6 +54,7 @@ if (MINGW) set (WINDOWS 1) # MinGW tries to imitate Windows set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) + set (__USE_MINGW_ANSI_STDIO 1) endif () if (WIN32 AND NOT MINGW) @@ -223,7 +209,9 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) ) endif () - #message (STATUS "Performing ${OTHER_TEST}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Performing ${OTHER_TEST}") + endif () try_compile (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c @@ -233,9 +221,13 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) ) if (${OTHER_TEST}) set (${HDF_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") - message (STATUS "Performing Other Test ${OTHER_TEST} - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Other Test ${OTHER_TEST} - Success") + endif () else () - message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Other Test ${OTHER_TEST} - Failed") + endif () set (${HDF_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" @@ -296,17 +288,23 @@ if (MINGW OR NOT WINDOWS) set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) set (LARGEFILE 1) set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - message (STATUS "${msg}... yes") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... yes") + endif () else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n" ) endif () else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Compile failed\n" ) @@ -339,11 +337,15 @@ endif () macro (HDF_CHECK_TYPE_SIZE type var) set (aType ${type}) set (aVar ${var}) -# message (STATUS "Checking size of ${aType} and storing into ${aVar}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Checking size of ${aType} and storing into ${aVar}") + endif () CHECK_TYPE_SIZE (${aType} ${aVar}) if (NOT ${aVar}) set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") -# message (STATUS "Size of ${aType} was NOT Found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Size of ${aType} was NOT Found") + endif () endif () endmacro () @@ -575,7 +577,9 @@ endif () #----------------------------------------------------------------------------- if (WINDOWS) if (NOT HDF_NO_IOEO_TEST) - message (STATUS "Checking for InitOnceExecuteOnce:") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for InitOnceExecuteOnce:") + endif () if (NOT DEFINED ${HDF_PREFIX}_HAVE_IOEO) if (LARGEFILE) set (CMAKE_REQUIRED_DEFINITIONS @@ -604,7 +608,9 @@ if (WINDOWS) # if the return value was 0 then it worked if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") - message (STATUS "Performing Test InitOnceExecuteOnce - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Test InitOnceExecuteOnce - Success") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" @@ -616,7 +622,9 @@ if (WINDOWS) set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") endif () - message (STATUS "Performing Test InitOnceExecuteOnce - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Test InitOnceExecuteOnce - Failed") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" @@ -639,7 +647,9 @@ endforeach () #----------------------------------------------------------------------------- if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown") set (PRINT_LL_FOUND 0) - message (STATUS "Checking for appropriate format for 64 bit long:") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long:") + endif () set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH") if (${HDF_PREFIX}_SIZEOF_LONG_LONG) set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") @@ -656,7 +666,9 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") set (PRINT_LL_FOUND 1) else () - message (STATUS "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + endif () endif () else () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log @@ -665,9 +677,13 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " endif () if (PRINT_LL_FOUND) - message (STATUS "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + endif () else () - message (STATUS "Checking for appropriate format for 64 bit long: not found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long: not found") + endif () set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index c3dc04a..846a3d1 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -118,7 +118,9 @@ if (NOT SZIP_FOUND) "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." ) if (NOT SZIP_FIND_QUIETLY) - message (STATUS "${SZIP_DIR_MESSAGE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${SZIP_DIR_MESSAGE}") + endif () else () if (SZIP_FIND_REQUIRED) message (FATAL_ERROR "SZip was NOT found and is Required by this project") diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp index f05151b..08ccb34 100644 --- a/config/cmake_ext_mod/HDFCXXTests.cpp +++ b/config/cmake_ext_mod/HDFCXXTests.cpp @@ -10,62 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME - -#include - -int main(void) { return 0; } - -#endif - - -#ifdef HDF_NO_NAMESPACE - -namespace HDF { -int fnord; -} - -int main(void) { - using namespace HDF; - fnord = 37; - return 0; -} - -#endif - -#ifdef HDF_NO_STD - -#include - -using namespace std; - -int main(void) { - string myString("testing namespace std"); - return 0; -} - -#endif - -#ifdef BOOL_NOTDEFINED -int main(void) { - bool flag; - return 0; -} - -#endif - -#ifdef NO_STATIC_CAST - -int main(void) { - float test_float; - int test_int; - test_float = 37.0; - test_int = static_cast (test_float); - return 0; -} - -#endif - #ifdef CXX_HAVE_OFFSETOF #include diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 821ac2d..a60d09f 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -84,6 +84,10 @@ endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) if (${compress_type} MATCHES "GIT") +# FetchContent_Declare (SZIP +# GIT_REPOSITORY ${SZIP_URL} +# GIT_TAG ${SZIP_BRANCH} +# ) EXTERNALPROJECT_ADD (SZIP GIT_REPOSITORY ${SZIP_URL} GIT_TAG ${SZIP_BRANCH} @@ -104,6 +108,10 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") +# FetchContent_Declare (SZIP +# URL ${SZIP_URL} +# URL_HASH "" +# ) EXTERNALPROJECT_ADD (SZIP URL ${SZIP_URL} URL_MD5 "" @@ -125,7 +133,12 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) ) endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) - +# FetchContent_GetProperties(SZIP) +# if(NOT SZIP_POPULATED) +# FetchContent_Populate(SZIP) +# add_subdirectory(${szip_SOURCE_DIR} ${szip_BINARY_DIR}) +# endif() +# ##include (${BINARY_DIR}/${SZ_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static if (USE_LIBAEC) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index c6bd9e6..ae0ebca 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -28,7 +28,9 @@ macro (SET_HDF_BUILD_TYPE) endif() endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message (STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Setting build type to 'RelWithDebInfo' as none was specified.") + endif() set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" @@ -126,10 +128,6 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} ) - #get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME) - #get_property (target_name_debug TARGET ${libtarget} PROPERTY OUTPUT_NAME_DEBUG) - #get_property (target_name_rwdi TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO) - #message (STATUS "${target_name} : ${target_name_debug} : ${target_name_rwdi}") if (${libtype} MATCHES "STATIC") if (WIN32) @@ -143,8 +141,8 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) endif () endif () - #----- Use MSVC Naming conventions for Shared Libraries - if (MINGW AND ${libtype} MATCHES "SHARED") + option (HDF5_MSVC_NAMING_CONVENTION "Use MSVC Naming conventions for Shared Libraries" OFF) + if (HDF5_MSVC_NAMING_CONVENTION AND MINGW AND ${libtype} MATCHES "SHARED") set_target_properties (${libtarget} PROPERTIES IMPORT_SUFFIX ".lib" IMPORT_PREFIX "" @@ -343,7 +341,7 @@ macro (HDF_DIR_PATHS package_prefix) set (${package_prefix}_INSTALL_INCLUDE_DIR include) endif () if (NOT ${package_prefix}_INSTALL_DATA_DIR) - if (NOT WIN32) + if (NOT MSVC) if (APPLE) if (${package_prefix}_BUILD_FRAMEWORKS) set (${package_prefix}_INSTALL_EXTRA_DIR ../SharedSupport) @@ -353,12 +351,13 @@ macro (HDF_DIR_PATHS package_prefix) set (${package_prefix}_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) endif () set (${package_prefix}_INSTALL_DATA_DIR share) - set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) else () set (${package_prefix}_INSTALL_DATA_DIR ".") - set (${package_prefix}_INSTALL_CMAKE_DIR cmake) endif () endif () + if (NOT ${package_prefix}_INSTALL_CMAKE_DIR) + set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) + endif () # Always use full RPATH, i.e. don't skip the full RPATH for the build tree set (CMAKE_SKIP_BUILD_RPATH FALSE) @@ -427,23 +426,49 @@ macro (HDF_DIR_PATHS package_prefix) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) endif () endif () + + if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if (CMAKE_HOST_UNIX) + set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + else () + GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) + set (CMAKE_INSTALL_PREFIX + "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + set (CMAKE_GENERIC_PROGRAM_FILES) + endif () + endif () + +#----------------------------------------------------------------------------- +# Setup pre-3.14 FetchContent +#----------------------------------------------------------------------------- + if(${CMAKE_VERSION} VERSION_LESS 3.14) + macro(FetchContent_MakeAvailable NAME) + FetchContent_GetProperties(${NAME}) + if(NOT ${NAME}_POPULATED) + FetchContent_Populate(${NAME}) + add_subdirectory(${${NAME}_SOURCE_DIR} ${${NAME}_BINARY_DIR}) + endif() + endmacro() + endif() endmacro () macro (ADD_H5_FLAGS h5_flag_var infile) file (STRINGS ${infile} TEST_FLAG_STREAM) - #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") + #message (TRACE "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") list (LENGTH TEST_FLAG_STREAM len_flag) if (len_flag GREATER 0) math (EXPR _FP_LEN "${len_flag} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET TEST_FLAG_STREAM ${line} str_flag) string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") - #message (STATUS "str_flag=${str_flag}") + #message (TRACE "str_flag=${str_flag}") if (str_flag) list (APPEND ${h5_flag_var} "${str_flag}") endif () endforeach () endif () - #message (STATUS "h5_flag_var=${${h5_flag_var}}") + #message (TRACE "h5_flag_var=${${h5_flag_var}}") endmacro () diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 86e57d5..2d7e1b4 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -178,7 +178,7 @@ int DebugReport(int reportType, char* message, int* returnValue) int main(void) { - char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL }; + char *llwidthArgs[] = { "I64", "l64", "ll", "l", "L", "q", NULL }; char *s = malloc(128); char **currentArg = NULL; LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index 9b4b138..580c409 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -70,7 +70,9 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) endif () - #message (STATUS "Performing ${OTHER_TEST}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Performing ${OTHER_TEST}") + endif () TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp @@ -80,9 +82,13 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) if (${OTHER_TEST} EQUAL 0) set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") - message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Success") + endif () else () - message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Failed") + endif () set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" @@ -97,11 +103,6 @@ endmacro () #----------------------------------------------------------------------------- if (CMAKE_CXX_COMPILER_LOADED) foreach (cxx_test - OLD_HEADER_FILENAME - HDF_NO_NAMESPACE - HDF_NO_STD - BOOL_NOTDEFINED - NO_STATIC_CAST CXX_HAVE_OFFSETOF ) HDF_CXX_FUNCTION_TEST (${cxx_test}) diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 17fdefb..9cbcd76 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -135,7 +135,9 @@ else () # so this one is used for a sizeof test. #----------------------------------------------------------------------------- macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) - message (STATUS "Testing Fortran ${FUNCTION}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION}") + endif () if (HDF5_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") @@ -153,13 +155,17 @@ else () OUTPUT_VARIABLE OUTPUT ) - # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - # message (STATUS "Test result ${OUTPUT}") - # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test result ${OUTPUT}") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # endif () if (${RESULT_VAR}) set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") - message (STATUS "Testing Fortran ${FUNCTION} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n" diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index ad3fe79..631fca6 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -16,18 +16,12 @@ if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif () if (NOT TEST_FOLDER) message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () if (NOT TEST_FILTER) message (STATUS "Optional TEST_FILTER to be defined") endif () @@ -46,7 +40,7 @@ endif () message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -55,7 +49,9 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") - #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") + endif () endif () # run the test program, capture the stdout/stderr and the result var @@ -105,7 +101,7 @@ if (TEST_ERRREF) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 21d34d8..f552dcd 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -38,7 +38,7 @@ endif () message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -212,7 +212,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -283,7 +283,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/libhdf5.pc.in b/config/libhdf5.pc.in new file mode 100644 index 0000000..4a2ebaa --- /dev/null +++ b/config/libhdf5.pc.in @@ -0,0 +1,14 @@ +prefix=@_PKG_CONFIG_PREFIX@ +exec_prefix=@_PKG_CONFIG_EXEC_PREFIX@ +libdir=@_PKG_CONFIG_LIBDIR@ +includedir=@_PKG_CONFIG_INCLUDEDIR@ + +Name: @_PKG_CONFIG_LIBNAME@ +Description: HDF5 (Hierarchical Data Format 5) Software Library +Version: @_PKG_CONFIG_VERSION@ + +Cflags: -I${includedir} +Libs: -L${libdir} @_PKG_CONFIG_SH_LIBS@ +Requires: @_PKG_CONFIG_REQUIRES@ +Libs.private: @_PKG_CONFIG_LIBS_PRIVATE@ @_PKG_CONFIG_LIBS@ +Requires.private: @_PKG_CONFIG_REQUIRES_PRIVATE@ diff --git a/config/sanitizer/formatting.cmake b/config/sanitizer/formatting.cmake new file mode 100644 index 0000000..5aaa2a6 --- /dev/null +++ b/config/sanitizer/formatting.cmake @@ -0,0 +1,92 @@ +# +# Copyright (C) 2019 by George Cave - gcave@stablecoder.ca +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# +# clang-format +# +find_program(CLANG_FORMAT_EXE "clang-format") +mark_as_advanced(FORCE CLANG_FORMAT_EXE) +if(CLANG_FORMAT_EXE) + message(STATUS "clang-format found: ${CLANG_FORMAT_EXE}") +else() + message(STATUS "clang-format not found!") +endif() + +# Generates a 'format' target using a custom name, files, and include +# directories all being parameters. +# +# Do note that in order for sources to be inherited properly, the source paths +# must be reachable from where the macro is called, or otherwise require a full +# path for proper inheritance. +# +# ~~~ +# Required: +# TARGET_NAME - The name of the target to create. +# +# Optional: ARGN - The list of targets OR files to format. Relative and absolute +# paths are accepted. +# ~~~ +function(clang_format TARGET_NAME) + if(CLANG_FORMAT_EXE) + set(FORMAT_FILES) + # Check through the ARGN's, determine existent files + foreach(item IN LISTS ARGN) + if(TARGET ${item}) + # If the item is a target, then we'll attempt to grab the associated + # source files from it. + get_target_property(_TARGET_TYPE ${item} TYPE) + if(NOT + _TARGET_TYPE + STREQUAL + "INTERFACE_LIBRARY") + get_property( + _TEMP + TARGET ${item} + PROPERTY SOURCES) + foreach(iter IN LISTS _TEMP) + if(EXISTS ${iter}) + set(FORMAT_FILES ${FORMAT_FILES} ${iter}) + endif() + endforeach() + endif() + elseif(EXISTS ${item}) + # Check if it's a full file path + set(FORMAT_FILES ${FORMAT_FILES} ${item}) + elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${item}) + # Check if it's based on the current source dir + set(FORMAT_FILES ${FORMAT_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${item}) + endif() + endforeach() + + # Make the target + if(FORMAT_FILES) + if(TARGET ${TARGET_NAME}) + message( + ERROR + "Cannot create clang-format target '${TARGET_NAME}', already exists.") + else() + add_custom_target(${TARGET_NAME} COMMAND ${CLANG_FORMAT_EXE} -i -style=file ${FORMAT_FILES}) + + if(NOT TARGET format) + add_custom_target(format) + endif() + + add_dependencies(format ${TARGET_NAME}) + endif() + endif() + + endif() +endfunction() + diff --git a/config/sanitizer/tools.cmake b/config/sanitizer/tools.cmake index a44022f..242e33f 100644 --- a/config/sanitizer/tools.cmake +++ b/config/sanitizer/tools.cmake @@ -1,5 +1,5 @@ # -# Copyright (C) 2018 by George Cave - gcave@stablecoder.ca +# Copyright (C) 2018-2020 by George Cave - gcave@stablecoder.ca # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of @@ -29,7 +29,7 @@ endmacro() # used as the options set. macro(include_what_you_use) if(IWYU AND IWYU_EXE) - set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "${IWYU_EXE};${IWYU_STRING}") + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXE} ${ARGN}) endif() endmacro() @@ -37,11 +37,12 @@ endmacro() # options set. macro(cppcheck) if(CPPCHECK AND CPPCHECK_EXE) - set(CMAKE_CXX_CPPCHECK "${CPPCHECK_EXE};${CPPCHECK_STRING}") + set(CMAKE_CXX_CPPCHECK ${CPPCHECK_EXE} ${ARGN}) endif() endmacro() find_program(CLANG_TIDY_EXE NAMES "clang-tidy") +mark_as_advanced(FORCE CLANG_TIDY_EXE) if(CLANG_TIDY_EXE) message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") if(NOT CLANG_TIDY) @@ -63,6 +64,7 @@ else() endif() find_program(IWYU_EXE NAMES "include-what-you-use") +mark_as_advanced(FORCE IWYU_EXE) if(IWYU_EXE) message(STATUS "include-what-you-use found: ${IWYU_EXE}") if(NOT IWYU) @@ -85,6 +87,7 @@ else() endif() find_program(CPPCHECK_EXE NAMES "cppcheck") +mark_as_advanced(FORCE CPPCHECK_EXE) if(CPPCHECK_EXE) message(STATUS "cppcheck found: ${CPPCHECK_EXE}") if(CPPECHECK) diff --git a/doc/branches-explained.md b/doc/branches-explained.md new file mode 100644 index 0000000..22b9c8f --- /dev/null +++ b/doc/branches-explained.md @@ -0,0 +1,41 @@ +# HDF5 Git Branching Model Explained + +This document describes current HDF5 branches. + +Branches are tested nightly and testing results are available at https://cdash-internal.hdfgroup.org/ and https://cdash.hdfgroup.org/. +Commits that break daily testing should be fixed by 3:00 pm Central time or reverted. +We encourage code contributors to check the status of their commits. If you have any questions, please contact help@hdfgroup.org. + +## `develop` +Develop is the main branch whose source code always reflects a state with the latest delivered development changes for the next major release of HDF5. +This is also considered the integration branch, as **all** new features are integrated into this branch from respective feature branches. + +## `Maintenance branches` + +Each currently supported release-line of HDF5 (e.g. 1.8.x, 1.10.x, 1.12.x) has a support branch with the name 1_8, 1_10, 1_12. +Maintenance branches are similar to the develop branch, except the source code in a maintenance branch always reflects a state +with the latest delivered development changes for the next **maintenance** release of that particular supported release-line of HDF5. +**Some** new features will be integrated into a release maintenance branch, depending on whether or not those features can be +introduced in minor releases. Maintenance branches are removed when a release-line is retired from support. + +## `feature/*` +Feature branches are temporary branches used to develop new features in HDF5. +Feature branches branch off of develop and exist as long as the feature is under development. +When the feature is complete, the branch is merged back into develop, as well as into any support branches in which the change will be included, and then the feature branch is removed. + +## `release/*` +Release branches are used to prepare a new production release. They are primarily used to allow for last minute dotting of i's and crossing of t's +(things like setting the release version, finalizing release notes, et cetera) and do not include new development. +They are created from the maintenance branch at the time of the maintenance release and have +names 1_8_N, 1_10_N, 1_12_N, where N is the minor release number. Once the release is done it is tagged. +Patches can be applied to the release branch for patch releases that are treated as "scaled down" maintenance releases as defined by Release coordinator. + +## `1.X/master/*` where X is 8, 10 or 12 +These branches are used to tag 1.X.* maintenance releases. + +## `inactive//*` +These branches are for experimental features that were developed in the past and have not been merged to develop, and are not under active development. The features +can be out of sync with the develop branch. + +This document was last updated on March 16, 2021 + diff --git a/doc/contributing.md b/doc/contributing.md new file mode 100644 index 0000000..7f9e8d3 --- /dev/null +++ b/doc/contributing.md @@ -0,0 +1,86 @@ +# How to contribute to HDF5 + +The HDF Group encourages community members to contribute to the HDF5 project. We accept and are very grateful for any contributions, +from minor typos and bug fixes to new features. The HDF Group is committed to work with the code contributors and make contribution process enjoyable and straightforward. + +This document describes guiding principles for the HDF5 code contributors and does not pretend to address any possible +contribution. If in doubt, please do not hesitate to ask us for guidance. +***Note that no contribution may be accepted unless the donor agrees with the HDF Group software license terms +found in the COPYING file in every branch's top source directory.*** + + +> We will assume that you are familiar with `git` and `GitHub`. If not, you may go through the GitHub tutorial found at [https://guides.github.com/activities/hello-world/](https://guides.github.com/activities/hello-world/). This tutorial should only take around 10 minutes. + +## Table of Contents + +* [Workflow](#workflow) +* [Acceptance criteria for a pull request](#criteria) +* [Check List](#checklist) + +# Workflow + +The process for contributing code to HDF5 is as follows: + +* Open an issue on [HDF5 GitHub](https://github.com/HDFGroup/hdf5/issues). + +> This step is ***required*** unless the change is minor (e.g., typo fix). + +* Fork the [HDF5](https://github.com/HDFGroup/hdf5) repository. +* Make the desired changes to the HDF5 software. + * New features should always go to _develop_ branch first and later should be merged to the appropriate maintenance branches. + * Bug fixes should go to all appropriate branches (_develop_ and maintenance). +* Build and test your changes. Detailed instructions on building and testing HDF5 can be found in the `INSTALL*` files in the `release_docs` directory. +* Push your changes to GitHub. +* Issue a pull request and address any code formatting and testing issues reported. + +Once a pull request is correctly formatted and passes **ALL** CI tests, it will be reviewed and evaluated by The HDF Group developers and HDF5 community members who can approve pull requests. +The HDF Group developers will work with you to ensure that the pull request satisfies the acceptance criteria described in the next section. + +# Acceptance criteria for a pull request + +We appreciate every contribution we receive, but we may not accept them all. Those that we *do* satisfy the following criteria: + +* **The pull request has a clear purpose** - What does the pull request address? How does it benefit the HDF5 community? +If the pull request does not have a clear purpose and benefits, it will not be accepted. + +* **The pull request is documented** - The HDF5 developers must understand not only *what* a change is doing, but *how* it is doing it. + Documenting the code makes it easier for us to understand your patch and maintain the code in the future. + +* **The pull request passes HDF5 regression testing** - Any issue fixed or functionality added should be accompanied by the corresponding +tests and pass HDF5 regression testing run by The HDF Group. We do not expect you to perform comprehensive testing across multiple platforms +before we accept the pull request. If the pull request does not pass regression testing after the merge, The HDF Group developers will work with you on the fixes. + +* **The pull request does not compromise the principles behind HDF5** - HDF5 has a 100% commitment to backward compatibility. + * Any file ever created with HDF5 must be readable by any future version of HDF5. + If your patch's purpose is to modify the HDF5 data model or file format, + **please** discuss this with us first. File format changes and features required by those changes can be introduced only in a new major release. + * HDF5 has a commitment to remaining *machine-independent*; data created on one platform/environment/architecture **must** remain readable by HDF5 on any other. + * For binary compatibility, no changes are allowed to public APIs and data structures in the maintenance releases; new APIs can be added. + +* **New features are documented** - Any new features should have proper documentation; talk to us if you have any questions. + + +# Checklist + +Please make sure that you check the items applicable to your pull request: + +* Code + * [ ] Does the pull request have a corresponding GitHub issue and clear purpose? + * [ ] Does the pull request follow HDF5 best practices (naming conventions, code portability, code structure, etc.)? <> + * [ ] If changes were done to Autotools build, were they added to CMake and vice versa? + * [ ] Is the pull request applicable to any other branches? If yes, which ones? Please document it in the GitHub issue. + * [ ] Is the new code sufficiently documented for future maintenance? + * [ ] Does the new feature require a change to an existing API? See "API Compatibility Macros" document (https://portal.hdfgroup.org/display/HDF5/API+Compatibility+Macros) +* Documentation + * [ ] Was the change described in the release_docs/RELEASE.txt file? + * [ ] Was MANIFEST updated if new files had been added to the source? + * [ ] Was the new function documented in the corresponding public header file using Doxygen? <> + * [ ] Was new functionality documented for the HDF5 community (the level of documentation depends on the feature; ask us what would be appropriate) +* Testing + * [ ] Does the pull request have tests? + * [ ] Does the pull request affect HDF5 library performance? + +We want as many contributions as we can get, and we are here to help. Feel free to reach out to us if you have any questions + +Thank you for your contribution! + diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 527b11f..9ab870f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -44,7 +44,7 @@ set (examples foreach (example ${examples}) add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - target_include_directories (${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${example} STATIC) target_link_libraries (${example} PRIVATE ${HDF5_LIB_TARGET}) @@ -53,11 +53,18 @@ foreach (example ${examples}) target_link_libraries (${example} PRIVATE ${HDF5_LIBSH_TARGET}) endif () set_target_properties (${example} PROPERTIES FOLDER examples) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_EXAMPLES_${example}_FORMAT ${example}) + endif () endforeach () if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - target_include_directories (ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (ph5example STATIC) target_link_libraries (ph5example PRIVATE ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) @@ -66,6 +73,13 @@ if (H5_HAVE_PARALLEL) target_link_libraries (ph5example PRIVATE ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) endif () set_target_properties (ph5example PROPERTIES FOLDER examples) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_EXAMPLES_ph5example_FORMAT ph5example) + endif () endif () if (BUILD_TESTING AND HDF5_TEST_EXAMPLES) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 02a71c3..610ee8c 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -46,7 +46,7 @@ foreach (example ${examples}) PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static" "${HDF5_SRC_DIR}" - "${HDF5_BINARY_DIR}" + "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/static" ) @@ -61,7 +61,7 @@ foreach (example ${examples}) PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" "${HDF5_SRC_DIR}" - "${HDF5_BINARY_DIR}" + "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/shared" ) @@ -87,7 +87,7 @@ foreach (example ${F2003_examples}) PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static" "${HDF5_SRC_DIR}" - "${HDF5_BINARY_DIR}" + "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/static" ) @@ -102,7 +102,7 @@ foreach (example ${F2003_examples}) PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" "${HDF5_SRC_DIR}" - "${HDF5_BINARY_DIR}" + "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/shared" ) @@ -128,7 +128,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static" "${HDF5_SRC_DIR}" - "${HDF5_BINARY_DIR}" + "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/static" "$<$:${MPI_Fortran_INCLUDE_DIRS}>" @@ -149,7 +149,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" "${HDF5_SRC_DIR}" - "${HDF5_BINARY_DIR}" + "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/shared" "$<$:${MPI_Fortran_INCLUDE_DIRS}>" diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index b1add54..37b5157 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -40,7 +40,7 @@ set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID) #----------------------------------------------------------------------------- add_executable (H5_buildiface ${HDF5_F90_SRC_SOURCE_DIR}/H5_buildiface.F90) -target_include_directories (H5_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}") +target_include_directories (H5_buildiface PRIVATE "${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR}") #if (BUILD_SHARED_LIBS) # target_compile_definitions(H5_buildiface PRIVATE $<$:/MT>) #endif () @@ -71,7 +71,7 @@ add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) -target_include_directories (H5match_types PRIVATE "${HDF5_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (H5match_types PRIVATE "${HDF5_SRC_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h @@ -145,7 +145,7 @@ set (f90CStub_C_SHHDRS if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) target_include_directories (${HDF5_F90_C_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_F90_C_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -163,7 +163,7 @@ endif () if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) target_include_directories (${HDF5_F90_C_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -180,6 +180,29 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_F90_C_SRC_FORMAT + ${HDF5_F90_C_LIB_TARGET} + ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h + ) + else () + clang_format (HDF5_F90_C_SRC_FORMAT + ${HDF5_F90_C_LIBSH_TARGET} + ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h + ) + endif () +endif () + +#----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- set (f90_F_GEN_SOURCES @@ -512,11 +535,11 @@ if (BUILD_SHARED_LIBS) set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_F90_LIB_CORENAME}") endif () -set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}") -set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) @@ -540,5 +563,3 @@ if (NOT WIN32 AND NOT MINGW) COMPONENT fortlibraries ) endif () - - diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index ff7001b..40aef6d 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -9,7 +9,7 @@ project (HDF5_FORTRAN_TESTS C Fortran) add_executable (H5_test_buildiface ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90) target_include_directories (H5_test_buildiface PRIVATE - ${HDF5_BINARY_DIR} ${HDF5_F90_BINARY_DIR} + ${HDF5_SRC_BINARY_DIR} ${HDF5_F90_BINARY_DIR} ) #if (BUILD_SHARED_LIBS) # target_compile_definitions(H5_test_buildiface @@ -42,10 +42,10 @@ endif () # Add Test Lib #----------------------------------------------------------------------------- if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) + add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c t.h) set_source_files_properties (t.c PROPERTIES LANGUAGE C) target_include_directories (${HDF5_F90_C_TEST_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -60,9 +60,9 @@ if (NOT BUILD_SHARED_LIBS) LINKER_LANGUAGE C ) else () - add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) + add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c t.h) target_include_directories (${HDF5_F90_C_TEST_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -79,6 +79,17 @@ else () ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT BUILD_SHARED_LIBS) + clang_format (HDF5_FORTRAN_TESTS_FORMAT ${HDF5_F90_C_TEST_LIB_TARGET}) + else () + clang_format (HDF5_FORTRAN_TESTS_FORMAT ${HDF5_F90_C_TEST_LIBSH_TARGET}) + endif () +endif () + if (NOT BUILD_SHARED_LIBS) add_custom_command ( OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 70c458d..083c60e 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -18,8 +18,6 @@ if (HDF5_BUILD_EXAMPLES) endif () #-- Build the Unit testing if requested -if (NOT HDF5_EXTERNALLY_CONFIGURED) - if (BUILD_TESTING AND HDF5_TEST_SERIAL) - add_subdirectory (test) - endif () +if (BUILD_TESTING AND HDF5_TEST_SERIAL) + add_subdirectory (test) endif () diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 22c9973..bfad538 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -5,7 +5,7 @@ project (HDF5_HL_CPP_EXAMPLES CXX) # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) -target_include_directories (ptExampleFL PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (ptExampleFL PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (ptExampleFL STATIC) target_link_libraries (ptExampleFL PRIVATE @@ -23,6 +23,13 @@ else () endif () set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_CPP_EXAMPLES_FORMAT ptExampleFL) +endif () + if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index fbabc86..1eac9fe 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -9,9 +9,9 @@ set (HDF5_HL_CPP_SOURCES ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) if (NOT ONLY_SHARED_LIBS) - add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES}) + add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES} ${HDF5_HL_CPP_HDRS}) target_include_directories (${HDF5_HL_CPP_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_HL_CPP_LIB_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") @@ -26,7 +26,7 @@ endif () if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SOURCES}) target_include_directories (${HDF5_HL_CPP_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_HL_CPP_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") @@ -40,6 +40,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_CPP_SRC_FORMAT ${HDF5_HL_CPP_LIB_TARGET}) + else () + clang_format (HDF5_HL_CPP_SRC_FORMAT ${HDF5_HL_CPP_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- install ( @@ -94,11 +105,11 @@ if (BUILD_SHARED_LIBS) set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_CPP_LIB_CORENAME}") endif () -set (_PKG_CONFIG_REQUIRES "${HDF5_HL_LIB_CORENAME}") -set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_HL_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES "${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) @@ -122,4 +133,3 @@ if (NOT WIN32 AND NOT MINGW) COMPONENT hlcpplibraries ) endif () - diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 5c224a8..9a1d6fd 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -3,7 +3,7 @@ project (HDF5_HL_CPP_TEST CXX) add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) target_compile_options(hl_ptableTest PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") -target_include_directories (hl_ptableTest PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (hl_ptableTest PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_ptableTest STATIC) target_link_libraries (hl_ptableTest PRIVATE @@ -25,6 +25,13 @@ else () endif () set_target_properties (hl_ptableTest PROPERTIES FOLDER test/hl/cpp) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_CPP_TEST_FORMAT hl_ptableTest) +endif () + if (HDF5_TEST_CPP AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 1707ae9..93ae9e8 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -28,7 +28,7 @@ set (examples foreach (example ${examples}) add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) - target_include_directories (hl_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (hl_ex_${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_ex_${example} STATIC) target_link_libraries (hl_ex_${example} PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -37,6 +37,13 @@ foreach (example ${examples}) target_link_libraries (hl_ex_${example} PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) endif () set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_EXAMPLES_${example}_FORMAT hl_ex_${example}) + endif () endforeach () if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index d682d5f..0b7795b 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -15,8 +15,8 @@ endif () # Generate the H5LT and H5TB REAL APIs #----------------------------------------------------------------------------- -add_executable (H5HL_buildiface ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5HL_buildiface.F90 ) -target_include_directories (H5HL_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}") +add_executable (H5HL_buildiface ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5HL_buildiface.F90) +target_include_directories (H5HL_buildiface PRIVATE "${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR}") if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) set_target_properties (H5HL_buildiface PROPERTIES COMPILE_FLAGS "/MT") @@ -54,12 +54,12 @@ set (HDF5_HL_F90_C_SOURCES ) set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C) -set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) +set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMcc.h) if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) target_include_directories (${HDF5_HL_F90_C_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_HL_F90_C_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -76,7 +76,7 @@ endif () if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) target_include_directories (${HDF5_HL_F90_C_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_HL_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -93,6 +93,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_F90_C_SRC_FORMAT ${HDF5_HL_F90_C_LIB_TARGET}) + else () + clang_format (HDF5_HL_F90_C_SRC_FORMAT ${HDF5_HL_F90_C_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- set (HDF5_HL_F90_F_BASE_SOURCES @@ -307,3 +318,51 @@ if (HDF5_EXPORTED_TARGETS) INCLUDES DESTINATION include ) endif () + +#----------------------------------------------------------------------------- +# Create pkgconfig files +#----------------------------------------------------------------------------- +set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) +set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib) +set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include) +set (_PKG_CONFIG_LIBNAME "${HDF5_HL_F90_LIB_CORENAME}") +set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") + +set (_PKG_CONFIG_LIBS_PRIVATE) + +if (NOT ONLY_SHARED_LIBS) + set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_HL_F90_LIB_CORENAME}") +endif () +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_F90_LIB_CORENAME}") +endif () + +set (_PKG_CONFIG_REQUIRES "${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") + +configure_file ( + ${HDF_CONFIG_DIR}/libhdf5.pc.in + ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + @ONLY +) +install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc + DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig + COMPONENT hlfortlibraries +) + +if (NOT WIN32 AND NOT MINGW) + set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5hlfc + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5hlfc + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT hlfortlibraries + ) +endif () diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index c4ddf19..785bdcf 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -30,12 +30,20 @@ set (HL_HEADERS set (HL_PRIVATE_HEADERS ${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5DSprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5IMprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5PTprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5HLprivate2.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5PTprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5TBprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5LDprivate.h ) if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS}) target_include_directories (${HDF5_HL_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_HL_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -50,7 +58,7 @@ endif () if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS}) target_include_directories (${HDF5_HL_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_HL_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -64,6 +72,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_SRC_FORMAT ${HDF5_HL_LIB_TARGET}) + else () + clang_format (HDF5_HL_SRC_FORMAT ${HDF5_HL_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- install ( @@ -118,11 +137,11 @@ if (BUILD_SHARED_LIBS) set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_LIB_CORENAME}") endif () -set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}") -set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}") +set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 306d8c9..01f6ded 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -22,7 +22,9 @@ #include #include -extern int yylex(); +#include "H5private.h" + +extern int yylex(void); extern int yyerror(const char *); #define STACK_SIZE 16 @@ -35,13 +37,13 @@ struct cmpd_info { }; /*stack for nested compound type*/ -struct cmpd_info cmpd_stack[STACK_SIZE] = { +static struct cmpd_info cmpd_stack[STACK_SIZE] = { {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1} }; -int csindex = -1; /*pointer to the top of compound stack*/ +static int csindex = -1; /*pointer to the top of compound stack*/ /*structure for array type information*/ struct arr_info { @@ -50,23 +52,18 @@ struct arr_info { hbool_t is_dim; /*flag to lexer for dimension*/ }; /*stack for nested array type*/ -struct arr_info arr_stack[STACK_SIZE]; -int asindex = -1; /*pointer to the top of array stack*/ +static struct arr_info arr_stack[STACK_SIZE]; +static int asindex = -1; /*pointer to the top of array stack*/ -hbool_t is_str_size = 0; /*flag to lexer for string size*/ -hbool_t is_str_pad = 0; /*flag to lexer for string padding*/ -H5T_str_t str_pad; /*variable for string padding*/ -H5T_cset_t str_cset; /*variable for string character set*/ -hbool_t is_variable = 0; /*variable for variable-length string*/ -size_t str_size; /*variable for string size*/ +static H5T_str_t str_pad; /*variable for string padding*/ +static H5T_cset_t str_cset; /*variable for string character set*/ +static hbool_t is_variable = 0; /*variable for variable-length string*/ +static size_t str_size; /*variable for string size*/ -hid_t enum_id; /*type ID*/ -hbool_t is_enum = 0; /*flag to lexer for enum type*/ -hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ -char* enum_memb_symbol; /*enum member symbol string*/ - -hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/ -hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ +static hid_t enum_id; /*type ID*/ +static hbool_t is_enum = 0; /*flag to lexer for enum type*/ +static hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ +static char* enum_memb_symbol; /*enum member symbol string*/ %} %union { @@ -99,7 +96,7 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ %token STRING %token NUMBER -%token '{' '}' '[' ']' '"' ':' ';' +%token '{' '}' '[' ']' ':' ';' %% start : { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } @@ -168,35 +165,35 @@ memb_list : | memb_list memb_def ; memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } - '"' field_name '"' field_offset ';' + field_name field_offset ';' { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; /*Adjust size and insert member, consider both member size and offset.*/ if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/ - new_size = H5Tget_size($1) + $6; + new_size = H5Tget_size($1) + $4; H5Tset_size(dtype_id, new_size); /*member name is saved in yylval.sval by lexer*/ - H5Tinsert(dtype_id, $4, $6, $1); + H5Tinsert(dtype_id, $3, $4, $1); cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); - if($6 == 0) { + if($4 == 0) { new_size = origin_size + H5Tget_size($1); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, $4, origin_size, $1); + H5Tinsert(dtype_id, $3, origin_size, $1); } else { - new_size = $6 + H5Tget_size($1); + new_size = $4 + H5Tget_size($1); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, $4, $6, $1); + H5Tinsert(dtype_id, $3, $4, $1); } } - if($4) { - free($4); - $4 = NULL; + if($3) { + HDfree($3); + $3 = NULL; } cmpd_stack[csindex].is_field = 0; H5Tclose($1); @@ -206,8 +203,8 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le ; field_name : STRING { - $$ = strdup(yylval.sval); - free(yylval.sval); + $$ = HDstrdup(yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; } ; @@ -247,20 +244,18 @@ vlen_type : H5T_VLEN_TOKEN '{' ddl_type '}' opaque_type : H5T_OPAQUE_TOKEN '{' - OPQ_SIZE_TOKEN { is_opq_size = 1; } opaque_size ';' + OPQ_SIZE_TOKEN opaque_size ';' { size_t size = (size_t)yylval.ival; $$ = H5Tcreate(H5T_OPAQUE, size); - is_opq_size = 0; } - OPQ_TAG_TOKEN { is_opq_tag = 1; } '"' opaque_tag '"' ';' + OPQ_TAG_TOKEN opaque_tag ';' { - H5Tset_tag($7, yylval.sval); - free(yylval.sval); + H5Tset_tag($6, yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; - is_opq_tag = 0; } - '}' { $$ = $7; } + '}' { $$ = $6; } ; opaque_size : NUMBER ; @@ -268,40 +263,39 @@ opaque_tag : STRING ; string_type : H5T_STRING_TOKEN '{' - STRSIZE_TOKEN { is_str_size = 1; } strsize ';' + STRSIZE_TOKEN strsize ';' { - if($5 == H5T_VARIABLE_TOKEN) + if($4 == H5T_VARIABLE_TOKEN) is_variable = 1; else str_size = yylval.ival; - is_str_size = 0; } STRPAD_TOKEN strpad ';' { - if($9 == H5T_STR_NULLTERM_TOKEN) + if($8 == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; - else if($9 == H5T_STR_NULLPAD_TOKEN) + else if($8 == H5T_STR_NULLPAD_TOKEN) str_pad = H5T_STR_NULLPAD; - else if($9 == H5T_STR_SPACEPAD_TOKEN) + else if($8 == H5T_STR_SPACEPAD_TOKEN) str_pad = H5T_STR_SPACEPAD; } CSET_TOKEN cset ';' { - if($13 == H5T_CSET_ASCII_TOKEN) + if($12 == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; - else if($13 == H5T_CSET_UTF8_TOKEN) + else if($12 == H5T_CSET_UTF8_TOKEN) str_cset = H5T_CSET_UTF8; } CTYPE_TOKEN ctype ';' { - if($17 == H5T_C_S1_TOKEN) + if($16 == H5T_C_S1_TOKEN) $$ = H5Tcopy(H5T_C_S1); - else if($17 == H5T_FORTRAN_S1_TOKEN) + else if($16 == H5T_FORTRAN_S1_TOKEN) $$ = H5Tcopy(H5T_FORTRAN_S1); } '}' { - hid_t str_id = $19; + hid_t str_id = $18; /*set string size*/ if(is_variable) { @@ -339,14 +333,10 @@ enum_type : H5T_ENUM_TOKEN '{' integer_type ';' enum_list : | enum_list enum_def ; -enum_def : '"' enum_symbol '"' { +enum_def : enum_symbol { is_enum_memb = 1; /*indicate member of enum*/ -#ifdef H5_HAVE_WIN32_API - enum_memb_symbol = _strdup(yylval.sval); -#else /* H5_HAVE_WIN32_API */ - enum_memb_symbol = strdup(yylval.sval); -#endif /* H5_HAVE_WIN32_API */ - free(yylval.sval); + enum_memb_symbol = HDstrdup(yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; } enum_val ';' @@ -386,7 +376,7 @@ enum_def : '"' enum_symbol '"' { } is_enum_memb = 0; - if(enum_memb_symbol) free(enum_memb_symbol); + if(enum_memb_symbol) HDfree(enum_memb_symbol); } H5Tclose(super); diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 6349bb3..b63004e 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -20,7 +20,7 @@ configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ON macro (HL_ADD_EXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) target_compile_options(hl_${hl_name} PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (hl_${hl_name} PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (hl_${hl_name} PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_${hl_name} STATIC) target_link_libraries (hl_${hl_name} PRIVATE @@ -37,6 +37,13 @@ macro (HL_ADD_EXE hl_name) ) endif () set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_${hl_name}_FORMAT hl_${hl_name}) + endif () endmacro () HL_ADD_EXE (test_lite) @@ -51,7 +58,7 @@ HL_ADD_EXE (test_h5do_compat) # test_packet has two source files add_executable (hl_test_packet test_packet.c test_packet_vlen.c) target_compile_options(hl_test_packet PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (hl_test_packet PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (hl_test_packet PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (hl_test_packet STATIC) target_link_libraries (hl_test_packet PRIVATE @@ -69,6 +76,13 @@ else () endif () set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_hl_test_packet_FORMAT hl_test_packet) +endif () + # -------------------------------------------------------------------- # This executable is used to generate test files for the test_ds test. # It should only be run during development when new test files are needed @@ -76,7 +90,7 @@ set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (hl_gen_test_ds gen_test_ds.c) target_compile_options(hl_gen_test_ds PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (hl_gen_test_ds PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (hl_gen_test_ds PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (hl_gen_test_ds STATIC) target_link_libraries (hl_gen_test_ds PRIVATE ${HDF5_HL_LIB_TARGET} @@ -85,9 +99,16 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) ) set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_hl_gen_test_ds_FORMAT hl_gen_test_ds) + endif () + add_executable (hl_gen_test_ld gen_test_ld.c) target_compile_options(hl_gen_test_ld PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (hl_gen_test_ld PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (hl_gen_test_ld PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (hl_gen_test_ld STATIC) target_link_libraries (hl_gen_test_ld PRIVATE ${HDF5_HL_LIB_TARGET} @@ -95,6 +116,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) ${HDF5_LIB_TARGET} ) set_target_properties (hl_gen_test_ld PROPERTIES FOLDER test/hl/gen) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_hl_gen_test_ld_FORMAT hl_gen_test_ld) + endif () endif () if (HDF5_TEST_SERIAL) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 0b895a3..372fb60 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -17,7 +17,7 @@ set (GIF2H5_SOURCES if (NOT ONLY_SHARED_LIBS) add_executable (gif2h5 ${GIF2H5_SOURCES}) target_compile_options(gif2h5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (gif2h5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (gif2h5 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (gif2h5 STATIC) target_link_libraries (gif2h5 PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl) @@ -30,7 +30,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (gif2h5-shared ${GIF2H5_SOURCES}) target_compile_options(gif2h5-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (gif2h5-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (gif2h5-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (gif2h5-shared SHARED) target_link_libraries (gif2h5-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) set_target_properties (gif2h5-shared PROPERTIES FOLDER tools/hl) @@ -40,6 +40,17 @@ if (BUILD_SHARED_LIBS) ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_TOOLS_GIF2H5_FORMAT gif2h5) + else () + clang_format (HDF5_HL_TOOLS_GIF2H5_FORMAT gif2h5-shared) + endif () +endif () + #-- Add h52gif program set (hdf2gif_SOURCES ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdf2gif.c @@ -48,7 +59,7 @@ set (hdf2gif_SOURCES if (NOT ONLY_SHARED_LIBS) add_executable (h52gif ${hdf2gif_SOURCES}) target_compile_options(h52gif PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (h52gif PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h52gif PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h52gif STATIC) target_link_libraries (h52gif PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h52gif PROPERTIES FOLDER tools/hl) @@ -61,7 +72,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h52gif-shared ${hdf2gif_SOURCES}) target_compile_options(h52gif-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (h52gif-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h52gif-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h52gif-shared SHARED) target_link_libraries (h52gif-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} PRIVATE ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) set_target_properties (h52gif-shared PROPERTIES FOLDER tools/hl) @@ -71,6 +82,17 @@ if (BUILD_SHARED_LIBS) ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_TOOLS_H52GIF_FORMAT h52gif) + else () + clang_format (HDF5_HL_TOOLS_H52GIF_FORMAT h52gif-shared) + endif () +endif () + if (BUILD_TESTING AND HDF5_TEST_SERIAL) # -------------------------------------------------------------------- # This executable can generate the actual test files - Currently not @@ -79,11 +101,18 @@ if (BUILD_TESTING AND HDF5_TEST_SERIAL) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/h52gifgentst.c) - target_include_directories (hl_h52gifgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (hl_h52gifgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (hl_h52gifgentest STATIC) target_link_libraries (hl_h52gifgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TOOLS_hl_h52gifgentest_FORMAT hl_h52gifgentest) + endif () + # add_test (NAME hl_h52gifgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index c5ad976..be983ba 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -12,7 +12,7 @@ set (H5WATCH_SOURCES if (NOT ONLY_SHARED_LIBS) add_executable (h5watch ${H5WATCH_SOURCES}) target_compile_options(h5watch PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (h5watch PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5watch PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5watch STATIC) target_link_libraries (h5watch PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5watch PROPERTIES FOLDER tools/hl) @@ -21,13 +21,24 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5watch-shared ${H5WATCH_SOURCES}) target_compile_options(h5watch-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (h5watch-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5watch-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5watch-shared SHARED) target_link_libraries (h5watch-shared PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) set_target_properties (h5watch-shared PROPERTIES FOLDER tools/hl) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5watch-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_TOOLS_H5WATCH_FORMAT h5watch) + else () + clang_format (HDF5_HL_TOOLS_H5WATCH_FORMAT h5watch-shared) + endif () +endif () + if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) #-- Add swmr_check_compat_vfd program set (hl_swmr_check_compat_vfd_SOURCES @@ -35,7 +46,7 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) ) add_executable (hl_swmr_check_compat_vfd ${hl_swmr_check_compat_vfd_SOURCES}) target_compile_options(hl_swmr_check_compat_vfd PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (hl_swmr_check_compat_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (hl_swmr_check_compat_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd STATIC) target_link_libraries (hl_swmr_check_compat_vfd PRIVATE ${HDF5_LIB_TARGET}) @@ -45,13 +56,20 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) endif () set_target_properties (hl_swmr_check_compat_vfd PROPERTIES FOLDER tools/hl) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TOOLS_H5WATCH_hl_swmr_check_compat_vfd_FORMAT hl_swmr_check_compat_vfd) + endif () + #-- Add extend_dset program set (extend_dset_SOURCES ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/extend_dset.c ) add_executable (extend_dset ${extend_dset_SOURCES}) target_compile_options(extend_dset PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (extend_dset PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (extend_dset PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (extend_dset STATIC) target_link_libraries (extend_dset PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) @@ -61,9 +79,16 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) endif () set_target_properties (extend_dset PROPERTIES FOLDER tools/hl) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TOOLS_H5WATCH_extend_dset_FORMAT extend_dset) + endif () + add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c) target_compile_options(h5watchgentest PRIVATE "${HDF5_CMAKE_C_FLAGS}") - target_include_directories (h5watchgentest PRIVATE "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5watchgentest PRIVATE "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5watchgentest STATIC) target_link_libraries (h5watchgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -73,6 +98,13 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) endif () set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TOOLS_H5WATCH_h5watchgentest_FORMAT h5watchgentest) + endif () + if (HDF5_TEST_TOOLS) include (CMakeTests.cmake) endif () diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 416e495..5c79bd3 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -9,10 +9,14 @@ find_package (Java) #----------------------------------------------------------------------------- include (${HDF_RESOURCES_DIR}/UseJava.cmake) -message (STATUS "JAVA: JAVA_HOME=$ENV{JAVA_HOME} JAVA_ROOT=$ENV{JAVA_ROOT}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "JAVA: JAVA_HOME=$ENV{JAVA_HOME} JAVA_ROOT=$ENV{JAVA_ROOT}") +endif () find_package (JNI) -message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}") -message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "JNI_LIBRARIES=${JNI_LIBRARIES}") + message (VERBOSE "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") +endif () if (WIN32) diff --git a/java/examples/Makefile.am b/java/examples/Makefile.am index c499bd5..eb7b7f5 100644 --- a/java/examples/Makefile.am +++ b/java/examples/Makefile.am @@ -1,6 +1,5 @@ # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index fc4acc4..8198135 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -39,7 +39,7 @@ set (HDF_JAVA_SZIP_EXAMPLES set (${HDF_JAVA_EXAMPLES} ${HDF_JAVA_EXAMPLES} ${HDF_JAVA_SZIP_EXAMPLES}) endif (H5_HAVE_FILTER_SZIP) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/java/examples/datasets/Makefile.am b/java/examples/datasets/Makefile.am index 8357614..41a914b 100644 --- a/java/examples/datasets/Makefile.am +++ b/java/examples/datasets/Makefile.am @@ -1,6 +1,5 @@ # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index bd4f483..6997b2e 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -24,7 +24,7 @@ set (HDF_JAVA_EXAMPLES H5Ex_T_VLString ) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/java/examples/datatypes/Makefile.am b/java/examples/datatypes/Makefile.am index 26f64cb..90790f7 100644 --- a/java/examples/datatypes/Makefile.am +++ b/java/examples/datatypes/Makefile.am @@ -1,6 +1,5 @@ # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index c2c7d0f..6483f91 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -13,7 +13,7 @@ set (HDF_JAVA_EXAMPLES H5Ex_G_Visit ) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in index 0baf347..34cf643 100644 --- a/java/examples/groups/JavaGroupExample.sh.in +++ b/java/examples/groups/JavaGroupExample.sh.in @@ -1,7 +1,6 @@ #! /bin/sh # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/java/examples/groups/Makefile.am b/java/examples/groups/Makefile.am index 85badb3..bfde9ae 100644 --- a/java/examples/groups/Makefile.am +++ b/java/examples/groups/Makefile.am @@ -1,6 +1,5 @@ # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 6cb1e16..867740b 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -13,7 +13,7 @@ set (HDF_JAVA_EXAMPLES H5_ReadWrite ) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/java/examples/intro/Makefile.am b/java/examples/intro/Makefile.am index 981ace0..7d1aeab 100644 --- a/java/examples/intro/Makefile.am +++ b/java/examples/intro/Makefile.am @@ -1,6 +1,5 @@ # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 3f71122..d137747 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -77,7 +77,7 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) ########### JNI libraries always must be built shared ############### add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS}) target_include_directories (${HDF5_JAVA_JNI_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_JAVA_JNI_SOURCE_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_JAVA_JNI_SOURCE_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" ) target_compile_options(${HDF5_JAVA_JNI_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED) @@ -87,6 +87,13 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED "JAVA") #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_JNI_SRC_FORMAT ${HDF5_JAVA_JNI_LIB_TARGET}) +endif () + +#----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index b97ad26..66991c4 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -96,7 +96,7 @@ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_ add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_files_list}) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") @@ -191,9 +191,11 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL) vol_pass_through2 ) + # native VOL = 0 + # pass-through VOL = 1 set (vol_native native) set (vol_pass_through1 "pass_through under_vol=0\;under_info={}") - set (vol_pass_through2 "pass_through under_vol=505\;under_info={under_vol=0\;under_info={}}") + set (vol_pass_through2 "pass_through under_vol=1\;under_info={under_vol=0\;under_info={}}") foreach (voltest ${VOL_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}") diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 2eabdf0..8da3384 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -1,7 +1,6 @@ #! /bin/sh # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1cceb87..c1e15bc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -738,7 +738,6 @@ set (H5_MODULE_HEADERS ${HDF5_SRC_DIR}/H5Dmodule.h ${HDF5_SRC_DIR}/H5Emodule.h ${HDF5_SRC_DIR}/H5EAmodule.h - ${HDF5_SRC_DIR}/H5ESmodule.h ${HDF5_SRC_DIR}/H5Fmodule.h ${HDF5_SRC_DIR}/H5FAmodule.h ${HDF5_SRC_DIR}/H5FDdrvr_module.h @@ -1036,11 +1035,11 @@ endif () if (HDF5_USE_PREGEN) set (HDF5_GENERATED_SOURCE_DIR ${HDF5_USE_PREGEN_DIR}) else () - set (HDF5_GENERATED_SOURCE_DIR ${HDF5_BINARY_DIR}) + set (HDF5_GENERATED_SOURCE_DIR ${HDF5_SRC_BINARY_DIR}) endif () if (BUILD_SHARED_LIBS) - file (MAKE_DIRECTORY "${HDF5_BINARY_DIR}/shared") + file (MAKE_DIRECTORY "${HDF5_SRC_BINARY_DIR}/shared") endif () if (LOCAL_BATCH_TEST) @@ -1066,7 +1065,7 @@ endif () if (NOT EXISTS "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) - target_include_directories (H5detect PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (H5detect PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_definitions(H5detect PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS}) TARGET_C_PROPERTIES (H5detect STATIC) target_link_libraries (H5detect @@ -1143,7 +1142,8 @@ else () ) if (BUILD_SHARED_LIBS) add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c + ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c" COMMAND ${CMAKE_COMMAND} @@ -1155,8 +1155,15 @@ else () endif () endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_SRC_DETECT_FORMAT ${HDF5_SRC_DIR}/H5detect.c) +endif () + add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) -target_include_directories (H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS}) TARGET_C_PROPERTIES (H5make_libsettings STATIC) target_link_libraries (H5make_libsettings @@ -1164,29 +1171,36 @@ target_link_libraries (H5make_libsettings PRIVATE $<$:"-O0"> ) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_SRC_LIBSETTINGS_FORMAT H5make_libsettings) +endif () + add_custom_command ( - OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c - ${HDF5_BINARY_DIR}/gen_SRCS.stamp2 + OUTPUT ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c + ${HDF5_SRC_BINARY_DIR}/gen_SRCS.stamp2 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ - ARGS ${HDF5_BINARY_DIR}/H5lib_settings.c + ARGS ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c COMMAND ${CMAKE_COMMAND} ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2 DEPENDS H5make_libsettings - WORKING_DIRECTORY ${HDF5_BINARY_DIR} + WORKING_DIRECTORY ${HDF5_SRC_BINARY_DIR} ) -set_source_files_properties (${HDF5_BINARY_DIR}/H5lib_settings.c PROPERTIES GENERATED TRUE) +set_source_files_properties (${HDF5_SRC_BINARY_DIR}/H5lib_settings.c PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) add_custom_command ( - OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c - ${HDF5_BINARY_DIR}/shared/shared_gen_SRCS.stamp2 + OUTPUT ${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c + ${HDF5_SRC_BINARY_DIR}/shared/shared_gen_SRCS.stamp2 COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_BINARY_DIR}/H5lib_settings.c" "${HDF5_BINARY_DIR}/shared/H5lib_settings.c" + ARGS -E copy_if_different "${HDF5_SRC_BINARY_DIR}/H5lib_settings.c" "${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c" COMMAND ${CMAKE_COMMAND} ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp2 - DEPENDS ${HDF5_BINARY_DIR}/H5lib_settings.c - WORKING_DIRECTORY ${HDF5_BINARY_DIR} + DEPENDS ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c + WORKING_DIRECTORY ${HDF5_SRC_BINARY_DIR} ) - set_source_files_properties (${HDF5_BINARY_DIR}/shared/H5lib_settings.c PROPERTIES GENERATED TRUE) + set_source_files_properties (${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c PROPERTIES GENERATED TRUE) endif () ## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,O,S,ST,T,Z" @@ -1197,13 +1211,13 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) # Add H5Tinit source to build - generated by H5detect/CMake at configure time #----------------------------------------------------------------------------- if (NOT ONLY_SHARED_LIBS) - set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) + set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c) add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS}) target_include_directories (${HDF5_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" - INTERFACE "$/include>;$" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + INTERFACE "$/include>;$" ) target_compile_options(${HDF5_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${HDF5_LIB_TARGET} @@ -1212,7 +1226,7 @@ if (NOT ONLY_SHARED_LIBS) ${HDF_EXTRA_FLAGS} PRIVATE $<$:H5_DEBUG_API> # Enable tracing of the API - $<$:H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG> + $<$:H5Z_DEBUG;H5T_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG> ) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC) target_link_libraries (${HDF5_LIB_TARGET} @@ -1233,14 +1247,14 @@ if (NOT ONLY_SHARED_LIBS) endif () if (BUILD_SHARED_LIBS) - set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) + set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c) add_custom_target (gen_${HDF5_LIBSH_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp2) - add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) + add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS}) target_include_directories (${HDF5_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" PUBLIC "$<$:${HDFS_INCLUDE_DIR}>" - INTERFACE "$/include>;$" + INTERFACE "$/include>;$" ) target_compile_options(${HDF5_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${HDF5_LIBSH_TARGET} @@ -1251,7 +1265,7 @@ if (BUILD_SHARED_LIBS) PRIVATE $<$:H5_HAVE_THREADSAFE> $<$:H5_DEBUG_API> # Enable tracing of the API - $<$:H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG> + $<$:H5Z_DEBUG;H5T_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG> ) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_LIBSH_TARGET} @@ -1267,6 +1281,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_SRC_FORMAT ${HDF5_LIB_TARGET}) + else () + clang_format (HDF5_SRC_FORMAT ${HDF5_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- if (NOT HDF5_INSTALL_NO_DEVELOPMENT) @@ -1274,7 +1299,7 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) FILES ${H5_PUBLIC_HEADERS} ${H5_PUBLIC_GENERATED_HEADERS} - ${HDF5_BINARY_DIR}/H5pubconf.h + ${HDF5_SRC_BINARY_DIR}/H5pubconf.h DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT @@ -1331,7 +1356,7 @@ set (_PKG_CONFIG_REQUIRES) set (_PKG_CONFIG_REQUIRES_PRIVATE) configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ad6b258..def070f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -22,6 +22,7 @@ set (TEST_LIB_SOURCES set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h + ${HDF5_TEST_SOURCE_DIR}/H5srcdir.h ${HDF5_TEST_SOURCE_DIR}/cache_common.h ${HDF5_TEST_SOURCE_DIR}/external_common.h ${HDF5_TEST_SOURCE_DIR}/external_fname.h @@ -32,7 +33,7 @@ set (TEST_LIB_HEADERS if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) target_include_directories (${HDF5_TEST_LIB_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -56,7 +57,7 @@ endif () if (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) target_include_directories (${HDF5_TEST_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -76,6 +77,17 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE Threads::Threads) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_TEST_SRC_FORMAT ${HDF5_TEST_LIB_TARGET}) + else () + clang_format (HDF5_TEST_SRC_FORMAT ${HDF5_TEST_LIBSH_TARGET}) + endif () +endif () + ################################################################################# # If filter and vol plugin tests can be tested ################################################################################# @@ -102,13 +114,20 @@ if (BUILD_SHARED_LIBS) set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) - target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED) target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${HDF5_TEST_PLUGIN_TARGET}_FORMAT ${HDF5_TEST_PLUGIN_TARGET}) + endif () + + #----------------------------------------------------------------------------- # Copy the filter plugin to a plugins folder #----------------------------------------------------------------------------- add_custom_command ( @@ -127,13 +146,20 @@ if (BUILD_SHARED_LIBS) set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) - target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED) target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${HDF5_TEST_PLUGIN_TARGET}_FORMAT ${HDF5_TEST_PLUGIN_TARGET}) + endif () + + #----------------------------------------------------------------------------- # Copy the filter plugin to a plugins folder #----------------------------------------------------------------------------- add_custom_command ( @@ -164,13 +190,20 @@ if (BUILD_SHARED_LIBS) set (HDF5_VOL_PLUGIN_LIB_TARGET ${HDF5_VOL_PLUGIN_LIB_CORENAME}) add_library (${HDF5_VOL_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${vol_lib}.c) - target_include_directories (${HDF5_VOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${HDF5_VOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${HDF5_VOL_PLUGIN_LIB_TARGET} SHARED) target_link_libraries (${HDF5_VOL_PLUGIN_LIB_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_VOL_PLUGIN_LIB_TARGET} ${HDF5_VOL_PLUGIN_LIB_NAME} SHARED "LIB") set_target_properties (${HDF5_VOL_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${HDF5_VOL_PLUGIN_LIB_TARGET}_FORMAT ${HDF5_VOL_PLUGIN_LIB_TARGET}) + endif () + + #----------------------------------------------------------------------------- # Copy VOL plugin to a plugins folder #----------------------------------------------------------------------------- add_custom_command ( @@ -189,6 +222,7 @@ endif () ################################################################################# set (testhdf5_SOURCES + ${HDF5_TEST_SOURCE_DIR}/testhdf5.h ${HDF5_TEST_SOURCE_DIR}/testhdf5.c ${HDF5_TEST_SOURCE_DIR}/tarray.c ${HDF5_TEST_SOURCE_DIR}/tattr.c @@ -238,6 +272,7 @@ set(vfd_swmr_zoo_writer_SOURCES ) set (ttsafe_SOURCES + ${HDF5_TEST_SOURCE_DIR}/ttsafe.h ${HDF5_TEST_SOURCE_DIR}/ttsafe.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c @@ -316,14 +351,13 @@ set (H5_TESTS cork swmr thread_id # special link - vfd_swmr vol timer ) macro (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) - target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${file} STATIC) @@ -333,6 +367,13 @@ macro (ADD_H5_EXE file) target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () set_target_properties (${file} PROPERTIES FOLDER test) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${file}_FORMAT ${file}) + endif () endmacro () set (H5_TESTS_MULTIPLE @@ -341,8 +382,8 @@ set (H5_TESTS_MULTIPLE testhdf5 cache_image ttsafe - mirror_vfd thread_id # special link + mirror_vfd ) # Only build single source tests here foreach (h5_test ${H5_TESTS}) @@ -358,7 +399,7 @@ endforeach () #-- Adding test for chunk_info add_executable (chunk_info ${HDF5_TEST_SOURCE_DIR}/chunk_info.c) target_compile_options(chunk_info PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (chunk_info PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (chunk_info PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (chunk_info STATIC) target_link_libraries (chunk_info PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS}) @@ -368,10 +409,17 @@ else () endif () set_target_properties (chunk_info PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_SRC_chunk_info_FORMAT chunk_info) +endif () + #-- Adding test for direct_chunk add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c) target_compile_options(direct_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (direct_chunk STATIC) target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS}) @@ -381,12 +429,18 @@ else () endif () set_target_properties (direct_chunk PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_direct_chunk_FORMAT direct_chunk) +endif () ######### Special handling for multiple sources ############# #-- Adding test for testhdf5 add_executable (testhdf5 ${testhdf5_SOURCES}) target_compile_options(testhdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (testhdf5 STATIC) target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIB_TARGET}) @@ -396,10 +450,17 @@ else () endif () set_target_properties (testhdf5 PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_testhdf5_FORMAT testhdf5) +endif () + #-- Adding test for cache_image add_executable (cache_image ${cache_image_SOURCES}) target_compile_options(cache_image PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (cache_image STATIC) target_link_libraries (cache_image PRIVATE ${HDF5_TEST_LIB_TARGET}) @@ -409,10 +470,17 @@ else () endif () set_target_properties (cache_image PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_cache_image_FORMAT cache_image) +endif () + #-- Adding test for ttsafe add_executable (ttsafe ${ttsafe_SOURCES}) target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (ttsafe STATIC) target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIB_TARGET}) @@ -427,11 +495,18 @@ else () endif () set_target_properties (ttsafe PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_ttsafe_FORMAT ttsafe) +endif () + ######### Special handling for extra link lib of threads ############# #-- Adding test for thread_id add_executable (thread_id ${HDF5_TEST_SOURCE_DIR}/thread_id.c) target_compile_options(thread_id PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (thread_id PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (thread_id PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (thread_id STATIC) target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIB_TARGET}) @@ -446,9 +521,16 @@ else () endif () set_target_properties (thread_id PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_thread_id_FORMAT thread_id) +endif () + #-- Adding test for mirror_vfd add_executable (mirror_vfd ${mirror_vfd_SOURCES}) -target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (mirror_vfd STATIC) target_link_libraries (mirror_vfd PRIVATE ${HDF5_TEST_LIB_TARGET}) @@ -458,6 +540,13 @@ else () endif () set_target_properties (mirror_vfd PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_mirror_vfd_FORMAT mirror_vfd) +endif () + ############################################################################## ### A D D I T I O N A L T E S T S ### ############################################################################## @@ -518,8 +607,29 @@ set (H5_VDS_SWMR_TESTS vds_swmr_writer ) +macro (ADD_H5_VDS_EXE file) + add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c ${HDF5_TEST_SOURCE_DIR}/vds_swmr.h) + target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (${file} STATIC) + target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET}) + else () + TARGET_C_PROPERTIES (${file} SHARED) + target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) + endif () + set_target_properties (${file} PROPERTIES FOLDER test) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${file}_FORMAT ${file}) + endif () +endmacro () + foreach (h5_test ${H5_VDS_SWMR_TESTS}) - ADD_H5_EXE(${h5_test}) + ADD_H5_VDS_EXE(${h5_test}) endforeach () set (H5_VFD_SWMR_TESTS @@ -546,7 +656,7 @@ endforeach () # and it can't be renamed (i.e., no -shared). add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c) target_compile_options(accum_swmr_reader PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (accum_swmr_reader STATIC) target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -556,6 +666,13 @@ else () endif () set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_accum_swmr_reader_FORMAT accum_swmr_reader) +endif () + #-- Set accum dependencies set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader) @@ -564,25 +681,39 @@ set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader) ############################################################################## if (BUILD_SHARED_LIBS) add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) - target_include_directories (filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (filter_plugin SHARED) target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_filter_plugin_FORMAT filter_plugin) + endif () + add_executable (vol_plugin ${HDF5_TEST_SOURCE_DIR}/vol_plugin.c) - target_include_directories (vol_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (vol_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (vol_plugin SHARED) target_link_libraries (vol_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (vol_plugin PROPERTIES FOLDER test) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_vol_plugin_FORMAT vol_plugin) + endif () endif () ############################################################################## ### U S E C A S E S T E S T S ############################################################################## -set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) +set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h) add_executable (use_append_chunk ${use_append_chunk_SOURCES}) target_compile_options(use_append_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (use_append_chunk STATIC) target_link_libraries (use_append_chunk PRIVATE ${HDF5_TEST_LIB_TARGET}) @@ -592,10 +723,37 @@ else () endif () set_target_properties (use_append_chunk PROPERTIES FOLDER test) -set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_use_append_chunk_FORMAT use_append_chunk) +endif () + +set (use_append_chunk_mirror_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk_mirror.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h) +add_executable (use_append_chunk_mirror ${use_append_chunk_mirror_SOURCES}) +target_compile_options(use_append_chunk_mirror PRIVATE "${HDF5_CMAKE_C_FLAGS}") +target_include_directories (use_append_chunk_mirror PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (use_append_chunk_mirror STATIC) + target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIB_TARGET}) +else () + TARGET_C_PROPERTIES (use_append_chunk_mirror SHARED) + target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIBSH_TARGET}) +endif () +set_target_properties (use_append_chunk_mirror PROPERTIES FOLDER test) + +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_use_append_chunk_mirror_FORMAT use_append_chunk_mirror) +endif () + +set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h) add_executable (use_append_mchunks ${use_append_mchunks_SOURCES}) target_compile_options(use_append_mchunks PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (use_append_mchunks STATIC) target_link_libraries (use_append_mchunks PRIVATE ${HDF5_TEST_LIB_TARGET}) @@ -605,10 +763,17 @@ else () endif () set_target_properties (use_append_mchunks PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_use_append_mchunks_FORMAT use_append_mchunks) +endif () + set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c) add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES}) target_compile_options(use_disable_mdc_flushes PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC) target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_TEST_LIB_TARGET}) @@ -618,6 +783,13 @@ else () endif () set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_use_disable_mdc_flushes_FORMAT use_disable_mdc_flushes) +endif () + if (HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/test/CMakePassthroughVOLTests.cmake b/test/CMakePassthroughVOLTests.cmake index cf5ad36..e9f1381 100644 --- a/test/CMakePassthroughVOLTests.cmake +++ b/test/CMakePassthroughVOLTests.cmake @@ -23,9 +23,11 @@ set (VOL_LIST vol_pass_through2 ) +# native VOL = 0 +# pass-through VOL = 1 set (vol_native native) set (vol_pass_through1 "pass_through under_vol=0\;under_info={}") -set (vol_pass_through2 "pass_through under_vol=505\;under_info={under_vol=0\;under_info={}}") +set (vol_pass_through2 "pass_through under_vol=1\;under_info={under_vol=0\;under_info={}}") foreach (voltest ${VOL_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}") diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 1bb389d..dfab713 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -844,7 +844,7 @@ endif () ### F I L T E R P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - if (WIN32 OR MINGW) + if (WIN32) set (CMAKE_SEP "\;") set (BIN_REL_PATH "../../") else () @@ -915,9 +915,9 @@ if (ENABLE_EXTENDED_TESTS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test ) + else () + message (STATUS "Cannot execute TEST flushrefresh - perl not found") endif () -else () - message (STATUS "Cannot execute TEST flushrefresh - perl not found") endif () ############################################################################## @@ -940,7 +940,7 @@ endif () ### V O L P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - if (WIN32 OR MINGW) + if (WIN32) set (CMAKE_SEP "\;") set (BIN_REL_PATH "../../") else () @@ -968,10 +968,17 @@ endif () if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) macro (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) - target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${genfile} STATIC) target_link_libraries (${genfile} PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${genfile}_FORMAT ${genfile}) + endif () endmacro () # generator executables diff --git a/test/H5srcdir.h b/test/H5srcdir.h index b2fd341..8cc91d1 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -17,8 +17,8 @@ * * Purpose: srcdir querying support. */ -#ifndef _H5SRCDIR_H -#define _H5SRCDIR_H +#ifndef H5SRCDIR_H +#define H5SRCDIR_H #ifdef __cplusplus extern "C" { @@ -33,4 +33,4 @@ H5TEST_DLL const char *H5_get_srcdir_filename(const char *filename); } #endif -#endif /* _H5SRCDIR_H */ +#endif /* H5SRCDIR_H */ diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index a9f45d5..ff4446c 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -24,7 +24,7 @@ set (testphdf5_SOURCES add_executable (testphdf5 ${testphdf5_SOURCES}) target_compile_options(testphdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (testphdf5 - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" ) if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (testphdf5 STATIC) @@ -39,11 +39,18 @@ else () endif () set_target_properties (testphdf5 PROPERTIES FOLDER test/par) -MACRO (ADD_H5P_EXE file) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_PAR_testphdf5_FORMAT testphdf5) +endif () + +macro (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (${file} - PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" ) if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${file} STATIC) @@ -59,7 +66,14 @@ MACRO (ADD_H5P_EXE file) ) endif () set_target_properties (${file} PROPERTIES FOLDER test/par) -ENDMACRO (ADD_H5P_EXE file) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_PAR_${file}_FORMAT ${file}) + endif () +endmacro (ADD_H5P_EXE file) set (H5P_TESTS t_mpi diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index ff9ca43..6e4d3e6 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -26,16 +26,18 @@ set (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.h + ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_error.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_utils.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_str.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_ref.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h + ${HDF5_TOOLS_LIB_SOURCE_DIR}/io_timer.h ) if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) target_include_directories (${HDF5_TOOLS_LIB_TARGET} - PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_TOOLS_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -55,7 +57,7 @@ endif () if (BUILD_SHARED_LIBS) add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) target_include_directories (${HDF5_TOOLS_LIBSH_TARGET} - PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" ) target_compile_options(${HDF5_TOOLS_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -75,6 +77,17 @@ if (BUILD_SHARED_LIBS) set (install_targets ${install_targets} ${HDF5_TOOLS_LIBSH_TARGET}) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_TOOLS_SRC_FORMAT ${HDF5_TOOLS_LIB_TARGET}) + else () + clang_format (HDF5_TOOLS_SRC_FORMAT ${HDF5_TOOLS_LIBSH_TARGET}) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/libtest/CMakeLists.txt b/tools/libtest/CMakeLists.txt index 3e0f671..1332099 100644 --- a/tools/libtest/CMakeLists.txt +++ b/tools/libtest/CMakeLists.txt @@ -6,7 +6,7 @@ project (HDF5_TOOLS_LIBTEST C) #----------------------------------------------------------------------------- add_executable (h5tools_test_utils ${HDF5_TOOLS_LIBTEST_SOURCE_DIR}/h5tools_test_utils.c) target_compile_options(h5tools_test_utils PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories(h5tools_test_utils PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories(h5tools_test_utils PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5tools_test_utils STATIC) target_link_libraries (h5tools_test_utils PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) @@ -16,6 +16,13 @@ else () endif () set_target_properties (h5tools_test_utils PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_H5TOOLS_TEST_SRC_FORMAT h5tools_test_utils) +endif () + if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 8f230a0..2f924a2 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -6,7 +6,7 @@ project (HDF5_TOOLS_SRC_H5COPY C) # -------------------------------------------------------------------- if (NOT ONLY_SHARED_LIBS) add_executable (h5copy ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) - target_include_directories (h5copy PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5copy PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5copy PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5copy STATIC) target_link_libraries (h5copy PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -18,7 +18,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5copy-shared ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) - target_include_directories (h5copy-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5copy-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5copy-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5copy-shared SHARED) target_link_libraries (h5copy-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -28,6 +28,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5copy-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5COPY_SRC_FORMAT h5copy) + else () + clang_format (HDF5_H5COPY_SRC_FORMAT h5copy-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 4087ab4..e54b2da 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -8,8 +8,9 @@ if (NOT ONLY_SHARED_LIBS) add_executable (h5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c + ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.h ) - target_include_directories (h5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5diff PRIVATE "${HDF5_CMAKE_C_FLAGS}") #target_compile_definitions (h5diff PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5diff STATIC) @@ -23,8 +24,9 @@ if (BUILD_SHARED_LIBS) add_executable (h5diff-shared ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c + ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.h ) - target_include_directories (h5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5diff-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") #target_compile_definitions (h5diff-shared PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5diff-shared SHARED) @@ -35,13 +37,24 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5diff-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5DIFF_SRC_FORMAT h5diff) + else () + clang_format (HDF5_H5DIFF_SRC_FORMAT h5diff-shared) + endif () +endif () + if (H5_HAVE_PARALLEL) if (NOT ONLY_SHARED_LIBS) add_executable (ph5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) - target_include_directories (ph5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (ph5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(ph5diff PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (ph5diff STATIC) target_link_libraries (ph5diff PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$:${MPI_C_LIBRARIES}>") @@ -54,7 +67,7 @@ if (H5_HAVE_PARALLEL) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) - target_include_directories (ph5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (ph5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(ph5diff-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (ph5diff-shared SHARED) target_link_libraries (ph5diff-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$:${MPI_C_LIBRARIES}>") diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index 0b6c968..8a12434 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -9,8 +9,13 @@ if (NOT ONLY_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_defines.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_extern.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.h ) - target_include_directories (h5dump PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5dump PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5dump PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5dump STATIC) target_link_libraries (h5dump PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -25,8 +30,13 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_defines.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_extern.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.h ) - target_include_directories (h5dump-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5dump-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5dump-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5dump-shared SHARED) target_link_libraries (h5dump-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -36,6 +46,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5dump-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5DUMP_SRC_FORMAT h5dump) + else () + clang_format (HDF5_H5DUMP_SRC_FORMAT h5dump-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 863ecbe..d0ddb32 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -6,7 +6,7 @@ project (HDF5_TOOLS_SRC_H5FC C) # -------------------------------------------------------------------- if (NOT ONLY_SHARED_LIBS) add_executable (h5format_convert ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c) - target_include_directories (h5format_convert PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5format_convert PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5format_convert PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5format_convert STATIC) target_link_libraries (h5format_convert PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -17,7 +17,7 @@ if (NOT ONLY_SHARED_LIBS) endif () if (BUILD_SHARED_LIBS) add_executable (h5format_convert-shared ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c) - target_include_directories (h5format_convert-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5format_convert-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5format_convert-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5format_convert-shared SHARED) target_link_libraries (h5format_convert-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -27,6 +27,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5format_convert-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5FORMAT_SRC_FORMAT h5format_convert) + else () + clang_format (HDF5_H5FORMAT_SRC_FORMAT h5format_convert-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index a52467e..a7f238e 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -5,8 +5,8 @@ project (HDF5_TOOLS_SRC_H5IMPORT C) # Add the h5import executables # -------------------------------------------------------------------- if (NOT ONLY_SHARED_LIBS) - add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c) - target_include_directories (h5import PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.h) + target_include_directories (h5import PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5import STATIC) target_link_libraries (h5import PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) #set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) @@ -17,8 +17,8 @@ if (NOT ONLY_SHARED_LIBS) endif () if (BUILD_SHARED_LIBS) - add_executable (h5import-shared ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c) - target_include_directories (h5import-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + add_executable (h5import-shared ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.h) + target_include_directories (h5import-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5import-shared SHARED) target_link_libraries (h5import-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) #set_target_properties (h5import-shared PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) @@ -28,6 +28,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5import-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5IMPORT_SRC_FORMAT h5import) + else () + clang_format (HDF5_H5IMPORT_SRC_FORMAT h5import-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 69d4c4d..0a31215 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -6,14 +6,14 @@ project (HDF5_TOOLS_SRC_H5JAM C) # -------------------------------------------------------------------- if (NOT ONLY_SHARED_LIBS) add_executable (h5jam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c) - target_include_directories (h5jam PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5jam PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5jam STATIC) target_link_libraries (h5jam PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5jam PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5jam") add_executable (h5unjam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5unjam.c) - target_include_directories (h5unjam PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5unjam PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5unjam STATIC) target_link_libraries (h5unjam PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5unjam PROPERTIES FOLDER tools) @@ -27,14 +27,14 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5jam-shared ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c) - target_include_directories (h5jam-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5jam-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5jam-shared SHARED) target_link_libraries (h5jam-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5jam-shared PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5jam-shared") add_executable (h5unjam-shared ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5unjam.c) - target_include_directories (h5unjam-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5unjam-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5unjam-shared SHARED) target_link_libraries (h5unjam-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5unjam-shared PROPERTIES FOLDER tools) @@ -46,6 +46,19 @@ if (BUILD_SHARED_LIBS) ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5JAM_SRC_FORMAT h5jam) + clang_format (HDF5_H5UNJAM_SRC_FORMAT h5unjam) + else () + clang_format (HDF5_H5JAM_SRC_FORMAT h5jam-shared) + clang_format (HDF5_H5UNJAM_SRC_FORMAT h5unjam-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index c1ce006..80b9b0c 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -6,7 +6,7 @@ project (HDF5_TOOLS_SRC_H5LS C) #----------------------------------------------------------------------------- if (NOT ONLY_SHARED_LIBS) add_executable (h5ls ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) - target_include_directories (h5ls PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5ls PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5ls PRIVATE "${HDF5_CMAKE_C_FLAGS}") #target_compile_definitions(h5ls PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5ls STATIC) @@ -19,7 +19,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5ls-shared ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) - target_include_directories (h5ls-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5ls-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5ls-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") #target_compile_definitions(h5ls-shared PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5ls-shared SHARED) @@ -30,6 +30,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5ls-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5LS_SRC_FORMAT h5ls) + else () + clang_format (HDF5_H5LS_SRC_FORMAT h5ls-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index a4aa1ef..b8b4709 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -12,11 +12,12 @@ set (REPACK_COMMON_SOURCES ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_refs.c ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_verify.c ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c + ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.h ) if (NOT ONLY_SHARED_LIBS) add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) - target_include_directories (h5repack PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5repack PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5repack PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5repack STATIC) target_link_libraries (h5repack PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -28,7 +29,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5repack-shared ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) - target_include_directories (h5repack-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5repack-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5repack-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5repack-shared SHARED) target_link_libraries (h5repack-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -38,6 +39,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repack-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5REPACK_SRC_FORMAT h5repack) + else () + clang_format (HDF5_H5REPACK_SRC_FORMAT h5repack-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index f0722fd..88c0d3d 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -6,7 +6,7 @@ project (HDF5_TOOLS_SRC_H5STAT C) # -------------------------------------------------------------------- if (NOT ONLY_SHARED_LIBS) add_executable (h5stat ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) - target_include_directories (h5stat PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5stat PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5stat PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5stat STATIC) target_link_libraries (h5stat PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -18,7 +18,7 @@ endif () if (BUILD_SHARED_LIBS) add_executable (h5stat-shared ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) - target_include_directories (h5stat-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5stat-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5stat-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5stat-shared SHARED) target_link_libraries (h5stat-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -28,6 +28,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5stat-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5STAT_SRC_FORMAT h5stat) + else () + clang_format (HDF5_H5STAT_SRC_FORMAT h5stat-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 1e9cacc..ea30c98 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -7,7 +7,7 @@ project (HDF5_TOOLS_SRC_MISC C) #-- Misc Executables if (NOT ONLY_SHARED_LIBS) add_executable (h5debug ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c) - target_include_directories (h5debug PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5debug PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5debug PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5debug STATIC) target_link_libraries (h5debug PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -15,7 +15,7 @@ if (NOT ONLY_SHARED_LIBS) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug") add_executable (h5repart ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5repart.c) - target_include_directories (h5repart PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5repart PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5repart PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5repart STATIC) target_link_libraries (h5repart PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -23,7 +23,7 @@ if (NOT ONLY_SHARED_LIBS) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repart") add_executable (h5mkgrp ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5mkgrp.c) - target_include_directories (h5mkgrp PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5mkgrp PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5mkgrp PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5mkgrp STATIC) target_link_libraries (h5mkgrp PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -31,7 +31,7 @@ if (NOT ONLY_SHARED_LIBS) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5mkgrp") add_executable (h5clear ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5clear.c) - target_include_directories (h5clear PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5clear PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5clear PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5clear STATIC) target_link_libraries (h5clear PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -47,7 +47,7 @@ if (NOT ONLY_SHARED_LIBS) endif () if (BUILD_SHARED_LIBS) add_executable (h5debug-shared ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c) - target_include_directories (h5debug-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5debug-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5debug-shared SHARED) target_compile_options(h5debug-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_link_libraries (h5debug-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -55,7 +55,7 @@ if (BUILD_SHARED_LIBS) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug-shared") add_executable (h5repart-shared ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5repart.c) - target_include_directories (h5repart-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5repart-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5repart-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5repart-shared SHARED) target_link_libraries (h5repart-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -63,7 +63,7 @@ if (BUILD_SHARED_LIBS) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repart-shared") add_executable (h5mkgrp-shared ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5mkgrp.c) - target_include_directories (h5mkgrp-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5mkgrp-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5mkgrp-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5mkgrp-shared SHARED) target_link_libraries (h5mkgrp-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -71,7 +71,7 @@ if (BUILD_SHARED_LIBS) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5mkgrp-shared") add_executable (h5clear-shared ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5clear.c) - target_include_directories (h5clear-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5clear-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5clear-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (h5clear-shared SHARED) target_link_libraries (h5clear-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -86,6 +86,23 @@ if (BUILD_SHARED_LIBS) ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5DEBUG_SRC_FORMAT h5debug) + clang_format (HDF5_H5REPART_SRC_FORMAT h5repart) + clang_format (HDF5_H5MKGRP_SRC_FORMAT h5mkgrp) + clang_format (HDF5_H5CLEAR_SRC_FORMAT h5clear) + else () + clang_format (HDF5_H5DEBUG_SRC_FORMAT h5debug-shared) + clang_format (HDF5_H5REPART_SRC_FORMAT h5repart-shared) + clang_format (HDF5_H5MKGRP_SRC_FORMAT h5mkgrp-shared) + clang_format (HDF5_H5CLEAR_SRC_FORMAT h5clear-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 034c8d3..f76a65e 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -6,11 +6,18 @@ project (HDF5_TOOLS_TEST_H5COPY C) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c) - target_include_directories (h5copygentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5copygentest PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5copygentest STATIC) target_link_libraries (h5copygentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5COPY_FORMAT h5copygentest) + endif () + #add_test (NAME h5copygentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () @@ -23,13 +30,21 @@ if (BUILD_SHARED_LIBS) set (H5COPY_TOOL_PLUGIN_LIB_TARGET ${H5COPY_TOOL_PLUGIN_LIB_CORENAME}) add_library (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c) - target_include_directories (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED) target_link_libraries (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5COPY_TOOL_PLUGIN_LIB_TARGET} ${H5COPY_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5COPY_PLUGIN_FORMAT ${H5COPY_TOOL_PLUGIN_LIB_TARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index e4bfc99..9349ace 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -6,11 +6,18 @@ project (HDF5_TOOLS_TEST_H5DIFF C) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c) - target_include_directories (h5diffgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5diffgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5diffgentest STATIC) target_link_libraries (h5diffgentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5DIFF_FORMAT h5diffgentest) + endif () + #add_test (NAME h5diffgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () @@ -23,11 +30,18 @@ if (BUILD_SHARED_LIBS) set (H5DIFF_TOOL_PLUGIN_LIB_TARGET ${H5DIFF_TOOL_PLUGIN_LIB_CORENAME}) add_library (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c) - target_include_directories (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED) target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} ${H5DIFF_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5DIFF_PLUGIN_FORMAT ${H5DIFF_TOOL_PLUGIN_LIB_TARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 8a83699..242465e 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -10,11 +10,18 @@ if (BUILD_SHARED_LIBS) set (H5DUMP_TOOL_PLUGIN_LIB_TARGET ${H5DUMP_TOOL_PLUGIN_LIB_CORENAME}) add_library (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c) - target_include_directories (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED) target_link_libraries (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} ${H5DUMP_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5DUMP_PLUGIN_FORMAT ${H5DUMP_TOOL_PLUGIN_LIB_TARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- @@ -35,11 +42,18 @@ endif () # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) - target_include_directories (h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5dumpgentest STATIC) target_link_libraries (h5dumpgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5DUMP_FORMAT h5dumpgentest) + endif () + #add_test (NAME h5dumpgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 44211ea..0d8563e 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -405,7 +405,7 @@ # -------------------------------------------------------------------- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbin1.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl" "h5dump_std_files") - if (WIN32 OR MINGW) + if (WIN32) configure_file(${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp NEWLINE_STYLE CRLF) #file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM) #file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 99420d8..34a3c7b 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -5,7 +5,7 @@ project (HDF5_TOOLS_TEST_H5FC C) # Add the h5format_convert test executables # -------------------------------------------------------------------- add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c) -target_include_directories (h5fc_chk_idx PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (h5fc_chk_idx PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5fc_chk_idx STATIC) target_link_libraries (h5fc_chk_idx PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -15,13 +15,27 @@ else () endif () set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5FC_h5fc_chk_idx_FORMAT h5fc_chk_idx) +endif () + if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c) - target_include_directories (h5fc_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5fc_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5fc_gentest STATIC) target_link_libraries (h5fc_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5FC_FORMAT h5fc_gentest) + endif () + #add_test (NAME h5fc_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index f3991c5..e8b5bce 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -5,7 +5,7 @@ project (HDF5_TOOLS_TEST_H5IMPORT C) # Add the h5import executables # -------------------------------------------------------------------- add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c) -target_include_directories (h5importtest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (h5importtest PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5importtest STATIC) target_link_libraries (h5importtest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -15,6 +15,13 @@ else () endif () set_target_properties (h5importtest PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5IMPORT_FORMAT h5importtest) +endif () + if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index 78160d3..9da7080 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -6,16 +6,23 @@ project (HDF5_TOOLS_TEST_H5JAM C) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c) - target_include_directories (h5jamgentest PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5jamgentest PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5jamgentest STATIC) target_link_libraries (h5jamgentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5JAM_FORMAT h5jamgentest) + endif () + #add_test (NAME h5jamgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c) -target_include_directories (getub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (getub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (getub STATIC) target_link_libraries (getub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -26,7 +33,7 @@ endif () set_target_properties (getub PROPERTIES FOLDER tools) add_executable (tellub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/tellub.c) -target_include_directories (tellub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (tellub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (tellub STATIC) target_link_libraries (tellub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -36,6 +43,14 @@ else () endif () set_target_properties (tellub PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5JAM_getub_FORMAT getub) + clang_format (HDF5_TOOLS_TEST_H5JAM_tellub_FORMAT tellub) +endif () + if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index 3993277..ee223b8 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -10,13 +10,21 @@ if (BUILD_SHARED_LIBS) set (H5LS_TOOL_PLUGIN_LIB_TARGET ${H5LS_TOOL_PLUGIN_LIB_CORENAME}) add_library (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c) - target_include_directories (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED) target_link_libraries (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5LS_TOOL_PLUGIN_LIB_TARGET} ${H5LS_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5LS_PLUGIN_FORMAT ${H5LS_TOOL_PLUGIN_LIB_TARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index 54cff64..26db85a 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -6,7 +6,7 @@ project (HDF5_TOOLS_TEST_H5REPACK C) # -------------------------------------------------------------------- add_executable (testh5repack_detect_szip ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) target_include_directories (testh5repack_detect_szip - PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" ) if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC) @@ -17,6 +17,7 @@ else () endif () set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) +# These are the same files used by the h5repack tool set (REPACK_COMMON_SOURCES ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_copy.c ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_filters.c @@ -28,7 +29,7 @@ set (REPACK_COMMON_SOURCES ) add_executable (h5repacktest ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repacktst.c) target_include_directories (h5repacktest - PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" ) if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5repacktest STATIC) @@ -51,17 +52,25 @@ if (BUILD_SHARED_LIBS) set (H5REPACK_TOOL_PLUGIN_LIB_VTARGET ${H5REPACK_TOOL_PLUGIN_LIB_VCORENAME}) add_library (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c) - target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED) target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} ${H5REPACK_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") add_library (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c) - target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED) target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} ${H5REPACK_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5REPACK_PLUGIN_FORMAT ${H5REPACK_TOOL_PLUGIN_LIB_TARGET}) + clang_format (HDF5_TOOLS_TEST_H5REPACK_VPLUGIN_FORMAT ${H5REPACK_TOOL_PLUGIN_LIB_VTARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- @@ -90,11 +99,18 @@ endif () # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5repackgentest ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repackgentest.c) - target_include_directories (h5repackgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5repackgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5repackgentest STATIC) target_link_libraries (h5repackgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5repackgentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5REPACK_FORMAT h5repackgentest) + endif () + #add_test (NAME h5repackgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 839d618..649cdab 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -276,7 +276,7 @@ endif () endmacro () - macro (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) + macro (ADD_H5_FILTER_TEST testname testfilter testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -410,6 +410,48 @@ endif () endmacro () + macro (ADD_H5_DIFF_TEST testname testtype resultcode testfile) + if ("${testtype}" STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_DIFF-${testname} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" + ) + set_property(TEST H5REPACK_DIFF-${testname} PROPERTY DISABLED) + endif () + else () + add_test ( + NAME H5REPACK_DIFF-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_DIFF-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack + ) + add_test ( + NAME H5REPACK_DIFF-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_DIFF-${testname} PROPERTIES + DEPENDS H5REPACK_DIFF-${testname}-clear-objects + ) + add_test ( + NAME H5REPACK_DIFF-${testname}_DFF + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;--enable-error-stack;${testfile};out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=out-${testname}.${testfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${testname}.${testfile}.tst" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5REPACK_DIFF-${testname}_DFF PROPERTIES + DEPENDS H5REPACK_DIFF-${testname} + ) + endif () + endmacro () + macro (ADD_H5_STAT_TEST testname testtype resultcode statarg resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -1148,7 +1190,7 @@ if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") endif () - ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) + ADD_H5_FILTER_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### # the following tests assume the input files have filters diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index f50a747..a40d196 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -6,11 +6,18 @@ project (HDF5_TOOLS_TEST_H5STAT C) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c) - target_include_directories (h5stat_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5stat_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5stat_gentest STATIC) target_link_libraries (h5stat_gentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5STAT_FORMAT h5stat_gentest) + endif () + #add_test (NAME h5stat_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 8f13d84..f67f36b 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -6,7 +6,7 @@ project (HDF5_TOOLS_TEST_MISC C) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c) - target_include_directories (h5repart_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5repart_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5repart_gentest STATIC) target_link_libraries (h5repart_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) @@ -17,8 +17,15 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5repart_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_h5repart_gentest_FORMAT h5repart_gentest) + endif () + add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) - target_include_directories (h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5clear_gentest STATIC) target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) @@ -29,12 +36,19 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) #add_test (NAME H5CLEAR-h5clear_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_h5clear_gentest_FORMAT h5clear_gentest) + endif () + add_subdirectory (vds) endif () add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c) -target_include_directories (h5repart_test PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (h5repart_test PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (h5repart_test STATIC) target_link_libraries (h5repart_test PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -44,8 +58,15 @@ else () endif () set_target_properties (h5repart_test PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_h5repart_test_FORMAT h5repart_test) +endif () + add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c) -target_include_directories (clear_open_chk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (clear_open_chk PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (clear_open_chk STATIC) target_link_libraries (clear_open_chk PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -55,6 +76,13 @@ else () endif () set_target_properties (clear_open_chk PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_clear_open_chk_FORMAT clear_open_chk) +endif () + if (HDF5_TEST_SERIAL) include (CMakeTestsRepart.cmake) include (CMakeTestsClear.cmake) diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 71261c4..e8eb960 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required (VERSION 3.12) project (HDF5_TOOLS_TEST_MISC_VDS C) -MACRO (ADD_H5_GENERATOR genfile) +macro (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c) - target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (${genfile} STATIC) target_link_libraries (${genfile} PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -12,7 +12,14 @@ MACRO (ADD_H5_GENERATOR genfile) target_link_libraries (${genfile} PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) endif () set_target_properties (${genfile} PROPERTIES FOLDER generator/tools) -ENDMACRO () + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_VDS_${genfile}_FORMAT ${genfile}) + endif () +endmacro () # generator executables set (H5_GENERATORS diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 3c45e85..7399723 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -10,7 +10,7 @@ set (h5perf_serial_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial ${h5perf_serial_SOURCES}) -target_include_directories (h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5perf_serial STATIC) target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -20,6 +20,13 @@ else () endif () set_target_properties (h5perf_serial PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_serial_FORMAT h5perf_serial) +endif () + if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf_serial_alone - io_timer.c includes set (h5perf_serial_alone_SOURCES @@ -29,7 +36,7 @@ if (HDF5_BUILD_PERFORM_STANDALONE) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_standalone.c ) add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES}) - target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5perf_serial_alone STATIC) target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_LIB_TARGET} "$<$:${MPI_C_LIBRARIES}>") @@ -38,9 +45,14 @@ if (HDF5_BUILD_PERFORM_STANDALONE) target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_LIBSH_TARGET} "$<$:${MPI_C_LIBRARIES}>") endif () set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) - set_property (TARGET h5perf_serial_alone - APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE - ) + set_property (TARGET h5perf_serial_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_serial_alone_FORMAT h5perf_serial_alone) + endif () endif () #-- Adding test for chunk @@ -48,7 +60,7 @@ set (chunk_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk.c ) add_executable(chunk ${chunk_SOURCES}) -target_include_directories (chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (chunk STATIC) target_link_libraries (chunk PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -58,12 +70,19 @@ else () endif () set_target_properties (chunk PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_chunk_FORMAT chunk) +endif () + #-- Adding test for iopipe set (iopipe_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/iopipe.c ) add_executable (iopipe ${iopipe_SOURCES}) -target_include_directories (iopipe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (iopipe PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (iopipe STATIC) target_link_libraries (iopipe PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -73,12 +92,19 @@ else () endif () set_target_properties (iopipe PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_iopipe_FORMAT iopipe) +endif () + #-- Adding test for chunk_cache set (chunk_cache_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk_cache.c ) add_executable (chunk_cache ${chunk_cache_SOURCES}) -target_include_directories (chunk_cache PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (chunk_cache PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (chunk_cache STATIC) target_link_libraries (chunk_cache PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -88,12 +114,19 @@ else () endif () set_target_properties (chunk_cache PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_chunk_cache_FORMAT chunk_cache) +endif () + #-- Adding test for overhead set (overhead_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/overhead.c ) add_executable (overhead ${overhead_SOURCES}) -target_include_directories (overhead PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (overhead PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (overhead STATIC) target_link_libraries (overhead PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -103,12 +136,19 @@ else () endif () set_target_properties (overhead PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_overhead_FORMAT overhead) +endif () + #-- Adding test for perf_meta set (perf_meta_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c ) add_executable (perf_meta ${perf_meta_SOURCES}) -target_include_directories (perf_meta PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (perf_meta PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (perf_meta STATIC) target_link_libraries (perf_meta PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -118,12 +158,19 @@ else () endif () set_target_properties (perf_meta PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_perf_meta_FORMAT perf_meta) +endif () + #-- Adding test for zip_perf set (zip_perf_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/zip_perf.c ) add_executable (zip_perf ${zip_perf_SOURCES}) -target_include_directories (zip_perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (zip_perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (zip_perf STATIC) target_link_libraries (zip_perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_COMP_LIBS}) @@ -133,22 +180,36 @@ else () endif () set_target_properties (zip_perf PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_zip_perf_FORMAT zip_perf) +endif () + if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL) if (UNIX) - #-- Adding test for perf - only on unix systems - set (perf_SOURCES - ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf.c - ) - add_executable (perf ${perf_SOURCES}) - target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - if (NOT BUILD_SHARED_LIBS) - TARGET_C_PROPERTIES (perf STATIC) - target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) - else () - TARGET_C_PROPERTIES (perf SHARED) - target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - endif () - set_target_properties (perf PROPERTIES FOLDER perform) + #-- Adding test for perf - only on unix systems + set (perf_SOURCES + ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf.c + ) + add_executable (perf ${perf_SOURCES}) + target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (perf STATIC) + target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + else () + TARGET_C_PROPERTIES (perf SHARED) + target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + endif () + set_target_properties (perf PROPERTIES FOLDER perform) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_perf_FORMAT perf) + endif () endif () #-- Adding test for h5perf @@ -157,7 +218,7 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf ${h5perf_SOURCES}) - target_include_directories (h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5perf STATIC) target_link_libraries (h5perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -167,6 +228,13 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL) endif () set_target_properties (h5perf PROPERTIES FOLDER perform) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_FORMAT h5perf) + endif () + if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf set (h5perf_alone_SOURCES @@ -176,7 +244,7 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_standalone.c ) add_executable (h5perf_alone ${h5perf_alone_SOURCES}) - target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (h5perf_alone STATIC) target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} ${LINK_LIBS} "$<$:${MPI_C_LIBRARIES}>") @@ -188,6 +256,13 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL) set_property (TARGET h5perf_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_alone_FORMAT h5perf_alone) + endif () endif () endif () diff --git a/utils/mirror_vfd/CMakeLists.txt b/utils/mirror_vfd/CMakeLists.txt index 1926352..92212e0 100644 --- a/utils/mirror_vfd/CMakeLists.txt +++ b/utils/mirror_vfd/CMakeLists.txt @@ -8,38 +8,54 @@ project (HDF5_UTILS_MIRRORVFD C) set (mirror_server_SOURCES ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_remote.c ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_server.c - ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_writer.c) + ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_writer.c + ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_remote.h +) add_executable (mirror_server ${mirror_server_SOURCES}) -target_include_directories (mirror_server PRIVATE "${HDF5_UITLS_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (mirror_server PRIVATE "${HDF5_UITLS_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (mirror_server STATIC) - target_link_libraries (mirror_server PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_link_libraries (mirror_server PRIVATE ${HDF5_LIB_TARGET}) else () TARGET_C_PROPERTIES (mirror_server SHARED) - target_link_libraries (mirror_server PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (mirror_server PRIVATE ${HDF5_LIBSH_TARGET}) endif () set_target_properties (mirror_server PROPERTIES FOLDER utils) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};mirror_server") set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} mirror_server) #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_UTILS_MIRRORVFD_SERVER_FORMAT mirror_server) +endif () + +#----------------------------------------------------------------------------- # Add the mirror_server_stop executable #----------------------------------------------------------------------------- set (mirror_server_stop_SOURCES ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_server_stop.c) add_executable (mirror_server_stop ${mirror_server_stop_SOURCES}) -target_include_directories (mirror_server_stop PRIVATE "${HDF5_UITLS_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (mirror_server_stop PRIVATE "${HDF5_UITLS_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (mirror_server_stop STATIC) - target_link_libraries (mirror_server_stop PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_link_libraries (mirror_server_stop PRIVATE ${HDF5_LIB_TARGET}) else () TARGET_C_PROPERTIES (mirror_server_stop SHARED) - target_link_libraries (mirror_server_stop PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (mirror_server_stop PRIVATE ${HDF5_LIBSH_TARGET}) endif () set_target_properties (mirror_server_stop PROPERTIES FOLDER utils) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};mirror_server_stop") set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} mirror_server_stop) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_UTILS_MIRRORVFD_STOP_FORMAT mirror_server_stop) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### -- cgit v0.12 From ee655cf374c5f2b2f43673a9e1d925af0f231626 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 9 Apr 2021 07:07:53 -0700 Subject: Brings a lot of smaller changes from develop --- src/H5ACmodule.h | 8 +- src/H5ACprivate.h | 38 +++--- src/H5Bpkg.h | 28 ++--- src/H5Cpkg.h | 30 ++--- src/H5Cprivate.h | 8 +- src/H5FDpublic.h | 6 +- test/bittests.c | 2 +- test/cache_api.c | 10 +- test/cache_common.h | 6 +- test/cache_logging.c | 2 +- test/chunk_info.c | 14 +-- test/cmpd_dset.c | 48 ++++---- test/cross_read.c | 2 +- test/dangle.c | 12 +- test/direct_chunk.c | 2 +- test/dt_arith.c | 77 ++++++------ test/dtransform.c | 8 +- test/enum.c | 6 +- test/error_test.c | 9 +- test/extend.c | 2 +- test/external.c | 22 ++-- test/external_common.c | 2 +- test/external_common.h | 8 +- test/external_env.c | 3 - test/external_fname.h | 8 +- test/filenotclosed.c | 4 +- test/fillval.c | 70 +++++------ test/filter_fail.c | 6 +- test/filter_plugin.c | 2 +- test/flush1.c | 2 +- test/flush2.c | 2 +- test/flushrefreshTest.cmake | 2 +- test/gen_bad_compound.c | 2 +- test/gen_bad_ohdr.c | 2 +- test/gen_cross.c | 4 +- test/gen_filters.c | 6 +- test/gen_mergemsg.c | 2 +- test/getname.c | 16 +-- test/hyperslab.c | 16 +-- test/istore.c | 10 +- test/links.c | 279 +++++++++++++++++++++++--------------------- test/swmr_common.h | 6 +- testpar/testphdf5.h | 5 +- tools/lib/h5diff.h | 6 +- tools/lib/h5tools.h | 8 +- tools/lib/h5tools_dump.h | 6 +- tools/lib/h5tools_error.h | 6 +- tools/lib/h5tools_ref.h | 4 +- tools/lib/h5tools_str.h | 8 +- tools/lib/h5tools_utils.h | 8 +- tools/lib/h5trav.h | 6 +- tools/lib/io_timer.h | 6 +- tools/lib/ph5diff.h | 6 +- 53 files changed, 431 insertions(+), 430 deletions(-) diff --git a/src/H5ACmodule.h b/src/H5ACmodule.h index b7fc48f..d1f9697 100644 --- a/src/H5ACmodule.h +++ b/src/H5ACmodule.h @@ -11,15 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the * H5AC package. Including this header means that the source file * is part of the H5AC package. */ -#ifndef _H5ACmodule_H -#define _H5ACmodule_H +#ifndef H5ACmodule_H +#define H5ACmodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error * reporting macros. @@ -29,4 +29,4 @@ #define H5_MY_PKG_ERR H5E_CACHE #define H5_MY_PKG_INIT YES -#endif /* _H5ACmodule_H */ +#endif /* H5ACmodule_H */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 66f590f..e320f72 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -13,12 +13,12 @@ /*------------------------------------------------------------------------- * - * Created: H5ACprivate.h - * Jul 9 1997 - * Robb Matzke + * Created: H5ACprivate.h + * Jul 9 1997 + * Robb Matzke * - * Purpose: Constants and typedefs available to the rest of the - * library. + * Purpose: Constants and typedefs available to the rest of the + * library. * *------------------------------------------------------------------------- */ @@ -26,14 +26,14 @@ #ifndef H5ACprivate_H #define H5ACprivate_H -#include "H5ACpublic.h" /*public prototypes */ +#include "H5ACpublic.h" /*public prototypes */ /* Pivate headers needed by this header */ -#include "H5private.h" /* Generic Functions */ -#include "H5Cprivate.h" /* Cache */ -#include "H5Fprivate.h" /* File access */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5SLprivate.h" /* Skip lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Cprivate.h" /* Cache */ +#include "H5Fprivate.h" /* File access */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5SLprivate.h" /* Skip lists */ /* Global metadata tag values */ #define H5AC__INVALID_TAG (haddr_t)0 @@ -90,20 +90,20 @@ typedef enum { * * NOTE: test/cache plays games with the f->shared->cache, and thus * setting H5AC_DUMP_STATS_ON_CLOSE will generate constant, - * irrelevant data when run with that test program. See - * comments on setup_cache() / takedown_cache() in test/cache_common.c. + * irrelevant data when run with that test program. See + * comments on setup_cache() / takedown_cache() in test/cache_common.c. * for details. * - * If you need to dump stats at file close in test/cache.c, - * use the dump_stats parameter to takedown_cache(), or call - * H5C_stats() directly. - * JRM -- 4/12/15 + * If you need to dump stats at file close in test/cache.c, + * use the dump_stats parameter to takedown_cache(), or call + * H5C_stats() directly. + * JRM -- 4/12/15 * * Added the H5AC_DUMP_IMAGE_STATS_ON_CLOSE #define, which works much * the same way as H5AC_DUMP_STATS_ON_CLOSE. However, the set of stats * displayed is much smaller, and directed purely at the cache image feature. * - * JRM -- 11/1/15 + * JRM -- 11/1/15 */ #if H5C_COLLECT_CACHE_STATS @@ -132,7 +132,7 @@ typedef enum { #endif /* - * Class methods pertaining to caching. Each type of cached object will + * Class methods pertaining to caching. Each type of cached object will * have a constant variable with permanent life-span that describes how * to cache the object. */ diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index 0f61461..0a79628 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -12,12 +12,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Thursday, May 15, 2003 + * Programmer: Quincey Koziol + * Thursday, May 15, 2003 * - * Purpose: This file contains declarations which are visible only within - * the H5B package. Source files outside the H5B package should - * include H5Bprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5B package. Source files outside the H5B package should + * include H5Bprivate.h instead. */ #if !(defined H5B_FRIEND || defined H5B_MODULE) #error "Do not include this file outside the H5B package!" @@ -30,7 +30,7 @@ #include "H5Bprivate.h" /* Other private headers needed by this file */ -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5FLprivate.h" /* Free Lists */ /**************************/ @@ -49,20 +49,20 @@ typedef struct H5B_t { H5AC_info_t cache_info; /* Information for H5AC cache functions */ /* _must_ be first field in structure */ - H5UC_t * rc_shared; /*ref-counted shared info */ - unsigned level; /*node level */ - unsigned nchildren; /*number of child pointers */ - haddr_t left; /*address of left sibling */ - haddr_t right; /*address of right sibling */ + H5UC_t * rc_shared; /*ref-counted shared info */ + unsigned level; /*node level */ + unsigned nchildren; /*number of child pointers */ + haddr_t left; /*address of left sibling */ + haddr_t right; /*address of right sibling */ uint8_t *native; /*array of keys in native format */ - haddr_t *child; /*2k child pointers */ + haddr_t *child; /*2k child pointers */ } H5B_t; /* Callback info for loading a B-tree node into the cache */ typedef struct H5B_cache_ud_t { H5F_t * f; /* File that B-tree node is within */ - const struct H5B_class_t *type; /* Type of tree */ - H5UC_t * rc_shared; /* Ref-counted shared info */ + const struct H5B_class_t *type; /* Type of tree */ + H5UC_t * rc_shared; /* Ref-counted shared info */ } H5B_cache_ud_t; /*****************************/ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 5c3549f..99ba4bd 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -17,13 +17,13 @@ * Purpose: This file contains declarations which are normally visible * only within the H5C package. * - * Source files outside the H5C package should include - * H5Cprivate.h instead. + * Source files outside the H5C package should include + * H5Cprivate.h instead. * - * The one exception to this rule is test/cache.c. The test - * code is easier to write if it can look at the cache's - * internal data structures. Indeed, this is the main - * reason why this file was created. + * The one exception to this rule is test/cache.c. The test + * code is easier to write if it can look at the cache's + * internal data structures. Indeed, this is the main + * reason why this file was created. */ /* clang-format off */ @@ -40,15 +40,16 @@ #include "H5Cprivate.h" /* Other private headers needed by this file */ -#include "H5Clog.h" /* Cache logging */ -#include "H5SLprivate.h" /* Skip lists */ +#include "H5Clog.h" /* Cache logging */ +#include "H5SLprivate.h" /* Skip lists */ /**************************/ /* Package Private Macros */ /**************************/ /* Number of epoch markers active */ -#define H5C__MAX_EPOCH_MARKERS 10 +#define H5C__MAX_EPOCH_MARKERS 10 + /* Cache configuration settings */ #define H5C__HASH_TABLE_LEN (64 * 1024) /* must be a power of 2 */ @@ -76,7 +77,7 @@ * to the HGOTO_ERROR macro, which may not be appropriate in all cases. * If so, we will need versions of the insertion and deletion macros which * do not reference the sanity checking macros. - * JRM - 5/5/04 + * JRM - 5/5/04 * * Changes: * @@ -151,14 +152,14 @@ * sanity checking macros. These macro are used to update the size of * a DLL when one of its entries changes size. * - * JRM - 9/8/05 + * JRM - 9/8/05 * * - Added macros supporting the index list -- a doubly liked list of * all entries in the index. This list is necessary to reduce the * cost of visiting all entries in the cache, which was previously * done via a scan of the hash table. * - * JRM - 10/15/15 + * JRM - 10/15/15 * ****************************************************************************/ @@ -799,6 +800,7 @@ #endif /* H5C_COLLECT_CACHE_STATS */ + /*********************************************************************** * * Hash table access and manipulation macros: @@ -815,13 +817,13 @@ * the clean_index_size and dirty_index_size fields of H5C_t. Also * added macros to allow us to track entry cleans and dirties. * - * JRM -- 11/5/08 + * JRM -- 11/5/08 * * - Updated existing index macros and sanity check macros to maintain * the index_ring_len, index_ring_size, clean_index_ring_size, and * dirty_index_ring_size fields of H5C_t. * - * JRM -- 9/1/15 + * JRM -- 9/1/15 * * - Updated existing index macros and sanity checks macros to * maintain an doubly linked list of all entries in the index. diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index a640c6a..0c827c6 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -26,11 +26,11 @@ #ifndef H5Cprivate_H #define H5Cprivate_H -#include "H5Cpublic.h" /* public prototypes */ +#include "H5Cpublic.h" /* public prototypes */ /* Private headers needed by this header */ -#include "H5private.h" /* Generic Functions */ -#include "H5Fprivate.h" /* File access */ +#include "H5private.h" /* Generic Functions */ +#include "H5Fprivate.h" /* File access */ /**************************/ /* Library Private Macros */ @@ -44,7 +44,7 @@ * or decrease it if appropriate. Its purposes is to detect corrupt * object sizes, so it probably doesn't matter if it is a bit big. * - * JRM - 5/17/04 + * JRM - 5/17/04 */ #define H5C_MAX_ENTRY_SIZE ((size_t)(32 * 1024 * 1024)) diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 8862362..f642f41 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -315,9 +315,9 @@ typedef struct H5FD_free_t { * are declared here and the driver appends private fields in memory. */ struct H5FD_t { - hid_t driver_id; /* Driver ID for this file */ - const H5FD_class_t *cls; /* Constant class info */ - unsigned long fileno; /* File 'serial' number */ + hid_t driver_id; /*driver ID for this file */ + const H5FD_class_t *cls; /*constant class info */ + unsigned long fileno; /* File 'serial' number */ unsigned access_flags; /* File access flags (from create or open) */ unsigned long feature_flags; /* VFL Driver feature Flags */ haddr_t maxaddr; /* For this file, overrides class */ diff --git a/test/bittests.c b/test/bittests.c index 75fb872..5e83dfe 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 16, 1998 * * Purpose: Tests functions in H5Tbit.c diff --git a/test/cache_api.c b/test/cache_api.c index 7a3a2be..75e1b9d 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1216,9 +1216,9 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) /* do random reads on all datasets */ n = 0; while ((pass) && (n < NUM_RANDOM_ACCESSES)) { - m = rand() % NUM_DSETS; - i = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; - j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; + m = HDrand() % NUM_DSETS; + i = (HDrand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; + j = (HDrand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; /* select on disk hyperslab */ offset[0] = (hsize_t)i; /*offset of hyperslab in file*/ @@ -1328,8 +1328,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) m = 0; n = 0; while ((pass) && (n < NUM_RANDOM_ACCESSES)) { - i = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; - j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; + i = (HDrand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; + j = (HDrand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; /* select on disk hyperslab */ offset[0] = (hsize_t)i; /*offset of hyperslab in file*/ diff --git a/test/cache_common.h b/test/cache_common.h index 3ee931f..1f3f5ad 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -17,8 +17,8 @@ * This file contains common #defines, type definitions, and * externs for tests of the cache implemented in H5C.c */ -#ifndef _CACHE_COMMON_H -#define _CACHE_COMMON_H +#ifndef CACHE_COMMON_H +#define CACHE_COMMON_H #define H5C_FRIEND /*suppress error about including H5Cpkg */ #define H5F_FRIEND /*suppress error about including H5Fpkg */ @@ -639,4 +639,4 @@ H5TEST_DLL void dump_LRU(H5F_t * file_ptr); } #endif -#endif /* _CACHE_COMMON_H */ +#endif /* CACHE_COMMON_H */ diff --git a/test/cache_logging.c b/test/cache_logging.c index 1ae908b..448e12b 100644 --- a/test/cache_logging.c +++ b/test/cache_logging.c @@ -76,7 +76,7 @@ test_logging_api(void) if (H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size, &start_on_access_out) < 0) TEST_ERROR; if ((is_enabled != is_enabled_out) || (start_on_access != start_on_access_out) || - HDstrcmp(LOG_LOCATION, location)) + HDstrcmp(LOG_LOCATION, location) != 0) TEST_ERROR; /* Create a file */ diff --git a/test/chunk_info.c b/test/chunk_info.c index 9390e6d..4a661eb 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -541,7 +541,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) #ifdef H5_HAVE_FILTER_DEFLATE /* Allocate input (compressed) buffer */ - inbuf = malloc(z_dst_nbytes); + inbuf = HDcalloc(1, z_dst_nbytes); /* Set chunk size to the compressed chunk size and the chunk point to the compressed data chunk */ @@ -553,20 +553,20 @@ test_get_chunk_info_highest_v18(hid_t fapl) /* Check for various zlib errors */ if (Z_BUF_ERROR == ret) { - fprintf(stderr, "overflow"); + HDfprintf(stderr, "overflow"); TEST_ERROR } else if (Z_MEM_ERROR == ret) { - fprintf(stderr, "deflate memory error"); + HDfprintf(stderr, "deflate memory error"); TEST_ERROR } else if (Z_OK != ret) { - fprintf(stderr, "other deflate error"); + HDfprintf(stderr, "other deflate error"); TEST_ERROR } #else /* Allocate input (non-compressed) buffer */ - inbuf = malloc(CHK_SIZE); + inbuf = HDcalloc(1, CHK_SIZE); HDmemcpy(inbuf, direct_buf, CHK_SIZE); #endif /* end H5_HAVE_FILTER_DEFLATE */ @@ -1637,7 +1637,7 @@ test_basic_query(hid_t fapl) TEST_ERROR /* Remove the test file */ - remove(filename); + HDremove(filename); PASSED(); return SUCCEED; @@ -2045,7 +2045,7 @@ test_flt_msk_with_skip_compress(hid_t fapl) TEST_ERROR /* Remove the test file */ - remove(filename); + HDremove(filename); PASSED(); return SUCCEED; diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 6fb157c..e74b438 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, January 23, 1998 */ @@ -302,7 +302,7 @@ test_compound(char *filename, hid_t fapl) s1[i].c[1] != s2[i].c[1] || s1[i].c[2] != s2[i].c[2] || s1[i].c[3] != s2[i].c[3] || s1[i].d != s2[i].d || s1[i].e != s2[i].e) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -339,7 +339,7 @@ test_compound(char *filename, hid_t fapl) s1[i].c[1] != s3[i].c[1] || s1[i].c[2] != s3[i].c[2] || s1[i].c[3] != s3[i].c[3] || s1[i].d != s3[i].d || s1[i].e != s3[i].e) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -369,7 +369,7 @@ test_compound(char *filename, hid_t fapl) for (i = 0; i < NX * NY; i++) { if (s1[i].b != s4[i].b || s1[i].d != s4[i].d) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -413,7 +413,7 @@ test_compound(char *filename, hid_t fapl) s1[i].c[1] != s5[i].c[1] || s1[i].c[2] != s5[i].c[2] || s1[i].c[3] != s5[i].c[3] || s1[i].d != s5[i].d || s1[i].e != s5[i].e) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -423,7 +423,7 @@ test_compound(char *filename, hid_t fapl) if (s5[i].pre != 1000 + 4 * i || s5[i].mid1 != 1001 + 4 * i || s5[i].mid2 != 1002 + 4 * i || s5[i].post != 1003 + 4 * i) { H5_FAILED(); - puts(" Memory values were clobbered"); + HDputs(" Memory values were clobbered"); goto error; } } @@ -482,7 +482,7 @@ test_compound(char *filename, hid_t fapl) s1[i].c[1] != s6[i].c[1] || s1[i].c[2] != s6[i].c[2] || s1[i].c[3] != s6[i].c[3] || s1[i].d != s6[i].d || s1[i].e != s6[i].e) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -492,7 +492,7 @@ test_compound(char *filename, hid_t fapl) if (s6[i].pre != 1000 + 4 * i || s6[i].mid1 != 1001 + 4 * i || s6[i].mid2 != 1002 + 4 * i || s6[i].post != 1003 + 4 * i) { H5_FAILED(); - puts(" Memory values were clobbered"); + HDputs(" Memory values were clobbered"); goto error; } } @@ -561,7 +561,7 @@ test_compound(char *filename, hid_t fapl) s2[i].c[1] != s1[i].c[1] || s2[i].c[2] != s1[i].c[2] || s2[i].c[3] != s1[i].c[3] || s2[i].d != s1[i].d || s2[i].e != s1[i].e) { H5_FAILED(); - puts(" Incorrect values read from file"); + HDputs(" Incorrect values read from file"); goto error; } } @@ -590,7 +590,7 @@ test_compound(char *filename, hid_t fapl) /* Read the dataset */ s8 = (s1_t *)HDcalloc((size_t)(h_size[0] * h_size[1]), sizeof(s1_t)); - assert(s8); + HDassert(s8); if (H5Dread(dataset, s1_tid, s8_m_sid, s8_f_sid, H5P_DEFAULT, s8) < 0) { goto error; } @@ -604,7 +604,7 @@ test_compound(char *filename, hid_t fapl) if (ps8->a != ps1->a || ps8->b != ps1->b || ps8->c[0] != ps1->c[0] || ps8->c[1] != ps1->c[1] || ps8->c[2] != ps1->c[2] || ps8->c[3] != ps1->c[3] || ps8->d != ps1->d || ps8->e != ps1->e) { H5_FAILED(); - puts(" Incorrect values read from file"); + HDputs(" Incorrect values read from file"); goto error; } } @@ -643,7 +643,7 @@ test_compound(char *filename, hid_t fapl) ps2->c[1] != ps1->c[1] || ps2->c[2] != ps1->c[2] || ps2->c[3] != ps1->c[3] || ps2->d != ps1->d || ps2->e != ps1->e) { H5_FAILED(); - puts(" Memory values clobbered"); + HDputs(" Memory values clobbered"); goto error; } } @@ -652,7 +652,7 @@ test_compound(char *filename, hid_t fapl) ps2->c[1] != (unsigned)(-1) || ps2->c[2] != (unsigned)(-1) || ps2->c[3] != (unsigned)(-1) || ps2->d != (unsigned)(-1) || ps2->e != (unsigned)(-1)) { H5_FAILED(); - puts(" Incorrect values read from file"); + HDputs(" Incorrect values read from file"); goto error; } } @@ -691,7 +691,7 @@ test_compound(char *filename, hid_t fapl) ps5->c[2] != ps1->c[2] || ps5->c[3] != ps1->c[3] || ps5->mid2 != (unsigned)(-1) || ps5->d != ps1->d || ps5->e != ps1->e || ps5->post != (unsigned)(-1)) { H5_FAILED(); - puts(" Memory values clobbered"); + HDputs(" Memory values clobbered"); goto error; } } @@ -702,7 +702,7 @@ test_compound(char *filename, hid_t fapl) ps5->c[3] != (unsigned)(-1) || ps5->mid2 != (unsigned)(-1) || ps5->d != (unsigned)(-1) || ps5->e != (unsigned)(-1) || ps5->post != (unsigned)(-1)) { H5_FAILED(); - puts(" Incorrect values read from file"); + HDputs(" Incorrect values read from file"); goto error; } } @@ -723,7 +723,7 @@ test_compound(char *filename, hid_t fapl) h_size[0] = 2 * NX / 3 - f_offset[0]; h_size[1] = 2 * NY / 3 - f_offset[1]; s11 = (s4_t *)HDmalloc((size_t)h_size[0] * (size_t)h_size[1] * sizeof(s4_t)); - assert(s11); + HDassert(s11); /* Initialize */ for (i = 0; i < h_size[0] * h_size[1]; i++) { @@ -751,7 +751,7 @@ test_compound(char *filename, hid_t fapl) ps1->c[1] != 8 * (i * NY + j) + 3 || ps1->c[2] != 8 * (i * NY + j) + 4 || ps1->c[3] != 8 * (i * NY + j) + 5 || ps1->e != 8 * (i * NY + j) + 7) { H5_FAILED(); - puts(" Write clobbered values"); + HDputs(" Write clobbered values"); goto error; } @@ -759,14 +759,14 @@ test_compound(char *filename, hid_t fapl) j < f_offset[1] + h_size[1]) { if (ps1->b != (unsigned)(-1) || ps1->d != (unsigned)(-1)) { H5_FAILED(); - puts(" Wrong values written or read"); + HDputs(" Wrong values written or read"); goto error; } } else { if (ps1->b != 8 * (i * NY + j) + 1 || ps1->d != 8 * (i * NY + j) + 6) { H5_FAILED(); - puts(" Write clobbered values"); + HDputs(" Write clobbered values"); goto error; } } @@ -792,7 +792,7 @@ test_compound(char *filename, hid_t fapl) return 0; error: - puts("*** DATASET TESTS FAILED ***"); + HDputs("*** DATASET TESTS FAILED ***"); /* Release resources */ if (s1) @@ -1669,7 +1669,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) return 0; error: - puts("*** DATASET TESTS FAILED ***"); + HDputs("*** DATASET TESTS FAILED ***"); return 1; } @@ -1684,7 +1684,7 @@ error: for (_i = 0; _i < PACK_NMEMBS; _i++) \ HDprintf(" %d", order[_i]); \ HDprintf("\n Inner compound order = %d, location = %d\n", sub_cmpd_order, order[sub_cmpd_order]); \ - fflush(stdout); \ + HDfflush(stdout); \ goto error; \ } @@ -1719,7 +1719,7 @@ test_pack_ooo(void) * the compound */ unsigned i, j; /* Indices */ - HDsrand((unsigned)time(NULL)); + HDsrand((unsigned)HDtime(NULL)); /* Initialize "free_order" array to indicate that all slots in order are * free */ @@ -2233,7 +2233,7 @@ main(int argc, char *argv[]) /* Turn off optimized compound converter? */ if (argc > 1) { - if (argc > 2 || strcmp("--noopt", argv[1])) { + if (argc > 2 || HDstrcmp("--noopt", argv[1]) != 0) { HDfprintf(stderr, "usage: %s [--noopt]\n", argv[0]); HDexit(EXIT_FAILURE); } diff --git a/test/cross_read.c b/test/cross_read.c index ace06c2..386c0da 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, March 23, 2006 * * Purpose: Check if floating-point data created on big-endian and diff --git a/test/dangle.c b/test/dangle.c index 50fef71..d41507b 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Purpose: Test dangling IDs @@ -663,7 +663,7 @@ main(void) int nerrors = 0; /* Run tests w/weak file close */ - puts("Testing dangling objects with weak file close:"); + HDputs("Testing dangling objects with weak file close:"); nerrors += test_dangle_dataset(H5F_CLOSE_WEAK); nerrors += test_dangle_group(H5F_CLOSE_WEAK); nerrors += test_dangle_datatype1(H5F_CLOSE_WEAK); @@ -671,7 +671,7 @@ main(void) nerrors += test_dangle_attribute(H5F_CLOSE_WEAK); /* Run tests w/semi file close */ - puts("Testing dangling objects with semi file close:"); + HDputs("Testing dangling objects with semi file close:"); nerrors += test_dangle_dataset(H5F_CLOSE_SEMI); nerrors += test_dangle_group(H5F_CLOSE_SEMI); nerrors += test_dangle_datatype1(H5F_CLOSE_SEMI); @@ -679,7 +679,7 @@ main(void) nerrors += test_dangle_attribute(H5F_CLOSE_SEMI); /* Run tests w/strong file close */ - puts("Testing dangling objects with strong file close:"); + HDputs("Testing dangling objects with strong file close:"); nerrors += test_dangle_dataset(H5F_CLOSE_STRONG); nerrors += test_dangle_group(H5F_CLOSE_STRONG); nerrors += test_dangle_datatype1(H5F_CLOSE_STRONG); @@ -692,11 +692,11 @@ main(void) /* Check for errors */ if (nerrors) goto error; - puts("All dangling ID tests passed."); + HDputs("All dangling ID tests passed."); return 0; error: - puts("***** DANGLING ID TESTS FAILED *****"); + HDputs("***** DANGLING ID TESTS FAILED *****"); return 1; } diff --git a/test/direct_chunk.c b/test/direct_chunk.c index 7db7242..61e3df9 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -2326,7 +2326,7 @@ main(void) need_comma = TRUE; } /* end if */ HDprintf(":\n"); - fflush(stdout); + HDfflush(stdout); nerrors += test_single_chunk(config); } /* end for */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 94bcb32..f2bf6cf 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 9, 1997 * * Purpose: Tests the data type interface (H5T) @@ -84,7 +84,7 @@ static int skip_overflow_tests_g = 0; * be allowed to continue (cf. Posix signals) so in order to recover from a * SIGFPE we run tests that might generate one in a child process. */ -#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) +#ifdef H5_HAVE_UNISTD_H #define HANDLE_SIGFPE #endif @@ -359,7 +359,7 @@ static int without_hardware_g = 0; \ for (n = 0; n < 2; n++) { \ if (n == 1) { \ - memset(value, 0, SRC_SIZE * sizeof(unsigned char)); \ + HDmemset(value, 0, SRC_SIZE * sizeof(unsigned char)); \ /* -0 */ \ H5T__bit_set(value, (size_t)(SRC_PREC - 1), (size_t)1, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ @@ -397,8 +397,8 @@ static int without_hardware_g = 0; void some_dummy_func(float x); static hbool_t overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits); static int my_isnan(dtype_t type, void *val); -static int my_isinf(int endian, unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, - size_t esize); +static int my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, + size_t esize); /*------------------------------------------------------------------------- * Function: fpe_handler @@ -556,7 +556,7 @@ some_dummy_func(float x) static void generates_sigfpe(void) { -#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) +#ifdef H5_HAVE_UNISTD_H pid_t pid; int status; size_t i, j; @@ -566,7 +566,7 @@ generates_sigfpe(void) HDfflush(stdout); HDfflush(stderr); - if ((pid = fork()) < 0) { + if ((pid = HDfork()) < 0) { HDperror("fork"); HDexit(EXIT_FAILURE); } @@ -580,7 +580,7 @@ generates_sigfpe(void) HDexit(EXIT_SUCCESS); } - while (pid != waitpid(pid, &status, 0)) + while (pid != HDwaitpid(pid, &status, 0)) /*void*/; if (WIFEXITED(status) && 0 == WEXITSTATUS(status)) { HDputs("Floating-point overflow cases will be tested."); @@ -592,12 +592,12 @@ generates_sigfpe(void) /* delete the core dump file that SIGFPE may have created */ HDunlink("core"); } -#else - HDputs("Cannot determine if floating-point overflows generate a SIGFPE;"); - HDputs("assuming yes."); +#else /* H5_HAVE_UNISTD_H */ + HDputs("Cannot determine if floating-point overflows generate a SIGFPE"); + HDputs("due to a lack of fork(2) - assuming yes."); HDputs("Overflow cases will not be tested."); skip_overflow_tests_g = TRUE; -#endif +#endif /* H5_HAVE_UNISTD_H */ } /*------------------------------------------------------------------------- @@ -775,7 +775,7 @@ test_particular_fp_integer(void) /* Print errors */ if (dst_c != SCHAR_MAX) { - double x = 0.; + double x = 0.0; signed char y; if (0 == fails_this_test++) @@ -819,7 +819,7 @@ test_particular_fp_integer(void) /* Print errors */ if (dst_i != fill_value) { - float x = 0.; + float x = 0.0; int y; if (0 == fails_this_test++) @@ -2391,7 +2391,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) } /* Make certain that there isn't some weird number of destination bits */ - assert(dst_nbits % 8 == 0); + HDassert(dst_nbits % 8 == 0); /* Are the two results the same? */ for (k = (dst_size - (dst_nbits / 8)); k < dst_size; k++) @@ -2786,18 +2786,18 @@ my_isnan(dtype_t type, void *val) char s[256]; if (FLT_FLOAT == type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, val, sizeof(float)); retval = (x != x); } else if (FLT_DOUBLE == type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, val, sizeof(double)); retval = (x != x); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE != 0 } else if (FLT_LDOUBLE == type) { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, val, sizeof(long double)); retval = (x != x); #endif @@ -2812,20 +2812,20 @@ my_isnan(dtype_t type, void *val) */ if (!retval) { if (FLT_FLOAT == type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, val, sizeof(float)); HDsnprintf(s, sizeof(s), "%g", (double)x); } else if (FLT_DOUBLE == type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, val, sizeof(double)); HDsnprintf(s, sizeof(s), "%g", x); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE != 0 } else if (FLT_LDOUBLE == type) { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, val, sizeof(long double)); HDsnprintf(s, sizeof(s), "%Lg", x); @@ -2856,7 +2856,8 @@ my_isnan(dtype_t type, void *val) *------------------------------------------------------------------------- */ static int -my_isinf(int endian, unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, size_t esize) +my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, + size_t esize) { unsigned char *bits; int retval = 0; @@ -2948,12 +2949,12 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) */ HDfflush(stdout); HDfflush(stderr); - if ((child_pid = fork()) < 0) { + if ((child_pid = HDfork()) < 0) { HDperror("fork"); return 1; } else if (child_pid > 0) { - while (child_pid != waitpid(child_pid, &status, 0)) /*void*/ + while (child_pid != HDwaitpid(child_pid, &status, 0)) /*void*/ ; if (WIFEXITED(status) && 255 == WEXITSTATUS(status)) { return 0; /*child exit after catching SIGFPE*/ @@ -3022,7 +3023,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) if (sizeof(float) == sizeof(double)) HDputs("Sizeof(float)==sizeof(double) - some tests may not be sensible."); if (OTHER == src_type || OTHER == dst_type) { - if (!strcmp(name, "noop")) + if (!HDstrcmp(name, "noop")) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); else if (run_test == TEST_SPECIAL) @@ -3041,7 +3042,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) goto error; } else { - if (!strcmp(name, "noop")) + if (!HDstrcmp(name, "noop")) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); else if (run_test == TEST_SPECIAL) @@ -3286,7 +3287,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) int check_expo[2]; if (FLT_FLOAT == dst_type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, &buf[j * dst_size], sizeof(float)); if (underflow && HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN) continue; /* all underflowed, no error */ @@ -3297,7 +3298,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) check_mant[1] = HDfrexpf(hw_f, check_expo + 1); } else if (FLT_DOUBLE == dst_type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, &buf[j * dst_size], sizeof(double)); if (underflow && HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN) continue; /* all underflowed, no error */ @@ -3309,7 +3310,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) #if H5_SIZEOF_LONG_DOUBLE != 0 && (H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE) } else { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, &buf[j * dst_size], sizeof(long double)); /* dst is largest float, no need to check underflow. */ check_mant[0] = (double)HDfrexpl(x, check_expo + 0); @@ -3356,18 +3357,18 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) HDprintf(" %02x", saved[j * src_size + ENDIAN(src_size, k, sendian)]); HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)dst_size - (ssize_t)src_size)), ""); if (FLT_FLOAT == src_type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, &saved[j * src_size], sizeof(float)); HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE == src_type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, &saved[j * src_size], sizeof(double)); HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE } else { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, &saved[j * src_size], sizeof(long double)); HDfprintf(stdout, " %29.20Le\n", x); #endif @@ -3378,18 +3379,18 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) HDprintf(" %02x", buf[j * dst_size + ENDIAN(dst_size, k, dendian)]); HDprintf("%*s", (int)(3 * MAX(0, (ssize_t)src_size - (ssize_t)dst_size)), ""); if (FLT_FLOAT == dst_type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, &buf[j * dst_size], sizeof(float)); HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE == dst_type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, &buf[j * dst_size], sizeof(double)); HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE } else { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, &buf[j * dst_size], sizeof(long double)); HDfprintf(stdout, " %29.20Le\n", x); #endif @@ -4350,7 +4351,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) } /* Make certain that there isn't some weird number of destination bits */ - assert(dst_nbits % 8 == 0); + HDassert(dst_nbits % 8 == 0); /* For Intel machines, the size of "long double" is 12 bytes, precision * is 80 bits; for AMD processors, the size of "long double" is 16 bytes, @@ -5009,7 +5010,7 @@ run_fp_tests(const char *name) { int nerrors = 0; - if (!strcmp(name, "noop")) { + if (!HDstrcmp(name, "noop")) { nerrors += test_conv_flt_1("noop", TEST_NOOP, H5T_NATIVE_FLOAT, H5T_NATIVE_FLOAT); nerrors += test_conv_flt_1("noop", TEST_NOOP, H5T_NATIVE_DOUBLE, H5T_NATIVE_DOUBLE); #if H5_SIZEOF_LONG_DOUBLE != 0 @@ -5246,7 +5247,7 @@ run_fp_int_conv(const char *name) #endif #if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG - if (!strcmp(name, "hw")) { /* Hardware conversion */ + if (!HDstrcmp(name, "hw")) { /* Hardware conversion */ nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LLONG); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LLONG); } diff --git a/test/dtransform.c b/test/dtransform.c index 895f22e..c679d30 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -18,12 +18,12 @@ #define FLOAT_TOL 0.0001F static int init_test(hid_t file_id); -static int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy); -static int test_trivial(const hid_t dxpl_id_simple); -static int test_poly(const hid_t dxpl_id_polynomial); +static int test_copy(hid_t dxpl_id_c_to_f_copy, hid_t dxpl_id_polynomial_copy); +static int test_trivial(hid_t dxpl_id_simple); +static int test_poly(hid_t dxpl_id_polynomial); static int test_specials(hid_t file); static int test_set(void); -static int test_getset(const hid_t dxpl_id_simple); +static int test_getset(hid_t dxpl_id_simple); /* These are needed for multiple tests, so are declared here globally and are init'ed in init_test */ hid_t dset_id_int = -1; diff --git a/test/enum.c b/test/enum.c index c1e750d..3923892 100644 --- a/test/enum.c +++ b/test/enum.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 22, 1998 */ #include "h5test.h" @@ -792,11 +792,11 @@ main(void) if (nerrors) goto error; - puts("All enum tests passed."); + HDputs("All enum tests passed."); h5_cleanup(FILENAME, fapl); return 0; error: - puts("*** ENUM TESTS FAILED ***"); + HDputs("*** ENUM TESTS FAILED ***"); return 1; } diff --git a/test/error_test.c b/test/error_test.c index dd7099c..c8205ff8 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -129,13 +129,8 @@ test_error(hid_t file) TEST_ERROR; if (old_data != NULL) TEST_ERROR; -#ifdef H5_USE_16_API - if (old_func != (H5E_auto_t)H5Eprint) - TEST_ERROR; -#else /* H5_USE_16_API */ if (old_func != (H5E_auto2_t)H5Eprint2) TEST_ERROR; -#endif /* H5_USE_16_API */ if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) TEST_ERROR; @@ -200,7 +195,7 @@ init_error(void) if (cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) TEST_ERROR; - if (HDstrcmp(ERR_CLS_NAME, cls_name)) + if (HDstrcmp(ERR_CLS_NAME, cls_name) != 0) TEST_ERROR; if ((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) @@ -225,7 +220,7 @@ init_error(void) TEST_ERROR; if (msg_type != H5E_MINOR) TEST_ERROR; - if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) + if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG) != 0) TEST_ERROR; /* Register another class for later testing. */ diff --git a/test/extend.c b/test/extend.c index 9cb7220..2583de9 100644 --- a/test/extend.c +++ b/test/extend.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, January 30, 1998 * * Purpose: Tests extendible datasets. diff --git a/test/external.c b/test/external.c index a5621e8..c31701d 100644 --- a/test/external.c +++ b/test/external.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 3, 1998 * * Purpose: Tests datasets stored in external raw files. @@ -72,7 +72,7 @@ files_have_same_contents(const char *name1, const char *name2) break; } - if (HDmemcmp(buf1, buf2, (size_t)n1)) + if (HDmemcmp(buf1, buf2, (size_t)n1) != 0) break; } /* end while */ @@ -474,7 +474,7 @@ error: *------------------------------------------------------------------------- */ static int -__add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, hsize_t max_ext_size) +add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, hsize_t max_ext_size) { char exname[AEF_EXNAME_MAX_LEN + 1]; unsigned int i = 0; @@ -485,12 +485,12 @@ __add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, for (i = 0; i < n_external_files; i++) { if (HDsnprintf(exname, AEF_EXNAME_MAX_LEN, "ext%d.data", i + 1) > AEF_EXNAME_MAX_LEN) { HDfprintf(stderr, "External file %d overflows name buffer\n", i + 1); - fflush(stderr); + HDfflush(stderr); return -1; } if (H5Pset_external(dcpl_id, exname, offset, max_ext_size) < 0) { HDfprintf(stderr, "Problem adding external file %s\n", exname); - fflush(stderr); + HDfflush(stderr); return -1; } } @@ -528,7 +528,7 @@ test_multiple_files(hid_t file) max_ext_size = (hsize_t)(sizeof(int) * max_size[0] / n_external_files); - if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) { + if (add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) { FAIL_STACK_ERROR; } @@ -552,7 +552,7 @@ test_multiple_files(hid_t file) max_ext_size -= 1; - if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) { + if (add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) { FAIL_STACK_ERROR; } @@ -965,7 +965,7 @@ test_path_absolute(hid_t fapl) hid_t dset = -1; /* dataset */ size_t i = 0; /* miscellaneous counter */ char cwdpath[1024]; /* working directory */ - char filename[1024]; /* file name */ + char filename[1088]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ hsize_t cur_size; /* current data space size */ @@ -1059,7 +1059,6 @@ test_path_relative(hid_t fapl) hid_t space = -1; /* data space */ hid_t dset = -1; /* dataset */ size_t i = 0; /* miscellaneous counters */ - char cwdpath[1024]; /* working directory */ char filename[1024]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ @@ -1084,8 +1083,6 @@ test_path_relative(hid_t fapl) /* Create the dataset */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - if (NULL == HDgetcwd(cwdpath, sizeof(cwdpath))) - TEST_ERROR for (i = 0; i < N_EXT_FILES; i++) { HDsnprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1); if (H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) @@ -1158,7 +1155,6 @@ test_path_relative_cwd(hid_t fapl) hid_t dset2 = -1; /* dataset, opened a second time */ hid_t dset3 = -1; /* dataset, opened with different prefix */ size_t i = 0; /* miscellaneous counters */ - char cwdpath[1024]; /* working directory */ char filename[1024]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ @@ -1184,8 +1180,6 @@ test_path_relative_cwd(hid_t fapl) /* Create the dataset */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - if (NULL == HDgetcwd(cwdpath, sizeof(cwdpath))) - TEST_ERROR for (i = 0; i < N_EXT_FILES; i++) { HDsnprintf(filename, sizeof(filename), "..%sextern_%dr.raw", H5_DIR_SEPS, (int)i + 1); if (H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) diff --git a/test/external_common.c b/test/external_common.c index d616104..c37fd16 100644 --- a/test/external_common.c +++ b/test/external_common.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * April, 2019 * * Purpose: Private function for external.c and external_env.c diff --git a/test/external_common.h b/test/external_common.h index 6e2915f..6215be9 100644 --- a/test/external_common.h +++ b/test/external_common.h @@ -12,13 +12,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * April, 2019 * * Purpose: Private function for external.c and external_env.c */ -#ifndef _EXTERNAL_COMMON_H -#define _EXTERNAL_COMMON_H +#ifndef EXTERNAL_COMMON_H +#define EXTERNAL_COMMON_H /* Include test header files */ #include "h5test.h" @@ -41,4 +41,4 @@ H5TEST_DLL herr_t reset_raw_data_files(hbool_t is_env); } #endif -#endif /* _EXTERNAL_COMMON_H */ +#endif /* EXTERNAL_COMMON_H */ diff --git a/test/external_env.c b/test/external_env.c index 4ab569f..5dc1d65 100644 --- a/test/external_env.c +++ b/test/external_env.c @@ -48,7 +48,6 @@ test_path_env(hid_t fapl) hid_t dapl = -1; /* dataset access property list */ hid_t dset = -1; /* dataset */ size_t i; /* miscellaneous counters */ - char cwdpath[1024]; /* working directory */ char filename[1024]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ @@ -71,8 +70,6 @@ test_path_env(hid_t fapl) /* Create the dataset */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - if (NULL == HDgetcwd(cwdpath, sizeof(cwdpath))) - TEST_ERROR for (i = 0; i < N_EXT_FILES; i++) { HDsnprintf(filename, sizeof(filename), "..%sextern_env_%dr.raw", H5_DIR_SEPS, (int)i + 1); if (H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) diff --git a/test/external_fname.h b/test/external_fname.h index 40b9f51..c2cd059 100644 --- a/test/external_fname.h +++ b/test/external_fname.h @@ -12,13 +12,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * July, 2019 * * Purpose: Private declaration for external.c and external_env.c */ -#ifndef _EXTERNAL_FNAME_H -#define _EXTERNAL_FNAME_H +#ifndef EXTERNAL_FNAME_H +#define EXTERNAL_FNAME_H /* Include test header files */ #include "h5test.h" @@ -26,4 +26,4 @@ static const char *EXT_FNAME[] = {"extern_1", "extern_2", "extern_3", "extern_4", "extern_dir/file_1", "extern_5", NULL}; -#endif /* _EXTERNAL_FNAME_H */ +#endif /* EXTERNAL_FNAME_H */ diff --git a/test/filenotclosed.c b/test/filenotclosed.c index f7c658f..b5def9b 100644 --- a/test/filenotclosed.c +++ b/test/filenotclosed.c @@ -77,10 +77,10 @@ main(void) * Further investigation is needed to resolve the test failure with the * split/multi driver. Please see HDFFV-10160. */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (!contig_addr_vfd) { SKIPPED(); - puts(" Temporary skipped for a spilt/multi driver"); + HDputs(" Temporary skipped for a spilt/multi driver"); HDexit(EXIT_SUCCESS); } diff --git a/test/fillval.c b/test/fillval.c index 6c32d98..673b267 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, October 1, 1998 * * Purpose: Tests dataset fill values. @@ -207,7 +207,7 @@ test_getset(void) H5E_END_TRY; if (fill_i != 0) { H5_FAILED(); - puts(" H5Pget_fill_value() should return default 0"); + HDputs(" H5Pget_fill_value() should return default 0"); goto error; } @@ -226,8 +226,8 @@ test_getset(void) goto error; if (fill_ss.v1 != fill_ss_rd.v1 || fill_ss.v2 != fill_ss_rd.v2) { H5_FAILED(); - puts(" Failed to get fill value using same data type that was "); - puts(" used to set the fill value."); + HDputs(" Failed to get fill value using same data type that was "); + HDputs(" used to set the fill value."); goto error; } @@ -238,8 +238,8 @@ test_getset(void) goto error; if (fill_ss.v1 != fill_si.v1 || fill_ss.v2 != fill_si.v2) { H5_FAILED(); - puts(" Failed to get fill value using a data type other than what"); - puts(" was used to set the fill value."); + HDputs(" Failed to get fill value using a data type other than what"); + HDputs(" was used to set the fill value."); goto error; } @@ -252,7 +252,7 @@ test_getset(void) goto error; if (fill_si.v1 != fill_ss.v1 || fill_si.v2 != fill_ss.v2) { H5_FAILED(); - puts(" Resetting the fill value was unsuccessful."); + HDputs(" Resetting the fill value was unsuccessful."); goto error; } @@ -324,7 +324,7 @@ test_getset_vl(hid_t fapl) TEST_ERROR /* Verify that the fill value is the original value */ - if (HDstrcmp(f2, orig_fill_value)) + if (HDstrcmp(f2, orig_fill_value) != 0) TEST_ERROR /* Release the fill value retrieved */ @@ -366,7 +366,7 @@ test_getset_vl(hid_t fapl) TEST_ERROR /* Verify that the fill value is the original value */ - if (HDstrcmp(f2, orig_fill_value)) + if (HDstrcmp(f2, orig_fill_value) != 0) TEST_ERROR /* Release the fill value retrieved */ @@ -670,12 +670,12 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (alloc_time != H5D_ALLOC_TIME_LATE) { H5_FAILED(); - puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); + HDputs(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); HDprintf(" Got %d\n", alloc_time); } if (fill_time != H5D_FILL_TIME_ALLOC) { H5_FAILED(); - puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); + HDputs(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); HDprintf(" Got %d\n", fill_time); } if (H5Dclose(dset3) < 0) @@ -690,7 +690,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) { H5_FAILED(); - puts(" Got allocated space instead of unallocated."); + HDputs(" Got allocated space instead of unallocated."); HDprintf(" Got %d\n", allocation); goto error; } @@ -702,12 +702,12 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (alloc_time != H5D_ALLOC_TIME_LATE) { H5_FAILED(); - puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); + HDputs(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); HDprintf(" Got %d\n", alloc_time); } if (fill_time != H5D_FILL_TIME_NEVER) { H5_FAILED(); - puts(" Got non-H5D_FILL_TIME_NEVER fill value write time."); + HDputs(" Got non-H5D_FILL_TIME_NEVER fill value write time."); HDprintf(" Got %d\n", fill_time); } if (H5Dclose(dset4) < 0) @@ -725,7 +725,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if (!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 || rd_c.z != '\0') { H5_FAILED(); - puts(" Got wrong fill value"); + HDputs(" Got wrong fill value"); HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z); } @@ -754,14 +754,14 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (alloc_time != H5D_ALLOC_TIME_EARLY) { H5_FAILED(); - puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); + HDputs(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); HDprintf(" Got %d\n", alloc_time); } if (H5Pget_fill_time(dcpl, &fill_time) < 0) goto error; if (fill_time != H5D_FILL_TIME_NEVER) { H5_FAILED(); - puts(" Got non-H5D_FILL_TIME_NEVER fill value write time."); + HDputs(" Got non-H5D_FILL_TIME_NEVER fill value write time."); HDprintf(" Got %d\n", fill_time); } if (H5Dclose(dset5) < 0) @@ -794,14 +794,14 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (alloc_time != H5D_ALLOC_TIME_EARLY) { H5_FAILED(); - puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); + HDputs(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); HDprintf(" Got %d\n", alloc_time); } if (H5Pget_fill_time(dcpl, &fill_time) < 0) goto error; if (fill_time != H5D_FILL_TIME_ALLOC) { H5_FAILED(); - puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); + HDputs(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); HDprintf(" Got %d\n", fill_time); } if (H5Dclose(dset6) < 0) @@ -819,7 +819,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if (!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 || rd_c.z != '\0') { H5_FAILED(); - puts(" Got wrong fill value"); + HDputs(" Got wrong fill value"); HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z); } @@ -1532,8 +1532,8 @@ test_extend_verify_cmpd_vl(unsigned lineno, const hsize_t *offset, const void *_ (const comp_vl_datatype *)_compare_val; /* Value to compare against */ /* Verify value */ - if ((test_val->x != compare_val->x) || HDstrcmp(test_val->a, compare_val->a) || - HDstrcmp(test_val->b, compare_val->b) || (test_val->y != compare_val->y)) { + if ((test_val->x != compare_val->x) || HDstrcmp(test_val->a, compare_val->a) != 0 || + HDstrcmp(test_val->b, compare_val->b) != 0 || (test_val->y != compare_val->y)) { HDfprintf(stdout, "%u: Value read was not expected.\n", lineno); HDfprintf(stdout, " Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: {%d, '%s', '%s', %d} " @@ -1588,7 +1588,7 @@ test_extend_release_cmpd_vl(void *_elmt) *------------------------------------------------------------------------- */ static int -test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, hsize_t *ch_size, hsize_t *start_size, +test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t *ch_size, hsize_t *start_size, hsize_t *max_size, hid_t dtype, void *fillval) { hid_t fspace = -1, mspace = -1; /* File & memory dataspaces */ @@ -1651,7 +1651,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, hsize_t *ch_si } /* end if */ else { /* Sanity check */ - assert(dtype_class == H5T_COMPOUND); + HDassert(dtype_class == H5T_COMPOUND); /* Initialize specific values for this datatype */ val_size = sizeof(comp_vl_datatype); @@ -1703,7 +1703,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, hsize_t *ch_si } /* end for */ /* Check for overflow */ - assert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size))); + HDassert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size))); /* Allocate & initialize buffer */ buf = HDmalloc((size_t)(nelmts * val_size)); @@ -2143,7 +2143,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) */ if (H5D_CONTIGUOUS == layout) { SKIPPED(); - puts(" Not implemented yet -- needs H5S_SELECT_DIFF operator"); + HDputs(" Not implemented yet -- needs H5S_SELECT_DIFF operator"); goto skip; } #endif @@ -2261,7 +2261,7 @@ test_compatible(void) goto error; if (dims[0] != 8 || dims[1] != 8) { H5_FAILED(); - puts(" Got a different dimension size than what was set."); + HDputs(" Got a different dimension size than what was set."); HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]); goto error; } @@ -2273,7 +2273,7 @@ test_compatible(void) goto error; if (val_rd != 0) { H5_FAILED(); - puts(" Got a different value than what was set."); + HDputs(" Got a different value than what was set."); HDprintf(" Got %ld, set 0\n", (long)val_rd); goto error; } @@ -2314,7 +2314,7 @@ test_compatible(void) goto error; if (dims[0] != 8 || dims[1] != 8) { H5_FAILED(); - puts(" Got a different dimension size than what was set."); + HDputs(" Got a different dimension size than what was set."); HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]); goto error; } @@ -2326,7 +2326,7 @@ test_compatible(void) goto error; if (val_rd != fill_val) { H5_FAILED(); - puts(" Got a different value than what was set."); + HDputs(" Got a different value than what was set."); HDprintf(" Got %ld, set %ld\n", (long)val_rd, (long)fill_val); goto error; } @@ -2661,11 +2661,11 @@ main(int argc, char *argv[]) if (argc >= 2) { test_contig = test_chunk = test_compact = 0; for (argno = 1; argno < argc; argno++) { - if (!strcmp(argv[argno], "contiguous")) + if (!HDstrcmp(argv[argno], "contiguous")) test_contig = 1; - else if (!strcmp(argv[argno], "chunked")) + else if (!HDstrcmp(argv[argno], "chunked")) test_chunk = 1; - else if (!strcmp(argv[argno], "compact")) + else if (!HDstrcmp(argv[argno], "compact")) test_compact = 1; else { HDfprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]); @@ -2695,11 +2695,11 @@ main(int argc, char *argv[]) /* Set the FAPL for the type of format */ if (new_format) { - puts("\nTesting with new file format:"); + HDputs("\nTesting with new file format:"); my_fapl = fapl2; } /* end if */ else { - puts("Testing with old file format:"); + HDputs("Testing with old file format:"); my_fapl = fapl; } /* end else */ diff --git a/test/filter_fail.c b/test/filter_fail.c index bcad18d..a1bcf28 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 7 September 2010 * * Purpose: Make sure dataset, file, and library can close properly when a @@ -174,7 +174,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) H5E_END_TRY; if (ret >= 0) { H5_FAILED(); - puts(" Data writing is supposed to fail because the chunk can't be written to file."); + HDputs(" Data writing is supposed to fail because the chunk can't be written to file."); TEST_ERROR } } @@ -195,7 +195,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) H5E_END_TRY; if (ret >= 0) { H5_FAILED(); - puts(" Dataset is supposed to fail because the chunk can't be flushed to file."); + HDputs(" Dataset is supposed to fail because the chunk can't be flushed to file."); TEST_ERROR } } diff --git a/test/filter_plugin.c b/test/filter_plugin.c index 60f7171..276141a 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -1068,7 +1068,7 @@ test_path_api_calls(void) /* Get the path */ if ((path_len = H5PLget(0, path, 256)) <= 0) { - HDfprintf(stderr, " get 0 len: %u : %s\n", path_len, path); + HDfprintf(stderr, " get 0 len: %zd : %s\n", path_len, path); TEST_ERROR; } if (HDstrcmp(path, "a_path_0") != 0) { diff --git a/test/flush1.c b/test/flush1.c index dde3963..456f5f4 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 23, 1998 * * Purpose: This is the first half of a two-part test that makes sure diff --git a/test/flush2.c b/test/flush2.c index 5f0d42c..3262b14 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 23, 1998 * * Purpose: This is the second half of a two-part test that makes sure diff --git a/test/flushrefreshTest.cmake b/test/flushrefreshTest.cmake index 4cb8b93..9a99902 100644 --- a/test/flushrefreshTest.cmake +++ b/test/flushrefreshTest.cmake @@ -41,7 +41,7 @@ endif () message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") diff --git a/test/gen_bad_compound.c b/test/gen_bad_compound.c index 7cbeda9..d5fcec1 100644 --- a/test/gen_bad_compound.c +++ b/test/gen_bad_compound.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 14, 2011 * * Purpose: This program is run to generate an HDF5 data file with objects diff --git a/test/gen_bad_ohdr.c b/test/gen_bad_ohdr.c index c88ec6d..b24371e 100644 --- a/test/gen_bad_ohdr.c +++ b/test/gen_bad_ohdr.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Jan 5, 2008 * * Purpose: This program is run to generate an HDF5 data file with a diff --git a/test/gen_cross.c b/test/gen_cross.c index 7400728..3eac79a 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, March 23, 2006 * * This program writes floating-point data to the HDF5 file. It generates @@ -928,7 +928,7 @@ create_deflate_dsets_float(hid_t fid, hid_t fsid, hid_t msid) #else /* H5_HAVE_FILTER_DEFLATE */ const char *not_supported = "Deflate filter is not enabled. Can't create the dataset."; - puts(not_supported); + HDputs(not_supported); #endif /* H5_HAVE_FILTER_DEFLATE */ return 0; diff --git a/test/gen_filters.c b/test/gen_filters.c index 1a3d468..7b7c268 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -37,7 +37,7 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned * * Failure: -1 * - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * Thursday, March 25, 2004 * *------------------------------------------------------------------------- @@ -243,12 +243,12 @@ main(void) if (nerrors) goto error; - printf("All tests passed.\n"); + HDprintf("All tests passed.\n"); return 0; error: nerrors = MAX(1, nerrors); - printf("***** %d GEN_FILTERS FAILURES *****\n", nerrors); + HDprintf("***** %d GEN_FILTERS FAILURES *****\n", nerrors); return 1; } diff --git a/test/gen_mergemsg.c b/test/gen_mergemsg.c index 38d3f87..d805dbf 100644 --- a/test/gen_mergemsg.c +++ b/test/gen_mergemsg.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, June 30, 2006 * * This program creates an object with fragmented object header messages diff --git a/test/getname.c b/test/getname.c index 4a72fd2..200c426 100644 --- a/test/getname.c +++ b/test/getname.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * April 12, 2002 * * Purpose: Tests the "ID to name" functionality @@ -68,11 +68,11 @@ check_name(hid_t id, const char *chk_name, const char *chk_user_path) TEST_ERROR /* Check on name from H5Iget_name() */ - if (HDstrcmp(name, chk_name)) + if (HDstrcmp(name, chk_name) != 0) goto error; /* Check on user path */ - if (HDstrcmp(user_path, chk_user_path)) + if (HDstrcmp(user_path, chk_user_path) != 0) goto error; /* Check that if user path is hidden, the name from H5Iget_name() and the user path should be different */ @@ -1439,7 +1439,7 @@ test_main(hid_t file_id, hid_t fapl) /* Check that name is longer */ if (name_len <= SMALL_NAME_BUF_SIZE) TEST_ERROR - if (HDstrcmp(name2, "/")) + if (HDstrcmp(name2, "/") != 0) TEST_ERROR } @@ -1481,7 +1481,7 @@ test_main(hid_t file_id, hid_t fapl) TEST_ERROR /* Verify */ - if (HDstrcmp(name3, "/g17")) + if (HDstrcmp(name3, "/g17") != 0) TEST_ERROR *name3 = '\0'; @@ -1491,7 +1491,7 @@ test_main(hid_t file_id, hid_t fapl) TEST_ERROR /* Verify */ - if (HDstrcmp(name3, "/g")) + if (HDstrcmp(name3, "/g") != 0) TEST_ERROR HDfree(name3); @@ -3787,7 +3787,7 @@ main(void) if (nerrors) goto error; - puts("All getname tests passed."); + HDputs("All getname tests passed."); h5_cleanup(FILENAME, fapl); @@ -3800,7 +3800,7 @@ error: } H5E_END_TRY; - puts("***** GET NAME TESTS FAILED *****"); + HDputs("***** GET NAME TESTS FAILED *****"); return 1; } diff --git a/test/hyperslab.c b/test/hyperslab.c index 67e4865..a867430 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, October 10, 1997 * * Purpose: Hyperslab operations are rather complex, so this file @@ -177,7 +177,7 @@ test_fill(size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_t dk, size } /* end else */ HDsprintf(s, "Testing hyperslab fill %-11s variable hyperslab", dim); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* Allocate array */ if (NULL == (dst = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz))) @@ -366,7 +366,7 @@ test_copy(int mode, size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_ HDsprintf(s, "Testing hyperslab copy %-11s %s", dim, sub); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* * Allocate arrays @@ -575,7 +575,7 @@ test_multifill(size_t nx) hsize_t i, j; HDprintf("%-70s", "Testing multi-byte fill value"); - fflush(stdout); + HDfflush(stdout); /* Initialize the source and destination */ if (NULL == (src = (struct a_struct *)HDmalloc(nx * sizeof(*src)))) @@ -687,7 +687,7 @@ test_endian(size_t nx) hsize_t i, j; HDprintf("%-70s", "Testing endian conversion by stride"); - fflush(stdout); + HDfflush(stdout); /* Initialize arrays */ if (NULL == (src = (uint8_t *)HDmalloc(nx * 4))) @@ -773,7 +773,7 @@ test_transpose(size_t nx, size_t ny) HDsprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx, (unsigned long)ny); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* Initialize */ if (NULL == (src = (int *)HDmalloc(nx * ny * sizeof(*src)))) @@ -872,7 +872,7 @@ test_sub_super(size_t nx, size_t ny) HDsprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)(2 * nx), (unsigned long)(2 * ny), (unsigned long)nx, (unsigned long)ny); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* Initialize */ if (NULL == (full = (uint8_t *)HDmalloc(4 * nx * ny))) @@ -922,7 +922,7 @@ test_sub_super(size_t nx, size_t ny) HDsprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)nx, (unsigned long)ny, (unsigned long)(2 * nx), (unsigned long)(2 * ny)); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* Setup stride */ size[0] = nx; diff --git a/test/istore.c b/test/istore.c index a72743d..192e184 100644 --- a/test/istore.c +++ b/test/istore.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, October 15, 1997 * * Purpose: Tests various aspects of indexed raw data storage. @@ -375,7 +375,7 @@ test_extend(hid_t f, const char *prefix, size_t nx, size_t ny, size_t nz) HDfprintf(stderr, " Read failed: ctr=%lu\n", (unsigned long)ctr); goto error; } - if (HDmemcmp(buf, check, (size_t)nelmts)) { + if (HDmemcmp(buf, check, (size_t)nelmts) != 0) { H5_FAILED(); HDfprintf(stderr, " Read check failed: ctr=%lu\n", (unsigned long)ctr); HDfprintf(stderr, " Wrote:\n"); @@ -617,13 +617,13 @@ main(int argc, char *argv[]) else { int i; for (i = 1, size_of_test = 0; i < argc; i++) { - if (!strcmp(argv[i], "small")) { + if (!HDstrcmp(argv[i], "small")) { size_of_test |= TEST_SMALL; } - else if (!strcmp(argv[i], "medium")) { + else if (!HDstrcmp(argv[i], "medium")) { size_of_test |= TEST_MEDIUM; } - else if (!strcmp(argv[i], "large")) { + else if (!HDstrcmp(argv[i], "large")) { size_of_test |= TEST_LARGE; } else { diff --git a/test/links.c b/test/links.c index 51cadaf..2ac2e28 100644 --- a/test/links.c +++ b/test/links.c @@ -631,6 +631,8 @@ cklinks(hid_t fapl, hbool_t new_format) if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR + //! [H5Otoken_cmp_snip] + /* Hard link */ if (H5Oget_info_by_name3(file, "d1", &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -641,6 +643,9 @@ cklinks(hid_t fapl, hbool_t new_format) HDprintf(" %d: Unexpected object type should have been a dataset\n", __LINE__); TEST_ERROR } /* end if */ + + //! [H5Otoken_cmp_snip] + if (H5Otoken_cmp(file, &oinfo1.token, &oinfo2.token, &token_cmp) < 0) FAIL_STACK_ERROR if (token_cmp) { @@ -698,7 +703,7 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if (H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(linkval, "/d1")) { + if (HDstrcmp(linkval, "/d1") != 0) { H5_FAILED(); HDputs(" Soft link test failed. Wrong link value"); TEST_ERROR @@ -729,7 +734,7 @@ cklinks(hid_t fapl, hbool_t new_format) HDprintf(" %d: Can't retrieve link value\n", __LINE__); TEST_ERROR } /* end if */ - if (HDstrcmp(linkval, "foobar")) { + if (HDstrcmp(linkval, "foobar") != 0) { H5_FAILED(); HDputs(" Dangling link test failed. Wrong link value"); TEST_ERROR @@ -760,7 +765,7 @@ cklinks(hid_t fapl, hbool_t new_format) HDprintf(" %d: Can't retrieve link value\n", __LINE__); TEST_ERROR } /* end if */ - if (HDstrcmp(linkval, "/grp1/recursive")) { + if (HDstrcmp(linkval, "/grp1/recursive") != 0) { H5_FAILED(); HDputs(" Recursive link test failed. Wrong link value"); TEST_ERROR @@ -1059,7 +1064,7 @@ toomany(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/hard21")) + if (HDstrcmp(objname, "/hard21") != 0) TEST_ERROR /* Create object in hard-linked group */ @@ -1093,7 +1098,7 @@ toomany(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft16")) + if (HDstrcmp(objname, "/soft16") != 0) TEST_ERROR /* Create object using soft links */ @@ -1962,7 +1967,7 @@ test_deprec(hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if (H5Gget_comment(file_id, "group1", sizeof(tmpstr), tmpstr) < 0) FAIL_STACK_ERROR - if (HDstrcmp(tmpstr, "comment")) + if (HDstrcmp(tmpstr, "comment") != 0) TEST_ERROR /* Create links using H5Glink and H5Glink2 */ @@ -1978,7 +1983,7 @@ test_deprec(hid_t fapl, hbool_t new_format) /* Test getting the names for objects */ if (H5Gget_objname_by_idx(group1_id, (hsize_t)0, tmpstr, sizeof(tmpstr)) < 0) FAIL_STACK_ERROR - if (HDstrcmp(tmpstr, "link_to_group2")) + if (HDstrcmp(tmpstr, "link_to_group2") != 0) TEST_ERROR H5E_BEGIN_TRY { @@ -2015,7 +2020,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_objinfo(file_id, "/group1/link_to_group2", TRUE, &sb_hard2) < 0) FAIL_STACK_ERROR - if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { + if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno)) != 0) { H5_FAILED(); HDputs(" Hard link test failed. Link seems not to point to the "); HDputs(" expected file location."); @@ -2028,7 +2033,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_objinfo(file_id, "/group2/link_to_group1", TRUE, &sb_hard2) < 0) FAIL_STACK_ERROR - if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { + if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno)) != 0) { H5_FAILED(); HDputs(" Hard link test failed. Link seems not to point to the "); HDputs(" expected file location."); @@ -2045,7 +2050,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_linkval(group2_id, "soft_link_to_group1", sb_soft1.linklen, tmpstr) < 0) FAIL_STACK_ERROR - if (HDstrcmp("link_to_group1", tmpstr)) + if (HDstrcmp("link_to_group1", tmpstr) != 0) TEST_ERROR /* Test non-existing links with H5Gget_objinfo */ @@ -2066,7 +2071,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_linkval(group2_id, "dangle_soft_link", sb_soft2.linklen, tmpstr) < 0) FAIL_STACK_ERROR - if (HDstrcmp("dangle", tmpstr)) + if (HDstrcmp("dangle", tmpstr) != 0) TEST_ERROR /* Test H5Gmove and H5Gmove2 */ @@ -2213,7 +2218,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) } /* end if */ if (H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(linkval, "/d1")) { + if (HDstrcmp(linkval, "/d1") != 0) { H5_FAILED(); HDputs(" Soft link test failed. Wrong link value"); TEST_ERROR @@ -2244,7 +2249,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) HDprintf(" %d: Can't retrieve link value\n", __LINE__); TEST_ERROR } /* end if */ - if (HDstrcmp(linkval, "foobar")) { + if (HDstrcmp(linkval, "foobar") != 0) { H5_FAILED(); HDputs(" Dangling link test failed. Wrong link value"); TEST_ERROR @@ -2275,7 +2280,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) HDprintf(" %d: Can't retrieve link value\n", __LINE__); TEST_ERROR } /* end if */ - if (HDstrcmp(linkval, "/grp1/recursive")) { + if (HDstrcmp(linkval, "/grp1/recursive") != 0) { H5_FAILED(); HDputs(" Recursive link test failed. Wrong link value"); TEST_ERROR @@ -2812,12 +2817,12 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR - if (HDstrcmp(file, filename1)) { + if (HDstrcmp(file, filename1) != 0) { H5_FAILED(); HDputs(" External link file name incorrect"); goto error; } - if (HDstrcmp(path, "/")) { + if (HDstrcmp(path, "/") != 0) { H5_FAILED(); HDputs(" External link path incorrect"); goto error; @@ -2840,12 +2845,12 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR - if (HDstrcmp(file, filename1)) { + if (HDstrcmp(file, filename1) != 0) { H5_FAILED(); HDputs(" External link file name incorrect"); goto error; } - if (HDstrcmp(path, "/")) { + if (HDstrcmp(path, "/") != 0) { H5_FAILED(); HDputs(" External link path incorrect"); goto error; @@ -2864,7 +2869,7 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/")) + if (HDstrcmp(objname, "/") != 0) TEST_ERROR /* Create object in external file */ @@ -2909,11 +2914,11 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format) /* Check names */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/new_group")) + if (HDstrcmp(objname, "/new_group") != 0) TEST_ERROR if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/newer_group")) + if (HDstrcmp(objname, "/newer_group") != 0) TEST_ERROR /* Close opened objects */ @@ -3061,9 +3066,9 @@ external_link_query_deprec(hid_t fapl, hbool_t new_format) TEST_ERROR /* Compare the file and object names */ - if (HDstrcmp(file_name, filename2)) + if (HDstrcmp(file_name, filename2) != 0) TEST_ERROR - if (HDstrcmp(object_name, "/dst")) + if (HDstrcmp(object_name, "/dst") != 0) TEST_ERROR /* Query information about object that external link points to */ @@ -3257,7 +3262,7 @@ external_link_closing_deprec(hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if (H5Oget_comment_by_name(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(buf, "comment")) + if (HDstrcmp(buf, "comment") != 0) TEST_ERROR /* Test H5*open */ @@ -3674,7 +3679,7 @@ ud_hard_links_deprec(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/group")) + if (HDstrcmp(objname, "/group") != 0) TEST_ERROR /* Create object in group */ @@ -3694,7 +3699,7 @@ ud_hard_links_deprec(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/group/new_group")) + if (HDstrcmp(objname, "/group/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -3857,7 +3862,7 @@ ud_link_reregister_deprec(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/" REREG_TARGET_NAME)) + if (HDstrcmp(objname, "/" REREG_TARGET_NAME) != 0) TEST_ERROR /* Create object in group */ @@ -3877,7 +3882,7 @@ ud_link_reregister_deprec(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/rereg_target/new_group")) + if (HDstrcmp(objname, "/rereg_target/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -4221,7 +4226,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft17")) + if (HDstrcmp(objname, "/soft17") != 0) TEST_ERROR /* Create group using soft link */ @@ -4265,7 +4270,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft4")) + if (HDstrcmp(objname, "/soft4") != 0) TEST_ERROR /* Test other functions that should use a LAPL */ @@ -4880,7 +4885,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -4889,7 +4894,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Don't test "native" order if there is no creation order index, since @@ -4919,7 +4924,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -4928,7 +4933,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR } /* end if */ @@ -4953,7 +4958,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -4962,7 +4967,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Verify the link information for first link, in increasing link name order */ @@ -4985,7 +4990,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -4994,7 +4999,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Don't test "native" order queries on link name order, since there's not @@ -5021,7 +5026,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -5030,7 +5035,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Success */ @@ -5377,7 +5382,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -5385,7 +5390,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR /* Verify link information (in native order - native is increasing) */ @@ -5400,7 +5405,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -5408,7 +5413,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR /* Make link name for decreasing order queries */ @@ -5429,7 +5434,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -5437,7 +5442,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -5663,7 +5668,7 @@ delete_by_idx_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -5737,7 +5742,7 @@ delete_by_idx_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -5816,7 +5821,7 @@ delete_by_idx_deprec(hid_t fapl) else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -5850,7 +5855,7 @@ delete_by_idx_deprec(hid_t fapl) else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 4))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -6017,7 +6022,7 @@ delete_by_idx_old_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -6091,7 +6096,7 @@ delete_by_idx_old_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -6125,7 +6130,7 @@ delete_by_idx_old_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -6207,7 +6212,7 @@ link_iterate_deprec_cb(hid_t group_id, const char *link_name, const H5L_info1_t /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder); - if (HDstrcmp(link_name, objname)) + if (HDstrcmp(link_name, objname) != 0) return H5_ITER_ERROR; /* Check if we've visited this link before */ @@ -6707,7 +6712,7 @@ link_iterate_old_deprec_cb(hid_t group_id, const char *link_name, const H5L_info /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped))); - if (HDstrcmp(link_name, objname)) + if (HDstrcmp(link_name, objname) != 0) return H5_ITER_ERROR; /* Check if we've visited this link before */ @@ -7130,12 +7135,12 @@ external_link_root(hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR - if (HDstrcmp(file, filename1)) { + if (HDstrcmp(file, filename1) != 0) { H5_FAILED(); HDputs(" External link file name incorrect"); goto error; } - if (HDstrcmp(path, "/")) { + if (HDstrcmp(path, "/") != 0) { H5_FAILED(); HDputs(" External link path incorrect"); goto error; @@ -7158,12 +7163,12 @@ external_link_root(hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR - if (HDstrcmp(file, filename1)) { + if (HDstrcmp(file, filename1) != 0) { H5_FAILED(); HDputs(" External link file name incorrect"); goto error; } - if (HDstrcmp(path, "/")) { + if (HDstrcmp(path, "/") != 0) { H5_FAILED(); HDputs(" External link path incorrect"); goto error; @@ -7182,7 +7187,7 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/")) + if (HDstrcmp(objname, "/") != 0) TEST_ERROR /* Create object in external file */ @@ -7227,11 +7232,11 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Check names */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/new_group")) + if (HDstrcmp(objname, "/new_group") != 0) TEST_ERROR if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/newer_group")) + if (HDstrcmp(objname, "/newer_group") != 0) TEST_ERROR /* Close opened objects */ @@ -7353,7 +7358,7 @@ external_link_path(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C")) + if (HDstrcmp(objname, "/A/B/C") != 0) TEST_ERROR /* Create object in external file */ @@ -7383,7 +7388,7 @@ external_link_path(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C/new_group")) + if (HDstrcmp(objname, "/A/B/C/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -7525,7 +7530,7 @@ external_link_mult(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C")) + if (HDstrcmp(objname, "/A/B/C") != 0) TEST_ERROR /* Create object in external file */ @@ -7555,7 +7560,7 @@ external_link_mult(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C/new_group")) + if (HDstrcmp(objname, "/A/B/C/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -7671,7 +7676,7 @@ external_link_self(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/X")) + if (HDstrcmp(objname, "/X") != 0) TEST_ERROR /* Create object through external link */ @@ -7693,7 +7698,7 @@ external_link_self(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/X/new_group")) + if (HDstrcmp(objname, "/X/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -7878,7 +7883,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/final")) + if (HDstrcmp(objname, "/final") != 0) TEST_ERROR /* Create object in external file */ @@ -7908,7 +7913,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/final/new_group")) + if (HDstrcmp(objname, "/final/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -8070,7 +8075,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/final")) + if (HDstrcmp(objname, "/final") != 0) TEST_ERROR /* Create object in external file */ @@ -9841,13 +9846,13 @@ external_set_elink_cb_cb(const char *parent_file, const char *parent_group, cons set_elink_cb_t *op_data = (set_elink_cb_t *)_op_data; /* Verify file and object names are correct */ - if (HDstrcmp(parent_file, op_data->parent_file)) + if (HDstrcmp(parent_file, op_data->parent_file) != 0) return FAIL; - if (HDstrcmp(parent_group, "/group1")) + if (HDstrcmp(parent_group, "/group1") != 0) return FAIL; - if (HDstrcmp(target_file, op_data->target_file)) + if (HDstrcmp(target_file, op_data->target_file) != 0) return FAIL; - if (HDstrcmp(target_obj, "/")) + if (HDstrcmp(target_obj, "/") != 0) return FAIL; /* Set flags to be read-write */ @@ -11110,9 +11115,9 @@ external_link_query(hid_t fapl, hbool_t new_format) TEST_ERROR /* Compare the file and object names */ - if (HDstrcmp(file_name, filename2)) + if (HDstrcmp(file_name, filename2) != 0) TEST_ERROR - if (HDstrcmp(object_name, "/dst")) + if (HDstrcmp(object_name, "/dst") != 0) TEST_ERROR /* Query information about object that external link points to */ @@ -11509,7 +11514,7 @@ external_link_move(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -11569,7 +11574,7 @@ external_link_move(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -11616,7 +11621,7 @@ external_link_move(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Move external link back to original location */ @@ -11626,7 +11631,7 @@ external_link_move(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -11800,7 +11805,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -11849,7 +11854,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -12042,7 +12047,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if (H5Oget_comment_by_name(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(buf, "comment")) + if (HDstrcmp(buf, "comment") != 0) TEST_ERROR /* Test H5*open */ @@ -12385,7 +12390,7 @@ external_link_strong(hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C")) + if (HDstrcmp(objname, "/A/B/C") != 0) TEST_ERROR if (H5Gclose(gid2) < 0) TEST_ERROR @@ -13953,7 +13958,7 @@ ud_hard_links(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/group")) + if (HDstrcmp(objname, "/group") != 0) TEST_ERROR /* Create object in group */ @@ -13973,7 +13978,7 @@ ud_hard_links(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/group/new_group")) + if (HDstrcmp(objname, "/group/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -14164,7 +14169,7 @@ ud_link_reregister(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/" REREG_TARGET_NAME)) + if (HDstrcmp(objname, "/" REREG_TARGET_NAME) != 0) TEST_ERROR /* Create object in group */ @@ -14184,7 +14189,7 @@ ud_link_reregister(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/rereg_target/new_group")) + if (HDstrcmp(objname, "/rereg_target/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -14273,9 +14278,9 @@ UD_cb_create(const char *link_name, hid_t loc_group, const void *udata, size_t u if (lcpl_id < 0) TEST_ERROR - if (HDstrcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -14300,9 +14305,9 @@ UD_cb_traverse(const char *link_name, hid_t cur_group, const void *udata, size_t if (udata_size > 0 && !udata) TEST_ERROR - if (HDstrcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -14327,9 +14332,9 @@ UD_cb_move(const char *new_name, hid_t new_loc, const void *udata, size_t udata_ if (udata_size > 0 && !udata) TEST_ERROR - if (HDstrcmp(new_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(new_name, NEW_UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -14351,9 +14356,9 @@ UD_cb_delete(const char *link_name, hid_t file, const void *udata, size_t udata_ if (udata_size > 0 && !udata) TEST_ERROR - if (HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -14373,9 +14378,9 @@ UD_cb_query(const char *link_name, const void *udata, size_t udata_size, void *b if (udata_size > 0 && !udata) TEST_ERROR - if (HDstrcmp(link_name, UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -14672,7 +14677,7 @@ lapl_udata(hid_t fapl, hbool_t new_format) TEST_ERROR /* Now use the same ud link to access group_b */ - strcpy(group_b_name, "group_b"); + HDstrcpy(group_b_name, "group_b"); if (H5Pset(plist_id, DEST_PROP_NAME, group_b_name) < 0) TEST_ERROR @@ -14986,7 +14991,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format) H5E_END_TRY; /* Create a user-defined link to the group. */ - strcpy(group_name, "/group"); + HDstrcpy(group_name, "/group"); if (H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, &group_name, HDstrlen(group_name) + 1, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -15207,7 +15212,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft17")) + if (HDstrcmp(objname, "/soft17") != 0) TEST_ERROR /* Create group using soft link */ @@ -15251,7 +15256,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft4")) + if (HDstrcmp(objname, "/soft4") != 0) TEST_ERROR /* Test other functions that should use a LAPL */ @@ -15711,7 +15716,7 @@ visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info2_t lvisit_ud_t *op_data = (lvisit_ud_t *)_op_data; /* Check for correct link information */ - if (HDstrcmp(op_data->info[op_data->idx].path, name)) + if (HDstrcmp(op_data->info[op_data->idx].path, name) != 0) return (H5_ITER_ERROR); if (op_data->info[op_data->idx].type != linfo->type) return (H5_ITER_ERROR); @@ -15902,7 +15907,7 @@ visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info2_t ovisit_ud_t *op_data = (ovisit_ud_t *)_op_data; /* Check for correct object information */ - if (HDstrcmp(op_data->info[op_data->idx].path, name)) + if (HDstrcmp(op_data->info[op_data->idx].path, name) != 0) return (H5_ITER_ERROR); if (op_data->info[op_data->idx].type != oinfo->type) return (H5_ITER_ERROR); @@ -15938,12 +15943,16 @@ obj_visit(hid_t fapl, hbool_t new_format) if ((fid = build_visit_file(fapl)) < 0) TEST_ERROR + //! [H5Ovisit3_snip] + /* Visit all the objects reachable from the root group (with file ID) */ udata.idx = 0; udata.info = new_format ? ovisit0_new : ovisit0_old; if (H5Ovisit3(fid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC) < 0) FAIL_STACK_ERROR + //! [H5Ovisit3_snip] + /* Visit all the objects reachable from the root group (with group ID) */ if ((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -16015,6 +16024,8 @@ obj_visit_by_name(hid_t fapl, hbool_t new_format) if ((fid = build_visit_file(fapl)) < 0) TEST_ERROR + //! [H5Ovisit_by_name3_snip] + /* Visit all the objects reachable from the root group (with file ID) */ udata.idx = 0; udata.info = new_format ? ovisit0_new : ovisit0_old; @@ -16022,6 +16033,8 @@ obj_visit_by_name(hid_t fapl, hbool_t new_format) H5P_DEFAULT) < 0) FAIL_STACK_ERROR + //! [H5Ovisit_by_name3_snip] + /* Visit all the objects reachable from the root group (with group ID) */ if ((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -16431,13 +16444,13 @@ link_filters(hid_t fapl, hbool_t new_format) if (H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR - if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) || + if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 || filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR if (H5Pget_filter2(gcpl2, (unsigned)(nfilters - 1), &flags_out, &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR - if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) || + if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 || filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR @@ -16448,7 +16461,7 @@ link_filters(hid_t fapl, hbool_t new_format) if (H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR - if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) || + if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 || filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR @@ -17896,7 +17909,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -17905,7 +17918,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Don't test "native" order if there is no creation order index, since @@ -17935,7 +17948,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -17944,7 +17957,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR } /* end if */ @@ -17969,7 +17982,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -17978,7 +17991,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Verify the link information for first link, in increasing link name order */ @@ -18001,7 +18014,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -18010,7 +18023,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Don't test "native" order queries on link name order, since there's not @@ -18037,7 +18050,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -18046,7 +18059,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Success */ @@ -18403,7 +18416,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -18411,7 +18424,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR /* Verify link information (in native order - native is increasing) */ @@ -18428,7 +18441,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -18436,7 +18449,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR /* Make link name for decreasing order queries */ @@ -18459,7 +18472,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -18467,7 +18480,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18691,7 +18704,7 @@ delete_by_idx(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18765,7 +18778,7 @@ delete_by_idx(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18844,7 +18857,7 @@ delete_by_idx(hid_t fapl) else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18878,7 +18891,7 @@ delete_by_idx(hid_t fapl) else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 4))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -19059,7 +19072,7 @@ delete_by_idx_old(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -19138,7 +19151,7 @@ delete_by_idx_old(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -19176,7 +19189,7 @@ delete_by_idx_old(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -19262,7 +19275,7 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info2_t *info, /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder); - if (HDstrcmp(link_name, objname)) + if (HDstrcmp(link_name, objname) != 0) return H5_ITER_ERROR; /* Check if we've visited this link before */ @@ -19777,7 +19790,7 @@ link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info2_t *in /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped))); - if (HDstrcmp(link_name, objname)) + if (HDstrcmp(link_name, objname) != 0) return H5_ITER_ERROR; /* Check if we've visited this link before */ diff --git a/test/swmr_common.h b/test/swmr_common.h index 249ff81..7e0ee23 100644 --- a/test/swmr_common.h +++ b/test/swmr_common.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _SWMR_COMMON_H -#define _SWMR_COMMON_H +#ifndef SWMR_COMMON_H +#define SWMR_COMMON_H /***********/ /* Headers */ @@ -75,4 +75,4 @@ H5TEST_DLL int print_metadata_retries_info(hid_t fid); } #endif -#endif /* _SWMR_COMMON_H */ +#endif /* SWMR_COMMON_H */ diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 9aa51c1..d1469df 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -98,9 +98,8 @@ enum H5TEST_COLL_CHUNK_API { #define MSPACE1_DIM 27000 /* Dataset size in memory */ #define FSPACE_RANK 2 /* Dataset rank as it is stored in the file */ #define FSPACE_DIM1 9 /* Dimension sizes of the dataset as it is stored in the file */ -#define FSPACE_DIM2 \ - 3600 /* We will read dataset back from the file to the dataset \ - in memory with these dataspace parameters. */ +#define FSPACE_DIM2 3600 +/* We will read dataset back from the file to the dataset in memory with these dataspace parameters. */ #define MSPACE_RANK 2 #define MSPACE_DIM1 9 #define MSPACE_DIM2 3600 diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 9fcf821..7b41538 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef H5DIFF_H__ -#define H5DIFF_H__ +#ifndef H5DIFF_H +#define H5DIFF_H #include "hdf5.h" #include "h5tools.h" @@ -160,4 +160,4 @@ int print_objname(diff_opt_t *opts, hsize_t nfound); void do_print_objname(const char *OBJ, const char *path1, const char *path2, diff_opt_t *opts); void do_print_attrname(const char *attr, const char *path1, const char *path2); -#endif /* H5DIFF_H__ */ +#endif /* H5DIFF_H */ diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index d807603..f9aabbf 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -12,13 +12,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 23, 1998 * * Purpose: Support functions for the various tools. */ -#ifndef H5TOOLS_H__ -#define H5TOOLS_H__ +#ifndef H5TOOLS_H +#define H5TOOLS_H #include "hdf5.h" #include "h5tools_error.h" @@ -712,4 +712,4 @@ H5TOOLS_DLL hbool_t h5tools_render_region_element(FILE *stream, const h5tool_for } #endif -#endif /* H5TOOLS_H__ */ +#endif /* H5TOOLS_H */ diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h index d49187d..901b38e 100644 --- a/tools/lib/h5tools_dump.h +++ b/tools/lib/h5tools_dump.h @@ -14,8 +14,8 @@ /* * Purpose: Support h5dump functions for the various tools. */ -#ifndef H5TOOLS_DUMP_H__ -#define H5TOOLS_DUMP_H__ +#ifndef H5TOOLS_DUMP_H +#define H5TOOLS_DUMP_H #include "h5tools_utils.h" @@ -94,4 +94,4 @@ H5TOOLS_DLL void h5tools_print_packed_bits(h5tools_str_t *buffer /*in,out*/, hid } #endif -#endif /* H5TOOLS_DUMP_H__ */ +#endif /* H5TOOLS_DUMP_H */ diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index b8e5339..8fd33bb 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -14,8 +14,8 @@ /* * Header file for error values, etc. */ -#ifndef H5TOOLS_ERROR_H_ -#define H5TOOLS_ERROR_H_ +#ifndef H5TOOLS_ERROR_H +#define H5TOOLS_ERROR_H #include "H5Epublic.h" #include "H5Eprivate.h" /* Error handling */ @@ -250,4 +250,4 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; H5_LEAVE(ret_val) \ } while (0) -#endif /* H5TOOLS_ERROR_H_ */ +#endif /* H5TOOLS_ERROR_H */ diff --git a/tools/lib/h5tools_ref.h b/tools/lib/h5tools_ref.h index b4819ef..9feaeb1 100644 --- a/tools/lib/h5tools_ref.h +++ b/tools/lib/h5tools_ref.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef H5TOOLS_REF_H__ -#define H5TOOLS_REF_H__ +#ifndef H5TOOLS_REF_H +#define H5TOOLS_REF_H #include "hdf5.h" diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index df1f64f..c207a83 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -12,11 +12,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * Monday, 19. February 2001 */ -#ifndef H5TOOLS_STR_H__ -#define H5TOOLS_STR_H__ +#ifndef H5TOOLS_STR_H +#define H5TOOLS_STR_H typedef struct h5tools_str_t { char * s; /*allocate string */ @@ -46,4 +46,4 @@ H5TOOLS_DLL char *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t * hid_t type, void *vp, h5tools_context_t *ctx); H5TOOLS_DLL char *h5tools_str_replace(const char *string, const char *substr, const char *replacement); -#endif /* H5TOOLS_STR_H__ */ +#endif /* H5TOOLS_STR_H */ diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 460dbba..307ce20 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -12,13 +12,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * Tuesday, 6. March 2001 * * Purpose: Support functions for the various tools. */ -#ifndef H5TOOLS_UTILS_H__ -#define H5TOOLS_UTILS_H__ +#ifndef H5TOOLS_UTILS_H +#define H5TOOLS_UTILS_H #include "hdf5.h" @@ -191,4 +191,4 @@ H5TOOLS_DLL herr_t h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int deli } #endif -#endif /* H5TOOLS_UTILS_H__ */ +#endif /* H5TOOLS_UTILS_H */ diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index c45b07a..c7b9db7 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef H5TRAV_H__ -#define H5TRAV_H__ +#ifndef H5TRAV_H +#define H5TRAV_H #include "hdf5.h" @@ -189,4 +189,4 @@ H5TOOLS_DLL void trav_table_free(trav_table_t *table); H5TOOLS_DLL void trav_table_addflags(unsigned *flags, char *objname, h5trav_type_t type, trav_table_t *table); -#endif /* H5TRAV_H__ */ +#endif /* H5TRAV_H */ diff --git a/tools/lib/io_timer.h b/tools/lib/io_timer.h index 96ea05e..0269b93 100644 --- a/tools/lib/io_timer.h +++ b/tools/lib/io_timer.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef IO_TIMER__ -#define IO_TIMER__ +#ifndef IO_TIMER +#define IO_TIMER #include "hdf5.h" @@ -88,4 +88,4 @@ H5TOOLS_DLL double io_time_get(io_time_t *pt, timer_type t); } #endif /* __cplusplus */ -#endif /* IO_TIMER__ */ +#endif /* IO_TIMER */ diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h index 8e884dd..7dce495 100644 --- a/tools/lib/ph5diff.h +++ b/tools/lib/ph5diff.h @@ -11,8 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _PH5DIFF_H__ -#define _PH5DIFF_H__ +#ifndef PH5DIFF_H +#define PH5DIFF_H /* Send from manager to workers */ #define MPI_TAG_ARGS 1 @@ -40,4 +40,4 @@ struct diffs_found { int not_cmp; }; -#endif /* _PH5DIFF_H__ */ +#endif /* PH5DIFF_H */ -- cgit v0.12 From 4442691d80278b239a33d1daf460acb6bf500635 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 30 Apr 2021 14:03:55 -0700 Subject: Disables attrdset tests while we investigate failures Also switches bin/bash shebang to use env instead --- test/testvfdswmr.sh.in | 101 +++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 50 deletions(-) diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index 979f5a9..9c0f272 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -46,7 +46,7 @@ nsofterrors=0 # soft errors are expected to occur some of the time ## 1: Default run. ## 2+: Quick run ############################################################################### -if [ -z $HDF5TestExpress ]; then # Set to default when not set +if [[ -z $HDF5TestExpress ]]; then # Set to default when not set HDF5TestExpress=1 fi ## @@ -155,7 +155,8 @@ if [ $rc -ne 0 ] ; then exit 0 fi -all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups attrdset" +#all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups attrdset" +all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups" all_tests="${all_tests} groups_attrs os_groups_attrs few_big many_small" tests=${all_tests} @@ -622,53 +623,53 @@ if [ ${do_zoo:-no} = yes ]; then fi # attrdset test -for options in "-p -g -a 10 -v -m -d 10 -c 3 -u 5" "-k -a 20 -v -m -d 5"; do - # - # Test a few big datasets of one and two dimensions. - # - if [ ${do_attrdset:-no} = no ]; then - continue - fi - # Clean up any existing fifo files from previous runs - if [ -e ./$FIFO_WRITER_TO_READER ]; then # If writer fifo file is found - rm -f ./$FIFO_WRITER_TO_READER - fi - if [ -e ./$FIFO_READER_TO_WRITER ]; then # If reader fifo file is found - rm -f ./$FIFO_READER_TO_WRITER - fi - # - echo launch vfd_swmr_attrdset_writer attrdset, options $options - catch_out_err_and_rc vfd_swmr_attrdset_writer \ - ../vfd_swmr_attrdset_writer $options & - pid_writer=$! - - catch_out_err_and_rc vfd_swmr_attrdset_reader \ - ../vfd_swmr_attrdset_reader $options & - pid_reader=$! - - # Wait for the reader to finish before signaling the - # writer to quit: the writer holds the file open so that the - # reader will find the shadow file when it opens - # the .h5 file. - wait $pid_reader - wait $pid_writer - - # Collect exit code of the reader - if [ $(cat vfd_swmr_attrdset_reader.rc) -ne 0 ]; then - echo reader had error - nerrors=$((nerrors + 1)) - fi - - # Collect exit code of the writer - if [ $(cat vfd_swmr_attrdset_writer.rc) -ne 0 ]; then - echo writer had error - nerrors=$((nerrors + 1)) - fi - - # Clean up output files - rm -f vfd_swmr_attrdset_writer.{out,rc} - rm -f vfd_swmr_attrdset_reader.*.{out,rc} -done +#for options in "-p -g -a 10 -v -m -d 10 -c 3 -u 5" "-k -a 20 -v -m -d 5"; do +# # +# # Test a few big datasets of one and two dimensions. +# # +# if [ ${do_attrdset:-no} = no ]; then +# continue +# fi +# # Clean up any existing fifo files from previous runs +# if [ -e ./$FIFO_WRITER_TO_READER ]; then # If writer fifo file is found +# rm -f ./$FIFO_WRITER_TO_READER +# fi +# if [ -e ./$FIFO_READER_TO_WRITER ]; then # If reader fifo file is found +# rm -f ./$FIFO_READER_TO_WRITER +# fi +# # +# echo launch vfd_swmr_attrdset_writer attrdset, options $options +# catch_out_err_and_rc vfd_swmr_attrdset_writer \ +# ../vfd_swmr_attrdset_writer $options & +# pid_writer=$! +# +# catch_out_err_and_rc vfd_swmr_attrdset_reader \ +# ../vfd_swmr_attrdset_reader $options & +# pid_reader=$! +# +# # Wait for the reader to finish before signaling the +# # writer to quit: the writer holds the file open so that the +# # reader will find the shadow file when it opens +# # the .h5 file. +# wait $pid_reader +# wait $pid_writer +# +# # Collect exit code of the reader +# if [ $(cat vfd_swmr_attrdset_reader.rc) -ne 0 ]; then +# echo reader had error +# nerrors=$((nerrors + 1)) +# fi +# +# # Collect exit code of the writer +# if [ $(cat vfd_swmr_attrdset_writer.rc) -ne 0 ]; then +# echo writer had error +# nerrors=$((nerrors + 1)) +# fi +# +# # Clean up output files +# rm -f vfd_swmr_attrdset_writer.{out,rc} +# rm -f vfd_swmr_attrdset_reader.*.{out,rc} +#done # # Make sure that we can create GROUP_n groups (20, 40, or 400 depending on the HDF5TestExpress level) -- cgit v0.12 From a58881550d74626a38c127bff4a7f6a1be03474d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 May 2021 11:24:11 -0700 Subject: Update top-level COPYING file and remove COPYING files from subdirectories (#561) * Modify temporary rpath for testing in java example scripts. * Update URL in source file Copyright headers for web copy of COPYING (license) file. * Add release_docs/code-conventions.md file. * Add script to test h5py. * Fix script error. * Add file h5pytest.yml. * Test declaration of counter variables in for loops. * Committing clang-format changes * Committing clang-format changes * Added [] to line 126 of H5LTanalyze.l. Ran bin/genparser with flex v2.6.4 and Bison v3.0.4 on jelly. * Revert "Added [] to line 126 of H5LTanalyze.l." This reverts commit e4a9cee441efa75b16a8ee030c86189e186dd266. * Revert extra commits to match canonical develop. * Update top-level COPYING file and remove COPYING files from subdirectories. * Remove subdirectory COPYING files from MANIFEST. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- COPYING | 6 ++++++ MANIFEST | 23 +++-------------------- bin/COPYING | 13 ------------- c++/COPYING | 13 ------------- config/COPYING | 13 ------------- fortran/COPYING | 13 ------------- hl/COPYING | 13 ------------- hl/c++/COPYING | 13 ------------- hl/fortran/COPYING | 13 ------------- hl/src/COPYING | 13 ------------- hl/test/COPYING | 13 ------------- hl/tools/COPYING | 13 ------------- java/COPYING | 13 ------------- release_docs/COPYING | 13 ------------- src/COPYING | 13 ------------- test/COPYING | 13 ------------- testpar/COPYING | 13 ------------- tools/COPYING | 13 ------------- tools/test/perform/COPYING | 13 ------------- utils/COPYING | 12 ------------ 20 files changed, 9 insertions(+), 253 deletions(-) delete mode 100755 bin/COPYING delete mode 100644 c++/COPYING delete mode 100644 config/COPYING delete mode 100644 fortran/COPYING delete mode 100644 hl/COPYING delete mode 100644 hl/c++/COPYING delete mode 100644 hl/fortran/COPYING delete mode 100644 hl/src/COPYING delete mode 100644 hl/test/COPYING delete mode 100644 hl/tools/COPYING delete mode 100644 java/COPYING delete mode 100644 release_docs/COPYING delete mode 100644 src/COPYING delete mode 100644 test/COPYING delete mode 100644 testpar/COPYING delete mode 100644 tools/COPYING delete mode 100644 tools/test/perform/COPYING delete mode 100644 utils/COPYING diff --git a/COPYING b/COPYING index da64ef8..9d32232 100644 --- a/COPYING +++ b/COPYING @@ -67,6 +67,12 @@ under Prime Contract No. DE-AC02-05CH11231. ----------------------------------------------------------------------------- +Portions of HDF5 were developed with support from Lawrence Livermore +National Laboratory and the United States Department of Energy under +Prime Contract No. DE-AC52-07NA27344. + +----------------------------------------------------------------------------- + Portions of HDF5 were developed with support from the University of California, Lawrence Livermore National Laboratory (UC LLNL). The following statement applies to those portions of the product and must diff --git a/MANIFEST b/MANIFEST index 3c31fde..2e5b176 100644 --- a/MANIFEST +++ b/MANIFEST @@ -58,7 +58,6 @@ ./m4/ax_try_compile_java.m4 ./m4/ax_try_run_java.m4 -./bin/COPYING ./bin/bbrelease _DO_NOT_DISTRIBUTE_ ./bin/buildhdf5 ./bin/checkapi _DO_NOT_DISTRIBUTE_ @@ -117,7 +116,6 @@ ./bin/pkgscrpts/makeInternalREADME.pl _DO_NOT_DISTRIBUTE_ ./bin/pkgscrpts/makeOuterREADME.pl _DO_NOT_DISTRIBUTE_ -./config/COPYING ./config/BlankForm ./config/apple ./config/cce-fflags @@ -263,7 +261,6 @@ # #------------------------------------------------------------------------------ -./fortran/COPYING ./fortran/Makefile.am ./fortran/robodoc.rc @@ -395,7 +392,6 @@ # #------------------------------------------------------------------------------ -./c++/COPYING ./c++/Makefile.am ./c++/examples/chunks.cpp @@ -526,7 +522,6 @@ # #------------------------------------------------------------------------------ -./release_docs/COPYING ./release_docs/HISTORY-1_0-1_8_0_rc3.txt ./release_docs/HISTORY-1_8_0-1_10_0.txt ./release_docs/HISTORY-1_10_0-1_12_0.txt @@ -549,7 +544,6 @@ ./src/hdf5.lnt _DO_NOT_DISTRIBUTE_ ./src/hdf5-win.lnt _DO_NOT_DISTRIBUTE_ ./src/hdf5-lin.lnt _DO_NOT_DISTRIBUTE_ -./src/COPYING ./src/H5.c ./src/H5checksum.c ./src/H5dbg.c @@ -1061,7 +1055,6 @@ ./src/libhdf5.settings.in ./test/AtomicWriterReader.txt -./test/COPYING ./test/H5srcdir.h ./test/H5srcdir_str.h.in ./test/Makefile.am @@ -1319,11 +1312,12 @@ ./test/vds_swmr_reader.c ./test/vds_swmr_writer.c ./test/vfd_swmr.c +./test/vfd_swmr_addrem_writer.c +./test/vfd_swmr_attrdset_writer.c +./test/vfd_swmr_bigset_writer.c ./test/vfd_swmr_common.c ./test/vfd_swmr_common.h ./test/vfd_swmr_generator.c -./test/vfd_swmr_addrem_writer.c -./test/vfd_swmr_bigset_writer.c ./test/vfd_swmr_group_writer.c ./test/vfd_swmr_reader.c ./test/vfd_swmr_remove_reader.c @@ -1440,7 +1434,6 @@ ./test/testfiles/plist_files/strcpl_64be ./test/testfiles/plist_files/strcpl_64le -./testpar/COPYING ./testpar/Makefile.am ./testpar/t_bigio.c ./testpar/t_cache.c @@ -1472,7 +1465,6 @@ ./testpar/testphdf5.c ./testpar/testphdf5.h -./tools/COPYING ./tools/Makefile.am ./tools/src/Makefile.am ./tools/test/Makefile.am @@ -2859,7 +2851,6 @@ ./tools/testfiles/h5mkgrp_single_p.ls ./tools/testfiles/h5mkgrp_single_l.ls -./tools/test/perform/COPYING ./tools/test/perform/Makefile.am ./tools/test/perform/build_h5perf_alone.sh ./tools/test/perform/build_h5perf_serial_alone.sh @@ -2884,7 +2875,6 @@ ./tools/test/perform/zip_perf.c # Utils directory -./utils/COPYING ./utils/Makefile.am # Mirror VFD utilities @@ -2896,7 +2886,6 @@ ./utils/mirror_vfd/mirror_writer.c # high level libraries -./hl/COPYING ./hl/Makefile.am ./hl/examples/Makefile.am ./hl/examples/ex_ds1.c @@ -2923,7 +2912,6 @@ ./hl/examples/ptExampleFL.c ./hl/examples/run-hl-ex.sh ./hl/examples/run-hlc-ex.sh.in -./hl/src/COPYING ./hl/src/Makefile.am ./hl/src/H5DO.c ./hl/src/H5DOpublic.h @@ -2952,7 +2940,6 @@ ./hl/src/H5TBprivate.h ./hl/src/H5TBpublic.h ./hl/src/hdf5_hl.h -./hl/test/COPYING ./hl/test/H5srcdir_str.h.in ./hl/test/Makefile.am ./hl/test/dsdata.txt @@ -2988,7 +2975,6 @@ ./hl/test/usa.wri # tools -./hl/tools/COPYING ./hl/tools/Makefile.am ./hl/tools/gif2h5/Makefile.am ./hl/tools/gif2h5/decompress.c @@ -3053,7 +3039,6 @@ ./hl/tools/testfiles/w-help1.ddl # hl fortran -./hl/fortran/COPYING ./hl/fortran/Makefile.am ./hl/fortran/examples/Makefile.am ./hl/fortran/examples/run-hlfortran-ex.sh.in @@ -3078,7 +3063,6 @@ ./hl/fortran/test/tsttable.F90 # hl c++ -./hl/c++/COPYING ./hl/c++/Makefile.am ./hl/c++/examples/Makefile.am ./hl/c++/examples/ptExampleFL.cpp @@ -3091,7 +3075,6 @@ ./hl/c++/test/Makefile.am # java -./java/COPYING ./java/Makefile.am ./java/CMakeLists.txt diff --git a/bin/COPYING b/bin/COPYING deleted file mode 100755 index 97969da..0000000 --- a/bin/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/c++/COPYING b/c++/COPYING deleted file mode 100644 index 97969da..0000000 --- a/c++/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/config/COPYING b/config/COPYING deleted file mode 100644 index 97969da..0000000 --- a/config/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/fortran/COPYING b/fortran/COPYING deleted file mode 100644 index 97969da..0000000 --- a/fortran/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/hl/COPYING b/hl/COPYING deleted file mode 100644 index 97969da..0000000 --- a/hl/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/hl/c++/COPYING b/hl/c++/COPYING deleted file mode 100644 index 97969da..0000000 --- a/hl/c++/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/hl/fortran/COPYING b/hl/fortran/COPYING deleted file mode 100644 index 97969da..0000000 --- a/hl/fortran/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/hl/src/COPYING b/hl/src/COPYING deleted file mode 100644 index 97969da..0000000 --- a/hl/src/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/hl/test/COPYING b/hl/test/COPYING deleted file mode 100644 index 97969da..0000000 --- a/hl/test/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/hl/tools/COPYING b/hl/tools/COPYING deleted file mode 100644 index 97969da..0000000 --- a/hl/tools/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/java/COPYING b/java/COPYING deleted file mode 100644 index 97969da..0000000 --- a/java/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/release_docs/COPYING b/release_docs/COPYING deleted file mode 100644 index 97969da..0000000 --- a/release_docs/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/src/COPYING b/src/COPYING deleted file mode 100644 index 97969da..0000000 --- a/src/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/test/COPYING b/test/COPYING deleted file mode 100644 index 97969da..0000000 --- a/test/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/testpar/COPYING b/testpar/COPYING deleted file mode 100644 index 97969da..0000000 --- a/testpar/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/tools/COPYING b/tools/COPYING deleted file mode 100644 index 97969da..0000000 --- a/tools/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/tools/test/perform/COPYING b/tools/test/perform/COPYING deleted file mode 100644 index 97969da..0000000 --- a/tools/test/perform/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - - Copyright by The HDF Group and - The Board of Trustees of the University of Illinois. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - diff --git a/utils/COPYING b/utils/COPYING deleted file mode 100644 index 9cec22f..0000000 --- a/utils/COPYING +++ /dev/null @@ -1,12 +0,0 @@ - - Copyright by The HDF Group. - All rights reserved. - - The files and subdirectories in this directory are part of HDF5. - The full HDF5 copyright notice, including terms governing use, - modification, and redistribution, is contained in the COPYING file - which can be found at the root of the source code distribution tree - or in https://www.hdfgroup.org/licenses. If you do - not have access to either file, you may request a copy from - help@hdfgroup.org. - -- cgit v0.12 From ed31eeacfadb6b0c07e2b46d4c16bcbc1747d2e1 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 May 2021 12:54:30 -0700 Subject: Many small changes from develop. Should allows running VFD SWMR tests from CMake. --- CMakeInstallation.cmake | 3 +- CMakeLists.txt | 20 +- c++/src/CMakeLists.txt | 6 +- c++/src/H5ArrayType.h | 6 +- c++/src/H5AtomType.h | 4 +- c++/src/H5Attribute.h | 18 +- c++/src/H5CompType.h | 6 +- c++/src/H5DaccProp.h | 4 +- c++/src/H5DataSet.h | 18 +- c++/src/H5DataSpace.h | 2 +- c++/src/H5DataType.h | 10 +- c++/src/H5DcreatProp.h | 4 +- c++/src/H5DxferProp.h | 4 +- c++/src/H5EnumType.h | 6 +- c++/src/H5FaccProp.h | 4 +- c++/src/H5FcreatProp.h | 4 +- c++/src/H5File.h | 2 +- c++/src/H5FloatType.h | 6 +- c++/src/H5IntType.h | 6 +- c++/src/H5LaccProp.h | 4 +- c++/src/H5LcreatProp.h | 4 +- c++/src/H5Location.cpp | 2 + c++/src/H5OcreatProp.h | 4 +- c++/src/H5PredType.h | 4 +- c++/src/H5PropList.cpp | 2 + c++/src/H5PropList.h | 10 +- c++/src/H5StrType.h | 6 +- c++/src/H5VarLenType.h | 6 +- c++/test/ttypes.cpp | 8 +- config/cmake/H5pubconf.h.in | 27 -- config/cmake/cacheinit.cmake | 2 + config/cmake_ext_mod/ConfigureChecks.cmake | 6 - config/gnu-cxxflags | 9 + config/gnu-fflags | 9 + config/gnu-flags | 9 + config/gnu-warnings/error-general | 1 - config/gnu-warnings/noerror-general | 1 - configure.ac | 53 +++- fortran/src/CMakeLists.txt | 78 +++--- fortran/test/CMakeLists.txt | 14 +- hl/c++/src/CMakeLists.txt | 6 +- hl/c++/src/H5PacketTable.h | 2 +- hl/fortran/src/CMakeLists.txt | 18 +- hl/src/CMakeLists.txt | 6 +- hl/src/H5TB.c | 342 ++++++++++++------------ hl/test/test_image.c | 11 +- src/CMakeLists.txt | 141 +++++----- src/H5.c | 1 + test/CMakeLists.txt | 1 + test/CMakeTests.cmake | 3 +- test/ShellTests.cmake | 7 +- testpar/CMakeVFDTests.cmake | 4 +- tools/test/h5copy/testh5copy.sh.in | 12 +- tools/test/h5diff/h5diff_plugin.sh.in | 117 +++++---- tools/test/h5diff/testh5diff.sh.in | 48 ++-- tools/test/h5dump/h5dump_plugin.sh.in | 28 +- tools/test/h5dump/testh5dump.sh.in | 408 ++++++++++++++++------------- tools/test/h5dump/testh5dumppbits.sh.in | 158 +++++------ tools/test/h5dump/testh5dumpvds.sh.in | 172 ++++++------ tools/test/h5dump/testh5dumpxml.sh.in | 31 ++- tools/test/h5jam/getub.c | 5 +- tools/test/h5ls/h5ls_plugin.sh.in | 6 +- tools/test/h5repack/h5repack.sh.in | 46 ++-- tools/test/misc/h5perf_gentest.c | 4 +- tools/test/misc/h5repart_gentest.c | 2 +- tools/test/misc/testh5mkgrp.sh.in | 93 +++---- tools/test/perform/chunk.c | 2 +- tools/test/perform/chunk_cache.c | 16 +- tools/test/perform/iopipe.c | 2 +- tools/test/perform/overhead.c | 2 +- tools/test/perform/perf_meta.c | 6 +- tools/test/perform/pio_perf.h | 6 +- tools/test/perform/pio_standalone.h | 32 +-- 73 files changed, 1151 insertions(+), 979 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index bff0c49..d811ea5 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -205,7 +205,6 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) if (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") set (release_files ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt - ${HDF5_SOURCE_DIR}/release_docs/COPYING ${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt ) if (WIN32) @@ -263,9 +262,9 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") set (CPACK_PACKAGE_VERSION_PATCH "") + set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") if (EXISTS "${HDF5_SOURCE_DIR}/release_docs") set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") endif () set (CPACK_PACKAGE_RELOCATABLE TRUE) diff --git a/CMakeLists.txt b/CMakeLists.txt index e34830b..4054110 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -507,6 +507,14 @@ else () endif () #----------------------------------------------------------------------------- +# perl is used in some optional src and tests, check availability +find_package (Perl) +if (PERL_FOUND) + set (H5_PERL_FOUND YES) +endif () +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- # Option to Build Static executables #----------------------------------------------------------------------------- option (BUILD_STATIC_EXECS "Build Static Executables" OFF) @@ -517,12 +525,18 @@ if (BUILD_STATIC_EXECS) endif () endif () +option (HDF5_ENABLE_ANALYZER_TOOLS "enable the use of Clang tools" OFF) +mark_as_advanced (HDF5_ENABLE_ANALYZER_TOOLS) if (HDF5_ENABLE_ANALYZER_TOOLS) include (${HDF5_SOURCE_DIR}/config/sanitizer/tools.cmake) endif () +option (HDF5_ENABLE_SANITIZERS "execute the Clang sanitizer" OFF) +mark_as_advanced (HDF5_ENABLE_SANITIZERS) if (HDF5_ENABLE_SANITIZERS) include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake) endif () +option (HDF5_ENABLE_FORMATTERS "format source files" OFF) +mark_as_advanced (HDF5_ENABLE_FORMATTERS) if (HDF5_ENABLE_FORMATTERS) include (${HDF5_SOURCE_DIR}/config/sanitizer/formatting.cmake) endif () @@ -1029,7 +1043,9 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for if (HDF5_BUILD_FORTRAN) include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) - message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}") + endif () include (${HDF_RESOURCES_DIR}/HDFFortranCompilerFlags.cmake) include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) set (LINK_Fortran_LIBS ${LINK_LIBS}) @@ -1071,7 +1087,7 @@ endif () # Option to build HDF5 C++ Library #----------------------------------------------------------------------------- if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") - option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" ON) + option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) if (HDF5_BUILD_CPP_LIB) # check for unsupported options if (HDF5_ENABLE_PARALLEL) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 8608c67..4b1a2d6 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -209,7 +209,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_CXX_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_CXX_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5c++ diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 4302352..b93ae4a 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -37,7 +37,7 @@ class H5_DLLCPP ArrayType : public DataType { // Returns an ArrayType object via DataType* by decoding the // binary object description of this type. - virtual DataType *decode() const; + virtual DataType *decode() const H5_OVERRIDE; // Returns the number of dimensions of this array datatype. int getArrayNDims() const; @@ -49,7 +49,7 @@ class H5_DLLCPP ArrayType : public DataType { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("ArrayType"); } @@ -61,7 +61,7 @@ class H5_DLLCPP ArrayType : public DataType { ArrayType(const hid_t existing_id); // Noop destructor - virtual ~ArrayType(); + virtual ~ArrayType() H5_OVERRIDE; // Default constructor ArrayType(); diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index 84da5e9..e00a308 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -58,7 +58,7 @@ class H5_DLLCPP AtomType : public DataType { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("AtomType"); } @@ -68,7 +68,7 @@ class H5_DLLCPP AtomType : public DataType { AtomType(const AtomType &original); // Noop destructor - virtual ~AtomType(); + virtual ~AtomType() H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS protected: diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 41e5a31..71bfa14 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -38,7 +38,7 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { Attribute(const hid_t attr_id); // Closes this attribute. - virtual void close(); + virtual void close() H5_OVERRIDE; // Gets the name of this attribute. ssize_t getName(char *attr_name, size_t buf_size = 0) const; @@ -50,13 +50,13 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { ssize_t getName(size_t buf_size, H5std_string &attr_name) const; // Gets a copy of the dataspace for this attribute. - virtual DataSpace getSpace() const; + virtual DataSpace getSpace() const H5_OVERRIDE; // Returns the amount of storage size required for this attribute. - virtual hsize_t getStorageSize() const; + virtual hsize_t getStorageSize() const H5_OVERRIDE; // Returns the in memory size of this attribute's data. - virtual size_t getInMemDataSize() const; + virtual size_t getInMemDataSize() const H5_OVERRIDE; // Reads data from this attribute. void read(const DataType &mem_type, void *buf) const; @@ -68,21 +68,21 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("Attribute"); } // Gets the attribute id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // Destructor: properly terminates access to this attribute. - virtual ~Attribute(); + virtual ~Attribute() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: // Sets the attribute id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS private: @@ -92,7 +92,7 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { // getTypeClass and various API functions getXxxType // defined in AbstractDs for generic datatype and specific // sub-types - virtual hid_t p_get_type() const; + virtual hid_t p_get_type() const H5_OVERRIDE; // Reads variable or fixed len strings from this attribute. void p_read_variable_len(const DataType &mem_type, H5std_string &strg) const; diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 6a4c093..4424d89 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -45,7 +45,7 @@ class H5_DLLCPP CompType : public DataType { // Returns a CompType object via DataType* by decoding the binary // object description of this type. - virtual DataType *decode() const; + virtual DataType *decode() const H5_OVERRIDE; // Returns the type class of the specified member of this compound // datatype. It provides to the user a way of knowing what type @@ -108,13 +108,13 @@ class H5_DLLCPP CompType : public DataType { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("CompType"); } // Noop destructor. - virtual ~CompType(); + virtual ~CompType() H5_OVERRIDE; private: // Contains common code that is used by the member functions diff --git a/c++/src/H5DaccProp.h b/c++/src/H5DaccProp.h index 7d6b250..398918d 100644 --- a/c++/src/H5DaccProp.h +++ b/c++/src/H5DaccProp.h @@ -38,7 +38,7 @@ class H5_DLLCPP DSetAccPropList : public LinkAccPropList { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("DSetAccPropList"); } @@ -51,7 +51,7 @@ class H5_DLLCPP DSetAccPropList : public LinkAccPropList { DSetAccPropList(const hid_t plist_id); // Noop destructor. - virtual ~DSetAccPropList(); + virtual ~DSetAccPropList() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index c745470..619bc30 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -28,7 +28,7 @@ namespace H5 { class H5_DLLCPP DataSet : public H5Object, public AbstractDs { public: // Close this dataset. - virtual void close(); + virtual void close() H5_OVERRIDE; // Extends the dataset with unlimited dimension. void extend(const hsize_t *size) const; @@ -53,16 +53,16 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { haddr_t getOffset() const; // Gets the dataspace of this dataset. - virtual DataSpace getSpace() const; + virtual DataSpace getSpace() const H5_OVERRIDE; // Determines whether space has been allocated for a dataset. void getSpaceStatus(H5D_space_status_t &status) const; // Returns the amount of storage size required for this dataset. - virtual hsize_t getStorageSize() const; + virtual hsize_t getStorageSize() const H5_OVERRIDE; // Returns the in memory size of this attribute's data. - virtual size_t getInMemDataSize() const; + virtual size_t getInMemDataSize() const H5_OVERRIDE; // Returns the number of bytes required to store VL data. hsize_t getVlenBufSize(const DataType &type, const DataSpace &space) const; @@ -100,7 +100,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("DataSet"); } @@ -121,15 +121,15 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { DataSet(const hid_t existing_id); // Gets the dataset id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // Destructor: properly terminates access to this dataset. - virtual ~DataSet(); + virtual ~DataSet() H5_OVERRIDE; protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS // Sets the dataset id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS private: @@ -139,7 +139,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { // getTypeClass and various API functions getXxxType // defined in AbstractDs for generic datatype and specific // sub-types - virtual hid_t p_get_type() const; + virtual hid_t p_get_type() const H5_OVERRIDE; // Reads variable or fixed len strings from this dataset. void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 470de74..5583baa 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -127,7 +127,7 @@ class H5_DLLCPP DataSpace : public IdComponent { static void deleteConstants(); // Destructor: properly terminates access to this dataspace. - virtual ~DataSpace(); + virtual ~DataSpace() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 49f5348..7dd371b 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -47,7 +47,7 @@ class H5_DLLCPP DataType : public H5Object { // PropList& plist = PropList::DEFAULT); // Closes this datatype. - virtual void close(); + virtual void close() H5_OVERRIDE; // Copies an existing datatype to this datatype object. void copy(const DataType &like_type); @@ -133,7 +133,7 @@ class H5_DLLCPP DataType : public H5Object { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("DataType"); } @@ -148,10 +148,10 @@ class H5_DLLCPP DataType : public H5Object { bool hasBinaryDesc() const; // Gets the datatype id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // Destructor: properly terminates access to this datatype. - virtual ~DataType(); + virtual ~DataType() H5_OVERRIDE; protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -162,7 +162,7 @@ class H5_DLLCPP DataType : public H5Object { hid_t p_decode() const; // Sets the datatype id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; // Opens a datatype and returns the id. hid_t p_opentype(const H5Location &loc, const char *dtype_name) const; diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 820c0d1..a576518 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -128,7 +128,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("DSetCreatPropList"); } @@ -141,7 +141,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { DSetCreatPropList(const hid_t plist_id); // Noop destructor. - virtual ~DSetCreatPropList(); + virtual ~DSetCreatPropList() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 1e4d668..3925a57 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -100,7 +100,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("DSetMemXferPropList"); } @@ -113,7 +113,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { DSetMemXferPropList(const hid_t plist_id); // Noop destructor - virtual ~DSetMemXferPropList(); + virtual ~DSetMemXferPropList() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 484405a..2501e4b 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -41,7 +41,7 @@ class H5_DLLCPP EnumType : public DataType { // Returns an EnumType object via DataType* by decoding the // binary object description of this type. - virtual DataType *decode() const; + virtual DataType *decode() const H5_OVERRIDE; // Returns the number of members in this enumeration datatype. int getNmembers() const; @@ -68,7 +68,7 @@ class H5_DLLCPP EnumType : public DataType { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("EnumType"); } @@ -82,7 +82,7 @@ class H5_DLLCPP EnumType : public DataType { // Copy constructor: same as the original EnumType. EnumType(const EnumType &original); - virtual ~EnumType(); + virtual ~EnumType() H5_OVERRIDE; }; // end of EnumType } // namespace H5 diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 998f870..53c7799 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -137,7 +137,7 @@ class H5_DLLCPP FileAccPropList : public PropList { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("FileAccPropList"); } @@ -150,7 +150,7 @@ class H5_DLLCPP FileAccPropList : public PropList { FileAccPropList(const hid_t plist_id); // Noop destructor - virtual ~FileAccPropList(); + virtual ~FileAccPropList() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 00ae0b1..65daf8f 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -78,7 +78,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("FileCreatPropList"); } @@ -91,7 +91,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { FileCreatPropList(const hid_t plist_id); // Noop destructor - virtual ~FileCreatPropList(); + virtual ~FileCreatPropList() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 6126eec..bdd7b84 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -117,7 +117,7 @@ class H5_DLLCPP H5File : public Group { virtual hid_t getId() const H5_OVERRIDE; // H5File destructor. - virtual ~H5File(); + virtual ~H5File() H5_OVERRIDE; protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index c76be95..e8df757 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -36,7 +36,7 @@ class H5_DLLCPP FloatType : public AtomType { // Returns an FloatType object via DataType* by decoding the // binary object description of this type. - virtual DataType *decode() const; + virtual DataType *decode() const H5_OVERRIDE; // Retrieves the exponent bias of a floating-point type. size_t getEbias() const; @@ -64,7 +64,7 @@ class H5_DLLCPP FloatType : public AtomType { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("FloatType"); } @@ -79,7 +79,7 @@ class H5_DLLCPP FloatType : public AtomType { FloatType(const FloatType &original); // Noop destructor. - virtual ~FloatType(); + virtual ~FloatType() H5_OVERRIDE; }; // end of FloatType } // namespace H5 diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 185c8f0..f0f30ac 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -36,7 +36,7 @@ class H5_DLLCPP IntType : public AtomType { // Returns an IntType object via DataType* by decoding the // binary object description of this type. - virtual DataType *decode() const; + virtual DataType *decode() const H5_OVERRIDE; // Retrieves the sign type for an integer type H5T_sign_t getSign() const; @@ -46,7 +46,7 @@ class H5_DLLCPP IntType : public AtomType { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("IntType"); } @@ -61,7 +61,7 @@ class H5_DLLCPP IntType : public AtomType { IntType(const IntType &original); // Noop destructor. - virtual ~IntType(); + virtual ~IntType() H5_OVERRIDE; }; // end of IntType } // namespace H5 diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 4fa516c..65a9673 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -32,7 +32,7 @@ class H5_DLLCPP LinkAccPropList : public PropList { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("LinkAccPropList"); } @@ -52,7 +52,7 @@ class H5_DLLCPP LinkAccPropList : public PropList { size_t getNumLinks() const; // Noop destructor - virtual ~LinkAccPropList(); + virtual ~LinkAccPropList() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h index aea38e7..c0c66a4 100644 --- a/c++/src/H5LcreatProp.h +++ b/c++/src/H5LcreatProp.h @@ -32,7 +32,7 @@ class H5_DLLCPP LinkCreatPropList : public PropList { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("LinkCreatPropList"); } @@ -59,7 +59,7 @@ class H5_DLLCPP LinkCreatPropList : public PropList { H5T_cset_t getCharEncoding() const; // Noop destructor - virtual ~LinkCreatPropList(); + virtual ~LinkCreatPropList() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 46f47bb..065de0c 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -2158,6 +2158,7 @@ H5Location::childObjType(const char *objname) const break; case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: + case H5O_TYPE_MAP: default: throwException("childObjType", "Unknown type of object"); } @@ -2236,6 +2237,7 @@ H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_iter_order_t o break; case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: + case H5O_TYPE_MAP: default: throwException("childObjType", "Unknown type of object"); } diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index 7f6d411..0aa825b 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -44,7 +44,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("ObjCreatPropList"); } @@ -57,7 +57,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { ObjCreatPropList(const hid_t plist_id); // Noop destructor - virtual ~ObjCreatPropList(); + virtual ~ObjCreatPropList() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index b40d2b3..c4ac6b2 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -29,7 +29,7 @@ class H5_DLLCPP PredType : public AtomType { public: ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("PredType"); } @@ -42,7 +42,7 @@ class H5_DLLCPP PredType : public AtomType { PredType(const PredType &original); // Noop destructor - virtual ~PredType(); + virtual ~PredType() H5_OVERRIDE; /*! \brief This dummy function do not inherit from DataType - it will throw a DataTypeIException if invoked. diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 2c80255..3df403b 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -152,6 +152,8 @@ PropList::PropList(const hid_t plist_id) : IdComponent() case H5I_ERROR_STACK: case H5I_NTYPES: case H5I_UNINIT: + case H5I_MAP: + case H5I_SPACE_SEL_ITER: default: id = H5P_DEFAULT; break; diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 12c8b4b..2df326b 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -38,7 +38,7 @@ class H5_DLLCPP PropList : public IdComponent { bool operator==(const PropList &rhs) const; // Close this property list. - virtual void close(); + virtual void close() H5_OVERRIDE; // Close a property list class. void closeClass() const; @@ -102,7 +102,7 @@ class H5_DLLCPP PropList : public IdComponent { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("PropList"); } @@ -114,10 +114,10 @@ class H5_DLLCPP PropList : public IdComponent { PropList(const PropList &original); // Gets the property list id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // Destructor: properly terminates access to this property list. - virtual ~PropList(); + virtual ~PropList() H5_OVERRIDE; #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -128,7 +128,7 @@ class H5_DLLCPP PropList : public IdComponent { hid_t id; // HDF5 property list id // Sets the property list id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; private: static PropList *DEFAULT_; diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index d272c53..3e4013a 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -42,7 +42,7 @@ class H5_DLLCPP StrType : public AtomType { // Returns an StrType object via DataType* by decoding the // binary object description of this type. - virtual DataType *decode() const; + virtual DataType *decode() const H5_OVERRIDE; // Retrieves the character set type of this string datatype. H5T_cset_t getCset() const; @@ -58,7 +58,7 @@ class H5_DLLCPP StrType : public AtomType { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("StrType"); } @@ -73,7 +73,7 @@ class H5_DLLCPP StrType : public AtomType { StrType(const StrType &original); // Noop destructor. - virtual ~StrType(); + virtual ~StrType() H5_OVERRIDE; }; // end of StrType } // namespace H5 diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index f767e0e..583b9cd 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -33,11 +33,11 @@ class H5_DLLCPP VarLenType : public DataType { // Returns an VarLenType object via DataType* by decoding the // binary object description of this type. - virtual DataType *decode() const; + virtual DataType *decode() const H5_OVERRIDE; ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("VarLenType"); } @@ -53,7 +53,7 @@ class H5_DLLCPP VarLenType : public DataType { VarLenType(const H5Location &loc, const H5std_string &name); // Noop destructor - virtual ~VarLenType(); + virtual ~VarLenType() H5_OVERRIDE; // Default constructor VarLenType(); diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index b633740..7d0337d 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -656,7 +656,6 @@ static void test_named() { static hsize_t ds_size[2] = {10, 20}; - hsize_t i; unsigned attr_data[10][20]; DataType * ds_type = NULL; @@ -726,8 +725,11 @@ test_named() // It should be possible to define an attribute for the named type Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space); - for (i = 0; i < ds_size[0] * ds_size[1]; i++) - attr_data[0][i] = (int)i; /*tricky*/ + for (hsize_t i = 0; i < ds_size[0]; i++) { + for (hsize_t j = 0; j < ds_size[1]; j++) { + attr_data[i][j] = (unsigned)(i * ds_size[1] + j); + } + } attr1.write(PredType::NATIVE_UINT, attr_data); attr1.close(); diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index bf24776..d757158 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -243,21 +243,9 @@ /* Define to 1 if you have the `z' library (-lz). */ #cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@ -/* Define to 1 if you have the `llround' function. */ -#cmakedefine H5_HAVE_LLROUND @H5_HAVE_LLROUND@ - -/* Define to 1 if you have the `llroundf' function. */ -#cmakedefine H5_HAVE_LLROUNDF @H5_HAVE_LLROUNDF@ - /* Define to 1 if you have the `longjmp' function. */ #cmakedefine H5_HAVE_LONGJMP @H5_HAVE_LONGJMP@ -/* Define to 1 if you have the `lround' function. */ -#cmakedefine H5_HAVE_LROUND @H5_HAVE_LROUND@ - -/* Define to 1 if you have the `lroundf' function. */ -#cmakedefine H5_HAVE_LROUNDF @H5_HAVE_LROUNDF@ - /* Define to 1 if you have the `lseek64' function. */ #cmakedefine H5_HAVE_LSEEK64 @H5_HAVE_LSEEK64@ @@ -322,12 +310,6 @@ compiled */ #cmakedefine H5_HAVE_ROS3_VFD @H5_HAVE_ROS3_VFD@ -/* Define to 1 if you have the `round' function. */ -#cmakedefine H5_HAVE_ROUND @H5_HAVE_ROUND@ - -/* Define to 1 if you have the `roundf' function. */ -#cmakedefine H5_HAVE_ROUNDF @H5_HAVE_ROUNDF@ - /* Define to 1 if you have the `setjmp' function. */ #cmakedefine H5_HAVE_SETJMP @H5_HAVE_SETJMP@ @@ -787,19 +769,10 @@ /* Define for large files, on AIX-style hosts. */ #cmakedefine H5__LARGE_FILES -/* Define to empty if `const' does not conform to ANSI C. */ -#cmakedefine H5_const - /* Define to `long int' if does not define. */ #cmakedefine H5_off_t /* Define to `long' if does not define. */ -#cmakedefine H5_ptrdiff_t - -/* Define to `unsigned long' if does not define. */ -#cmakedefine H5_size_t - -/* Define to `long' if does not define. */ #cmakedefine H5_ssize_t #endif diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index fc85277..e423deb 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -21,6 +21,8 @@ set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace (can be empty)" FORCE) +set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build C++ support" FORCE) + set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_INSTALL_MOD_FORTRAN "NO" CACHE STRING "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" FORCE) diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 4b11f51..105e0e7 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -500,18 +500,12 @@ CHECK_FUNCTION_EXISTS (frexpl ${HDF_PREFIX}_HAVE_FREXPL) CHECK_FUNCTION_EXISTS (gethostname ${HDF_PREFIX}_HAVE_GETHOSTNAME) CHECK_FUNCTION_EXISTS (getrusage ${HDF_PREFIX}_HAVE_GETRUSAGE) -CHECK_FUNCTION_EXISTS (llround ${HDF_PREFIX}_HAVE_LLROUND) -CHECK_FUNCTION_EXISTS (llroundf ${HDF_PREFIX}_HAVE_LLROUNDF) -CHECK_FUNCTION_EXISTS (lround ${HDF_PREFIX}_HAVE_LROUND) -CHECK_FUNCTION_EXISTS (lroundf ${HDF_PREFIX}_HAVE_LROUNDF) CHECK_FUNCTION_EXISTS (lstat ${HDF_PREFIX}_HAVE_LSTAT) CHECK_FUNCTION_EXISTS (pread ${HDF_PREFIX}_HAVE_PREAD) CHECK_FUNCTION_EXISTS (pwrite ${HDF_PREFIX}_HAVE_PWRITE) CHECK_FUNCTION_EXISTS (rand_r ${HDF_PREFIX}_HAVE_RAND_R) CHECK_FUNCTION_EXISTS (random ${HDF_PREFIX}_HAVE_RANDOM) -CHECK_FUNCTION_EXISTS (round ${HDF_PREFIX}_HAVE_ROUND) -CHECK_FUNCTION_EXISTS (roundf ${HDF_PREFIX}_HAVE_ROUNDF) CHECK_FUNCTION_EXISTS (setsysinfo ${HDF_PREFIX}_HAVE_SETSYSINFO) CHECK_FUNCTION_EXISTS (signal ${HDF_PREFIX}_HAVE_SIGNAL) diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index 67f925c..cba8298 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -144,6 +144,15 @@ if test "X-g++" = "X-$cxx_vendor"; then DEBUG_CXXFLAGS="-ftrapv -fno-common" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $cxx_vers_major -ge 10; then + NO_DIAGS_CXXFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_CXXFLAGS= + ########### # Symbols # ########### diff --git a/config/gnu-fflags b/config/gnu-fflags index 51895ed..ec4fcab 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -105,6 +105,15 @@ if test "X-gfortran" = "X-$f9x_vendor"; then DEBUG_FCFLAGS="-fbounds-check" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $f9x_vers_major -ge 10; then + NO_DIAGS_FCFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_FCFLAGS= + ########### # Symbols # ########### diff --git a/config/gnu-flags b/config/gnu-flags index 89d27d6..01533de 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -158,6 +158,15 @@ if test "X-gcc" = "X-$cc_vendor"; then DEBUG_CFLAGS="-ftrapv -fno-common" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $cc_vers_major -ge 10; then + NO_DIAGS_CFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_CFLAGS= + ########### # Symbols # ########### diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general index 4358b20..8405c40 100644 --- a/config/gnu-warnings/error-general +++ b/config/gnu-warnings/error-general @@ -3,7 +3,6 @@ # circumstances, so ask the compiler to treat them as errors: # -Werror=bad-function-cast --Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=missing-prototypes diff --git a/config/gnu-warnings/noerror-general b/config/gnu-warnings/noerror-general index e19014f..31194d3 100644 --- a/config/gnu-warnings/noerror-general +++ b/config/gnu-warnings/noerror-general @@ -3,7 +3,6 @@ # circumstances, so ask the compiler to treat them as errors: # -Wbad-function-cast --Wdeclaration-after-statement -Wimplicit-function-declaration -Wmissing-declarations -Wmissing-prototypes diff --git a/configure.ac b/configure.ac index 2b8bb69..cb6d431 100644 --- a/configure.ac +++ b/configure.ac @@ -95,12 +95,12 @@ AC_CONFIG_COMMANDS([pubconf], [ sed 's/#define /#define H5_/' pubconf if test ! -f src/H5pubconf.h; then - /bin/mv -f pubconf src/H5pubconf.h + mv -f pubconf src/H5pubconf.h elif (diff pubconf src/H5pubconf.h >/dev/null); then rm -f pubconf echo "src/H5pubconf.h is unchanged" else - /bin/mv -f pubconf src/H5pubconf.h + mv -f pubconf src/H5pubconf.h fi echo "Post process src/libhdf5.settings" sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP @@ -2094,6 +2094,51 @@ AC_ARG_ENABLE([production], ## ---------------------------------------------------------------------- +## Check if the compiler should include build diagnostics +## +AC_MSG_CHECKING([enable build diagnostics]) +AC_ARG_ENABLE([diags], + [AS_HELP_STRING([--enable-diags=(yes|no|)], + [Allow default enhanced diagnostics to the build. + This is independent of the build mode and optimization + level. + [default=no] + ])], + [DIAGS=$enableval]) + +## Set default +if test "X-$DIAGS" = X- ; then + DIAGS=no +fi + +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) +AC_SUBST([DIAGS]) + +case "X-$DIAGS" in + X-yes) + H5_CFLAGS="$H5_CFLAGS $DIAGS_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DIAGS_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $DIAGS_FCFLAGS" + AC_MSG_RESULT([yes]) + ;; + X-no) + H5_CFLAGS="$H5_CFLAGS $NO_DIAGS_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $NO_DIAGS_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $NO_DIAGS_FCFLAGS" + AC_MSG_RESULT([no]) + ;; + *) + H5_CFLAGS="$H5_CFLAGS $DIAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DIAGS" + H5_FCFLAGS="$H5_FCFLAGS $DIAGS" + DIAGS="custom ($DIAGS)" + AC_MSG_RESULT([$DIAGS]) + ;; +esac + + +## ---------------------------------------------------------------------- ## Check if the compiler should include symbols ## AC_MSG_CHECKING([enable debugging symbols]) @@ -2207,10 +2252,6 @@ if test "X-$DEV_WARNINGS" = X- ; then DEV_WARNINGS=no fi -## Allow this variable to be substituted in -## other files (src/libhdf5.settings.in, etc.) -AC_SUBST([DEV_WARNINGS]) - case "X-$DEV_WARNINGS" in X-yes) H5_CFLAGS="$H5_CFLAGS $DEVELOPER_WARNING_CFLAGS" diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 37b5157..7a39abf 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -73,38 +73,35 @@ add_executable (H5match_types ) target_include_directories (H5match_types PRIVATE "${HDF5_SRC_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") -add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 +add_custom_command (TARGET H5match_types POST_BUILD + BYPRODUCTS H5f90i_gen.h H5fortran_types.F90 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} DEPENDS H5match_types ) if (NOT ONLY_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 + add_custom_command (TARGET H5match_types POST_BUILD + BYPRODUCTS H5f90i_gen.h H5fortran_types.F90 COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5f90i_gen.h" "${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h" + ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5fortran_types.F90" "${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90" + ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static - DEPENDS ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + DEPENDS H5_buildiface H5match_types ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE) set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE) endif () if (BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h - ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 + add_custom_command (TARGET H5match_types POST_BUILD + BYPRODUCTS H5f90i_gen.h H5fortran_types.F90 COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5f90i_gen.h" "${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h" + ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5fortran_types.F90" "${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90" + ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared - DEPENDS ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + DEPENDS H5_buildiface H5match_types ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h PROPERTIES GENERATED TRUE) set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 PROPERTIES GENERATED TRUE) @@ -134,16 +131,29 @@ set (f90CStub_C_SOURCES set_source_files_properties (${f90CStub_C_SOURCES} PROPERTIES LANGUAGE C) set (f90CStub_C_HDRS + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h +) + +set (f90CStub_CGEN_HDRS # generated files ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h ) -set (f90CStub_C_SHHDRS +add_custom_target (H5gen_i ALL + DEPENDS H5match_types ${f90CStub_CGEN_HDRS} +) + +set (f90CStub_CGEN_SHHDRS # generated files ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h ) +add_custom_target (H5gen_iSH ALL + DEPENDS H5match_types ${f90CStub_CGEN_SHHDRS} +) if (NOT ONLY_SHARED_LIBS) - add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) + add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS} ${f90CStub_CGEN_HDRS}) target_include_directories (${HDF5_F90_C_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" @@ -157,11 +167,12 @@ if (NOT ONLY_SHARED_LIBS) FOLDER libraries/fortran LINKER_LANGUAGE C ) + add_dependencies (${HDF5_F90_C_LIB_TARGET} H5gen_i) set (install_targets ${HDF5_F90_C_LIB_TARGET}) endif () if (BUILD_SHARED_LIBS) - add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) + add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS} ${f90CStub_CGEN_SHHDRS}) target_include_directories (${HDF5_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" @@ -176,6 +187,7 @@ if (BUILD_SHARED_LIBS) FOLDER libraries/fortran LINKER_LANGUAGE C ) + add_dependencies (${HDF5_F90_C_LIBSH_TARGET} H5gen_iSH) set (install_targets ${install_targets} ${HDF5_F90_C_LIBSH_TARGET}) endif () @@ -210,39 +222,39 @@ set (f90_F_GEN_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90 ) -add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90 +add_custom_command (TARGET H5_buildiface POST_BUILD + BYPRODUCTS ${HDF5_F90_BINARY_DIR}/H5_gen.F90 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} - DEPENDS ${f90_F_GEN_SOURCES} + DEPENDS H5_buildiface ${f90_F_GEN_SOURCES} COMMENT "Generating the H5_gen.F90 file" ) if (NOT ONLY_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 + add_custom_command (TARGET H5_buildiface POST_BUILD + BYPRODUCTS H5_gen.F90 COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5_gen.F90" "${HDF5_F90_BINARY_DIR}/static/H5_gen.F90" + ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5_gen.F90 ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static - DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90 + DEPENDS H5_buildiface ${HDF5_F90_BINARY_DIR}/H5_gen.F90 COMMENT "Generating the H5_gen.F90 file" ) add_custom_target (H5gen ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 + DEPENDS H5_buildiface ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE) endif () if (BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 + add_custom_command (TARGET H5_buildiface POST_BUILD + BYPRODUCTS H5_gen.F90 COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5_gen.F90" "${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90" + ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5_gen.F90 ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90 COMMENT "Generating the H5_gen.F90 shared file" ) add_custom_target (H5genSH ALL - DEPENDS ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 + DEPENDS H5_buildiface ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 PROPERTIES GENERATED TRUE) endif () @@ -550,7 +562,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_Fortran_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_Fortran_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5fc diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 40aef6d..147746c 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -91,27 +91,27 @@ if (HDF5_ENABLE_FORMATTERS) endif () if (NOT BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 + add_custom_command (TARGET H5_test_buildiface POST_BUILD + BYPRODUCTS tf_gen.F90 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static DEPENDS H5_test_buildiface - COMMENT "Generating the tf_gen.F90 file" + COMMENT "Generating the tf_gen.F90 static file" ) add_custom_target (H5testgen ALL - DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 + DEPENDS H5_test_buildiface ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 ) set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE) else () - add_custom_command ( - OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 + add_custom_command (TARGET H5_test_buildiface POST_BUILD + BYPRODUCTS tf_gen.F90 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared DEPENDS H5_test_buildiface COMMENT "Generating the tf_gen.F90 shared file" ) add_custom_target (H5testgenSH ALL - DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 + DEPENDS H5_test_buildiface ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 ) set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE) endif () diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 1eac9fe..e488656 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -120,7 +120,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_CXX_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_CXX_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5hlc++ diff --git a/hl/c++/src/H5PacketTable.h b/hl/c++/src/H5PacketTable.h index a73b4c9..acd0ccf 100644 --- a/hl/c++/src/H5PacketTable.h +++ b/hl/c++/src/H5PacketTable.h @@ -35,7 +35,7 @@ class H5_HLCPPDLL PacketTable { */ PacketTable() { - table_id = H5I_BADID; + table_id = H5I_INVALID_HID; } /* "Open" Constructor diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 0b7795b..4f0b451 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -114,15 +114,15 @@ set (HDF5_HL_F90_F_BASE_SOURCES ) if (NOT ONLY_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90 + add_custom_command (TARGET H5HL_buildiface POST_BUILD + BYPRODUCTS $H5LTff_gen.F90 H5TBff_gen.F90 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/static DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files" ) add_custom_target (H5HLgen ALL - DEPENDS ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90 + DEPENDS H5HL_buildiface ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90 ) set_source_files_properties ( ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 @@ -131,15 +131,15 @@ if (NOT ONLY_SHARED_LIBS) ) endif () if (BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 + add_custom_command (TARGET H5HL_buildiface POST_BUILD + BYPRODUCTS H5LTff_gen.F90 H5TBff_gen.F90 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/shared DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES} COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files" ) add_custom_target (H5HLgenSH ALL - DEPENDS ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 + DEPENDS H5HL_buildiface ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90 ) set_source_files_properties ( ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 @@ -353,7 +353,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_Fortran_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_Fortran_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5hlfc diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 785bdcf..427424e 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -152,7 +152,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_C_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5hlcc diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 1ac162f..efa61a3 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -57,11 +57,11 @@ H5TBmake_table(const char *table_title, hid_t loc_id, const char *dset_name, hsi hsize_t nrecords, size_t type_size, const char *field_names[], const size_t *field_offset, const hid_t *field_types, hsize_t chunk_size, void *fill_data, int compress, const void *buf) { - hid_t did = H5I_BADID; - hid_t sid = H5I_BADID; - hid_t mem_type_id = H5I_BADID; - hid_t plist_id = H5I_BADID; - hid_t attr_id = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t mem_type_id = H5I_INVALID_HID; + hid_t plist_id = H5I_INVALID_HID; + hid_t attr_id = H5I_INVALID_HID; hsize_t dims[1]; hsize_t dims_chunk[1]; hsize_t maxdims[1] = {H5S_UNLIMITED}; @@ -129,17 +129,17 @@ H5TBmake_table(const char *table_title, hid_t loc_id, const char *dset_name, hsi /* terminate access to the data space. */ if (H5Sclose(sid) < 0) goto out; - sid = H5I_BADID; + sid = H5I_INVALID_HID; /* end access to the dataset */ if (H5Dclose(did) < 0) goto out; - did = H5I_BADID; + did = H5I_INVALID_HID; /* end access to the property list */ if (H5Pclose(plist_id) < 0) goto out; - plist_id = H5I_BADID; + plist_id = H5I_INVALID_HID; /*------------------------------------------------------------------------- * set the conforming table attributes @@ -196,24 +196,24 @@ H5TBmake_table(const char *table_title, hid_t loc_id, const char *dset_name, hsi if (H5Aclose(attr_id) < 0) goto out; - attr_id = H5I_BADID; + attr_id = H5I_INVALID_HID; } /* end for */ /* terminate access to the data space. */ if (H5Sclose(sid) < 0) goto out; - sid = H5I_BADID; + sid = H5I_INVALID_HID; /* end access to the dataset */ if (H5Dclose(did) < 0) goto out; - did = H5I_BADID; + did = H5I_INVALID_HID; } /* end if */ /* release the datatype. */ if (H5Tclose(mem_type_id) < 0) goto out; - mem_type_id = H5I_BADID; + mem_type_id = H5I_INVALID_HID; ret_val = 0; @@ -267,9 +267,9 @@ herr_t H5TBappend_records(hid_t loc_id, const char *dset_name, hsize_t nrecords, size_t type_size, const size_t *field_offset, const size_t *field_sizes, const void *buf) { - hid_t did = H5I_BADID; - hid_t tid = H5I_BADID; - hid_t mem_type_id = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t mem_type_id = H5I_INVALID_HID; hsize_t nrecords_orig; hsize_t nfields; herr_t ret_val = -1; @@ -332,11 +332,11 @@ herr_t H5TBwrite_records(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t type_size, const size_t *field_offset, const size_t *field_sizes, const void *buf) { - hid_t did = H5I_BADID; - hid_t tid = H5I_BADID; - hid_t sid = H5I_BADID; - hid_t m_sid = H5I_BADID; - hid_t mem_type_id = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; + hid_t mem_type_id = H5I_INVALID_HID; hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; @@ -425,14 +425,14 @@ H5TBwrite_fields_name(hid_t loc_id, const char *dset_name, const char *field_nam hsize_t nrecords, size_t type_size, const size_t *field_offset, const size_t *field_sizes, const void *buf) { - hid_t did = H5I_BADID; - hid_t tid = H5I_BADID; - hid_t write_type_id = H5I_BADID; - hid_t member_type_id = H5I_BADID; - hid_t nmtype_id = H5I_BADID; - hid_t m_sid = H5I_BADID; - hid_t file_space_id = H5I_BADID; - hid_t preserve_id = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t write_type_id = H5I_INVALID_HID; + hid_t member_type_id = H5I_INVALID_HID; + hid_t nmtype_id = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; + hid_t file_space_id = H5I_INVALID_HID; + hid_t preserve_id = H5I_INVALID_HID; hssize_t nfields; hssize_t i, j; hsize_t count[1]; @@ -510,10 +510,10 @@ H5TBwrite_fields_name(hid_t loc_id, const char *dset_name, const char *field_nam /* close */ if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; if (H5Tclose(nmtype_id) < 0) goto out; - nmtype_id = H5I_BADID; + nmtype_id = H5I_INVALID_HID; } /* end if */ H5free_memory(member_name); @@ -583,14 +583,14 @@ H5TBwrite_fields_index(hid_t loc_id, const char *dset_name, hsize_t nfields, con hsize_t start, hsize_t nrecords, size_t type_size, const size_t *field_offset, const size_t *field_sizes, const void *buf) { - hid_t did = H5I_BADID; - hid_t tid = H5I_BADID; - hid_t write_type_id = H5I_BADID; - hid_t member_type_id = H5I_BADID; - hid_t nmtype_id = H5I_BADID; - hid_t m_sid = H5I_BADID; - hid_t file_space_id = H5I_BADID; - hid_t preserve_id = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t write_type_id = H5I_INVALID_HID; + hid_t member_type_id = H5I_INVALID_HID; + hid_t nmtype_id = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; + hid_t file_space_id = H5I_INVALID_HID; + hid_t preserve_id = H5I_INVALID_HID; hsize_t count[1]; hsize_t offset[1]; hsize_t i; @@ -663,10 +663,10 @@ H5TBwrite_fields_index(hid_t loc_id, const char *dset_name, hsize_t nfields, con /* close */ if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; if (H5Tclose(nmtype_id) < 0) goto out; - nmtype_id = H5I_BADID; + nmtype_id = H5I_INVALID_HID; H5free_memory(member_name); member_name = NULL; @@ -747,10 +747,10 @@ herr_t H5TBread_table(hid_t loc_id, const char *dset_name, size_t type_size, const size_t *field_offset, const size_t *field_sizes, void *dst_buf) { - hid_t did = H5I_BADID; - hid_t ftype_id = H5I_BADID; - hid_t mem_type_id = H5I_BADID; - hid_t sid = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t ftype_id = H5I_INVALID_HID; + hid_t mem_type_id = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dims[1]; herr_t ret_val = -1; @@ -820,9 +820,9 @@ herr_t H5TBread_records(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t type_size, const size_t *field_offset, const size_t *field_sizes, void *buf) { - hid_t did = H5I_BADID; - hid_t ftype_id = H5I_BADID; - hid_t mem_type_id = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t ftype_id = H5I_INVALID_HID; + hid_t mem_type_id = H5I_INVALID_HID; hsize_t nrecords_orig; hsize_t nfields; herr_t ret_val = -1; @@ -887,13 +887,13 @@ H5TBread_fields_name(hid_t loc_id, const char *dset_name, const char *field_name hsize_t nrecords, size_t type_size, const size_t *field_offset, const size_t *field_sizes, void *buf) { - hid_t did = H5I_BADID; - hid_t ftype_id = H5I_BADID; - hid_t mem_type_id = H5I_BADID; - hid_t mtype_id = H5I_BADID; - hid_t nmtype_id = H5I_BADID; - hid_t sid = H5I_BADID; - hid_t m_sid = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t ftype_id = H5I_INVALID_HID; + hid_t mem_type_id = H5I_INVALID_HID; + hid_t mtype_id = H5I_INVALID_HID; + hid_t nmtype_id = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; hssize_t nfields; hsize_t count[1]; hsize_t offset[1]; @@ -960,10 +960,10 @@ H5TBread_fields_name(hid_t loc_id, const char *dset_name, const char *field_name /* close */ if (H5Tclose(mtype_id) < 0) goto out; - mtype_id = H5I_BADID; + mtype_id = H5I_INVALID_HID; if (H5Tclose(nmtype_id) < 0) goto out; - nmtype_id = H5I_BADID; + nmtype_id = H5I_INVALID_HID; j++; } /* end if */ @@ -1044,13 +1044,13 @@ H5TBread_fields_index(hid_t loc_id, const char *dset_name, hsize_t nfields, cons hsize_t start, hsize_t nrecords, size_t type_size, const size_t *field_offset, const size_t *field_sizes, void *buf) { - hid_t did = H5I_BADID; - hid_t tid = H5I_BADID; - hid_t read_type_id = H5I_BADID; - hid_t member_type_id = H5I_BADID; - hid_t nmtype_id = H5I_BADID; - hid_t sid = H5I_BADID; - hid_t m_sid = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t read_type_id = H5I_INVALID_HID; + hid_t member_type_id = H5I_INVALID_HID; + hid_t nmtype_id = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; @@ -1117,10 +1117,10 @@ H5TBread_fields_index(hid_t loc_id, const char *dset_name, hsize_t nfields, cons /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; if (H5Tclose(nmtype_id) < 0) goto out; - nmtype_id = H5I_BADID; + nmtype_id = H5I_INVALID_HID; H5free_memory(member_name); member_name = NULL; @@ -1198,11 +1198,11 @@ out: herr_t H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords) { - hid_t did = H5I_BADID; - hid_t tid = H5I_BADID; - hid_t sid = H5I_BADID; - hid_t m_sid = H5I_BADID; - hid_t mem_type_id = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; + hid_t mem_type_id = H5I_INVALID_HID; hsize_t nfields; hsize_t ntotal_records; hsize_t read_start; @@ -1294,16 +1294,16 @@ H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr /* close */ if (H5Sclose(m_sid) < 0) goto out; - m_sid = H5I_BADID; + m_sid = H5I_INVALID_HID; if (H5Tclose(mem_type_id) < 0) goto out; - mem_type_id = H5I_BADID; + mem_type_id = H5I_INVALID_HID; if (H5Sclose(sid) < 0) goto out; - sid = H5I_BADID; + sid = H5I_INVALID_HID; if (H5Tclose(tid) < 0) goto out; - tid = H5I_BADID; + tid = H5I_INVALID_HID; } /* read_nrecords */ /*------------------------------------------------------------------------- @@ -1361,11 +1361,11 @@ herr_t H5TBinsert_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t type_size, const size_t *field_offset, const size_t *field_sizes, void *buf) { - hid_t did = H5I_BADID; - hid_t tid = H5I_BADID; - hid_t mem_type_id = H5I_BADID; - hid_t sid = H5I_BADID; - hid_t m_sid = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t mem_type_id = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; hsize_t nfields; hsize_t ntotal_records; hsize_t read_nrecords; @@ -1442,10 +1442,10 @@ H5TBinsert_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr /* terminate access to the dataspace */ if (H5Sclose(m_sid) < 0) goto out; - m_sid = H5I_BADID; + m_sid = H5I_INVALID_HID; if (H5Sclose(sid) < 0) goto out; - sid = H5I_BADID; + sid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * write the "pushed down" records @@ -1513,10 +1513,10 @@ herr_t H5TBadd_records_from(hid_t loc_id, const char *dset_name1, hsize_t start1, hsize_t nrecords, const char *dset_name2, hsize_t start2) { - hid_t did = H5I_BADID; - hid_t tid = H5I_BADID; - hid_t sid = H5I_BADID; - hid_t m_sid = H5I_BADID; + hid_t did = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; @@ -1643,24 +1643,24 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c const char *dset_name3) { /* identifiers for the 1st dataset. */ - hid_t did_1 = H5I_BADID; - hid_t tid_1 = H5I_BADID; - hid_t sid_1 = H5I_BADID; - hid_t pid_1 = H5I_BADID; + hid_t did_1 = H5I_INVALID_HID; + hid_t tid_1 = H5I_INVALID_HID; + hid_t sid_1 = H5I_INVALID_HID; + hid_t pid_1 = H5I_INVALID_HID; /* identifiers for the 2nd dataset. */ - hid_t did_2 = H5I_BADID; - hid_t tid_2 = H5I_BADID; - hid_t sid_2 = H5I_BADID; - hid_t pid_2 = H5I_BADID; + hid_t did_2 = H5I_INVALID_HID; + hid_t tid_2 = H5I_INVALID_HID; + hid_t sid_2 = H5I_INVALID_HID; + hid_t pid_2 = H5I_INVALID_HID; /* identifiers for the 3rd dataset. */ - hid_t did_3 = H5I_BADID; - hid_t tid_3 = H5I_BADID; - hid_t sid_3 = H5I_BADID; - hid_t pid_3 = H5I_BADID; - hid_t sid = H5I_BADID; - hid_t m_sid = H5I_BADID; - hid_t member_type_id = H5I_BADID; - hid_t attr_id = H5I_BADID; + hid_t did_3 = H5I_INVALID_HID; + hid_t tid_3 = H5I_INVALID_HID; + hid_t sid_3 = H5I_INVALID_HID; + hid_t pid_3 = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; + hid_t member_type_id = H5I_INVALID_HID; + hid_t attr_id = H5I_INVALID_HID; hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; @@ -1807,17 +1807,17 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c if (H5Aclose(attr_id) < 0) goto out; - attr_id = H5I_BADID; + attr_id = H5I_INVALID_HID; if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; } /* end for */ /* close data space. */ if (H5Sclose(sid) < 0) goto out; - sid = H5I_BADID; + sid = H5I_INVALID_HID; } /* end if */ /*------------------------------------------------------------------------- @@ -1856,7 +1856,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c */ if (H5Sclose(m_sid) < 0) goto out; - m_sid = H5I_BADID; + m_sid = H5I_INVALID_HID; HDfree(tmp_buf); tmp_buf = NULL; @@ -1999,25 +1999,25 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi hsize_t position, const void *fill_data, const void *buf) { /* identifiers for the 1st, original dataset */ - hid_t did_1 = H5I_BADID; - hid_t tid_1 = H5I_BADID; - hid_t sid_1 = H5I_BADID; - hid_t pid_1 = H5I_BADID; - hid_t msid_1 = H5I_BADID; + hid_t did_1 = H5I_INVALID_HID; + hid_t tid_1 = H5I_INVALID_HID; + hid_t sid_1 = H5I_INVALID_HID; + hid_t pid_1 = H5I_INVALID_HID; + hid_t msid_1 = H5I_INVALID_HID; /* identifiers for the 2nd, new dataset */ - hid_t did_2 = H5I_BADID; - hid_t tid_2 = H5I_BADID; - hid_t sid_2 = H5I_BADID; - hid_t pid_2 = H5I_BADID; - hid_t msid_2 = H5I_BADID; + hid_t did_2 = H5I_INVALID_HID; + hid_t tid_2 = H5I_INVALID_HID; + hid_t sid_2 = H5I_INVALID_HID; + hid_t pid_2 = H5I_INVALID_HID; + hid_t msid_2 = H5I_INVALID_HID; /* identifiers for the 3rd, final dataset */ - hid_t did_3 = H5I_BADID; - hid_t tid_3 = H5I_BADID; - hid_t sid_3 = H5I_BADID; - hid_t member_type_id = H5I_BADID; - hid_t write_type_id = H5I_BADID; - hid_t preserve_id = H5I_BADID; - hid_t attr_id = H5I_BADID; + hid_t did_3 = H5I_INVALID_HID; + hid_t tid_3 = H5I_INVALID_HID; + hid_t sid_3 = H5I_INVALID_HID; + hid_t member_type_id = H5I_INVALID_HID; + hid_t write_type_id = H5I_INVALID_HID; + hid_t preserve_id = H5I_INVALID_HID; + hid_t attr_id = H5I_INVALID_HID; size_t member_size; size_t new_member_size = 0; size_t total_size; @@ -2157,7 +2157,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; } /* end else */ } /* end for */ @@ -2307,12 +2307,12 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi if (H5Aclose(attr_id) < 0) goto out; - attr_id = H5I_BADID; + attr_id = H5I_INVALID_HID; /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; } /* end for */ /*------------------------------------------------------------------------- @@ -2334,11 +2334,11 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi if (H5Aclose(attr_id) < 0) goto out; - attr_id = H5I_BADID; + attr_id = H5I_INVALID_HID; if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; } /* end fill_data */ ret_val = 0; @@ -2415,23 +2415,23 @@ herr_t H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name) { /* identifiers for the 1st original dataset */ - hid_t did_1 = H5I_BADID; - hid_t tid_1 = H5I_BADID; - hid_t sid_1 = H5I_BADID; - hid_t pid_1 = H5I_BADID; + hid_t did_1 = H5I_INVALID_HID; + hid_t tid_1 = H5I_INVALID_HID; + hid_t sid_1 = H5I_INVALID_HID; + hid_t pid_1 = H5I_INVALID_HID; /* identifiers for the 2nd new dataset */ - hid_t did_2 = H5I_BADID; - hid_t tid_2 = H5I_BADID; - hid_t sid_2 = H5I_BADID; - hid_t pid_2 = H5I_BADID; + hid_t did_2 = H5I_INVALID_HID; + hid_t tid_2 = H5I_INVALID_HID; + hid_t sid_2 = H5I_INVALID_HID; + hid_t pid_2 = H5I_INVALID_HID; /* identifiers for the 3rd final dataset */ - hid_t did_3 = H5I_BADID; - hid_t tid_3 = H5I_BADID; - hid_t member_type_id = H5I_BADID; - hid_t preserve_id = H5I_BADID; - hid_t read_type_id = H5I_BADID; - hid_t write_type_id = H5I_BADID; - hid_t attr_id = H5I_BADID; + hid_t did_3 = H5I_INVALID_HID; + hid_t tid_3 = H5I_INVALID_HID; + hid_t member_type_id = H5I_INVALID_HID; + hid_t preserve_id = H5I_INVALID_HID; + hid_t read_type_id = H5I_INVALID_HID; + hid_t write_type_id = H5I_INVALID_HID; + hid_t attr_id = H5I_INVALID_HID; size_t member_size; size_t type_size1; size_t type_size2; @@ -2515,7 +2515,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name) /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; H5free_memory(member_name); member_name = NULL; @@ -2598,7 +2598,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name) /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; } /* end if */ H5free_memory(member_name); @@ -2682,22 +2682,22 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name) /* end access to the property list */ if (H5Pclose(preserve_id) < 0) goto out; - preserve_id = H5I_BADID; + preserve_id = H5I_INVALID_HID; /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; /* close the read type */ if (H5Tclose(read_type_id) < 0) goto out; - read_type_id = H5I_BADID; + read_type_id = H5I_INVALID_HID; /* close the write type */ if (H5Tclose(write_type_id) < 0) goto out; - write_type_id = H5I_BADID; + write_type_id = H5I_INVALID_HID; HDfree(tmp_buf); tmp_buf = NULL; @@ -2769,18 +2769,18 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name) if (H5Aclose(attr_id) < 0) goto out; - attr_id = H5I_BADID; + attr_id = H5I_INVALID_HID; /* close the member type */ if (H5Tclose(member_type_id) < 0) goto out; - member_type_id = H5I_BADID; + member_type_id = H5I_INVALID_HID; } /* end for */ /* close data space. */ if (H5Sclose(sid_1) < 0) goto out; - sid_1 = H5I_BADID; + sid_1 = H5I_INVALID_HID; } /* end if */ ret_val = 0; @@ -2962,9 +2962,9 @@ out: herr_t H5TBget_table_info(hid_t loc_id, const char *dset_name, hsize_t *nfields, hsize_t *nrecords) { - hid_t tid = H5I_BADID; - hid_t sid = H5I_BADID; - hid_t did = H5I_BADID; + hid_t tid = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; hsize_t dims[1]; int num_members; herr_t ret_val = -1; @@ -3008,7 +3008,7 @@ H5TBget_table_info(hid_t loc_id, const char *dset_name, hsize_t *nfields, hsize_ /* terminate access to the dataspace */ if (H5Sclose(sid) < 0) goto out; - sid = H5I_BADID; + sid = H5I_INVALID_HID; *nrecords = dims[0]; } /* end if */ @@ -3048,11 +3048,11 @@ herr_t H5TBget_field_info(hid_t loc_id, const char *dset_name, char *field_names[], size_t *field_sizes, size_t *field_offsets, size_t *type_size) { - hid_t did = H5I_BADID; /* dataset ID */ - hid_t tid = H5I_BADID; /* file type ID */ - hid_t n_tid = H5I_BADID; /* native type ID */ - hid_t m_tid = H5I_BADID; /* member type ID */ - hid_t nm_tid = H5I_BADID; /* native member ID */ + hid_t did = H5I_INVALID_HID; /* dataset ID */ + hid_t tid = H5I_INVALID_HID; /* file type ID */ + hid_t n_tid = H5I_INVALID_HID; /* native type ID */ + hid_t m_tid = H5I_INVALID_HID; /* member type ID */ + hid_t nm_tid = H5I_INVALID_HID; /* native member ID */ hssize_t nfields; hssize_t i; herr_t ret_val = -1; @@ -3111,10 +3111,10 @@ H5TBget_field_info(hid_t loc_id, const char *dset_name, char *field_names[], siz /* close the member types */ if (H5Tclose(m_tid) < 0) goto out; - m_tid = H5I_BADID; + m_tid = H5I_INVALID_HID; if (H5Tclose(nm_tid) < 0) goto out; - nm_tid = H5I_BADID; + nm_tid = H5I_INVALID_HID; } /* end for */ ret_val = 0; @@ -3267,9 +3267,9 @@ static hid_t H5TB_create_type(hid_t loc_id, const char *dset_name, size_t type_size, const size_t *field_offset, const size_t *field_sizes, hid_t ftype_id) { - hid_t mem_type_id = H5I_BADID; - hid_t mtype_id = H5I_BADID; - hid_t nmtype_id = H5I_BADID; + hid_t mem_type_id = H5I_INVALID_HID; + hid_t mtype_id = H5I_INVALID_HID; + hid_t nmtype_id = H5I_INVALID_HID; size_t size_native; hsize_t nfields = 0; char ** fnames = NULL; @@ -3310,10 +3310,10 @@ H5TB_create_type(hid_t loc_id, const char *dset_name, size_t type_size, const si goto out; if (H5Tclose(mtype_id) < 0) goto out; - mtype_id = H5I_BADID; + mtype_id = H5I_INVALID_HID; if (H5Tclose(nmtype_id) < 0) goto out; - nmtype_id = H5I_BADID; + nmtype_id = H5I_INVALID_HID; } /* end for */ ret_val = mem_type_id; @@ -3364,8 +3364,8 @@ herr_t H5TB_common_append_records(hid_t dataset_id, hid_t mem_type_id, size_t nrecords, hsize_t orig_table_size, const void *buf) { - hid_t sid = H5I_BADID; - hid_t m_sid = H5I_BADID; + hid_t sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; hsize_t count[1]; hsize_t offset[1]; hsize_t dims[1]; @@ -3429,8 +3429,8 @@ herr_t H5TB_common_read_records(hid_t dataset_id, hid_t mem_type_id, hsize_t start, size_t nrecords, hsize_t table_size, void *buf) { - hid_t sid = H5I_BADID; - hid_t m_sid = H5I_BADID; + hid_t sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 0c7d511..dc1be96 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -650,10 +650,10 @@ test_generate(void) HL_TESTING2("make indexed image from land data"); for (i = 0; i < n_elements; i++) { - if (data[i] < 0) + if (data[i] < 0.0f) image_data[i] = 0; else - image_data[i] = (unsigned char)((255 * (data[i])) / xmax); + image_data[i] = (unsigned char)((255 * data[i]) / xmax); } /* make the image */ @@ -671,10 +671,11 @@ test_generate(void) HL_TESTING2("make indexed image from sea data"); for (i = 0; i < n_elements; i++) { - if (data[i] > 0) + if (data[i] > 0.0f) image_data[i] = 0; - else - image_data[i] = (unsigned char)((255 * (data[i] - xmin)) / xmin); + else { + image_data[i] = (unsigned char)((255.0f * (data[i] - xmin)) / (xmax - xmin)); + } } /* make the image */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c1e15bc..ea346b0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1009,8 +1009,7 @@ set (H5_PUBLIC_GENERATED_HEADERS option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON) if (HDF5_GENERATE_HEADERS) set_source_files_properties(${H5_GENERATED_HEADERS} PROPERTIES GENERATED TRUE) - find_package (Perl) - if (PERL_FOUND) + if (H5_PERL_FOUND) execute_process ( COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SRC_DIR}/H5err.txt OUTPUT_VARIABLE SCRIPT_OUTPUT ) @@ -1063,6 +1062,7 @@ if (LOCAL_BATCH_TEST) endif () endif () +set (lib_prog_deps) if (NOT EXISTS "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) target_include_directories (H5detect PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") @@ -1070,8 +1070,11 @@ if (NOT EXISTS "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") TARGET_C_PROPERTIES (H5detect STATIC) target_link_libraries (H5detect PRIVATE "$<$:${MPI_C_LIBRARIES}>" $<$,$>:ws2_32.lib> - PRIVATE $<$:"-O0"> ) + target_compile_options(H5detect + PRIVATE "$<$:-O0>" + ) + set (lib_prog_deps ${lib_prog_deps} H5detect) if (HDF5_BATCH_H5DETECT) configure_file ( @@ -1079,77 +1082,68 @@ if (NOT EXISTS "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c") ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT} ESCAPE_QUOTES @ONLY ) add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c - ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 - COMMAND ${HDF5_BATCH_CMD} - ARGS ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT} - COMMAND ${CMAKE_COMMAND} - ARGS -E echo "Executed batch command to create H5Tinit.c" + OUTPUT gen_SRCS.stamp1 + COMMAND ${HDF5_BATCH_CMD} + ARGS ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT} + BYPRODUCTS H5Tinit.c gen_SRCS.stamp1 + COMMAND ${CMAKE_COMMAND} + ARGS -E echo "Executed batch command to create H5Tinit.c" COMMAND ${CMAKE_COMMAND} - ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 + ARGS -E touch gen_SRCS.stamp1 DEPENDS H5detect WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} ) add_custom_target (gen_H5Tinit COMMAND ${CMAKE_COMMAND} -P ${HDF5_SOURCE_DIR}/config/cmake/wait_H5Tinit.cmake ) - if (BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c - ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c" - COMMAND ${CMAKE_COMMAND} - ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 - DEPENDS gen_H5Tinit ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit_created - WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} - ) - set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE) - endif () + set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE) else () - add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c - ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ - ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c + add_custom_command (TARGET H5detect POST_BUILD + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + ARGS H5Tinit.c + BYPRODUCTS H5Tinit.c gen_SRCS.stamp1 COMMAND ${CMAKE_COMMAND} - ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 + ARGS -E touch gen_SRCS.stamp1 DEPENDS H5detect WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} + COMMENT "Create H5Tinit.c" ) + set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c - ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 + add_custom_command (TARGET H5detect POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c" + ARGS -E copy_if_different H5Tinit.c shared/H5Tinit.c + BYPRODUCTS shared/H5Tinit.c shared/shared_gen_SRCS.stamp1 COMMAND ${CMAKE_COMMAND} - ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 - DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c + ARGS -E touch shared/shared_gen_SRCS.stamp1 + DEPENDS H5detect H5Tinit.c WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} + COMMENT "Copy H5Tinit.c to shared folder" ) set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE) endif () endif () - set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE) else () add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 + OUTPUT gen_SRCS.stamp1 COMMAND ${CMAKE_COMMAND} - ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 - DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c + ARGS -E touch gen_SRCS.stamp1 + DEPENDS H5Tinit.c WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} + COMMENT "Touch existing H5Tinit.c" ) + set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c - ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 + OUTPUT shared/shared_gen_SRCS.stamp1 COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c" + ARGS -E copy_if_different H5Tinit.c shared/H5Tinit.c + BYPRODUCTS shared/H5Tinit.c shared/shared_gen_SRCS.stamp1 COMMAND ${CMAKE_COMMAND} - ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 - DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c + ARGS -E touch shared/shared_gen_SRCS.stamp1 + DEPENDS H5Tinit.c WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} + COMMENT "Copy existing H5Tinit.c to shared folder" ) set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE) endif () @@ -1168,8 +1162,11 @@ target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_ TARGET_C_PROPERTIES (H5make_libsettings STATIC) target_link_libraries (H5make_libsettings PRIVATE "$<$:${MPI_C_LIBRARIES}>" $<$,$>:ws2_32.lib> - PRIVATE $<$:"-O0"> ) +target_compile_options(H5make_libsettings + PRIVATE "$<$:-O0>" +) +set (lib_prog_deps ${lib_prog_deps} H5make_libsettings) #----------------------------------------------------------------------------- # Add Target to clang-format @@ -1178,27 +1175,27 @@ if (HDF5_ENABLE_FORMATTERS) clang_format (HDF5_SRC_LIBSETTINGS_FORMAT H5make_libsettings) endif () -add_custom_command ( - OUTPUT ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c - ${HDF5_SRC_BINARY_DIR}/gen_SRCS.stamp2 - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ - ARGS ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c +add_custom_command (TARGET H5make_libsettings POST_BUILD + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ + ARGS H5lib_settings.c + BYPRODUCTS H5lib_settings.c gen_SRCS.stamp2 COMMAND ${CMAKE_COMMAND} - ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2 + ARGS -E touch gen_SRCS.stamp2 DEPENDS H5make_libsettings WORKING_DIRECTORY ${HDF5_SRC_BINARY_DIR} + COMMENT "Create H5lib_settings.c" ) set_source_files_properties (${HDF5_SRC_BINARY_DIR}/H5lib_settings.c PROPERTIES GENERATED TRUE) if (BUILD_SHARED_LIBS) - add_custom_command ( - OUTPUT ${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c - ${HDF5_SRC_BINARY_DIR}/shared/shared_gen_SRCS.stamp2 + add_custom_command (TARGET H5make_libsettings POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different "${HDF5_SRC_BINARY_DIR}/H5lib_settings.c" "${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c" + ARGS -E copy_if_different H5lib_settings.c shared/H5lib_settings.c + BYPRODUCTS shared/H5lib_settings.c shared/shared_gen_SRCS.stamp2 COMMAND ${CMAKE_COMMAND} - ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp2 - DEPENDS ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c + ARGS -E touch shared/shared_gen_SRCS.stamp2 + DEPENDS H5make_libsettings H5lib_settings.c WORKING_DIRECTORY ${HDF5_SRC_BINARY_DIR} + COMMENT "Copy H5lib_settings.c to shared folder" ) set_source_files_properties (${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c PROPERTIES GENERATED TRUE) endif () @@ -1212,7 +1209,10 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) #----------------------------------------------------------------------------- if (NOT ONLY_SHARED_LIBS) set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c) - add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2) + add_custom_target (gen_${HDF5_LIB_TARGET} ALL + DEPENDS ${lib_prog_deps} ${gen_SRCS} ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_SRC_BINARY_DIR}/gen_SRCS.stamp2 + COMMENT "Generation target files" + ) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS}) target_include_directories (${HDF5_LIB_TARGET} @@ -1248,7 +1248,10 @@ endif () if (BUILD_SHARED_LIBS) set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c) - add_custom_target (gen_${HDF5_LIBSH_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp2) + add_custom_target (gen_${HDF5_LIBSH_TARGET} ALL + DEPENDS ${lib_prog_deps} ${shared_gen_SRCS} ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 ${HDF5_SRC_BINARY_DIR}/shared/shared_gen_SRCS.stamp2 + COMMENT "Shared generation target files" + ) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS}) target_include_directories (${HDF5_LIBSH_TARGET} @@ -1367,7 +1370,11 @@ install ( ) if (NOT WIN32) - set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_C_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5cc @@ -1379,4 +1386,18 @@ if (NOT WIN32) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE COMPONENT libraries ) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + #legacy requires a different name + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5pcc + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5pcc + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT libraries + ) + endif () endif () diff --git a/src/H5.c b/src/H5.c index 06332fa..62ea257 100644 --- a/src/H5.c +++ b/src/H5.c @@ -411,6 +411,7 @@ H5_term_library(void) */ if (pending == 0) { pending += DOWN(AC); + /* Shut down the "pluggable" interfaces, before the plugin framework */ pending += DOWN(Z); pending += DOWN(FD); pending += DOWN(VL); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index def070f..5b4302e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -547,6 +547,7 @@ if (HDF5_ENABLE_FORMATTERS) clang_format (HDF5_TEST_mirror_vfd_FORMAT mirror_vfd) endif () + ############################################################################## ### A D D I T I O N A L T E S T S ### ############################################################################## diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index dfab713..e5ad962 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -888,8 +888,7 @@ if (ENABLE_EXTENDED_TESTS) #-- Adding test for flushrefresh file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test") - find_package (Perl) - if (PERL_FOUND) + if (H5_PERL_FOUND) add_test ( NAME H5TEST-testflushrefresh-clear-objects COMMAND ${CMAKE_COMMAND} -E remove flushrefresh.h5 diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake index 4676184..b28bbd6 100644 --- a/test/ShellTests.cmake +++ b/test/ShellTests.cmake @@ -23,8 +23,7 @@ if (UNIX) ############################################################################## # configure scripts to test dir ############################################################################## - find_package (Perl) - if (PERL_FOUND) + if (H5_PERL_FOUND) configure_file(${HDF5_TEST_SOURCE_DIR}/testflushrefresh.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh @ONLY) endif () configure_file(${HDF5_TEST_SOURCE_DIR}/test_usecases.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh @ONLY) @@ -198,18 +197,22 @@ if (UNIX) # testvdsswmr.sh: vds_swmr* add_test (H5SHELL-testflushrefresh ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh) set_tests_properties (H5SHELL-testflushrefresh PROPERTIES + ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) add_test (H5SHELL-test_usecases ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh) set_tests_properties (H5SHELL-test_usecases PROPERTIES + ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) add_test (H5SHELL-testswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh) set_tests_properties (H5SHELL-testswmr PROPERTIES + ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) add_test (H5SHELL-testvdsswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh) set_tests_properties (H5SHELL-testvdsswmr PROPERTIES + ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) diff --git a/testpar/CMakeVFDTests.cmake b/testpar/CMakeVFDTests.cmake index 32f9337..5fac4ea 100644 --- a/testpar/CMakeVFDTests.cmake +++ b/testpar/CMakeVFDTests.cmake @@ -58,9 +58,9 @@ macro (ADD_VFD_TEST vfdname resultcode) WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}/${vfdname} ) endforeach () - set_tests_properties (MPI_TEST_VFD-${vfdname}-pflush1 PROPERTIES WILL_FAIL "true") + set_tests_properties (MPI_TEST_VFD-${vfdname}-t_pflush1 PROPERTIES WILL_FAIL "true") #set_property (TEST MPI_TEST_t_pflush1 PROPERTY PASS_REGULAR_EXPRESSION "PASSED") - set_tests_properties (MPI_TEST_VFD-${vfdname}-pflush2 PROPERTIES DEPENDS MPI_TEST_VFD-${vfdname}-pflush1) + set_tests_properties (MPI_TEST_VFD-${vfdname}-t_pflush2 PROPERTIES DEPENDS MPI_TEST_VFD-${vfdname}-t_pflush1) endif () endmacro () diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index 374e397..79b6fd5 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -13,7 +13,7 @@ # # Tests for the h5copy tool # -# Pedro Vicente Nunes (pvn@hdfgroup.org), Albert Cheng (acheng@hdfgroup.org) +# Pedro Vicente Nunes, Albert Cheng # Thursday, July 20, 2006 # @@ -200,6 +200,7 @@ TOOLTEST() fi runh5diff=no fi + if [ "$3" = -o ]; then outputfile=$4 else @@ -219,6 +220,7 @@ TOOLTEST() $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -268,6 +270,7 @@ TOOLTEST_PREFILL() $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -282,6 +285,7 @@ TOOLTEST_PREFILL() $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2 ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -313,6 +317,7 @@ TOOLTEST_SAME() else runh5diff=no fi + if [ "$3" = -o ]; then outputfile=$4 else @@ -330,6 +335,7 @@ TOOLTEST_SAME() $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -344,6 +350,7 @@ TOOLTEST_SAME() $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -406,6 +413,7 @@ TOOLTEST_FAIL() if [ "$1" = -i ]; then inputfile=$2 fi + if [ "$3" = -o ]; then outputfile=$4 fi @@ -417,8 +425,8 @@ TOOLTEST_FAIL() #echo "#############################" $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr - RET=$? + # save actualout and actualerr in case they are needed later. cp $actualout $actualout_sav STDOUT_FILTER $actualout diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in index ff3d289..0ab169a 100644 --- a/tools/test/h5diff/h5diff_plugin.sh.in +++ b/tools/test/h5diff/h5diff_plugin.sh.in @@ -135,24 +135,24 @@ CLEAN_TESTFILES_AND_TESTDIR() # -h print help page while [ $# -gt 0 ]; do case "$1" in - -p) # reset the tool name and bin to run ph5diff tests - TESTNAME=ph5diff - H5DIFF=../../src/h5diff/ph5diff # The tool name - H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary - pmode=yes - shift - ;; + -p) # reset the tool name and bin to run ph5diff tests + TESTNAME=ph5diff + H5DIFF=../../src/h5diff/ph5diff # The tool name + H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary + pmode=yes + shift + ;; -h) # print help page - echo "$0 [-p] [-h]" - echo " -p run ph5diff tests" - echo " -h print help page" - shift - exit 0 - ;; + echo "$0 [-p] [-h]" + echo " -p run ph5diff tests" + echo " -h print help page" + shift + exit 0 + ;; *) # unknown option echo "$0: Unknown option ($1)" - exit 1 - ;; + exit 1 + ;; esac done @@ -218,19 +218,21 @@ TOOLTEST() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err cat $actual_err >> $actual + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -260,27 +262,29 @@ TOOLTEST() { actual_sorted=actual_sorted sort $expect -o $expect_sorted sort $actual -o $actual_sorted + # remove "EXIT CODE:" line from expect file. test for exit code # is done by serial mode. grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then @@ -306,18 +310,20 @@ TOOLTEST_ERR() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -348,23 +354,24 @@ TOOLTEST_ERR() { sort $expect_err -o $expect_sorted sort $actual_err -o $actual_sorted mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index ac02da2..c8f8ed2 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -500,18 +500,20 @@ TOOLTEST() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -545,23 +547,24 @@ TOOLTEST() { # is done by serial mode. grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then @@ -1199,6 +1202,11 @@ TOOLTEST h5diff_800.txt -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array /g1/array TOOLTEST h5diff_801.txt -v h5diff_dset1.h5 h5diff_dset3.h5 /g1/array /g1/array # ############################################################################## +# # dataset subsets +# ############################################################################## +#TRILABS_227 TOOLTEST h5diff_830.txt --enable-error-stack -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array3D[0,0,0;2,2,1;2,2,2;] /g1/array3D[0,0,0;2,2,1;2,2,2;] + +# ############################################################################## # VDS tests # ############################################################################## TOOLTEST h5diff_v1.txt -v 1_vds.h5 2_vds.h5 diff --git a/tools/test/h5dump/h5dump_plugin.sh.in b/tools/test/h5dump/h5dump_plugin.sh.in index 6a97fd1..a552f60 100644 --- a/tools/test/h5dump/h5dump_plugin.sh.in +++ b/tools/test/h5dump/h5dump_plugin.sh.in @@ -181,8 +181,8 @@ TOOLTEST() { # Run test. TESTING $H5DUMP $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $H5DUMP_BIN "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $H5DUMP_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -192,24 +192,24 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual > /dev/null 2>&1 ; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index d5bd568..686ecfb 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -465,14 +465,14 @@ TESTING() { TOOLTEST() { # check if caseless compare and diff requested if [ "$1" = ignorecase ]; then - caseless="-i" - # replace cmp with diff which runs much longer. - xCMP="$DIFF -i" - shift + caseless="-i" + # replace cmp with diff which runs much longer. + xCMP="$DIFF -i" + shift else - caseless="" - # stick with faster cmp if ignorecase is not requested. - xCMP="$CMP" + caseless="" + # stick with faster cmp if ignorecase is not requested. + xCMP="$CMP" fi expect="$TESTDIR/$1" @@ -485,8 +485,8 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -495,24 +495,24 @@ TOOLTEST() { cp $actual_err $actual_err_sav STDERR_FILTER $actual_err - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $xCMP $expect $actual > /dev/null 2>&1 ; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } @@ -534,41 +534,41 @@ TOOLTEST2() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $CMP $expectdata $actualdata; then - echo " PASSED" - else + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err + rm -f $actual $actualdata $actual_err fi } @@ -592,56 +592,55 @@ TOOLTEST2A() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $DIFF $expectdata $actualdata; then - if [ ! -f $expectmeta ]; then - # Create the expect meta file if it doesn't yet exist. - echo " CREATED" - cp $actualmeta $expectmeta - echo " Expected metafile (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expectmeta $actualmeta; then - echo " PASSED" + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $DIFF $expectdata $actualdata; then + if [ ! -f $expectmeta ]; then + # Create the expect meta file if it doesn't yet exist. + echo " CREATED" + cp $actualmeta $expectmeta + echo " Expected metafile (*.ddl) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectmeta $actualmeta; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected metafile (*.ddl) differs from actual metafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectmeta $actualmeta |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected metafile (*.ddl) differs from actual metafile (*.txt)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectmeta $actualmeta |sed 's/^/ /' + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' fi - else + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err $actualmeta + rm -f $actual $actualdata $actual_err $actualmeta fi - } # same as TOOLTEST2 but only compares the generated data file to the expected data file @@ -658,28 +657,28 @@ TOOLTEST2B() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. - echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err + rm -f $actual $actualdata $actual_err fi } @@ -699,8 +698,8 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -719,23 +718,23 @@ TOOLTEST3() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -757,8 +756,8 @@ TOOLTEST4() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -777,30 +776,30 @@ TOOLTEST4() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -822,8 +821,8 @@ TOOLTEST5() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -842,33 +841,62 @@ TOOLTEST5() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav + fi +} + +# same as TOOLTEST1 but expects h5dump to fail +# +TOOLTEST_FAIL() { + + infile=$1 + expect="$TESTDIR/`basename $1 exp`.ddl" + actual="$TESTDIR/`basename $1 .exp`.out" + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" $infile + ) >&$actual + RET=$? + # Segfault occurred + if [ $RET == 139 ] ; then + nerrors="`expr $nerrors + 1`" + echo "*FAILED - test on $infile failed with segmentation fault" + # Should fail but didn't + elif [ $RET == 0 ] ; then + nerrors="`expr $nerrors + 1`" + echo "*FAILED - test on $infile did not fail as expected" + else + echo " PASSED" fi } + # ADD_HELP_TEST TOOLTEST_HELP() { @@ -880,27 +908,27 @@ TOOLTEST_HELP() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect-CREATED - echo " Expected output (*.txt) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect-CREATED + echo " Expected output (*.txt) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected output (*.txt) differs from actual output (*.out)" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + echo " Expected output (*.txt) differs from actual output (*.out)" + nerrors="`expr $nerrors + 1`" fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } @@ -920,14 +948,16 @@ GREPTEST() # Run test. TESTING $DUMPER -p $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" ) >$actual 2>$actual_err + if [ "$txttype" = "ERRTXT" ]; then $GREP "$expectdata" $actual_err > /dev/null else $GREP "$expectdata" $actual > /dev/null fi + if [ $? -eq 0 ]; then echo " PASSED" else @@ -937,7 +967,7 @@ GREPTEST() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } @@ -956,14 +986,16 @@ GREPTEST2() # Run test. TESTING $DUMPER -p $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" ) >$actual 2>$actual_err + if [ "$txttype" = "ERRTXT" ]; then $GREP "$expectdata" $actual_err > /dev/null else $GREP "$expectdata" $actual > /dev/null fi + if [ $? -eq 0 ]; then echo " PASSED" else @@ -973,21 +1005,21 @@ GREPTEST2() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ + TESTING $DUMPER $@ echo " -SKIP-" } # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { - SPACES=" " - echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' } @@ -997,10 +1029,11 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" @@ -1014,8 +1047,8 @@ DIFFTEST() # beginning with the word "Verifying". # PRINT_H5IMPORT() { - SPACES=" " - echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' } # Call the h5import tool @@ -1025,15 +1058,16 @@ IMPORTTEST() # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then - rm -f $hdf5_file + rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" @@ -1138,9 +1172,9 @@ TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 TOOLTEST tcompound_complex2.ddl --enable-error-stack tcompound_complex2.h5 # tests for bitfields and opaque data types if test $WORDS_BIGENDIAN != "yes"; then -TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5 + TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5 else -TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5 + TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5 fi #test for the nested compound type @@ -1318,12 +1352,12 @@ TOOLTEST tallfilters.ddl --enable-error-stack -H -p -d all tfilters.h5 TOOLTEST tuserfilter.ddl --enable-error-stack -H -p -d myfilter tfilters.h5 if test $USE_FILTER_DEFLATE = "yes" ; then - # data read internal filters - TOOLTEST treadintfilter.ddl --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5 - if test $USE_FILTER_SZIP = "yes"; then - # data read - TOOLTEST treadfilter.ddl --enable-error-stack -d all -d szip tfilters.h5 - fi + # data read internal filters + TOOLTEST treadintfilter.ddl --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5 + if test $USE_FILTER_SZIP = "yes"; then + # data read + TOOLTEST treadfilter.ddl --enable-error-stack -d all -d szip tfilters.h5 + fi fi # test for displaying objects with very long names @@ -1380,9 +1414,9 @@ TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbin # Clean up binary output files if test -z "$HDF5_NOCLEANUP"; then - rm -f out[1-4].bin - rm -f out1.h5 - rm -f out3.h5 + rm -f out[1-4].bin + rm -f out1.h5 + rm -f out3.h5 fi # test for dataset region references @@ -1394,7 +1428,7 @@ TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR. # Clean up text output files if test -z "$HDF5_NOCLEANUP"; then - rm -f tbinregR.txt + rm -f tbinregR.txt fi # tests for group creation order diff --git a/tools/test/h5dump/testh5dumppbits.sh.in b/tools/test/h5dump/testh5dumppbits.sh.in index 2c8a0c9..6689749 100644 --- a/tools/test/h5dump/testh5dumppbits.sh.in +++ b/tools/test/h5dump/testh5dumppbits.sh.in @@ -236,26 +236,25 @@ TOOLTEST() { cp $actual_err $actual_err_sav STDERR_FILTER $actual_err - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi - } @@ -274,36 +273,36 @@ TOOLTEST2() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $CMP $expectdata $actualdata; then - echo " PASSED" - else + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file @@ -328,8 +327,8 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -348,23 +347,23 @@ TOOLTEST3() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -385,8 +384,8 @@ TOOLTEST4() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -405,30 +404,30 @@ TOOLTEST4() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -442,8 +441,8 @@ SKIP() { # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { - SPACES=" " - echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' } @@ -453,10 +452,11 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" @@ -470,8 +470,8 @@ DIFFTEST() # beginning with the word "Verifying". # PRINT_H5IMPORT() { - SPACES=" " - echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' } # Call the h5import tool @@ -481,22 +481,22 @@ IMPORTTEST() # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then - rm -f $hdf5_file + rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else echo " PASSED" fi - } diff --git a/tools/test/h5dump/testh5dumpvds.sh.in b/tools/test/h5dump/testh5dumpvds.sh.in index 8381063..f2c486e 100644 --- a/tools/test/h5dump/testh5dumpvds.sh.in +++ b/tools/test/h5dump/testh5dumpvds.sh.in @@ -205,8 +205,8 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -216,26 +216,25 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi - } @@ -254,42 +253,42 @@ TOOLTEST2() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err cat $actual_err >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $CMP $expectdata $actualdata; then - echo " PASSED" - else + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err + rm -f $actual $actualdata $actual_err fi } @@ -309,8 +308,8 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -326,27 +325,27 @@ TOOLTEST3() { -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ - $actual_err > $actual_ext + $actual_err > $actual_ext cat $actual_ext >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -367,8 +366,8 @@ TOOLTEST4() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -384,47 +383,46 @@ TOOLTEST4() { -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ - $actual_err > $actual_ext + $actual_err > $actual_ext #cat $actual_ext >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi - } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ + TESTING $DUMPER $@ echo " -SKIP-" } # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { - SPACES=" " - echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' } @@ -434,25 +432,25 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else echo " PASSED" fi - } # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # PRINT_H5IMPORT() { - SPACES=" " - echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' } # Call the h5import tool @@ -462,22 +460,22 @@ IMPORTTEST() # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then - rm -f $hdf5_file + rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else echo " PASSED" fi - } @@ -491,7 +489,7 @@ COPY_TESTFILES_TO_TESTDIR ####### test for dataset vds ###### - # Data read +# Data read if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST tvds-1.ddl --enable-error-stack 1_vds.h5 TOOLTEST tvds-2.ddl --enable-error-stack 2_vds.h5 @@ -504,7 +502,7 @@ if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST vds-gap2.ddl --vds-gap-size=2 --enable-error-stack vds-eiger.h5 fi - # Layout read +# Layout read if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST tvds_layout-1.ddl -p --enable-error-stack 1_vds.h5 TOOLTEST tvds_layout-2.ddl -p --enable-error-stack 2_vds.h5 diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index 2eda110..447c819 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -262,36 +262,35 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.xml) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.xml) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.xml) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.xml) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ - echo " -SKIP-" + TESTING $DUMPER $@ + echo " -SKIP-" } diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index a21c2af..a9b4437 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -138,14 +138,15 @@ main(int argc, const char *argv[]) } /* end if */ /* close things and exit */ + HDfree(filename); HDfree(buf); HDclose(fd); return EXIT_SUCCESS; error: - if (buf) - HDfree(buf); + HDfree(filename); + HDfree(buf); if (fd >= 0) HDclose(fd); return EXIT_FAILURE; diff --git a/tools/test/h5ls/h5ls_plugin.sh.in b/tools/test/h5ls/h5ls_plugin.sh.in index 2d45f59..29e982d 100644 --- a/tools/test/h5ls/h5ls_plugin.sh.in +++ b/tools/test/h5ls/h5ls_plugin.sh.in @@ -139,8 +139,8 @@ CLEAN_TESTFILES_AND_TESTDIR() # Print a $* message left justified in a field of 70 characters # MESSAGE() { - SPACES=" " - echo "$* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo "$* $SPACES" | cut -c1-70 | tr -d '\012' } # Print a line-line message left justified in a field of 70 characters @@ -206,7 +206,7 @@ TOOLTEST() { echo "" fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect echo " Expected result (*.ls) missing" diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index fadc143..8f3ed8c 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -271,6 +271,12 @@ SKIP() { echo " -SKIP-" } +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + # Call the h5diff tool # DIFFTEST() @@ -620,6 +626,7 @@ VERIFY_INVALIDBOUNDS() # ----------------------------------------------------------------------------- # Expect h5diff to fail +# Use only by VERIFY_EXTERNAL_CONSOLIDATION # ----------------------------------------------------------------------------- DIFFFAIL() { @@ -629,7 +636,7 @@ DIFFFAIL() $RUNSERIAL $H5DIFF_BIN -q "$@" ) RET=$? - if [ $RET == 0 ] ; then + if [ $RET -eq 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else @@ -1356,44 +1363,28 @@ TOOLTEST_STAT SPT $arg # layout options (these files have no filters) ######################################################### VERIFY_LAYOUT_DSET dset2_chunk_20x10 h5repack_layout.h5 dset2 CHUNKED --layout dset2:CHUNK=20x10 - VERIFY_LAYOUT_ALL chunk_20x10 h5repack_layout.h5 CHUNKED -l CHUNK=20x10 - VERIFY_LAYOUT_DSET dset2_conti h5repack_layout.h5 dset2 CONTIGUOUS -l dset2:CONTI - VERIFY_LAYOUT_ALL conti h5repack_layout.h5 CONTIGUOUS -l CONTI - VERIFY_LAYOUT_DSET dset2_compa h5repack_layout.h5 dset2 COMPACT -l dset2:COMPA - VERIFY_LAYOUT_ALL compa h5repack_layout.h5 COMPACT -l COMPA - TOOLTESTM dset2_chunk_20x10-errstk h5repack_layout.h5 --layout=dset2:CHUNK=20x10x5 --enable-error-stack ################################################################ # layout conversions (file has no filters) ############################################################### - VERIFY_LAYOUT_DSET dset_compa_conti h5repack_layout.h5 dset_compact CONTIGUOUS -l dset_compact:CONTI - VERIFY_LAYOUT_DSET dset_compa_chunk h5repack_layout.h5 dset_compact CHUNKED -l dset_compact:CHUNK=2x5 - VERIFY_LAYOUT_DSET dset_compa_compa h5repack_layout.h5 dset_compact COMPACT -l dset_compact:COMPA - VERIFY_LAYOUT_DSET dset_conti_compa h5repack_layout.h5 dset_contiguous COMPACT -l dset_contiguous:COMPA - VERIFY_LAYOUT_DSET dset_conti_chunk h5repack_layout.h5 dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6 - VERIFY_LAYOUT_DSET dset_conti_conti h5repack_layout.h5 dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI - VERIFY_LAYOUT_DSET chunk_compa h5repack_layout.h5 dset_chunk COMPACT -l dset_chunk:COMPA - VERIFY_LAYOUT_DSET chunk_conti h5repack_layout.h5 dset_chunk CONTIGUOUS -l dset_chunk:CONTI - VERIFY_LAYOUT_DSET chunk_18x13 h5repack_layout.h5 dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13 # test convert small size dataset ( < 1k) to compact layout without -m VERIFY_LAYOUT_DSET contig_small_compa h5repack_layout2.h5 contig_small COMPACT -l contig_small:COMPA - VERIFY_LAYOUT_DSET contig_small_fixed_compa h5repack_layout2.h5 chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA #--------------------------------------------------------------------------- @@ -1421,6 +1412,7 @@ VERIFY_LAYOUT_DSET chunk2compa h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk # chunk dim is bigger than dataset dim. ( dset size < 64k ) VERIFY_LAYOUT_DSET error1 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE # chunk dim is bigger than dataset dim. ( dset size > 64k ) + VERIFY_LAYOUT_DSET error2 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE # chunk dims are smaller than dataset dims. ( dset size < 64k ) @@ -1435,7 +1427,6 @@ TOOLTEST error4 h5repack_layout3.h5 -f NONE # (dset size < 64K) and with unlimited max dims on a condition as follow. # (HDFFV-8214) #-------------------------------------------------------------------------- - # chunk dim is bigger than dataset dim. should succeed. VERIFY_LAYOUT_DSET ckdim_biger h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI # chunk dim is smaller than dataset dim. should succeed. @@ -1466,7 +1457,6 @@ else fi # several global filters - arg="h5repack_layout.h5 --filter GZIP=1 --filter SHUF" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg @@ -1562,9 +1552,15 @@ else VERIFY_LAYOUT_VDS vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI fi -######################################################### -# Testing version bounds -######################################################### +################################################################ +# reference new api conversions +############################################################### +#TOOLTEST_DUMP attrregion tattrreg.h5 +#TOOLTEST_DUMP dataregion tdatareg.h5 + +############################################################################## +### V E R S I O N B O U N D S T E S T S +############################################################################## # -j 0 -k 2, superblock will be 0 VERIFY_SUPERBLOCK 0 2 0 h5repack_layout.h5 -j 0 -k 2 h5repack_layout.h5 # -j 1 -k 2, superblock will be 2 @@ -1574,9 +1570,9 @@ VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5 # -j 0 -k 1, file cannot be opened VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5 -######################################## -# Testing external storage -######################################## +############################################################################## +### E X T E R N A L S T O R A G E T E S T S +############################################################################## VERIFY_EXTERNAL_CONSOLIDATION -l CONTI # Clean up temporary files/directories diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c index a3a781b..332e49c 100644 --- a/tools/test/misc/h5perf_gentest.c +++ b/tools/test/misc/h5perf_gentest.c @@ -14,7 +14,7 @@ creates a large number of attributes, groups, and datasets by specifying -a, -g, -d options respectively. Using "-h" option to see details. - Programmer: Peter Cao , Jan. 2013 + Programmer: Peter Cao, Jan. 2013 ****************************************************************************/ #include "hdf5.h" @@ -128,7 +128,7 @@ main(int argc, char *argv[]) Return: Non-negative on success/Negative on failure - Programmer: Peter Cao , Jan. 2013 + Programmer: Peter Cao, Jan. 2013 ****************************************************************************/ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsize_t nrows, hsize_t dim0, diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c index dc228f3..b068985 100644 --- a/tools/test/misc/h5repart_gentest.c +++ b/tools/test/misc/h5repart_gentest.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * June 1, 2005 * * Purpose: Generate a family file of 1024 bytes for each member diff --git a/tools/test/misc/testh5mkgrp.sh.in b/tools/test/misc/testh5mkgrp.sh.in index 9f3c4f7..5cd852a 100644 --- a/tools/test/misc/testh5mkgrp.sh.in +++ b/tools/test/misc/testh5mkgrp.sh.in @@ -13,7 +13,7 @@ # # Tests for the h5mkgrp tool # -# Quincey Koziol (koziol@hdfgroup.org) +# Quincey Koziol # Tuesday, February 13, 2007 # @@ -150,10 +150,11 @@ TOOLTEST() { TESTING $H5MKGRP $@ ( - cd $TESTDIR - $RUNSERIAL $H5MKGRP_BIN $@ + cd $TESTDIR + $RUNSERIAL $H5MKGRP_BIN $@ ) > output.out RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -164,7 +165,7 @@ TOOLTEST() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f output.out + rm -f output.out fi fi } @@ -181,8 +182,8 @@ H5LSTEST() # any unexpected output from that stream too. VERIFY_H5LS $@ ( - cd $TESTDIR - $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ + cd $TESTDIR + $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' >$actual # save actual in case it is needed later. @@ -190,25 +191,25 @@ H5LSTEST() STDOUT_FILTER $actual STDERR_FILTER $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ls) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.ls) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_sav - fi + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.ls) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_sav + fi } # Single run of tool @@ -258,30 +259,30 @@ CMPTEST() # any unexpected output from that stream too. TESTING $H5MKGRP $@ ( - cd $TESTDIR - $RUNSERIAL $H5MKGRP_BIN $@ + cd $TESTDIR + $RUNSERIAL $H5MKGRP_BIN $@ ) >$actual 2>$actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.txt) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.txt) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err - fi + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.txt) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.txt) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err + fi } ############################################################################## diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index 397954a..ada2ed3 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 14, 1998 * * Purpose: Checks the effect of various I/O request sizes and raw data diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index c4bdb4b..fcaa337 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -98,7 +98,7 @@ create_dset1(hid_t file) hid_t dcpl = H5I_INVALID_HID; hsize_t dims[RANK] = {DSET1_DIM1, DSET1_DIM2}; hsize_t chunk_dims[RANK] = {CHUNK1_DIM1, CHUNK1_DIM2}; - int ** data; /* data for writing */ + int ** data = NULL; /* data for writing */ /* Create the data space. */ if ((dataspace = H5Screate_simple(RANK, dims, NULL)) < 0) @@ -134,6 +134,7 @@ create_dset1(hid_t file) H5Dclose(dataset); H5Pclose(dcpl); H5Sclose(dataspace); + HDfree(data); return 0; error: @@ -144,6 +145,7 @@ error: H5Sclose(dataspace); } H5E_END_TRY; + HDfree(data); return 1; } @@ -160,7 +162,7 @@ create_dset2(hid_t file) hid_t dcpl = H5I_INVALID_HID; hsize_t dims[RANK] = {DSET2_DIM1, DSET2_DIM2}; hsize_t chunk_dims[RANK] = {CHUNK2_DIM1, CHUNK2_DIM2}; - int ** data; /* data for writing */ + int ** data = NULL; /* data for writing */ /* Create the data space. */ if ((dataspace = H5Screate_simple(RANK, dims, NULL)) < 0) @@ -195,6 +197,7 @@ create_dset2(hid_t file) H5Dclose(dataset); H5Pclose(dcpl); H5Sclose(dataspace); + HDfree(data); return 0; @@ -206,6 +209,7 @@ error: H5Sclose(dataspace); } H5E_END_TRY; + HDfree(data); return 1; } @@ -259,11 +263,11 @@ check_partial_chunks_perf(hid_t file) end_t = H5_get_time(); if ((end_t - start_t) > (double)0.0f) - printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %lu\n", + printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %zu\n", (end_t - start_t), nbytes_global); else printf("1. Partial chunks: no total read time because timer is not available; number of bytes being " - "read from file is %lu\n", + "read from file is %zu\n", nbytes_global); H5Dclose(dataset); @@ -337,11 +341,11 @@ check_hash_value_perf(hid_t file) end_t = H5_get_time(); if ((end_t - start_t) > (double)0.0f) - printf("2. Hash value: total read time is %lf; number of bytes being read from file is %lu\n", + printf("2. Hash value: total read time is %lf; number of bytes being read from file is %zu\n", (end_t - start_t), nbytes_global); else printf("2. Hash value: no total read time because timer is not available; number of bytes being read " - "from file is %lu\n", + "from file is %zu\n", nbytes_global); H5Dclose(dataset); diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index 08c0d7d..68eaa3a 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, March 12, 1998 */ diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index ec8c281..dba8220 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, September 28, 1998 * * Purpose: Creates a chunked dataset and measures the storage overhead. diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index f9e1a7f..d8ed9ec 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Friday, Oct 3, 2004 * * Purpose: Tests performance of metadata @@ -818,8 +818,10 @@ main(int argc, char **argv) goto error; #ifdef H5_HAVE_PARALLEL if (facc_type != FACC_DEFAULT && MAINPROCESS) -#endif /*H5_HAVE_PARALLEL*/ printf("All metadata performance tests passed.\n"); +#else + printf("All metadata performance tests passed.\n"); +#endif /*H5_HAVE_PARALLEL*/ return 0; diff --git a/tools/test/perform/pio_perf.h b/tools/test/perform/pio_perf.h index 027b553..24621da 100644 --- a/tools/test/perform/pio_perf.h +++ b/tools/test/perform/pio_perf.h @@ -10,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef PIO_PERF_H__ -#define PIO_PERF_H__ +#ifndef PIO_PERF_H +#define PIO_PERF_H #ifndef STANDALONE #include "io_timer.h" @@ -97,4 +97,4 @@ extern results do_pio(parameters param); } #endif /* __cplusplus */ -#endif /* PIO_PERF_H__ */ +#endif /* PIO_PERF_H */ diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index 5a3f16d..7c1ac42 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -10,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef PIO_STANDALONE_H__ -#define PIO_PERF_H__ +#ifndef PIO_STANDALONE_H +#define PIO_STANDALONE_H /* Header file for building h5perf by standalone mode. * Created: Christian Chilan, 2005/5/18. @@ -356,7 +356,7 @@ H5_DLL int c99_snprintf(char *str, size_t size, const char *format, ...); #endif /* sprintf() variable arguments */ #define HDsprintf sprintf /*varargs*/ -#define HDsqrt(X) sqrt(X) +#define HDsqrt(X) sqrt(X) #ifdef H5_HAVE_RAND_R H5_DLL void HDsrand(unsigned int seed); #define HDsrandom(S) HDsrand(S) @@ -429,25 +429,25 @@ H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base); #else #define HDunlink(S) unlink(S) #endif -#define HDutime(S, T) utime(S, T) -#define HDva_arg(A, T) va_arg(A, T) -#define HDva_end(A) va_end(A) -#define HDva_start(A, P) va_start(A, P) -#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A) -#define HDvfprintf(F, FMT, A) vfprintf(F, FMT, A) -#define HDvprintf(FMT, A) vprintf(FMT, A) -#define HDvsprintf(S, FMT, A) vsprintf(S, FMT, A) +#define HDutime(S, T) utime(S, T) +#define HDva_arg(A, T) va_arg(A, T) +#define HDva_end(A) va_end(A) +#define HDva_start(A, P) va_start(A, P) +#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A) +#define HDvfprintf(F, FMT, A) vfprintf(F, FMT, A) +#define HDvprintf(FMT, A) vprintf(FMT, A) +#define HDvsprintf(S, FMT, A) vsprintf(S, FMT, A) #ifdef H5_HAVE_WIN32_API H5_DLL int c99_vsnprintf(char *str, size_t size, const char *format, va_list ap); #define HDvsnprintf c99_vsnprintf #else #define HDvsnprintf(S, N, FMT, A) vsnprintf(S, N, FMT, A) #endif -#define HDwait(W) wait(W) -#define HDwaitpid(P, W, O) waitpid(P, W, O) -#define HDwcstombs(S, P, Z) wcstombs(S, P, Z) -#define HDwctomb(S, C) wctomb(S, C) -#define HDwrite(F, M, Z) write(F, M, Z) +#define HDwait(W) wait(W) +#define HDwaitpid(P, W, O) waitpid(P, W, O) +#define HDwcstombs(S, P, Z) wcstombs(S, P, Z) +#define HDwctomb(S, C) wctomb(S, C) +#define HDwrite(F, M, Z) write(F, M, Z) /* * And now for a couple non-Posix functions... Watch out for systems that -- cgit v0.12 From fca509b7d61b9dffae85be3406ca484c1bf28242 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 May 2021 13:35:22 -0700 Subject: Fixes issue in vfd_swmr_attrdset_writer.c --- test/testvfdswmr.sh.in | 98 ++++++++++++++++++++--------------------- test/vfd_swmr_attrdset_writer.c | 4 +- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index 9c0f272..a50d7ab 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -155,8 +155,7 @@ if [ $rc -ne 0 ] ; then exit 0 fi -#all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups attrdset" -all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups" +all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups attrdset" all_tests="${all_tests} groups_attrs os_groups_attrs few_big many_small" tests=${all_tests} @@ -623,53 +622,54 @@ if [ ${do_zoo:-no} = yes ]; then fi # attrdset test -#for options in "-p -g -a 10 -v -m -d 10 -c 3 -u 5" "-k -a 20 -v -m -d 5"; do -# # -# # Test a few big datasets of one and two dimensions. -# # -# if [ ${do_attrdset:-no} = no ]; then -# continue -# fi -# # Clean up any existing fifo files from previous runs -# if [ -e ./$FIFO_WRITER_TO_READER ]; then # If writer fifo file is found -# rm -f ./$FIFO_WRITER_TO_READER -# fi -# if [ -e ./$FIFO_READER_TO_WRITER ]; then # If reader fifo file is found -# rm -f ./$FIFO_READER_TO_WRITER -# fi -# # -# echo launch vfd_swmr_attrdset_writer attrdset, options $options -# catch_out_err_and_rc vfd_swmr_attrdset_writer \ -# ../vfd_swmr_attrdset_writer $options & -# pid_writer=$! -# -# catch_out_err_and_rc vfd_swmr_attrdset_reader \ -# ../vfd_swmr_attrdset_reader $options & -# pid_reader=$! -# -# # Wait for the reader to finish before signaling the -# # writer to quit: the writer holds the file open so that the -# # reader will find the shadow file when it opens -# # the .h5 file. -# wait $pid_reader -# wait $pid_writer -# -# # Collect exit code of the reader -# if [ $(cat vfd_swmr_attrdset_reader.rc) -ne 0 ]; then -# echo reader had error -# nerrors=$((nerrors + 1)) -# fi -# -# # Collect exit code of the writer -# if [ $(cat vfd_swmr_attrdset_writer.rc) -ne 0 ]; then -# echo writer had error -# nerrors=$((nerrors + 1)) -# fi -# -# # Clean up output files -# rm -f vfd_swmr_attrdset_writer.{out,rc} -# rm -f vfd_swmr_attrdset_reader.*.{out,rc} -#done +for options in "-p -g -a 10 -v -m -d 10 -c 3 -u 5" "-k -a 20 -v -m -d 5"; do + # + # Test a few big datasets of one and two dimensions. + # + if [ ${do_attrdset:-no} = no ]; then + continue + fi + + # Clean up any existing fifo files from previous runs + if [ -e ./$FIFO_WRITER_TO_READER ]; then # If writer fifo file is found + rm -f ./$FIFO_WRITER_TO_READER + fi + if [ -e ./$FIFO_READER_TO_WRITER ]; then # If reader fifo file is found + rm -f ./$FIFO_READER_TO_WRITER + fi + + echo launch vfd_swmr_attrdset_writer attrdset, options $options + catch_out_err_and_rc vfd_swmr_attrdset_writer \ + ../vfd_swmr_attrdset_writer $options & + pid_writer=$! + + catch_out_err_and_rc vfd_swmr_attrdset_reader \ + ../vfd_swmr_attrdset_reader $options & + pid_reader=$! + + # Wait for the reader to finish before signaling the + # writer to quit: the writer holds the file open so that the + # reader will find the shadow file when it opens + # the .h5 file. + wait $pid_reader + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_attrdset_reader.rc) -ne 0 ]; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_attrdset_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_attrdset_writer.{out,rc} + rm -f vfd_swmr_attrdset_reader.*.{out,rc} +done # # Make sure that we can create GROUP_n groups (20, 40, or 400 depending on the HDF5TestExpress level) diff --git a/test/vfd_swmr_attrdset_writer.c b/test/vfd_swmr_attrdset_writer.c index 0871898..7800727 100644 --- a/test/vfd_swmr_attrdset_writer.c +++ b/test/vfd_swmr_attrdset_writer.c @@ -1106,7 +1106,7 @@ modify_attr(const state_t *s, hid_t did, unsigned int which) TEST_ERROR; } - HDsprintf(val, "%u %u %u %u %u", which, which+1, which+2, which+3, which+4); + HDsprintf(val, "%u %c", which, 'M'); tid = vl_tid; } else { @@ -1331,7 +1331,7 @@ verify_add_or_modify_attr(unsigned action, hid_t did, char *attr_name, unsigned if(action == ADD_ATTR) HDsprintf(vl_which, "%u", which); else - HDsprintf(vl_which, "%u %u %u %u %u", which, which+1, which+2, which+3, which+4); + HDsprintf(vl_which, "%u %c", which, 'M'); if((read_vl_which = HDmalloc(sizeof("9999999999"))) == NULL) { printf("HDmalloc failed\n"); -- cgit v0.12 From 0ab5dd5e8ea2342ef039f0f79bd76e4ab187dddf Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 May 2021 14:55:26 -0700 Subject: Brings more develop code over, especially Doxygen --- CMakeLists.txt | 30 + MANIFEST | 73 + Makefile.am | 10 + README.txt | 4 +- config/commence.am | 6 +- configure.ac | 82 +- doxygen/Doxyfile.in | 2555 +++ doxygen/aliases | 264 + doxygen/dox/About.dox | 11 + doxygen/dox/Cookbook.dox | 5 + doxygen/dox/DDLBNF110.dox | 650 + doxygen/dox/DDLBNF112.dox | 653 + doxygen/dox/FileFormatSpec.dox | 23 + doxygen/dox/GettingStarted.dox | 3 + doxygen/dox/H5AC_cache_config_t.dox | 415 + doxygen/dox/H5Acreate.dox | 9 + doxygen/dox/H5Aiterate.dox | 9 + doxygen/dox/H5Fget_info.dox | 44 + doxygen/dox/H5Lget_info.dox | 17 + doxygen/dox/H5Lget_info_by_idx.dox | 17 + doxygen/dox/H5Literate.dox | 20 + doxygen/dox/H5Literate_by_name.dox | 21 + doxygen/dox/H5Lvisit.dox | 20 + doxygen/dox/H5Lvisit_by_name.dox | 20 + doxygen/dox/H5Oget_info.dox | 72 + doxygen/dox/H5Oget_info_by_idx.dox | 55 + doxygen/dox/H5Oget_info_by_name.dox | 58 + doxygen/dox/H5Ovisit.dox | 55 + doxygen/dox/H5Ovisit_by_name.dox | 54 + doxygen/dox/H5Sencode.dox | 5 + doxygen/dox/MetadataCachingInHDF5.dox | 1020 + doxygen/dox/OtherSpecs.dox | 11 + doxygen/dox/Overview.dox | 32 + doxygen/dox/ReferenceManual.dox | 43 + doxygen/dox/Specifications.dox | 22 + doxygen/dox/TechnicalNotes.dox | 20 + doxygen/dox/api-compat-macros.dox | 898 + doxygen/dox/maybe_metadata_reads.dox | 82 + doxygen/dox/rm-template.dox | 72 + doxygen/examples/FF-IH_FileGroup.gif | Bin 0 -> 3407 bytes doxygen/examples/FF-IH_FileObject.gif | Bin 0 -> 2136 bytes doxygen/examples/FileFormatSpecChunkDiagram.jpg | Bin 0 -> 29237 bytes doxygen/examples/H5.format.1.0.html | 4050 ++++ doxygen/examples/H5.format.1.1.html | 6439 ++++++ doxygen/examples/H5.format.2.0.html | 14902 ++++++++++++++ doxygen/examples/H5.format.html | 20400 +++++++++++++++++++ doxygen/examples/H5A_examples.c | 145 + doxygen/examples/H5D_examples.c | 173 + doxygen/examples/H5F_examples.c | 187 + doxygen/examples/H5Fclose.c | 13 + doxygen/examples/H5Fcreate.c | 13 + doxygen/examples/H5Pget_metadata_read_attempts.1.c | 22 + doxygen/examples/H5Pget_metadata_read_attempts.2.c | 44 + doxygen/examples/H5Pget_metadata_read_attempts.3.c | 44 + doxygen/examples/H5Pget_object_flush_cb.c | 41 + doxygen/examples/H5Pset_metadata_read_attempts.c | 59 + doxygen/examples/H5Pset_object_flush_cb.c | 41 + doxygen/examples/ImageSpec.html | 1203 ++ doxygen/examples/PaletteExample1.gif | Bin 0 -> 2731 bytes doxygen/examples/Palettes.fm.anc.gif | Bin 0 -> 4748 bytes doxygen/examples/TableSpec.html | 193 + doxygen/examples/ThreadSafeLibrary.html | 787 + doxygen/examples/VFL.html | 1601 ++ doxygen/examples/hello_hdf5.c | 13 + doxygen/hdf5_footer.html | 21 + doxygen/hdf5_header.html | 61 + doxygen/hdf5_navtree_hacks.js | 246 + doxygen/hdf5doxy.css | 251 + doxygen/hdf5doxy_layout.xml | 182 + doxygen/img/FF-IH_FileGroup.gif | Bin 0 -> 3407 bytes doxygen/img/FF-IH_FileObject.gif | Bin 0 -> 2136 bytes doxygen/img/FileFormatSpecChunkDiagram.jpg | Bin 0 -> 29237 bytes doxygen/img/HDFG-logo.png | Bin 0 -> 1689 bytes doxygen/img/PaletteExample1.gif | Bin 0 -> 2731 bytes doxygen/img/Palettes.fm.anc.gif | Bin 0 -> 4748 bytes doxygen/img/ftv2node.png | Bin 0 -> 86 bytes doxygen/img/ftv2pnode.png | Bin 0 -> 229 bytes m4/ax_prog_doxygen.m4 | 586 + src/CMakeLists.txt | 49 + src/H5AC.c | 128 +- src/H5FDcore.h | 64 +- src/H5FDdirect.h | 63 +- src/H5FDfamily.h | 52 +- src/H5FDhdfs.c | 1158 +- src/H5FDhdfs.h | 22 +- src/H5Gdeprec.c | 30 +- src/H5Pfapl.c | 11 +- src/Makefile.am | 35 +- test/cache_logging.c | 22 +- test/hdfs.c | 154 +- test/testhdf5.c | 2 +- test/tfile.c | 12 +- test/tgenprop.c | 2 +- test/th5o.c | 2 +- test/th5s.c | 36 +- test/theap.c | 2 +- test/tid.c | 4 +- test/timer.c | 9 +- test/titerate.c | 23 +- test/tmisc.c | 39 +- 100 files changed, 60102 insertions(+), 994 deletions(-) create mode 100644 doxygen/Doxyfile.in create mode 100644 doxygen/aliases create mode 100644 doxygen/dox/About.dox create mode 100644 doxygen/dox/Cookbook.dox create mode 100644 doxygen/dox/DDLBNF110.dox create mode 100644 doxygen/dox/DDLBNF112.dox create mode 100644 doxygen/dox/FileFormatSpec.dox create mode 100644 doxygen/dox/GettingStarted.dox create mode 100644 doxygen/dox/H5AC_cache_config_t.dox create mode 100644 doxygen/dox/H5Acreate.dox create mode 100644 doxygen/dox/H5Aiterate.dox create mode 100644 doxygen/dox/H5Fget_info.dox create mode 100644 doxygen/dox/H5Lget_info.dox create mode 100644 doxygen/dox/H5Lget_info_by_idx.dox create mode 100644 doxygen/dox/H5Literate.dox create mode 100644 doxygen/dox/H5Literate_by_name.dox create mode 100644 doxygen/dox/H5Lvisit.dox create mode 100644 doxygen/dox/H5Lvisit_by_name.dox create mode 100644 doxygen/dox/H5Oget_info.dox create mode 100644 doxygen/dox/H5Oget_info_by_idx.dox create mode 100644 doxygen/dox/H5Oget_info_by_name.dox create mode 100644 doxygen/dox/H5Ovisit.dox create mode 100644 doxygen/dox/H5Ovisit_by_name.dox create mode 100644 doxygen/dox/H5Sencode.dox create mode 100644 doxygen/dox/MetadataCachingInHDF5.dox create mode 100644 doxygen/dox/OtherSpecs.dox create mode 100644 doxygen/dox/Overview.dox create mode 100644 doxygen/dox/ReferenceManual.dox create mode 100644 doxygen/dox/Specifications.dox create mode 100644 doxygen/dox/TechnicalNotes.dox create mode 100644 doxygen/dox/api-compat-macros.dox create mode 100644 doxygen/dox/maybe_metadata_reads.dox create mode 100644 doxygen/dox/rm-template.dox create mode 100644 doxygen/examples/FF-IH_FileGroup.gif create mode 100644 doxygen/examples/FF-IH_FileObject.gif create mode 100644 doxygen/examples/FileFormatSpecChunkDiagram.jpg create mode 100644 doxygen/examples/H5.format.1.0.html create mode 100644 doxygen/examples/H5.format.1.1.html create mode 100644 doxygen/examples/H5.format.2.0.html create mode 100644 doxygen/examples/H5.format.html create mode 100644 doxygen/examples/H5A_examples.c create mode 100644 doxygen/examples/H5D_examples.c create mode 100644 doxygen/examples/H5F_examples.c create mode 100644 doxygen/examples/H5Fclose.c create mode 100644 doxygen/examples/H5Fcreate.c create mode 100644 doxygen/examples/H5Pget_metadata_read_attempts.1.c create mode 100644 doxygen/examples/H5Pget_metadata_read_attempts.2.c create mode 100644 doxygen/examples/H5Pget_metadata_read_attempts.3.c create mode 100644 doxygen/examples/H5Pget_object_flush_cb.c create mode 100644 doxygen/examples/H5Pset_metadata_read_attempts.c create mode 100644 doxygen/examples/H5Pset_object_flush_cb.c create mode 100644 doxygen/examples/ImageSpec.html create mode 100644 doxygen/examples/PaletteExample1.gif create mode 100644 doxygen/examples/Palettes.fm.anc.gif create mode 100644 doxygen/examples/TableSpec.html create mode 100644 doxygen/examples/ThreadSafeLibrary.html create mode 100644 doxygen/examples/VFL.html create mode 100644 doxygen/examples/hello_hdf5.c create mode 100644 doxygen/hdf5_footer.html create mode 100644 doxygen/hdf5_header.html create mode 100644 doxygen/hdf5_navtree_hacks.js create mode 100644 doxygen/hdf5doxy.css create mode 100644 doxygen/hdf5doxy_layout.xml create mode 100644 doxygen/img/FF-IH_FileGroup.gif create mode 100644 doxygen/img/FF-IH_FileObject.gif create mode 100644 doxygen/img/FileFormatSpecChunkDiagram.jpg create mode 100644 doxygen/img/HDFG-logo.png create mode 100644 doxygen/img/PaletteExample1.gif create mode 100644 doxygen/img/Palettes.fm.anc.gif create mode 100644 doxygen/img/ftv2node.png create mode 100644 doxygen/img/ftv2pnode.png create mode 100644 m4/ax_prog_doxygen.m4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 4054110..ec5c0ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -232,6 +232,7 @@ set (HDF5_JAVA_LIB_DIR ${HDF5_SOURCE_DIR}/java/lib) set (HDF5_JAVA_LOGGING_JAR ${HDF5_SOURCE_DIR}/java/lib/slf4j-api-1.7.25.jar) set (HDF5_JAVA_LOGGING_NOP_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-nop-1.7.25.jar) set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple-1.7.25.jar) +set (HDF5_DOXYGEN_DIR ${HDF5_SOURCE_DIR}/doxygen) #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO @@ -571,6 +572,20 @@ endif () # endif () #----------------------------------------------------------------------------- +# Option to build documentation +#----------------------------------------------------------------------------- +option (HDF5_BUILD_DOC "Build documentation" OFF) +if (HDF5_BUILD_DOC AND EXISTS "${HDF5_DOXYGEN_DIR}" AND IS_DIRECTORY "${HDF5_DOXYGEN_DIR}") +# check if Doxygen is installed + find_package(Doxygen) + if (DOXYGEN_FOUND) + message(STATUS "Doxygen version: ${DOXYGEN_VERSION}") + else () + message(STATUS "Doxygen needs to be installed to generate the doxygen documentation") + endif () +endif () + +#----------------------------------------------------------------------------- # Option to indicate using a memory checker #----------------------------------------------------------------------------- option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) @@ -1010,6 +1025,21 @@ if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools endif () #----------------------------------------------------------------------------- +# Include filter plugins +#----------------------------------------------------------------------------- +include (CMakePlugins.cmake) + +if (HDF5_PACKAGE_EXTLIBS AND NOT HDF5_NO_PACKAGES) + if (HDF5_ENABLE_PLUGIN_SUPPORT AND PLUGIN_FOUND) + PACKAGE_PLUGIN_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) +# option (HDF5_TEST_PLUGIN "Execute plugin tests" ON) +# mark_as_advanced (HDF5_TEST_PLUGIN) + +# TEST_PLUGIN_LIBRARY () + endif () +endif () + +#----------------------------------------------------------------------------- # Option to build examples #----------------------------------------------------------------------------- if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") diff --git a/MANIFEST b/MANIFEST index 2e5b176..ab793c6 100644 --- a/MANIFEST +++ b/MANIFEST @@ -47,6 +47,7 @@ ./m4/ax_java_check_class.m4 ./m4/ax_java_options.m4 ./m4/ax_jni_include_dir.m4 +./m4/ax_prog_doxygen.m4 ./m4/ax_prog_jar.m4 ./m4/ax_prog_java_cc.m4 ./m4/ax_prog_java_works.m4 @@ -207,6 +208,78 @@ ./doc/code-conventions.md ./doc/contributing.md +./doxygen/aliases +./doxygen/Doxyfile.in +./doxygen/dox/About.dox +./doxygen/dox/Cookbook.dox +./doxygen/dox/DDLBNF110.dox +./doxygen/dox/DDLBNF112.dox +./doxygen/dox/FileFormatSpec.dox +./doxygen/dox/GettingStarted.dox +./doxygen/dox/H5AC_cache_config_t.dox +./doxygen/dox/H5Acreate.dox +./doxygen/dox/H5Aiterate.dox +./doxygen/dox/H5Fget_info.dox +./doxygen/dox/H5Lget_info_by_idx.dox +./doxygen/dox/H5Lget_info.dox +./doxygen/dox/H5Literate_by_name.dox +./doxygen/dox/H5Literate.dox +./doxygen/dox/H5Lvisit_by_name.dox +./doxygen/dox/H5Lvisit.dox +./doxygen/dox/H5Oget_info_by_idx.dox +./doxygen/dox/H5Oget_info_by_name.dox +./doxygen/dox/H5Oget_info.dox +./doxygen/dox/H5Ovisit_by_name.dox +./doxygen/dox/H5Ovisit.dox +./doxygen/dox/H5Sencode.dox +./doxygen/dox/MetadataCachingInHDF5.dox +./doxygen/dox/OtherSpecs.dox +./doxygen/dox/Overview.dox +./doxygen/dox/ReferenceManual.dox +./doxygen/dox/Specifications.dox +./doxygen/dox/TechnicalNotes.dox +./doxygen/dox/api-compat-macros.dox +./doxygen/dox/maybe_metadata_reads.dox +./doxygen/dox/rm-template.dox +./doxygen/examples/FF-IH_FileGroup.gif +./doxygen/examples/FF-IH_FileObject.gif +./doxygen/examples/FileFormatSpecChunkDiagram.jpg +./doxygen/examples/H5Pset_metadata_read_attempts.c +./doxygen/examples/H5Pset_object_flush_cb.c +./doxygen/examples/H5.format.1.0.html +./doxygen/examples/H5.format.1.1.html +./doxygen/examples/H5.format.2.0.html +./doxygen/examples/H5.format.html +./doxygen/examples/H5A_examples.c +./doxygen/examples/H5D_examples.c +./doxygen/examples/H5Fclose.c +./doxygen/examples/H5Fcreate.c +./doxygen/examples/H5F_examples.c +./doxygen/examples/H5Pget_metadata_read_attempts.1.c +./doxygen/examples/H5Pget_metadata_read_attempts.2.c +./doxygen/examples/H5Pget_metadata_read_attempts.3.c +./doxygen/examples/H5Pget_object_flush_cb.c +./doxygen/examples/ImageSpec.html +./doxygen/examples/PaletteExample1.gif +./doxygen/examples/Palettes.fm.anc.gif +./doxygen/examples/TableSpec.html +./doxygen/examples/ThreadSafeLibrary.html +./doxygen/examples/VFL.html +./doxygen/examples/hello_hdf5.c +./doxygen/hdf5_footer.html +./doxygen/hdf5_header.html +./doxygen/hdf5_navtree_hacks.js +./doxygen/hdf5doxy.css +./doxygen/hdf5doxy_layout.xml +./doxygen/img/FF-IH_FileGroup.gif +./doxygen/img/FF-IH_FileObject.gif +./doxygen/img/FileFormatSpecChunkDiagram.jpg +./doxygen/img/HDFG-logo.png +./doxygen/img/PaletteExample1.gif +./doxygen/img/Palettes.fm.anc.gif +./doxygen/img/ftv2node.png +./doxygen/img/ftv2pnode.png + ./examples/Attributes.txt ./examples/Makefile.am ./examples/credel.c diff --git a/Makefile.am b/Makefile.am index 794007c..cc38972 100644 --- a/Makefile.am +++ b/Makefile.am @@ -187,6 +187,16 @@ check-all-install: trace: @(cd src && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; +# Run doxygen across source files. +# Currently, only invoke doxygen in the src directory. +doxygen: + @echo Invoking doxygen + for d in src; do \ + if test $$d != .; then \ + (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ + fi; \ + done + # Run tests with different Virtual File Drivers. # Currently, only invoke check-vfd in the test directory. check-vfd: diff --git a/README.txt b/README.txt index 021f217..fb027aa 100644 --- a/README.txt +++ b/README.txt @@ -75,6 +75,6 @@ Periodically development code snapshots are provided at the following URL: Source packages for current and previous releases are located at: https://portal.hdfgroup.org/display/support/Downloads -Development code is available at our BitBucket Server: - https://bitbucket.hdfgroup.org/projects/HDFFV/repos/hdf5/browse +Development code is available at our Github location: + https://github.com/HDFGroup/hdf5.git diff --git a/config/commence.am b/config/commence.am index 486dea7..96c2fc2 100644 --- a/config/commence.am +++ b/config/commence.am @@ -96,9 +96,9 @@ CHECK_CLEANFILES=*.chkexe *.chklog *.clog *.clog2 # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - check-passthrough-vol install-doc lib progs tests uninstall-doc \ - _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + check-passthrough-vol install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help trace doxygen help: @$(top_srcdir)/bin/makehelp diff --git a/configure.ac b/configure.ac index cb6d431..7fa32e5 100644 --- a/configure.ac +++ b/configure.ac @@ -1078,6 +1078,82 @@ else fi ## ---------------------------------------------------------------------- +## Check if they would like to enable building doxygen files +## + +## This needs to be exposed for the library info file. +AC_SUBST([HDF5_DOXYGEN]) + +## Default is to not build DOXYGEN +HDF5_DOXYGEN=no + +AC_MSG_CHECKING([if building doxygen is enabled]) + +AC_ARG_ENABLE([doxygen], + [AS_HELP_STRING([--enable-doxygen], + [Compile the HDF5 doxygen files [default=no]])], + [HDF5_DOXYGEN=$enableval]) + +if test "X$HDF5_DOXYGEN" = "Xyes"; then + AC_MSG_RESULT([yes]) + DX_DOXYGEN_FEATURE(ON) + DX_DOT_FEATURE(OFF) + DX_HTML_FEATURE(ON) + DX_CHM_FEATURE(OFF) + DX_CHI_FEATURE(OFF) + DX_MAN_FEATURE(ON) + DX_RTF_FEATURE(OFF) + DX_XML_FEATURE(OFF) + DX_PDF_FEATURE(OFF) + DX_PS_FEATURE(OFF) + + AC_SUBST([DOXYGEN_PACKAGE]) + AC_SUBST([DOXYGEN_VERSION_STRING]) + AC_SUBST([DOXYGEN_INCLUDE_ALIASES]) + AC_SUBST([DOXYGEN_PROJECT_LOGO]) + AC_SUBST([DOXYGEN_PROJECT_BRIEF]) + AC_SUBST([DOXYGEN_INPUT_DIRECTORY]) + AC_SUBST([DOXYGEN_OPTIMIZE_OUTPUT_FOR_C]) + AC_SUBST([DOXYGEN_MACRO_EXPANSION]) + AC_SUBST([DOXYGEN_OUTPUT_DIRECTORY]) + AC_SUBST([DOXYGEN_EXAMPLES_DIRECTORY]) + AC_SUBST([DOXYGEN_LAYOUT_FILE]) + AC_SUBST([DOXYGEN_HTML_HEADER]) + AC_SUBST([DOXYGEN_HTML_FOOTER]) + AC_SUBST([DOXYGEN_HTML_EXTRA_STYLESHEET]) + AC_SUBST([DOXYGEN_HTML_EXTRA_FILES]) + AC_SUBST([DOXYGEN_SERVER_BASED_SEARCH]) + AC_SUBST([DOXYGEN_EXTERNAL_SEARCH]) + AC_SUBST([DOXYGEN_SEARCHENGINE_URL]) + + DOXYGEN_PACKAGE=${PACKAGE_NAME} + DOXYGEN_VERSION_STRING=${PACKAGE_VERSION} + DOXYGEN_INCLUDE_ALIASES='$(SRCDIR)/doxygen/aliases' + DOXYGEN_PROJECT_LOGO='$(SRCDIR)/doxygen/img/HDFG-logo.png' + DOXYGEN_PROJECT_BRIEF= + DOXYGEN_INPUT_DIRECTORY='$(SRCDIR) $(SRCDIR)/doxygen/dox' + DOXYGEN_OPTIMIZE_OUTPUT_FOR_C=YES + DOXYGEN_MACRO_EXPANSION=YES + DOXYGEN_OUTPUT_DIRECTORY=hdf5lib_docs + DOXYGEN_EXAMPLES_DIRECTORY='$(SRCDIR)/doxygen/examples' + DOXYGEN_LAYOUT_FILE='$(SRCDIR)/doxygen/hdf5doxy_layout.xml' + DOXYGEN_HTML_HEADER='$(SRCDIR)/doxygen/hdf5_header.html' + DOXYGEN_HTML_FOOTER='$(SRCDIR)/doxygen/hdf5_footer.html' + DOXYGEN_HTML_EXTRA_STYLESHEET='$(SRCDIR)/doxygen/hdf5doxy.css' + DOXYGEN_HTML_EXTRA_FILES='$(SRCDIR)/doxygen/hdf5_navtree_hacks.js $(SRCDIR)/doxygen/img/ftv2node.png $(SRCDIR)/doxygen/img/ftv2pnode.png' + DOXYGEN_SERVER_BASED_SEARCH=NO + DOXYGEN_EXTERNAL_SEARCH=NO + DOXYGEN_SEARCHENGINE_URL= + + DX_INIT_DOXYGEN([HDF5], [../doxygen/Doxyfile], [hdf5lib_docs]) + +else + AC_MSG_RESULT([no]) + echo "Doxygen support is disabled" +fi + + +## ---------------------------------------------------------------------- ## Create libtool. If shared/static libraries are going to be enabled ## or disabled, it should happen before these macros. LT_PREREQ([2.2]) @@ -1990,7 +2066,6 @@ AC_CHECK_FUNCS([signal longjmp setjmp siglongjmp sigsetjmp sigprocmask]) AC_CHECK_FUNCS([sigtimedwait snprintf srandom strdup symlink system]) AC_CHECK_FUNCS([strtoll strtoull timespeccmp]) AC_CHECK_FUNCS([tmpfile asprintf vasprintf vsnprintf waitpid]) -AC_CHECK_FUNCS([roundf lroundf llroundf round lround llround]) ## ---------------------------------------------------------------------- ## Check compiler characteristics @@ -3252,6 +3327,9 @@ if test "x$HAVE_LIBHDFS" = "xyes"; then [Proceed to build with libhdfs]) fi +## Read-only HDFS files are not built if not required. +AM_CONDITIONAL([HDFS_VFD_CONDITIONAL], [test "X$HAVE_LIBHDFS" = "Xyes"]) + ## Checkpoint the cache AC_CACHE_SAVE @@ -3886,6 +3964,7 @@ AM_CONDITIONAL([BUILD_HDF5_HL_CONDITIONAL], [test "X$HDF5_HL" = "Xyes"]) AM_CONDITIONAL([BUILD_TESTS_CONDITIONAL], [test "X$HDF5_TESTS" = "Xyes"]) AM_CONDITIONAL([BUILD_TESTS_PARALLEL_CONDITIONAL], [test -n "$TESTPARALLEL"]) AM_CONDITIONAL([BUILD_TOOLS_CONDITIONAL], [test "X$HDF5_TOOLS" = "Xyes"]) +AM_CONDITIONAL([BUILD_DOXYGEN_CONDITIONAL], [test "X$HDF5_DOXYGEN" = "Xyes"]) ## ---------------------------------------------------------------------- ## Build the Makefiles. @@ -3991,6 +4070,7 @@ AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"]) AC_CONFIG_FILES([src/libhdf5.settings Makefile + doxygen/Doxyfile src/Makefile test/Makefile test/H5srcdir_str.h diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in new file mode 100644 index 0000000..b1cb955 --- /dev/null +++ b/doxygen/Doxyfile.in @@ -0,0 +1,2555 @@ +# Doxyfile 1.8.18 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = @DOXYGEN_PACKAGE@ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = @DOXYGEN_VERSION_STRING@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = @DOXYGEN_PROJECT_BRIEF@ + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = @DOXYGEN_PROJECT_LOGO@ + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @DOXYGEN_OUTPUT_DIRECTORY@ + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) + +ALIASES = + +@INCLUDE_PATH = @DOXYGEN_INCLUDE_ALIASES_PATH@ +@INCLUDE = @DOXYGEN_INCLUDE_ALIASES@ + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = YES + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# (including Cygwin) ands Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = YES + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = YES + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = @DOXYGEN_LAYOUT_FILE@ + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = @DOXYGEN_INPUT_DIRECTORY@ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = H5*public.h \ + H5*module.h \ + H5FDcore.h \ + H5FDdirect.h \ + H5FDfamily.h \ + H5FDlog.h \ + H5FDmpi.h \ + H5FDmpio.h \ + H5FDmulti.h \ + H5FDsec2.h \ + H5FDstdio.h \ + H5FDwindows.h \ + H5VLconnector.h \ + H5VLconnector_passthru.h \ + H5VLnative.h \ + H5version.h \ + *.dox + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = examples + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = ../src ../examples ../test @DOXYGEN_EXAMPLES_DIRECTORY@ + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = *.c + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = NO + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = NO + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = H5 + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = @DOXYGEN_HTML_HEADER@ + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = @DOXYGEN_HTML_FOOTER@ + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = @DOXYGEN_HTML_EXTRA_STYLESHEET@ + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = @DOXYGEN_HTML_EXTRA_FILES@ + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = YES + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = YES + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png The default and svg Looks nicer but requires the +# pdf2svg tool. +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2 + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /