summaryrefslogtreecommitdiffstats
path: root/c++/test/tarray.cpp
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-06-01 13:49:39 (GMT)
committerGitHub <noreply@github.com>2021-06-01 13:49:39 (GMT)
commit50d0888f491821435f6884c0c4c516f69ff67927 (patch)
treecfb3c7737ad9850667771206bc6f457da4e489fb /c++/test/tarray.cpp
parent4ef33ef7cd0f2af55b34682b6949a101a68436bb (diff)
downloadhdf5-50d0888f491821435f6884c0c4c516f69ff67927.zip
hdf5-50d0888f491821435f6884c0c4c516f69ff67927.tar.gz
hdf5-50d0888f491821435f6884c0c4c516f69ff67927.tar.bz2
C++ warning and build fixes (#707)
* Committing clang-format changes * C++ build and warning updates * Fixes all warnings on C++ (with gcc 9.3) * Updates CMake and Autotools C++ builds * Undo warning clobber Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'c++/test/tarray.cpp')
-rw-r--r--c++/test/tarray.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp
index 7525c5f..c7c0b65 100644
--- a/c++/test/tarray.cpp
+++ b/c++/test/tarray.cpp
@@ -83,7 +83,8 @@ test_array_compound_array()
for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) {
wdata[idxi][idxj].i = static_cast<int>(idxi * 10 + idxj);
for (idxk = 0; idxk < ARRAY1_DIM1; idxk++) {
- float temp = idxi * 10.0 + idxj * 2.5 + idxk;
+ float temp = static_cast<float>(idxi) * 10.0F + static_cast<float>(idxj) * 2.5F +
+ static_cast<float>(idxk);
wdata[idxi][idxj].f[idxk] = temp;
}
} // end for
@@ -242,7 +243,7 @@ test_array_compound_array()
verify_val(ndims, ARRAY1_RANK, "f2_atype_check.getArrayNDims", __LINE__, __FILE__);
// Get the array dimensions
- HDmemset(rdims1, 0, H5S_MAX_RANK);
+ HDmemset(rdims1, 0, sizeof(rdims1));
f2_atype_check.getArrayDims(rdims1);
// Check the array dimensions
@@ -288,7 +289,7 @@ test_array_compound_array()
/*
* Helper routine to demonstrate the issue in HDFFV-9562
*/
-H5::DataType
+static H5::DataType
getArr()
{
hsize_t *dims = new hsize_t;
@@ -388,10 +389,11 @@ test_array_info()
for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) {
wdata[idxi][idxj].i = static_cast<int>(idxi * 10 + idxj);
for (idxk = 0; idxk < ARRAY1_DIM1; idxk++) {
- float temp = idxi * 10.0 + idxj * 2.5 + idxk;
+ float temp = static_cast<float>(idxi) * 10.0F + static_cast<float>(idxj) * 2.5F +
+ static_cast<float>(idxk);
wdata[idxi][idxj].f[idxk] = temp;
}
- } // end for
+ }
try {
// Create File