From 7552ce23c70249dc6f3792eb812edf3312d0db1f Mon Sep 17 00:00:00 2001 From: Xav83 Date: Tue, 10 Oct 2023 07:50:50 +0200 Subject: [PATCH] Corrects a clang-tidy warning about an implicit narrowing conversion from 'std::size_t' to 'int': /home/runner/work/avogadrolibs/avogadrolibs/avogadrolibs/avogadro/core/atomutilities.cpp:70:24: warning: narrowing conversion from 'std::vector::size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions] int currentValence = allVectors.size(); ^ Signed-off-by: Xav83 --- avogadro/core/atomutilities.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avogadro/core/atomutilities.cpp b/avogadro/core/atomutilities.cpp index 1bf4e948dd..5d37940964 100644 --- a/avogadro/core/atomutilities.cpp +++ b/avogadro/core/atomutilities.cpp @@ -67,7 +67,7 @@ Vector3 AtomUtilities::generateNewBondVector( { Vector3 newPos; bool success = false; - int currentValence = allVectors.size(); + int currentValence = static_cast(allVectors.size()); // No bonded atoms, just pick a random vector if (currentValence == 0) {