diff options
Diffstat (limited to 'tools/test/h5dump')
-rw-r--r-- | tools/test/h5dump/CMakeLists.txt | 10 | ||||
-rw-r--r-- | tools/test/h5dump/h5dumpgentest.c | 249 |
2 files changed, 132 insertions, 127 deletions
diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 38f4118..b9e4ef5 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -43,10 +43,12 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) #add_test (NAME h5dumpgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dumpgentest>) endif () -include (CMakeTests.cmake) +if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL) + include (CMakeTests.cmake) -include (CMakeTestsPBITS.cmake) + include (CMakeTestsPBITS.cmake) -include (CMakeTestsVDS.cmake) + include (CMakeTestsVDS.cmake) -include (CMakeTestsXML.cmake) + include (CMakeTestsXML.cmake) +endif () diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 310b1ed..026ab20 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -638,11 +638,11 @@ static void gent_softlink(void) #define NY 2 static int gent_softlink2(void) { - hid_t fileid1 = -1; - hid_t gid1 = -1, gid2 = -1; - hid_t datatype = -1; - hid_t dset1 = -1, dset2 = -1; - hid_t dataspace = -1; + hid_t fileid1 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; + hid_t datatype = H5I_INVALID_HID; + hid_t dset1 = H5I_INVALID_HID, dset2 = H5I_INVALID_HID; + hid_t dataspace = H5I_INVALID_HID; hsize_t dimsf[2]; /* dataset dimensions */ int data1[NX][NY] = {{0,0},{1,1},{2,2},{3,3}}; int data2[NX][NY] = {{0,0},{0,1},{0,2},{3,3}}; @@ -1554,7 +1554,7 @@ gent_many(void) dset1_t dset1[6]; hsize_t dim[4]; - herr_t H5_ATTR_SANITY_CHECK ret; + herr_t H5_ATTR_NDEBUG_UNUSED ret; fid = H5Fcreate(FILE12, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2548,7 +2548,7 @@ static void gent_opaque(void) static void gent_bitfields(void) { - hid_t file, grp=-1, type=-1, space=-1, dset=-1; + hid_t file, grp=H5I_INVALID_HID, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID; size_t i; hsize_t nelmts; unsigned char buf[32]; @@ -2603,7 +2603,7 @@ static void gent_vldatatypes(void) hid_t file, dset, space, type; hsize_t dims[] = { SPACE1_DIM1 }; int i; - herr_t H5_ATTR_SANITY_CHECK ret=0; + herr_t H5_ATTR_NDEBUG_UNUSED ret=0; file = H5Fcreate(FILE21, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2698,7 +2698,7 @@ gent_vldatatypes2(void) hid_t tid1, tid2; /* Datatype IDs */ hsize_t dims1[] = {SPACE1_DIM1}; unsigned i,j,k; /* counting variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize VL data to write */ for(i = 0; i < SPACE1_DIM1; i++) { @@ -2771,7 +2771,7 @@ static void gent_vldatatypes3(void) hid_t tid1, tid2; /* Datatype IDs */ hsize_t dims1[] = {SPACE1_DIM1}; unsigned i,j; /* counting variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize VL data to write */ for(i=0; i<SPACE1_DIM1; i++) { @@ -2840,7 +2840,7 @@ static void gent_vldatatypes4(void) hid_t tid1, tid2; /* Datatype IDs */ hsize_t dims1[] = {SPACE1_DIM1}; unsigned i,j; /* counting variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize VL data to write */ for(i=0; i<SPACE1_DIM1; i++) { @@ -2904,7 +2904,7 @@ static void gent_vldatatypes5(void) hid_t tid1; hsize_t dims1[] = {SPACE1_DIM1}; int i,j; /* counting variable */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* initialize data for dataset */ for(i=0; i<SPACE1_DIM1; i++) { @@ -2974,8 +2974,7 @@ static void gent_array1_big(void) hsize_t sdims1[] = {SPACE_ARRAY1BIG_DIM}; hsize_t tdims1[] = {ARRAY1BIG_DIM}; int i,j; /* counting variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ - + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* for region reference dataset */ hid_t dset2; @@ -3109,7 +3108,7 @@ static void gent_array2(void) hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims2[] = {ARRAY2_DIM1,ARRAY2_DIM2,ARRAY2_DIM3}; int i,j,k,l; /* counting variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3157,7 +3156,7 @@ static void gent_array3(void) hsize_t tdims1[] = {ARRAY1_DIM1}; hsize_t tdims2[] = {ARRAY3_DIM1,ARRAY3_DIM2}; int i,j,k,l; /* counting variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3213,7 +3212,7 @@ static void gent_array4(void) hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims1[] = {ARRAY1_DIM1}; int i,j; /* counting variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3280,7 +3279,7 @@ static void gent_array5(void) hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims1[] = {ARRAY1_DIM1}; int i,j,k; /* counting variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3350,7 +3349,7 @@ static void gent_array6(void) hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims1[] = {ARRAY1_DIM1}; int i,j,k; /* counting variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3411,7 +3410,7 @@ static void gent_array7(void) hsize_t sdims1[] = {SPACE1_DIM1}; hsize_t tdims1[] = {ARRAY1_DIM1}; int i,j,k,l; /* Index variables */ - herr_t H5_ATTR_SANITY_CHECK ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3471,11 +3470,11 @@ static void gent_array7(void) /* Test the boundary of the display output buffer at the reallocation event */ static void gent_array8(void) { - hid_t file = -1; /* Handles */ - hid_t filetype = -1; /* Handles */ - hid_t space = -1; /* Handles */ - hid_t dset = -1; /* Handles */ - herr_t H5_ATTR_SANITY_CHECK status = -1; + hid_t file = H5I_INVALID_HID; /* Handles */ + hid_t filetype = H5I_INVALID_HID; /* Handles */ + hid_t space = H5I_INVALID_HID; /* Handles */ + hid_t dset = H5I_INVALID_HID; /* Handles */ + herr_t H5_ATTR_NDEBUG_UNUSED status = -1; hsize_t sdims[] = {F64_DIM0}; hsize_t tdims[] = {F64_DIM1}; int *wdata; /* Write buffer */ @@ -3542,7 +3541,7 @@ static void gent_empty(void) } empty_struct; hid_t file, dset, space, type; hsize_t dims[] = { SPACE1_DIM1 }; - herr_t H5_ATTR_SANITY_CHECK ret=0; + herr_t H5_ATTR_NDEBUG_UNUSED ret=0; file = H5Fcreate(FILE32, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3930,7 +3929,7 @@ static void write_attr_in(hid_t loc_id, hid_t aid; hid_t sid; hid_t tid; - herr_t H5_ATTR_SANITY_CHECK status; + herr_t H5_ATTR_NDEBUG_UNUSED status; int val, i, j, k, n; float f; @@ -4371,7 +4370,7 @@ static void write_dset_in(hid_t loc_id, hid_t sid; hid_t tid; hid_t plist_id; - herr_t H5_ATTR_SANITY_CHECK status; + herr_t H5_ATTR_NDEBUG_UNUSED status; int val, i, j, k, n; float f; int fillvalue=2; @@ -4809,7 +4808,7 @@ static void gent_attr_all(void) hid_t root_id; hid_t sid; hsize_t dims[1] = {2}; - herr_t H5_ATTR_SANITY_CHECK status; + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Create a file and a dataset */ fid = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -4967,7 +4966,7 @@ static void gent_compound_complex(void) hid_t array4_tid; /* Array datatype handle */ hid_t datafile, dataset; /* Datafile/dataset handles */ hid_t dataspace; /* Dataspace handle */ - herr_t H5_ATTR_SANITY_CHECK status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = {F41_LENGTH}; /* Dataspace dimensions */ hsize_t array_dimb[] = {F41_DIMb}; /* Array dimensions */ hsize_t array_dimd[]={F41_ARRAY_DIMd1,F41_ARRAY_DIMd2}; /* Array dimensions */ @@ -5116,7 +5115,7 @@ static void gent_named_dtype_attr(void) hid_t aid; hid_t gid; int data=8; - herr_t H5_ATTR_SANITY_CHECK ret; + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Create a file */ fid=H5Fcreate(FILE42, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -5338,7 +5337,7 @@ make_external(hid_t fid) hsize_t cur_size[1]; /*data space current size */ hsize_t max_size[1]; /*data space maximum size */ hsize_t size; /*bytes reserved for data in the external file*/ - int H5_ATTR_SANITY_CHECK ret; + int H5_ATTR_NDEBUG_UNUSED ret; cur_size[0] = max_size[0] = 100; size = (max_size[0]*sizeof(int)/2); @@ -5386,7 +5385,8 @@ static void gent_filters(void) hsize_t dims1[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; int buf1[DIM1][DIM2]; - int i, j, n, H5_ATTR_SANITY_CHECK ret; + int i, j, n; + int H5_ATTR_NDEBUG_UNUSED ret; for(i=n=0; i<DIM1; i++){ for(j=0; j<DIM2; j++){ @@ -5732,8 +5732,7 @@ static void gent_fcontents(void) hid_t tid; /* datatype ID */ hsize_t dims[1]={4}; int buf[4]={1,2,3,4}; - int H5_ATTR_SANITY_CHECK ret; - + int H5_ATTR_NDEBUG_UNUSED ret; /* create a file */ fid = H5Fcreate(FILE46, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -5866,7 +5865,7 @@ static void gent_fvalues(void) hvl_t fillval3; /* vlen fill value */ hsize_t dimarray[1]={3}; /* array dimension */ int buf4[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int H5_ATTR_SANITY_CHECK ret; + int H5_ATTR_NDEBUG_UNUSED ret; /* create a file */ fid = H5Fcreate(FILE48, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -6026,7 +6025,7 @@ static void gent_string(void) hsize_t dims1[] = {1}; hsize_t dims2[] = {SPACE1_DIM1}; hsize_t dims4[1]; - int H5_ATTR_SANITY_CHECK ret; + int H5_ATTR_NDEBUG_UNUSED ret; dims4[0] = sizeof(buf4); @@ -6121,7 +6120,8 @@ static void gent_aindices(void) int buf2[10][10]; int buf3[2][10][10]; int buf4[2][2][10][10]; - int i, j, k, l, n, H5_ATTR_SANITY_CHECK ret; + int i, j, k, l, n; + int H5_ATTR_NDEBUG_UNUSED ret; for(i = n = 0; i < 100; i++) buf1[i] = n++; @@ -6190,7 +6190,7 @@ static void gent_longlinks(void) { hid_t fid = (-1); /* File ID */ hid_t gid = (-1); /* Group ID */ - hid_t H5_ATTR_SANITY_CHECK gid2 = (-1); /* Datatype ID */ + hid_t H5_ATTR_NDEBUG_UNUSED gid2 = (-1); /* Datatype ID */ char *objname = NULL; /* Name of object [Long] */ size_t u; /* Local index variable */ @@ -6353,12 +6353,12 @@ gent_binary(void) static void gent_bigdims(void) { - hid_t fid = -1; - hid_t did = -1; - hid_t f_sid = -1; - hid_t m_sid = -1; - hid_t tid = -1; - hid_t dcpl = -1; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; + hid_t f_sid = H5I_INVALID_HID; + hid_t m_sid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; hsize_t dims[1]={DIM_4GB}; /* dataset dimensions */ hsize_t chunk_dims[1]={1024}; /* chunk dimensions */ hsize_t hs_start[1]; @@ -6369,7 +6369,7 @@ gent_bigdims(void) hsize_t i; char c; size_t nelmts; - int H5_ATTR_SANITY_CHECK ret; + int H5_ATTR_NDEBUG_UNUSED ret; /* create a file */ fid = H5Fcreate(FILE56, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -6418,19 +6418,19 @@ gent_bigdims(void) /* close */ if(H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; if(H5Sclose(f_sid) < 0) goto out; - f_sid = -1; + f_sid = H5I_INVALID_HID; if(H5Sclose(m_sid) < 0) goto out; - m_sid = -1; + m_sid = H5I_INVALID_HID; if(H5Pclose(dcpl) < 0) goto out; - dcpl = -1; + dcpl = H5I_INVALID_HID; if(H5Dclose(did) < 0) goto out; - did = -1; + did = H5I_INVALID_HID; ret = H5Fclose(fid); HDassert(ret >= 0); @@ -6465,7 +6465,8 @@ gent_hyperslab(void) hid_t fid; /* file id */ hsize_t dims[2] = {32,4097}; /* big enough data size to force a second stripmine read */ double *buf; - int i, H5_ATTR_SANITY_CHECK ret; + int i; + int H5_ATTR_NDEBUG_UNUSED ret; buf = (double*) HDmalloc(32 * 4097 * sizeof(double) ); for(i = 0; i < 32 * 4097; i++) @@ -6494,10 +6495,10 @@ gent_hyperslab(void) static void gent_group_creation_order(void) { - hid_t fid = -1; /* file ID */ - hid_t gid = -1; /* group ID */ - hid_t gcpl_id = -1; /* group creation property list ID */ - hid_t fcpl_id = -1; /* file creation property list ID (to set root group order) */ + hid_t fid = H5I_INVALID_HID; /* file ID */ + hid_t gid = H5I_INVALID_HID; /* group ID */ + hid_t gcpl_id = H5I_INVALID_HID; /* group creation property list ID */ + hid_t fcpl_id = H5I_INVALID_HID; /* file creation property list ID (to set root group order) */ if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) goto out; @@ -6523,45 +6524,45 @@ gent_group_creation_order(void) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "2/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; /*------------------------------------------------------------------------- @@ -6576,56 +6577,56 @@ gent_group_creation_order(void) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if((gid = H5Gcreate2(fid, "1/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; if(H5Pclose(gcpl_id) < 0) goto out; - gcpl_id = -1; + gcpl_id = H5I_INVALID_HID; if(H5Pclose(fcpl_id) < 0) goto out; - fcpl_id = -1; + fcpl_id = H5I_INVALID_HID; if(H5Fclose(fid) < 0) goto out; - fid = -1; + fid = H5I_INVALID_HID; return; @@ -6653,15 +6654,15 @@ gent_group_creation_order(void) static void gent_attr_creation_order(void) { - hid_t fid = -1; /* file id */ - hid_t gid = -1; /* group id */ - hid_t did = -1; /* dataset id */ - hid_t sid = -1; /* space id */ - hid_t aid = -1; /* attribute id */ - hid_t tid = -1; /* datatype id */ - hid_t gcpl_id = -1; /* group creation property list ID */ - hid_t dcpl_id = -1; /* dataset creation property list ID */ - hid_t tcpl_id = -1; /* datatype creation property list ID */ + hid_t fid = H5I_INVALID_HID; /* file id */ + hid_t gid = H5I_INVALID_HID; /* group id */ + hid_t did = H5I_INVALID_HID; /* dataset id */ + hid_t sid = H5I_INVALID_HID; /* space id */ + hid_t aid = H5I_INVALID_HID; /* attribute id */ + hid_t tid = H5I_INVALID_HID; /* datatype id */ + hid_t gcpl_id = H5I_INVALID_HID; /* group creation property list ID */ + hid_t dcpl_id = H5I_INVALID_HID; /* dataset creation property list ID */ + hid_t tcpl_id = H5I_INVALID_HID; /* datatype creation property list ID */ int i; const char *attr_name[3] = {"c", "b", "a" }; @@ -6714,12 +6715,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Dclose(did) < 0) goto out; - did = -1; + did = H5I_INVALID_HID; /*------------------------------------------------------------------------- @@ -6740,12 +6741,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Dclose(did) < 0) goto out; - did = -1; + did = H5I_INVALID_HID; @@ -6766,12 +6767,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * create a group without creation order tracked for attributes and atributes in it @@ -6790,12 +6791,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * create a named datatype with creation order tracked for attributes and atributes in it @@ -6817,12 +6818,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * create a named datatype without creation order tracked for attributes and atributes in it @@ -6844,12 +6845,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Tclose(tid) < 0) goto out; - tid = -1; + tid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * add some attributes to the root group @@ -6867,12 +6868,12 @@ gent_attr_creation_order(void) /* close attribute */ if(H5Aclose(aid) < 0) goto out; - aid = -1; + aid = H5I_INVALID_HID; } /* end for */ if(H5Gclose(gid) < 0) goto out; - gid = -1; + gid = H5I_INVALID_HID; /*------------------------------------------------------------------------- * close @@ -6880,19 +6881,19 @@ gent_attr_creation_order(void) */ if(H5Sclose(sid) < 0) goto out; - sid = -1; + sid = H5I_INVALID_HID; if(H5Pclose(dcpl_id) < 0) goto out; - dcpl_id = -1; + dcpl_id = H5I_INVALID_HID; if(H5Pclose(gcpl_id) < 0) goto out; - gcpl_id = -1; + gcpl_id = H5I_INVALID_HID; if(H5Pclose(tcpl_id) < 0) goto out; - tcpl_id = -1; + tcpl_id = H5I_INVALID_HID; if(H5Fclose(fid) < 0) goto out; - fid = -1; + fid = H5I_INVALID_HID; @@ -7091,7 +7092,8 @@ gent_dataset_idx(void) hsize_t dims[2]; hsize_t maxdims[2]; int buf[20][10]; - int i, j, H5_ATTR_SANITY_CHECK ret; + int i, j; + int H5_ATTR_NDEBUG_UNUSED ret; /* Get a copy of the file aaccess property */ fapl = H5Pcreate(H5P_FILE_ACCESS); @@ -7615,7 +7617,7 @@ static void gent_charsets(void) { hid_t fid, did, sid; - herr_t H5_ATTR_SANITY_CHECK status; + herr_t H5_ATTR_NDEBUG_UNUSED status; hsize_t dim[] = {1}; /* Dataspace dimensions */ typedef struct CharSetInfo { const char *ascii_p_; @@ -7689,7 +7691,7 @@ static void gent_compound_intsizes(void) { Array1Struct *Array1; hid_t Array1Structid; /* File datatype identifier */ - herr_t H5_ATTR_SANITY_CHECK status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = { F70_LENGTH }; /* Dataspace dimensions */ int m, n, o; /* Array init loop vars */ @@ -7962,7 +7964,7 @@ static void gent_compound_attr_intsizes(void) { Array1Struct Array1[F70_LENGTH]; hid_t Array1Structid; /* File datatype identifier */ - herr_t H5_ATTR_SANITY_CHECK status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = { F70_LENGTH }; /* Dataspace dimensions */ int m, n, o; /* Array init loop vars */ @@ -8838,7 +8840,7 @@ static void gent_compound_int_array(void) { Cmpd1Struct *Cmpd1; hid_t Cmpd1Structid; /* File datatype identifier */ - herr_t H5_ATTR_SANITY_CHECK status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = { F76_LENGTH }; /* Dataspace dimensions */ int m, n; /* Array init loop vars */ @@ -9094,7 +9096,7 @@ static void gent_compound_ints(void) { hid_t Cmpd1Structid; /* File datatype identifier */ hid_t Cmpd2Structid; /* File datatype identifier */ - herr_t H5_ATTR_SANITY_CHECK status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = { F77_LENGTH }; /* Dataspace dimensions */ int m; /* Array init loop vars */ @@ -9797,7 +9799,7 @@ static void gent_bitnopaquefields(void) uint64_t d; } s_t; - hid_t file, grp=-1, type=-1, space=-1, dset=-1; + hid_t file_id=H5I_INVALID_HID, grp=H5I_INVALID_HID, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID; size_t i; hsize_t nelmts = F80_DIM32; uint8_t buf[F80_DIM32]; /* bitfield, opaque */ @@ -9806,9 +9808,9 @@ static void gent_bitnopaquefields(void) uint64_t buf4[F80_DIM32]; /* bitfield, opaque */ s_t buf5[F80_DIM32]; /* compound */ - file = H5Fcreate(FILE80, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + file_id = H5Fcreate(FILE80, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if ((grp = H5Gcreate2(file, "bittypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if ((grp = H5Gcreate2(file_id, "bittypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { /* bitfield_1 */ if ((type = H5Tcopy(H5T_STD_B8LE)) >= 0) { if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { @@ -9872,7 +9874,7 @@ static void gent_bitnopaquefields(void) H5Gclose(grp); } - if ((grp = H5Gcreate2(file, "opaquetypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if ((grp = H5Gcreate2(file_id, "opaquetypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { /* opaque_1 */ if ((type = H5Tcreate(H5T_OPAQUE, 1)) >= 0) { if ((H5Tset_tag(type, "1-byte opaque type")) >= 0) { @@ -9908,7 +9910,7 @@ static void gent_bitnopaquefields(void) H5Gclose(grp); } - if ((grp = H5Gcreate2(file, "cmpdtypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if ((grp = H5Gcreate2(file_id, "cmpdtypetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { /* compound_1 */ if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); @@ -9934,7 +9936,7 @@ static void gent_bitnopaquefields(void) H5Gclose(grp); } - H5Fclose(file); + H5Fclose(file_id); } /*------------------------------------------------------------------------- @@ -10033,9 +10035,9 @@ static void gent_compound_complex2(void) compound *buf; /* compound */ - hid_t file, type=-1, space=-1, dset=-1; + hid_t file, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID; hid_t dset_array_a, dset_array_b, dset_array_c; - hid_t cmpd_tid1 = -1, cmpd_tid2 = -1, cmpd_tid3 = -1; + hid_t cmpd_tid1 = H5I_INVALID_HID, cmpd_tid2 = H5I_INVALID_HID, cmpd_tid3 = H5I_INVALID_HID; size_t i; size_t j, k; unsigned dset_array_ndims; @@ -10321,7 +10323,7 @@ static void gent_vlenstr_array(void) }; const char *buffer[F83_DIM*F83_ARRAYDIM]; - hid_t file, type=-1, space=-1, dset=-1; + hid_t file, type=H5I_INVALID_HID, space=H5I_INVALID_HID, dset=H5I_INVALID_HID; hid_t cmpd_tid1, array_tid; int i, j; @@ -10396,7 +10398,8 @@ static void gent_udfilter(void) hsize_t dims1[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; int buf1[DIM1][DIM2]; - int i, j, n, H5_ATTR_SANITY_CHECK ret; + int i, j, n; + int H5_ATTR_NDEBUG_UNUSED ret; for(i=n=0; i<DIM1; i++){ for(j=0; j<DIM2; j++){ @@ -10564,10 +10567,10 @@ static void gent_null_space_group(void) static void gent_err_attr_dspace(void) { - hid_t fid = -1; /* File identifier */ - hid_t fcpl = -1; /* File access property list */ - hid_t sid = -1; /* Dataspace identifier */ - hid_t aid = -1; /* Attribute identifier */ + hid_t fid = H5I_INVALID_HID; /* File identifier */ + hid_t fcpl = H5I_INVALID_HID; /* File access property list */ + hid_t sid = H5I_INVALID_HID; /* Dataspace identifier */ + hid_t aid = H5I_INVALID_HID; /* Attribute identifier */ hsize_t dims = 2; /* Dimensino size */ int wdata[2] = {7, 42}; /* The buffer to write */ int fd = -1; /* The file descriptor */ |