Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecoTracker/MeasurementDet : bug fix for gcc 6.0 misleading-indentation warning #15003

Merged
merged 3 commits into from Jul 9, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions RecoTracker/MeasurementDet/plugins/TkStripMeasurementDet.cc
Expand Up @@ -80,14 +80,16 @@ bool TkStripMeasurementDet::recHits(SimpleHitContainer & result,
SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), leftCluster);
bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), tmp);
if(!isCompatible) break; // exit loop on first incompatible hit
for (auto && h: tmp) result.push_back(new SiStripRecHit2D(std::move(h))); tmp.clear();
for (auto && h: tmp) result.push_back(new SiStripRecHit2D(std::move(h)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

tmp.clear();
}
}
for ( ; rightCluster != detSet.end(); rightCluster++) {
SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), rightCluster);
bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), tmp);
if(!isCompatible) break; // exit loop on first incompatible hit
for (auto && h: tmp) result.push_back(new SiStripRecHit2D(std::move(h))); tmp.clear();
for (auto && h: tmp) result.push_back(new SiStripRecHit2D(std::move(h)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

tmp.clear();
}

return result.size()>oldSize;
Expand Down
15 changes: 8 additions & 7 deletions RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc
Expand Up @@ -20,14 +20,15 @@ void StMeasurementConditionSet::set128StripStatus(int i, bool good, int idx) {
} else {
bad128Strip_[offset+idx] = !good;
if (good == false) {
hasAny128StripBad_[i] = false;
hasAny128StripBad_[i] = false;
} else { // this should not happen, as usually you turn on all fibers
// and then turn off the bad ones, and not vice-versa,
// so I don't care if it's not optimized
hasAny128StripBad_[i] = true;
for (int j = 0; i < (totalStrips_[j] >> 7); j++) {
if (bad128Strip_[j+offset] == false) hasAny128StripBad_[i] = false; break;
}
// and then turn off the bad ones, and not vice-versa,
// so I don't care if it's not optimized
hasAny128StripBad_[i] = true;
for (int j = 0; i < (totalStrips_[j] >> 7); j++) {
if (bad128Strip_[j+offset] == false) hasAny128StripBad_[i] = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add {}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want

if (bad128Strip_[j+offset] == false) { hasAny128StripBad_[i] = false; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

if (bad128Strip_[j+offset] == false) { hasAny128StripBad_[i] = false; break;}

which makes sense

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually make sense, although matches what the previous version was doing. This code always stops after the first iteration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better fix the bug and not loose the warning that points to a problem.
It may make more sense if someone (@VinInn ?) take over.
In the case the bug is fixed, the title of the PR should be changed.

}
}
}
}
Expand Down