summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataSet.cpp
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-07-11 15:59:51 (GMT)
committerGitHub <noreply@github.com>2022-07-11 15:59:51 (GMT)
commitfa7caf843508b250f085e88cf5edfc2606da1205 (patch)
tree8ecc6f13d62952ab8ee49ea59bae9c2a47684e9b /c++/src/H5DataSet.cpp
parentf599e2ac7fb7fb146b49e2f349a9c100e897f7ef (diff)
downloadhdf5-fa7caf843508b250f085e88cf5edfc2606da1205.zip
hdf5-fa7caf843508b250f085e88cf5edfc2606da1205.tar.gz
hdf5-fa7caf843508b250f085e88cf5edfc2606da1205.tar.bz2
Fixes C++ sign-conversion warnings w/ clang 14 (#1870)
* Fixes sign-conversion warnings w/ clang 14 * 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.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index 68ddefa..3ee0ec5 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -268,8 +268,10 @@ DataSet::getInMemDataSize() const
}
// Calculate and return the size of the data
- size_t data_size = type_size * num_elements;
- return (data_size);
+ // Note that large datasets can overflow a size_t
+ size_t data_size = type_size * static_cast<size_t>(num_elements);
+
+ return data_size;
}
//--------------------------------------------------------------------------