Skip to content

Commit

Permalink
Corrects a clang-tidy warning about an implicit narrowing conversion …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
Xav83 committed Oct 10, 2023
1 parent 3698e05 commit 7552ce2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion avogadro/core/atomutilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Vector3 AtomUtilities::generateNewBondVector(
{
Vector3 newPos;
bool success = false;
int currentValence = allVectors.size();
int currentValence = static_cast<int>(allVectors.size());

// No bonded atoms, just pick a random vector
if (currentValence == 0) {
Expand Down

0 comments on commit 7552ce2

Please sign in to comment.