Skip to content

Commit

Permalink
Fixup some minor CodeQL notes
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Dec 14, 2023
1 parent 55f1b64 commit 522f411
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions avogadro/qtplugins/vibrations/vibrations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ void Vibrations::setMode(int mode)
m_molecule->setForceVector(atom, v);
++atom;
}
// m_molecule->emitChanged(QtGui::Molecule::Atoms | QtGui::Molecule::Added);

int frames = 5; // TODO: needs an option
int frameCounter = 0;
Expand All @@ -154,7 +153,7 @@ void Vibrations::setMode(int mode)
// Current coords + displacement.
for (int i = 1; i <= frames; ++i) {
Core::Array<Vector3> framePositions;
for (Index atom = 0; atom < m_molecule->atomCount(); ++atom) {
for (atom = 0; atom < m_molecule->atomCount(); ++atom) {
framePositions.push_back(atomPositions[atom] + atomDisplacements[atom] *
factor *
(double(i) / frames));
Expand All @@ -164,7 +163,7 @@ void Vibrations::setMode(int mode)
// + displacement back to original.
for (int i = frames - 1; i >= 0; --i) {
Core::Array<Vector3> framePositions;
for (Index atom = 0; atom < m_molecule->atomCount(); ++atom) {
for (atom = 0; atom < m_molecule->atomCount(); ++atom) {
framePositions.push_back(atomPositions[atom] + atomDisplacements[atom] *
factor *
(double(i) / frames));
Expand All @@ -174,7 +173,7 @@ void Vibrations::setMode(int mode)
// Current coords - displacement.
for (int i = 1; i <= frames; ++i) {
Core::Array<Vector3> framePositions;
for (Index atom = 0; atom < m_molecule->atomCount(); ++atom) {
for (atom = 0; atom < m_molecule->atomCount(); ++atom) {
framePositions.push_back(atomPositions[atom] - atomDisplacements[atom] *
factor *
(double(i) / frames));
Expand All @@ -184,7 +183,7 @@ void Vibrations::setMode(int mode)
// - displacement back to original.
for (int i = frames - 1; i >= 0; --i) {
Core::Array<Vector3> framePositions;
for (Index atom = 0; atom < m_molecule->atomCount(); ++atom) {
for (atom = 0; atom < m_molecule->atomCount(); ++atom) {
framePositions.push_back(atomPositions[atom] - atomDisplacements[atom] *
factor *
(double(i) / frames));
Expand Down

0 comments on commit 522f411

Please sign in to comment.