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

CommonTools/TrackerMap : fix for bug flagged by gcc 6.0 misleading-indentation warning #15025

Merged
merged 2 commits into from Jul 12, 2016
Merged
Changes from all commits
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 CommonTools/TrackerMap/src/TrackerMap.cc
Expand Up @@ -1481,9 +1481,10 @@ void TrackerMap::save_as_fectrackermap(bool print_total,float minval, float maxv
col =gROOT->GetColor(ncolor+100);
if(col)
col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
else
else {
c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
vc.push_back(c);
Copy link
Member Author

Choose a reason for hiding this comment

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

Without the curly braces this pushes back a pointer to the last TColor set instead of the new one just created.

}
ncolor++;
}
for (int i=0;i<npoints;i++){
Expand Down Expand Up @@ -1762,9 +1763,10 @@ void TrackerMap::save_as_HVtrackermap(bool print_total,float minval, float maxva
col =gROOT->GetColor(ncolor+100);
if(col)
col->SetRGB((Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
else
else {
c = new TColor(ncolor+100,(Double_t)(red/255.),(Double_t)(green/255.),(Double_t)(blue/255.));
Copy link
Member Author

Choose a reason for hiding this comment

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

Same as above.

vc.push_back(c);
}
ncolor++;
}
for (int i=0;i<npoints;i++){
Expand Down