Skip to content

Commit

Permalink
Merge pull request #1365 from Xav83/master
Browse files Browse the repository at this point in the history
Corrects clang-tidy warnings from atomutilities cpp file
  • Loading branch information
ghutchis authored Oct 10, 2023
2 parents a0f41dc + 7552ce2 commit 7f27522
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions avogadro/core/atomutilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include <cmath>
#include <vector>

#define M_TETRAHED 109.47122063449069389
constexpr double M_TETRAHED = 109.47122063449069389;

namespace Avogadro::Core {

typedef Array<Bond> NeighborListType;
using NeighborListType = Array<Bond>;

inline unsigned int countExistingBonds(const NeighborListType& bonds)
{
Expand Down Expand Up @@ -67,15 +67,15 @@ 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) {
newPos = Vector3::Random().normalized();
return newPos;
} else if (currentValence == 1) {
// One bonded atom
Vector3 bond1 = allVectors[0];
const Vector3& bond1 = allVectors[0];

// Check what's attached to our neighbor -- we want to set trans to the
// neighbor
Expand Down Expand Up @@ -147,8 +147,8 @@ Vector3 AtomUtilities::generateNewBondVector(
return -1.0 * newPos.normalized();
} // end one bond
else if (currentValence == 2) {
Vector3 bond1 = allVectors[0];
Vector3 bond2 = allVectors[1];
const Vector3& bond1 = allVectors[0];
const Vector3& bond2 = allVectors[1];

Vector3 v1 = bond1 + bond2;
v1.normalize();
Expand All @@ -170,9 +170,9 @@ Vector3 AtomUtilities::generateNewBondVector(
return -1.0 * newPos.normalized();
} // end two bonds
else if (currentValence == 3) {
Vector3 bond1 = allVectors[0];
Vector3 bond2 = allVectors[1];
Vector3 bond3 = allVectors[2];
const Vector3& bond1 = allVectors[0];
const Vector3& bond2 = allVectors[1];
const Vector3& bond3 = allVectors[2];

// need to handle different hybridizations here

Expand Down

0 comments on commit 7f27522

Please sign in to comment.