Commit f0d38c98 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

cppcheck knownConditionTrueFalse

parent 258fb92e
......@@ -168,6 +168,7 @@ PCARMSD::PCARMSD(const ActionOptions&ao):
{
log<<" Opening the eigenvectors file "<<f_eigenvectors.c_str()<<"\n";
bool do_read=true;
unsigned nat=0;
while (do_read) {
PDB mypdb;
// check the units for reading this file: how can they make sense?
......@@ -175,7 +176,7 @@ PCARMSD::PCARMSD(const ActionOptions&ao):
if(do_read) {
neigenvects++;
if(mypdb.getAtomNumbers().size()==0) error("number of atoms in a frame should be more than zero");
unsigned nat=mypdb.getAtomNumbers().size();
if(nat==0) nat=mypdb.getAtomNumbers().size();
if(nat!=mypdb.getAtomNumbers().size()) error("frames should have the same number of atoms");
if(aaa.empty()) aaa=mypdb.getAtomNumbers();
if(aaa!=mypdb.getAtomNumbers()) error("frames should contain same atoms in same order");
......
......@@ -69,6 +69,7 @@ PathMSDBase::PathMSDBase(const ActionOptions&ao):
{
log<<"Opening reference file "<<reference.c_str()<<"\n";
bool do_read=true;
unsigned nat=0;
while (do_read) {
PDB mypdb;
RMSD mymsd;
......@@ -76,7 +77,7 @@ PathMSDBase::PathMSDBase(const ActionOptions&ao):
if(do_read) {
nframes++;
if(mypdb.getAtomNumbers().size()==0) error("number of atoms in a frame should be more than zero");
unsigned nat=mypdb.getAtomNumbers().size();
if(nat==0) nat=mypdb.getAtomNumbers().size();
if(nat!=mypdb.getAtomNumbers().size()) error("frames should have the same number of atoms");
if(aaa.empty()) {
aaa=mypdb.getAtomNumbers();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment