Skip to content

Commit

Permalink
Merge pull request #1518 from davidrohr/master_pull_request2
Browse files Browse the repository at this point in the history
Fix compiler warnings of GCC13 that go into -Werror
  • Loading branch information
alibuild authored Mar 30, 2024
2 parents 51b4692 + 2bd3a0d commit f00f490
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 22 deletions.
8 changes: 4 additions & 4 deletions AD/ADrec/AliADDecision.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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()) &&
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ANALYSIS/ANALYSISalice/AliESDtrackCuts.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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; i<kNCuts; i++) {
fhCutStatistics->GetXaxis()->SetBinLabel(i+4,fgkCutNames[i]);
Expand Down
4 changes: 2 additions & 2 deletions ANALYSIS/ANALYSISalice/AliESDv0Cuts.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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; i<kNCuts; i++) {
fhCutStatistics->GetXaxis()->SetBinLabel(i+4,fgkCutNames[i]);
Expand Down
8 changes: 4 additions & 4 deletions STEER/ESD/AliESDFMD.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions STEER/ESD/AliESDpid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void AliESDpid::MakeTPCPID(AliESDtrack *track) const

if (mismatch) {
for (Int_t j=0; j<AliPID::kSPECIES; j++) {
p[j] = 1./AliPID::kSPECIES;
p[j] = 1./(double)AliPID::kSPECIES;
}
}

Expand Down Expand Up @@ -186,7 +186,7 @@ void AliESDpid::MakeITSPID(AliESDtrack *track) const

if (mismatch) {
for (Int_t j=0; j<AliPID::kSPECIES; j++) {
p[j] = 1./AliPID::kSPECIES;
p[j] = 1./(double)AliPID::kSPECIES;
}
}

Expand Down
4 changes: 2 additions & 2 deletions STEER/STEER/AliLHCData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ TObjArray* AliLHCData::GetDCSEntry(const char* key,int &entry,int &last,double t
Bool_t found = kFALSE;
for (entry=0;entry<ntot;entry++) {
ent = (AliDCSArray*)arr->At(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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion STEER/STEER/AliLHCData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 5 additions & 3 deletions STEER/STEER/AliLHCDipValT.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ Element AliLHCDipValT<Element>::GetValue(Int_t i) const
template<class Element>
void AliLHCDipValT<Element>::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<sz) memset(arr+nc, 0, (sz-nc)*sizeof(Element));
if (fArray) delete[] fArray;
Expand All @@ -199,6 +200,7 @@ void AliLHCDipValT<Element>::SetSize(Int_t sz)
fArray = 0;
fSizeTot = 0;
}
#pragma GCC diagnostic pop
}

//__________________________________________________________________________
Expand Down
2 changes: 1 addition & 1 deletion STEER/STEERBase/AliMagFast.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
if (z>-fgkSolZMax) zSeg = (z+fgkSolZMax)*zGridSpaceInv; // solenoid params
Expand Down
2 changes: 1 addition & 1 deletion STEER/STEERBase/AliPID.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

//_______________________________________________________________________
Expand Down

0 comments on commit f00f490

Please sign in to comment.