summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-17 00:32:33 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-01-17 00:32:33 (GMT)
commit44739ccd4715cc9e15595575700e945341fcdbcc (patch)
tree732a9381da5d3f0246a8d931da0074e2c5756704 /hl
parent46c3bc6b98bc467d46ca22cfc1b912c741a9d886 (diff)
parent55670c88cfa07a4fd5a884502f8bd32768f70256 (diff)
downloadhdf5-44739ccd4715cc9e15595575700e945341fcdbcc.zip
hdf5-44739ccd4715cc9e15595575700e945341fcdbcc.tar.gz
hdf5-44739ccd4715cc9e15595575700e945341fcdbcc.tar.bz2
Merge branch 'develop' into stack_size_warnings
Diffstat (limited to 'hl')
-rw-r--r--hl/CMakeLists.txt2
-rw-r--r--hl/c++/examples/CMakeLists.txt2
-rw-r--r--hl/c++/test/CMakeLists.txt4
-rw-r--r--hl/examples/CMakeLists.txt4
-rw-r--r--hl/fortran/examples/CMakeLists.txt2
-rw-r--r--hl/fortran/test/CMakeLists.txt4
-rw-r--r--hl/src/H5DS.c171
-rw-r--r--hl/src/H5LT.c4
-rw-r--r--hl/test/CMakeLists.txt4
-rw-r--r--hl/tools/gif2h5/CMakeLists.txt6
-rw-r--r--hl/tools/h5watch/CMakeLists.txt6
11 files changed, 132 insertions, 77 deletions
diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt
index 2a71b47..bef034c 100644
--- a/hl/CMakeLists.txt
+++ b/hl/CMakeLists.txt
@@ -19,7 +19,7 @@ endif ()
#-- Build the Unit testing if requested
if (NOT HDF5_EXTERNALLY_CONFIGURED)
- if (BUILD_TESTING)
+ if (BUILD_TESTING AND HDF5_TEST_SERIAL)
add_subdirectory (test)
endif ()
endif ()
diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt
index 50e08e8..4bd4807 100644
--- a/hl/c++/examples/CMakeLists.txt
+++ b/hl/c++/examples/CMakeLists.txt
@@ -23,6 +23,6 @@ else ()
endif ()
set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp)
-if (BUILD_TESTING)
+if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
include (CMakeTests.cmake)
endif ()
diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt
index cfb24a8..429e5c7 100644
--- a/hl/c++/test/CMakeLists.txt
+++ b/hl/c++/test/CMakeLists.txt
@@ -24,4 +24,6 @@ else ()
endif ()
set_target_properties (hl_ptableTest PROPERTIES FOLDER test/hl/cpp)
-include (CMakeTests.cmake)
+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 86c1770..44115e5 100644
--- a/hl/examples/CMakeLists.txt
+++ b/hl/examples/CMakeLists.txt
@@ -39,8 +39,6 @@ foreach (example ${examples})
set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl)
endforeach ()
-if (BUILD_TESTING)
-
+if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
include (CMakeTests.cmake)
-
endif ()
diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt
index e41b8fe..449194e 100644
--- a/hl/fortran/examples/CMakeLists.txt
+++ b/hl/fortran/examples/CMakeLists.txt
@@ -52,6 +52,6 @@ foreach (example ${examples})
endif ()
endforeach ()
-if (BUILD_TESTING)
+if (BUILD_TESTING AND HDF5_TEST_FORTRAN AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
include (CMakeTests.cmake)
endif ()
diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt
index c152142..369692d 100644
--- a/hl/fortran/test/CMakeLists.txt
+++ b/hl/fortran/test/CMakeLists.txt
@@ -61,4 +61,6 @@ foreach (h5_test ${H5_TESTS})
ADD_H5_FORTRAN_EXE(${h5_test})
endforeach ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_FORTRAN AND HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index c91ea1f..63fb461 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -140,10 +140,10 @@ herr_t H5DSattach_scale(hid_t did,
hobj_ref_t ref_j; /* iterator reference */
hvl_t *buf = NULL; /* VL buffer to store in the attribute */
hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
- H5O_info_t oi1, oi2;
+ H5O_info2_t oi1, oi2;
H5I_type_t it1, it2;
int i;
- size_t len;
+ size_t len;
int found_ds=0;
htri_t is_scale;
@@ -156,20 +156,26 @@ herr_t H5DSattach_scale(hid_t did,
return FAIL;
/* the dataset cannot be a DS dataset */
- if ( is_scale == 1)
+ if (is_scale == 1)
return FAIL;
/* get info for the dataset in the parameter list */
- if(H5Oget_info2(did, &oi1, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(did, &oi1, H5O_INFO_BASIC) < 0)
return FAIL;
/* get info for the scale in the parameter list */
- if(H5Oget_info2(dsid, &oi2, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(dsid, &oi2, H5O_INFO_BASIC) < 0)
return FAIL;
/* same object, not valid */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
- return FAIL;
+ if(oi1.fileno == oi2.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(did, &oi1.token, &oi2.token, &token_cmp) < 0)
+ return FAIL;
+ if(!token_cmp)
+ return FAIL;
+ } /* end if */
/* get ID type */
if ((it1 = H5Iget_type(did)) < 0)
@@ -324,16 +330,22 @@ herr_t H5DSattach_scale(hid_t did,
goto out;
/* get info for DS in the parameter list */
- if(H5Oget_info2(dsid, &oi1, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(dsid, &oi1, H5O_INFO_BASIC) < 0)
goto out;
/* get info for this DS */
- if(H5Oget_info2(dsid_j, &oi2, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(dsid_j, &oi2, H5O_INFO_BASIC) < 0)
goto out;
/* same object, so this DS scale is already in this DIM IDX */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
- found_ds = 1;
+ if(oi1.fileno == oi2.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(did, &oi1.token, &oi2.token, &token_cmp) < 0)
+ goto out;
+ if(!token_cmp)
+ found_ds = 1;
+ } /* end if */
/* close the dereferenced dataset */
if(H5Dclose(dsid_j) < 0)
@@ -586,7 +598,7 @@ herr_t H5DSdetach_scale(hid_t did,
int i;
size_t j;
hssize_t ii;
- H5O_info_t did_oi, dsid_oi, tmp_oi;
+ H5O_info2_t did_oi, dsid_oi, tmp_oi;
int found_dset = 0, found_ds = 0;
int have_ds = 0;
htri_t is_scale;
@@ -609,16 +621,22 @@ herr_t H5DSdetach_scale(hid_t did,
return FAIL;
/* get info for the dataset in the parameter list */
- if(H5Oget_info2(did, &did_oi, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(did, &did_oi, H5O_INFO_BASIC) < 0)
return FAIL;
/* get info for the scale in the parameter list */
- if(H5Oget_info2(dsid, &dsid_oi, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(dsid, &dsid_oi, H5O_INFO_BASIC) < 0)
return FAIL;
/* same object, not valid */
- if(did_oi.fileno == dsid_oi.fileno && did_oi.addr == dsid_oi.addr)
- return FAIL;
+ if(did_oi.fileno == dsid_oi.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(did, &did_oi.token, &dsid_oi.token, &token_cmp) < 0)
+ return FAIL;
+ if(!token_cmp)
+ return FAIL;
+ } /* end if */
/*-------------------------------------------------------------------------
@@ -696,7 +714,7 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
/* get info for this DS */
- if(H5Oget_info2(dsid_j, &tmp_oi, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(dsid_j, &tmp_oi, H5O_INFO_BASIC) < 0)
goto out;
/* Close the dereferenced dataset */
@@ -704,30 +722,35 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
/* same object, reset */
- if(dsid_oi.fileno == tmp_oi.fileno && dsid_oi.addr == tmp_oi.addr)
- {
- /* If there are more than one reference in the VL element
- and the reference we found is not the last one,
- copy the last one to replace the found one since the order
- of the references doesn't matter according to the spec;
- reduce the size of the VL element by 1;
- if the length of the element becomes 0, free the pointer
- and reset to NULL */
-
- size_t len = buf[idx].len;
-
- if(j < len - 1)
- ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
- len = --buf[idx].len;
- if(len == 0) {
- HDfree(buf[idx].p);
- buf[idx].p = NULL;
- }
- /* Since a reference to a dim. scale can be inserted only once,
- we do not need to continue the search if it is found */
- found_ds = 1;
- break;
- }
+ if(dsid_oi.fileno == tmp_oi.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(did, &dsid_oi.token, &tmp_oi.token, &token_cmp) < 0)
+ goto out;
+ if(!token_cmp) {
+ /* If there are more than one reference in the VL element
+ and the reference we found is not the last one,
+ copy the last one to replace the found one since the order
+ of the references doesn't matter according to the spec;
+ reduce the size of the VL element by 1;
+ if the length of the element becomes 0, free the pointer
+ and reset to NULL */
+
+ size_t len = buf[idx].len;
+
+ if(j < len - 1)
+ ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
+ len = --buf[idx].len;
+ if(len == 0) {
+ HDfree(buf[idx].p);
+ buf[idx].p = NULL;
+ }
+ /* Since a reference to a dim. scale can be inserted only once,
+ we do not need to continue the search if it is found */
+ found_ds = 1;
+ break;
+ } /* end if */
+ } /* end if */
} /* j */
} /* if */
@@ -806,7 +829,7 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
/* get info for this dataset */
- if(H5Oget_info2(did_i, &tmp_oi, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(did_i, &tmp_oi, H5O_INFO_BASIC) < 0)
goto out;
/* close the dereferenced dataset */
@@ -814,13 +837,19 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
/* same object, reset. we want to detach only for this DIM */
- if(did_oi.fileno == tmp_oi.fileno && did_oi.addr == tmp_oi.addr) {
- /* copy the last one to replace the one which is found */
- dsbuf[ii] = dsbuf[nelmts-1];
- nelmts--;
- found_dset=1;
- break;
- } /* if */
+ if(did_oi.fileno == tmp_oi.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(did, &did_oi.token, &tmp_oi.token, &token_cmp) < 0)
+ goto out;
+ if(!token_cmp) {
+ /* copy the last one to replace the one which is found */
+ dsbuf[ii] = dsbuf[nelmts-1];
+ nelmts--;
+ found_dset=1;
+ break;
+ } /* end if */
+ } /* end if */
} /* if we have the same dimension index */
} /* ii */
@@ -954,7 +983,7 @@ htri_t H5DSis_attached(hid_t did,
hvl_t *buf = NULL; /* VL buffer to store in the attribute */
hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
hid_t did_i; /* dataset ID in REFERENCE_LIST */
- H5O_info_t oi1, oi2, oi3, oi4;
+ H5O_info2_t oi1, oi2, oi3, oi4;
H5I_type_t it1, it2;
int i;
int found_dset=0, found_ds=0;
@@ -973,16 +1002,22 @@ htri_t H5DSis_attached(hid_t did,
return FAIL;
/* get info for the dataset in the parameter list */
- if(H5Oget_info2(did, &oi1, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(did, &oi1, H5O_INFO_BASIC) < 0)
return FAIL;
/* get info for the scale in the parameter list */
- if(H5Oget_info2(dsid, &oi2, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(dsid, &oi2, H5O_INFO_BASIC) < 0)
return FAIL;
/* same object, not valid */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
- return FAIL;
+ if(oi1.fileno == oi2.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(did, &oi1.token, &oi2.token, &token_cmp) < 0)
+ return FAIL;
+ if(!token_cmp)
+ return FAIL;
+ } /* end if */
/* get ID type */
if ((it1 = H5Iget_type(did)) < 0)
@@ -1054,16 +1089,22 @@ htri_t H5DSis_attached(hid_t did,
goto out;
/* get info for DS in the parameter list */
- if(H5Oget_info2(dsid, &oi1, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(dsid, &oi1, H5O_INFO_BASIC) < 0)
goto out;
/* get info for this DS */
- if(H5Oget_info2(dsid_j, &oi2, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(dsid_j, &oi2, H5O_INFO_BASIC) < 0)
goto out;
/* same object */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
- found_ds = 1;
+ if(oi1.fileno == oi2.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(did, &oi1.token, &oi2.token, &token_cmp) < 0)
+ goto out;
+ if(!token_cmp)
+ found_ds = 1;
+ } /* end if */
/* close the dereferenced dataset */
if (H5Dclose(dsid_j) < 0)
@@ -1144,16 +1185,22 @@ htri_t H5DSis_attached(hid_t did,
goto out;
/* get info for dataset in the parameter list */
- if(H5Oget_info2(did, &oi3, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(did, &oi3, H5O_INFO_BASIC) < 0)
goto out;
/* get info for this dataset */
- if(H5Oget_info2(did_i, &oi4, H5O_INFO_BASIC) < 0)
+ if(H5Oget_info3(did_i, &oi4, H5O_INFO_BASIC) < 0)
goto out;
/* same object */
- if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && idx==dsbuf[i].dim_idx)
- found_dset=1;
+ if(oi3.fileno == oi4.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(did, &oi3.token, &oi4.token, &token_cmp) < 0)
+ goto out;
+ if(!token_cmp && (idx == dsbuf[i].dim_idx))
+ found_dset=1;
+ } /* end if */
/* close the dereferenced dataset */
if (H5Dclose(did_i) < 0)
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index bb72ce6..3f6c538 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -1360,7 +1360,7 @@ out:
*/
static herr_t
-find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_data)
+find_dataset(hid_t loc_id, const char *name, 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.
@@ -1411,7 +1411,7 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d
herr_t
H5LTfind_dataset( hid_t loc_id, const char *dset_name )
{
- return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, 0, find_dataset, (void *)dset_name);
+ return H5Literate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, 0, find_dataset, (void *)dset_name);
}
diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt
index 2959c6c..69f3dae 100644
--- a/hl/test/CMakeLists.txt
+++ b/hl/test/CMakeLists.txt
@@ -93,4 +93,6 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
set_target_properties (hl_gen_test_ld PROPERTIES FOLDER test/hl/gen)
endif ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt
index 3cd913f..e12588b 100644
--- a/hl/tools/gif2h5/CMakeLists.txt
+++ b/hl/tools/gif2h5/CMakeLists.txt
@@ -67,7 +67,7 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-if (BUILD_TESTING)
+if (BUILD_TESTING AND HDF5_TEST_SERIAL)
# --------------------------------------------------------------------
# This executable can generate the actual test files - Currently not
# used in the CMake Build system as we rely on the test files that are
@@ -83,7 +83,9 @@ if (BUILD_TESTING)
# add_test (NAME hl_h52gifgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_h52gifgentest>)
endif ()
- include (CMakeTests.cmake)
+ if (HDF5_TEST_TOOLS)
+ include (CMakeTests.cmake)
+ endif ()
endif ()
#-----------------------------------------------------------------------------
diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt
index b3d65f7..edb78c0 100644
--- a/hl/tools/h5watch/CMakeLists.txt
+++ b/hl/tools/h5watch/CMakeLists.txt
@@ -26,7 +26,7 @@ if (BUILD_SHARED_LIBS)
set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5watch-shared)
endif ()
-if (BUILD_TESTING)
+if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL)
#-- Add swmr_check_compat_vfd program
set (hl_swmr_check_compat_vfd_SOURCES
${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c
@@ -68,7 +68,9 @@ if (BUILD_TESTING)
endif ()
set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl)
- include (CMakeTests.cmake)
+ if (HDF5_TEST_TOOLS)
+ include (CMakeTests.cmake)
+ endif ()
endif ()
#-----------------------------------------------------------------------------