From a55bf295f0b7e9232d8f67043f1bda022313df91 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Mon, 12 Feb 2024 18:38:19 -0500 Subject: [PATCH] COMP: Fix VS compiler warnings (#855) --- .../SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.cpp | 2 +- .../SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.cpp | 4 ++-- src/Plugins/SimplnxCore/test/ReadHDF5DatasetTest.cpp | 2 +- src/Plugins/SimplnxCore/test/SurfaceNetsTest.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.cpp index d275fed3a2..483b506b7a 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ExtractVertexGeometry.cpp @@ -75,7 +75,7 @@ Result<> ExtractVertexGeometry::operator()() VertexGeom& vertexGeometry = m_DataStructure.getDataRefAs(m_InputValues->VertexGeometryPath); SizeVec3 dims = inputGeometry.getDimensions(); - const usize cellCount = std::accumulate(dims.begin(), dims.end(), static_cast(1ULL), std::multiplies<>()); + const usize cellCount = std::accumulate(dims.begin(), dims.end(), static_cast(1), std::multiplies<>()); usize totalCells = cellCount; // We save this here because it may change based on the use_mask flag. usize vertexCount = cellCount; DataPath vertexAttributeMatrixDataPath = vertexGeometry.getVertexAttributeMatrixDataPath(); diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.cpp index 8aac5be736..411769f6ec 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/ReadCSVFileFilter.cpp @@ -600,13 +600,13 @@ IFilter::PreflightResult ReadCSVFileFilter::preflightImpl(const DataStructure& d // Create the arrays std::vector tupleDims(readCSVData.tupleDims.size()); - std::transform(readCSVData.tupleDims.begin(), readCSVData.tupleDims.end(), tupleDims.begin(), [](float64 d) { return static_cast(d); }); + std::transform(readCSVData.tupleDims.begin(), readCSVData.tupleDims.end(), tupleDims.begin(), [](usize d) { return d; }); if(useExistingAM) { const AttributeMatrix& am = dataStructure.getDataRefAs(groupPath); tupleDims = am.getShape(); - auto totalLinesRead = std::accumulate(tupleDims.begin(), tupleDims.end(), 1UL, std::multiplies<>()); + auto totalLinesRead = std::accumulate(tupleDims.begin(), tupleDims.end(), static_cast(1), std::multiplies<>()); std::string msg = fmt::format("The Array Tuple Dimensions ({}) will be ignored and the Existing Attribute Matrix tuple dimensions ({}) will be used. The total number of lines read will be {}.", fmt::join(readCSVData.tupleDims, "x"), fmt::join(tupleDims, "x"), totalLinesRead); diff --git a/src/Plugins/SimplnxCore/test/ReadHDF5DatasetTest.cpp b/src/Plugins/SimplnxCore/test/ReadHDF5DatasetTest.cpp index 12a45b4ad8..931474aa20 100644 --- a/src/Plugins/SimplnxCore/test/ReadHDF5DatasetTest.cpp +++ b/src/Plugins/SimplnxCore/test/ReadHDF5DatasetTest.cpp @@ -53,7 +53,7 @@ void writePointerArrayDataset(nx::core::HDF5::GroupWriter& ptrGroupWriter) dims = {10, 8, 6, (COMPDIMPROD * TUPLEDIMPROD) / 10 / 8 / 6}; } - hsize_t tSize = std::accumulate(dims.cbegin(), dims.cend(), 1UL, std::multiplies()); + hsize_t tSize = std::accumulate(dims.cbegin(), dims.cend(), static_cast(1), std::multiplies()); std::vector data(tSize); for(hsize_t i = 0; i < tSize; ++i) { diff --git a/src/Plugins/SimplnxCore/test/SurfaceNetsTest.cpp b/src/Plugins/SimplnxCore/test/SurfaceNetsTest.cpp index f0b2a81414..b09af1b6ed 100644 --- a/src/Plugins/SimplnxCore/test/SurfaceNetsTest.cpp +++ b/src/Plugins/SimplnxCore/test/SurfaceNetsTest.cpp @@ -112,8 +112,8 @@ TEST_CASE("SimplnxCore::SurfaceNetsFilter: With Smoothing", "[SimplnxCore][Surfa // Create default Parameters for the filter. args.insertOrAssign(SurfaceNetsFilter::k_ApplySmoothing_Key, std::make_any(true)); - args.insertOrAssign(SurfaceNetsFilter::k_MaxDistanceFromVoxelCenter_Key, std::make_any(1.0)); - args.insertOrAssign(SurfaceNetsFilter::k_RelaxationFactor_Key, std::make_any(0.5)); + args.insertOrAssign(SurfaceNetsFilter::k_MaxDistanceFromVoxelCenter_Key, std::make_any(1.0f)); + args.insertOrAssign(SurfaceNetsFilter::k_RelaxationFactor_Key, std::make_any(0.5f)); const DataPath gridGeomDataPath({k_DataContainer}); args.insertOrAssign(SurfaceNetsFilter::k_GridGeometryDataPath_Key, std::make_any(gridGeomDataPath));