Commit c9a5c46c authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos Committed by Lukas Riedel

Fix "unused variable" warnings in H5File

H5File will now log warnings if non-critical assertions fail.
parent 1dd038dd
......@@ -14,6 +14,7 @@
### Fixed
* Compiler warnings for unused variables in `dune/dorie/common/h5file.hh` !206
* Ensure UTF-8 locale definition in Docker images !210
## 2.0.0 (2020-05-14)
......
......@@ -58,6 +58,8 @@ public:
// release properties
herr_t status = H5Pclose(h5_plist_id);
assert(status > -1);
if (status < 0)
_log->warn("Unable to release H5 file properties");
// check for errors regardless of build type
if (_file_id < 0) {
......@@ -81,6 +83,9 @@ public:
// close the opened file
status = H5Fclose(_file_id);
assert(status > -1);
if (status < 0)
_log->warn("Error closing H5 file: {}", _file_path);
}
/// Return the file path of this object
......@@ -92,14 +97,17 @@ public:
*/
void open_group(const std::string& group_path="./")
{
_log->trace("Opening H5 group: {}", group_path);
// close the group if we already opened it
if (_group_id >= 0) {
herr_t status = H5Gclose(_group_id);
assert(status > -1);
if (status < 0)
_log->warn("Error closing previously opened H5 group");
}
// open the new group
_log->trace("Opening H5 group: {}", group_path);
_group_id = H5Gopen(_file_id, group_path.c_str(), H5P_DEFAULT);
if (_group_id < 0) {
_log->error("Failed to open H5 group: {}", group_path);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment