summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataSet.cpp
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-06-23 03:42:02 (GMT)
committerGitHub <noreply@github.com>2021-06-23 03:42:02 (GMT)
commitcc88fe8fafa0a522ba583bf75b2fe9a15688db9c (patch)
tree322f12e7ebe3cd900ec65486466991ebdf48ea94 /c++/src/H5DataSet.cpp
parent3d4481c2920b7b983a8d791a266cd2bc9c96e846 (diff)
downloadhdf5-cc88fe8fafa0a522ba583bf75b2fe9a15688db9c.zip
hdf5-cc88fe8fafa0a522ba583bf75b2fe9a15688db9c.tar.gz
hdf5-cc88fe8fafa0a522ba583bf75b2fe9a15688db9c.tar.bz2
Removes C++ dependency on H5private.h (#774)
* Removes C++ dependency on H5private.h Most C API calls have been removed, aside from a few uses of free, where we just dropped the 'HD'. A couple of H5_ATTR_UNUSED macros were also replaced with (void) statements. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'c++/src/H5DataSet.cpp')
-rw-r--r--c++/src/H5DataSet.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index 47031db..ce56e30 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -14,7 +14,6 @@
#include <iostream>
#include <string>
-#include "H5private.h" // for HDfree
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -717,8 +716,8 @@ DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, con
// If there is data, allocate buffer and read it.
if (data_size > 0) {
- char *strg_C = new char[data_size + 1];
- HDmemset(strg_C, 0, data_size + 1); // clear buffer
+ // Create buffer for C string
+ char *strg_C = new char[data_size + 1]();
herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C);
@@ -759,7 +758,7 @@ DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id,
// Get string from the C char* and release resource allocated by C API
strg = strg_C;
- HDfree(strg_C);
+ free(strg_C);
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS