cleanup a bunch of compiler warnings (#3849)

* cleanup a bunch of g++ warnings

* make it work with clang

* remove some additional warnings based on CI builds

* fix that version number

* stop being verbose when building
This commit is contained in:
Greg Landrum
2021-02-26 05:10:02 +01:00
committed by GitHub
parent 4776203249
commit 0e89b2dbea
22 changed files with 82 additions and 50 deletions

View File

@@ -12,18 +12,20 @@
namespace GapeGa {
BinaryStringChromosomePolicy::BinaryStringChromosomePolicy(GarethUtil::RandomUtil & rng_) : rng(rng_){
}
BinaryStringChromosomePolicy::BinaryStringChromosomePolicy(
GarethUtil::RandomUtil& rng_)
: rng(rng_) {}
BinaryStringChromosomePolicy::~BinaryStringChromosomePolicy() {
}
BinaryStringChromosomePolicy::~BinaryStringChromosomePolicy() {}
bool BinaryStringChromosomePolicy::mutate(int pos, bool currentValue) const {
return ! currentValue;
}
bool BinaryStringChromosomePolicy::initialize(int pos) const {
return rng.randomBoolean();
(void)pos; // not used
return !currentValue;
}
bool BinaryStringChromosomePolicy::initialize(int pos) const {
(void)pos; // not used
return rng.randomBoolean();
}
} // namespace GapeGa

View File

@@ -141,6 +141,8 @@ LinkedPopLinearSel<Chromosome, PopulationPolicy>::LinkedPopLinearSel(
assert(abs(totalScaledFitness - predictTotalScaledFitness) < 1.0e-5);
double predictEndFitness = SELECT_START + (popsize - 1.0) * scaledFitnessStep;
(void)predictEndFitness; // suppress warnings when building with
// assertions disabled
#ifdef INCLUDE_REPORTER
REPORT(Reporter::TRACE) << "endFitness " << endFitness
<< " predictEndFitness " << predictEndFitness;

View File

@@ -93,11 +93,11 @@ bool assignBondDirs(RWMol& mol, INT_PAIR_VECT& zBondPairs,
INT_PAIR_VECT& eBondPairs) {
// bonds to assign
std::set<int> pending;
for (const auto pair : zBondPairs) {
for (const auto& pair : zBondPairs) {
pending.insert(pair.first);
pending.insert(pair.second);
}
for (const auto pair : eBondPairs) {
for (const auto& pair : eBondPairs) {
pending.insert(pair.first);
pending.insert(pair.second);
}
@@ -138,7 +138,7 @@ bool assignBondDirs(RWMol& mol, INT_PAIR_VECT& zBondPairs,
for (int _ = 0; _ < 2; _++) {
INT_PAIR_VECT* _rules = _ == 0 ? &zBondPairs : &eBondPairs;
Bond::BondDir _dir = _ == 0 ? dir : otherDir;
for (const auto pair : *_rules) {
for (const auto& pair : *_rules) {
int other = -1;
if (pair.first == curBondIdx) {
other = pair.second;
@@ -1872,7 +1872,7 @@ std::string MolToInchi(const ROMol& mol, ExtraInchiReturnValues& rv,
// std::sort(neighbors.begin(), neighbors.end());
unsigned char nid = 0;
// std::cerr<<" at: "<<atom->getIdx();
for (const auto p : neighbors) {
for (const auto& p : neighbors) {
stereo0D.neighbor[nid++] = p.second;
// std::cerr<<" "<<p.second;
}