diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-06-01 13:49:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-01 13:49:39 (GMT) |
commit | 50d0888f491821435f6884c0c4c516f69ff67927 (patch) | |
tree | cfb3c7737ad9850667771206bc6f457da4e489fb /c++/test/ttypes.cpp | |
parent | 4ef33ef7cd0f2af55b34682b6949a101a68436bb (diff) | |
download | hdf5-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/ttypes.cpp')
-rw-r--r-- | c++/test/ttypes.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 7d0337d..1cedef6 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -110,8 +110,8 @@ test_classes() // PredType::NATIVE_DOUBLE should be in H5T_FLOAT class tcls = PredType::NATIVE_DOUBLE.getClass(); if (H5T_FLOAT != tcls) { - verify_val(tcls, H5T_FLOAT, "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__, - __FILE__); + verify_val(static_cast<long>(tcls), static_cast<long>(H5T_FLOAT), + "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__, __FILE__); } PASSED(); } // end of try block @@ -727,7 +727,7 @@ test_named() Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space); for (hsize_t i = 0; i < ds_size[0]; i++) { for (hsize_t j = 0; j < ds_size[1]; j++) { - attr_data[i][j] = (unsigned)(i * ds_size[1] + j); + attr_data[i][j] = static_cast<unsigned>(i * ds_size[1] + j); } } attr1.write(PredType::NATIVE_UINT, attr_data); @@ -989,7 +989,8 @@ test_encode_decode() // Create an IntType instance from the decoded pointer and verify it IntType * decoded_int_ptr(static_cast<IntType *>(inttyp.decode())); H5T_sign_t int_sign = decoded_int_ptr->getSign(); - verify_val(int_sign, H5T_SGN_NONE, "DataType::decode", __LINE__, __FILE__); + verify_val(static_cast<long>(int_sign), static_cast<long>(H5T_SGN_NONE), "DataType::decode", __LINE__, + __FILE__); verify_val(inttyp == *decoded_int_ptr, true, "DataType::decode", __LINE__, __FILE__); delete decoded_int_ptr; |