From 2bd3a0dcf57e76651e34ff73057e7fd92d35239c Mon Sep 17 00:00:00 2001 From: drohr Date: Sat, 30 Mar 2024 00:45:22 +0100 Subject: [PATCH] Fix compiler warnings that go into -Werror --- AD/ADrec/AliADDecision.cxx | 8 ++++---- ANALYSIS/ANALYSISalice/AliESDtrackCuts.cxx | 4 ++-- ANALYSIS/ANALYSISalice/AliESDv0Cuts.cxx | 4 ++-- STEER/ESD/AliESDFMD.cxx | 8 ++++---- STEER/ESD/AliESDpid.cxx | 4 ++-- STEER/STEER/AliLHCData.cxx | 4 ++-- STEER/STEER/AliLHCData.h | 2 +- STEER/STEER/AliLHCDipValT.h | 8 +++++--- STEER/STEERBase/AliMagFast.cxx | 2 +- STEER/STEERBase/AliPID.cxx | 2 +- 10 files changed, 24 insertions(+), 22 deletions(-) diff --git a/AD/ADrec/AliADDecision.cxx b/AD/ADrec/AliADDecision.cxx index 3f512645f36..78d80961dde 100644 --- a/AD/ADrec/AliADDecision.cxx +++ b/AD/ADrec/AliADDecision.cxx @@ -160,7 +160,7 @@ void AliADDecision::FillDecisions(AliESDAD *esdAD) if (adc1 > GetRecoParam()->GetAdcThresHold() && adc2 > GetRecoParam()->GetAdcThresHold()) { Float_t time1 = esdAD->GetTime(i); Float_t time2 = esdAD->GetTime(i+4); - if(time1 > (AliADReconstructor::kInvalidTime+1.e-6) && time2 > (AliADReconstructor::kInvalidTime+1.e-6)){ + if(time1 > ((float)AliADReconstructor::kInvalidTime+1.e-6) && time2 > ((float)AliADReconstructor::kInvalidTime+1.e-6)){ Float_t timeErr1 = 1/adc1; Float_t timeErr2 = 1/adc2; Float_t timeDiff = TMath::Abs(time1-time2); @@ -190,7 +190,7 @@ void AliADDecision::FillDecisions(AliESDAD *esdAD) if (adc1 > GetRecoParam()->GetAdcThresHold() && adc2 > GetRecoParam()->GetAdcThresHold()) { Float_t time1 = esdAD->GetTime(i); Float_t time2 = esdAD->GetTime(i+4); - if(time1 > (AliADReconstructor::kInvalidTime+1.e-6) && time2 > (AliADReconstructor::kInvalidTime+1.e-6)){ + if(time1 > ((float)AliADReconstructor::kInvalidTime+1.e-6) && time2 > ((float)AliADReconstructor::kInvalidTime+1.e-6)){ Float_t timeErr1 = 1/adc1; Float_t timeErr2 = 1/adc2; Float_t timeDiff = TMath::Abs(time1-time2); @@ -244,7 +244,7 @@ void AliADDecision::FillDecisions(AliESDAD *esdAD) else if (timeADA > (-fADADist + GetRecoParam()->GetTimeWindowBGALow()) && timeADA < (-fADADist + GetRecoParam()->GetTimeWindowBGAUp())) esdAD->SetADADecision(AliESDAD::kADBG); - else if (timeADA > (AliADReconstructor::kInvalidTime + 1e-6)) + else if (timeADA > ((float)AliADReconstructor::kInvalidTime + 1e-6)) esdAD->SetADADecision(AliESDAD::kADFake); if (timeADC > (fADCDist + GetRecoParam()->GetTimeWindowBBCLow()) && @@ -253,7 +253,7 @@ void AliADDecision::FillDecisions(AliESDAD *esdAD) else if (timeADC > (-fADCDist + GetRecoParam()->GetTimeWindowBGCLow()) && timeADC < (-fADCDist + GetRecoParam()->GetTimeWindowBGCUp())) esdAD->SetADCDecision(AliESDAD::kADBG); - else if (timeADC > (AliADReconstructor::kInvalidTime + 1e-6)) + else if (timeADC > ((float)AliADReconstructor::kInvalidTime + 1e-6)) esdAD->SetADCDecision(AliESDAD::kADFake); UInt_t aBBtriggerADA = 0; // bit mask for Beam-Beam trigger in ADA diff --git a/ANALYSIS/ANALYSISalice/AliESDtrackCuts.cxx b/ANALYSIS/ANALYSISalice/AliESDtrackCuts.cxx index 4740c32ef43..baf70758e5f 100644 --- a/ANALYSIS/ANALYSISalice/AliESDtrackCuts.cxx +++ b/ANALYSIS/ANALYSISalice/AliESDtrackCuts.cxx @@ -2423,12 +2423,12 @@ Int_t AliESDtrackCuts::CountAcceptedTracks(const AliESDEvent* const esd) //################################################################################### // defining histograms - fhCutStatistics = new TH1F("cut_statistics","cut statistics",kNCuts+4,-0.5,kNCuts+3.5); + fhCutStatistics = new TH1F("cut_statistics","cut statistics",(int)kNCuts+4,-0.5,(float)kNCuts+3.5); fhCutStatistics->GetXaxis()->SetBinLabel(1,"n tracks"); fhCutStatistics->GetXaxis()->SetBinLabel(2,"n cut tracks"); - fhCutCorrelation = new TH2F("cut_correlation","cut correlation",kNCuts,-0.5,kNCuts-0.5,kNCuts,-0.5,kNCuts-0.5);; + fhCutCorrelation = new TH2F("cut_correlation","cut correlation",(int)kNCuts,-0.5,(float)kNCuts-0.5,(float)kNCuts,-0.5,(float)kNCuts-0.5);; for (Int_t i=0; iGetXaxis()->SetBinLabel(i+4,fgkCutNames[i]); diff --git a/ANALYSIS/ANALYSISalice/AliESDv0Cuts.cxx b/ANALYSIS/ANALYSISalice/AliESDv0Cuts.cxx index 904582a56d0..86c8703d85a 100644 --- a/ANALYSIS/ANALYSISalice/AliESDv0Cuts.cxx +++ b/ANALYSIS/ANALYSISalice/AliESDv0Cuts.cxx @@ -604,12 +604,12 @@ Int_t AliESDv0Cuts::CountAcceptedV0s(const AliESDEvent* esd) //################################################################################### // defining histograms - fhCutStatistics = new TH1F("cut_statistics","cut statistics",kNCuts+4,-0.5,kNCuts+3.5); + fhCutStatistics = new TH1F("cut_statistics","cut statistics",(int)kNCuts+4,-0.5,(float)kNCuts+3.5); fhCutStatistics->GetXaxis()->SetBinLabel(1,"n v0s"); fhCutStatistics->GetXaxis()->SetBinLabel(2,"n cut v0s"); - fhCutCorrelation = new TH2F("cut_correlation","cut correlation",kNCuts,-0.5,kNCuts-0.5,kNCuts,-0.5,kNCuts-0.5);; + fhCutCorrelation = new TH2F("cut_correlation","cut correlation",(int)kNCuts,-0.5,(float)kNCuts-0.5,(float)kNCuts,-0.5,(float)kNCuts-0.5);; for (Int_t i=0; iGetXaxis()->SetBinLabel(i+4,fgkCutNames[i]); diff --git a/STEER/ESD/AliESDFMD.cxx b/STEER/ESD/AliESDFMD.cxx index b0d4639a1cf..34ffaf8231a 100755 --- a/STEER/ESD/AliESDFMD.cxx +++ b/STEER/ESD/AliESDFMD.cxx @@ -93,10 +93,10 @@ namespace { printf("\n Sector %d", fOldS); } if (t % 4 == 0) printf("\n %3d-%3d ", t, t+3); - if (m == AliESDFMD::kInvalidMult) printf("------/"); - else printf("%6.3f/", m); - if (e == AliESDFMD::kInvalidEta) printf("------ "); - else printf("%6.3f ", e); + if (m == (float)AliESDFMD::kInvalidMult) printf("------/"); + else printf("%6.3f/", m); + if (e == (float)AliESDFMD::kInvalidEta) printf("------ "); + else printf("%6.3f ", e); return kTRUE; } diff --git a/STEER/ESD/AliESDpid.cxx b/STEER/ESD/AliESDpid.cxx index 8529be9598c..700a044b6e7 100644 --- a/STEER/ESD/AliESDpid.cxx +++ b/STEER/ESD/AliESDpid.cxx @@ -117,7 +117,7 @@ void AliESDpid::MakeTPCPID(AliESDtrack *track) const if (mismatch) { for (Int_t j=0; jAt(entry); - if (ent->GetTimeStamp()>=tmin-kMarginSOR && ent->GetTimeStamp()<=tmax+kMarginEOR) { + if (ent->GetTimeStamp()>=tmin-(float)kMarginSOR && ent->GetTimeStamp()<=tmax+(float)kMarginEOR) { found = kTRUE; if (ent->GetTimeStamp()>tmin) break; } @@ -316,7 +316,7 @@ TObjArray* AliLHCData::GetDCSEntry(const char* key,int &entry,int &last,double t if (ent->GetTimeStamp()>tmax) break; } if (last == ntot) last--; - else if (ent->GetTimeStamp()>tmax+kMarginEOR) last--; + else if (ent->GetTimeStamp()>tmax+(float)kMarginEOR) last--; // return arr; } diff --git a/STEER/STEER/AliLHCData.h b/STEER/STEER/AliLHCData.h index f36553de0d0..57b77f17747 100755 --- a/STEER/STEER/AliLHCData.h +++ b/STEER/STEER/AliLHCData.h @@ -91,7 +91,7 @@ class AliLHCData : public TObject void SetFillNumber(Int_t fill) {fFillNumber = fill;} void SetTMin(Double_t t) {fTMin = t<0?0:(t>1e10?1e10:t);} void SetTMax(Double_t t) {fTMax = t<0?0:(t>1e10?1e10:t);} - Bool_t IsRun2() const {return fTMin>kY2015;} + Bool_t IsRun2() const {return fTMin>(double)kY2015;} // virtual void Print(const Option_t *opt="") const; TGraph* ExportGraph(Int_t *coord, Int_t elID=0) const; diff --git a/STEER/STEER/AliLHCDipValT.h b/STEER/STEER/AliLHCDipValT.h index 4c59402e645..4560d9c3587 100755 --- a/STEER/STEER/AliLHCDipValT.h +++ b/STEER/STEER/AliLHCDipValT.h @@ -183,11 +183,12 @@ Element AliLHCDipValT::GetValue(Int_t i) const template void AliLHCDipValT::SetSize(Int_t sz) { - //resize - Element* arr = 0; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" if (sz>0) { + Element* arr = nullptr; arr = new Element[sz]; - int nc = GetSizeTotal() > sz ? sz:GetSizeTotal(); // n elems to copy + int nc = GetSizeTotal() > sz ? sz : GetSizeTotal(); // n elems to copy if (nc && fArray) memcpy(arr, fArray, nc*sizeof(Element)); if (nc::SetSize(Int_t sz) fArray = 0; fSizeTot = 0; } +#pragma GCC diagnostic pop } //__________________________________________________________________________ diff --git a/STEER/STEERBase/AliMagFast.cxx b/STEER/STEERBase/AliMagFast.cxx index 8edc94efe12..cda2695baf1 100644 --- a/STEER/STEERBase/AliMagFast.cxx +++ b/STEER/STEERBase/AliMagFast.cxx @@ -246,7 +246,7 @@ Bool_t AliMagFast::GetSegmentSol(const float xyz[3], int& zSeg,int &rSeg, int &q { // get segment of point location const float &x=xyz[kX],&y=xyz[kY],&z=xyz[kZ]; - const float zGridSpaceInv = 1/(fgkSolZMax*2/kNSolZRanges); + const float zGridSpaceInv = 1.f/(fgkSolZMax*2/(float)kNSolZRanges); zSeg = -1; if (z-fgkSolZMax) zSeg = (z+fgkSolZMax)*zGridSpaceInv; // solenoid params diff --git a/STEER/STEERBase/AliPID.cxx b/STEER/STEERBase/AliPID.cxx index 63e11d4af52..70bb9d0696e 100644 --- a/STEER/STEERBase/AliPID.cxx +++ b/STEER/STEERBase/AliPID.cxx @@ -190,7 +190,7 @@ AliPID::AliPID() : Init(); // set default values (= equal probabilities) for (Int_t i = 0; i < kSPECIESCN; i++) - fProbDensity[i] = 1./kSPECIESCN; + fProbDensity[i] = 1./(double)kSPECIESCN; } //_______________________________________________________________________