Skip to content

Commit 2ad76f5

Browse files
ktfsawenzel
authored andcommitted
Fix all the modernize-use-auto errors reported by clang-tidy
Description of the check can be found at: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html
1 parent 015bddc commit 2ad76f5

49 files changed

Lines changed: 1933 additions & 1933 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Common/Field/src/MagFieldContFact.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void MagFieldContFact::setAllContainers()
2727
{
2828
// Creates the Container objects and adds it to the list of containers
2929

30-
FairContainer* p = new FairContainer("MagFieldParam", "Mag. Field Parameters", "Default Field");
30+
auto* p = new FairContainer("MagFieldParam", "Mag. Field Parameters", "Default Field");
3131
containers->Add(p);
3232
}
3333

Common/Field/src/MagneticWrapperChebyshev.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ void MagneticWrapperChebyshev::loadData(const char* inpfile)
832832
int nparSol = buffs.Atoi();
833833

834834
for (int ip = 0; ip < nparSol; ip++) {
835-
Chebyshev3D* cheb = new Chebyshev3D();
835+
auto* cheb = new Chebyshev3D();
836836
cheb->loadData(stream);
837837
addParameterSolenoid(cheb);
838838
}
@@ -853,7 +853,7 @@ void MagneticWrapperChebyshev::loadData(const char* inpfile)
853853
int nparTPCInt = buffs.Atoi();
854854

855855
for (int ip = 0; ip < nparTPCInt; ip++) {
856-
Chebyshev3D* cheb = new Chebyshev3D();
856+
auto* cheb = new Chebyshev3D();
857857
cheb->loadData(stream);
858858
addParameterTPCIntegral(cheb);
859859
}
@@ -877,7 +877,7 @@ void MagneticWrapperChebyshev::loadData(const char* inpfile)
877877
int nparTPCRatInt = buffs.Atoi();
878878

879879
for (int ip = 0; ip < nparTPCRatInt; ip++) {
880-
Chebyshev3D* cheb = new Chebyshev3D();
880+
auto* cheb = new Chebyshev3D();
881881
cheb->loadData(stream);
882882
addParameterTPCRatIntegral(cheb);
883883
}
@@ -901,7 +901,7 @@ void MagneticWrapperChebyshev::loadData(const char* inpfile)
901901
int nparDip = buffs.Atoi();
902902

903903
for (int ip = 0; ip < nparDip; ip++) {
904-
Chebyshev3D* cheb = new Chebyshev3D();
904+
auto* cheb = new Chebyshev3D();
905905
cheb->loadData(stream);
906906
addParameterDipole(cheb);
907907
}
@@ -1444,8 +1444,8 @@ void MagneticWrapperChebyshev::saveData(const char* outfile) const
14441444
Int_t MagneticWrapperChebyshev::segmentDimension(float** seg, const TObjArray* par, int npar, int dim, float xmn,
14451445
float xmx, float ymn, float ymx, float zmn, float zmx)
14461446
{
1447-
float* tmpC = new float[2 * npar];
1448-
int* tmpInd = new int[2 * npar];
1447+
auto* tmpC = new float[2 * npar];
1448+
auto* tmpInd = new int[2 * npar];
14491449
int nseg0 = 0;
14501450
for (int ip = 0; ip < npar; ip++) {
14511451
Chebyshev3D* cheb = (Chebyshev3D*)par->At(ip);

Common/MathUtils/src/Chebyshev3D.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,10 @@ Int_t Chebyshev3D::chebyshevFit(int dmOut)
512512
maxDim = mNumberOfPoints[i];
513513
}
514514
}
515-
Float_t* fvals = new Float_t[mNumberOfPoints[0]];
516-
Float_t* tmpCoef3D = new Float_t[mNumberOfPoints[0] * mNumberOfPoints[1] * mNumberOfPoints[2]];
517-
Float_t* tmpCoef2D = new Float_t[mNumberOfPoints[0] * mNumberOfPoints[1]];
518-
Float_t* tmpCoef1D = new Float_t[maxDim];
515+
auto* fvals = new Float_t[mNumberOfPoints[0]];
516+
auto* tmpCoef3D = new Float_t[mNumberOfPoints[0] * mNumberOfPoints[1] * mNumberOfPoints[2]];
517+
auto* tmpCoef2D = new Float_t[mNumberOfPoints[0] * mNumberOfPoints[1]];
518+
auto* tmpCoef1D = new Float_t[maxDim];
519519

520520
// 1D Cheb.fit for 0-th dimension at current steps of remaining dimensions
521521
int ncmax = 0;
@@ -580,7 +580,7 @@ Int_t Chebyshev3D::chebyshevFit(int dmOut)
580580

581581
// now find 2D surface which separates significant coefficients of 3D matrix from nonsignificant ones (up to
582582
// prec)
583-
UShort_t* tmpCoefSurf = new UShort_t[mNumberOfPoints[0] * mNumberOfPoints[1]];
583+
auto* tmpCoefSurf = new UShort_t[mNumberOfPoints[0] * mNumberOfPoints[1]];
584584
for (int id0 = mNumberOfPoints[0]; id0--;) {
585585
for (int id1 = mNumberOfPoints[1]; id1--;) {
586586
tmpCoefSurf[id1 + id0 * mNumberOfPoints[1]] = 0;
@@ -622,7 +622,7 @@ Int_t Chebyshev3D::chebyshevFit(int dmOut)
622622

623623
// see if there are rows to reject, find max.significant column at each row
624624
int nRows = mNumberOfPoints[0];
625-
UShort_t* tmpCols = new UShort_t[nRows];
625+
auto* tmpCols = new UShort_t[nRows];
626626
for (int id0 = mNumberOfPoints[0]; id0--;) {
627627
int id1 = mNumberOfPoints[1];
628628
while (id1 > 0 && tmpCoefSurf[(id1 - 1) + id0 * mNumberOfPoints[1]] == 0) {
@@ -831,7 +831,7 @@ void Chebyshev3D::setDimOut(const int d, const float *prec)
831831
mTemporaryUserResults = new Float_t[mOutputArrayDimension];
832832
mChebyshevParameter.Delete();
833833
for (int i = 0; i < d; i++) {
834-
Chebyshev3DCalc *clc = new Chebyshev3DCalc();
834+
auto *clc = new Chebyshev3DCalc();
835835
clc->setPrecision(prec && prec[i] > sMinimumPrecision ? prec[i] : mPrecision);
836836
mChebyshevParameter.AddAtAndExpand(new Chebyshev3DCalc(), i);
837837
}

DataFormats/TimeFrame/test/TimeFrameTest.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace DataFormat
1616
BOOST_AUTO_TEST_CASE(MessageSizePair_test)
1717
{
1818
size_t S = 100;
19-
char* buffer = new char[S];
19+
auto* buffer = new char[S];
2020

2121
// fill the buffer with something
2222
buffer[0] = 'a';
@@ -59,7 +59,7 @@ inline static void SimpleMsgCleanup(void* /*data*/, void* obj)
5959
template<typename Factory, typename T>
6060
inline static FairMQMessagePtr NewSimpleMessage(Factory const &f, const T& data)
6161
{
62-
T* dataCopy = new T(data);
62+
auto* dataCopy = new T(data);
6363
return f.CreateMessage(dataCopy, sizeof(T), SimpleMsgCleanup<T>, dataCopy);
6464
}
6565

DataFormats/simulation/src/Stack.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void Stack::PushTrack(Int_t toBeDone, Int_t parentId, Int_t pdgCode, Double_t px
129129
Int_t nPoints = 0;
130130
Int_t daughter1Id = -1;
131131
Int_t daughter2Id = -1;
132-
TParticle *particle = new(partArray[mNumberOfEntriesInParticles++])
132+
auto *particle = new(partArray[mNumberOfEntriesInParticles++])
133133
TParticle(pdgCode, trackId, parentId, nPoints, daughter1Id, daughter2Id, px, py, pz, e, vx, vy, vz, time);
134134
particle->SetPolarisation(polx, poly, polz);
135135
particle->SetWeight(weight);
@@ -215,7 +215,7 @@ TParticle *Stack::GetCurrentTrack() const
215215
void Stack::AddParticle(TParticle *oldPart)
216216
{
217217
TClonesArray &array = *mParticles;
218-
TParticle *newPart = new(array[mIndex]) TParticle(*oldPart);
218+
auto *newPart = new(array[mIndex]) TParticle(*oldPart);
219219
newPart->SetWeight(oldPart->GetWeight());
220220
newPart->SetUniqueID(oldPart->GetUniqueID());
221221
mIndex++;
@@ -249,7 +249,7 @@ void Stack::FillTrackArray()
249249
Bool_t store = (*mStoreIterator).second;
250250

251251
if (store) {
252-
MCTrack *track = new((*mTracks)[mNumberOfEntriesInTracks]) MCTrack(GetParticle(iPart));
252+
auto *track = new((*mTracks)[mNumberOfEntriesInTracks]) MCTrack(GetParticle(iPart));
253253
mIndexMap[iPart] = mNumberOfEntriesInTracks;
254254
// Set the number of points in the detectors for this track
255255
for (Int_t iDet = kAliIts; iDet < kSTOPHERE; iDet++) {

Detectors/ITSMFT/ITS/base/src/GeometryTGeo.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ void GeometryTGeo::createT2LMatrices()
960960
double dx = gloB[0] - gloA[0];
961961
double dy = gloB[1] - gloA[1];
962962
double t = (gloB[0] * dx + gloB[1] * dy) / (dx * dx + dy * dy), x = gloB[0] - dx * t, y = gloB[1] - dy * t;
963-
TGeoHMatrix* t2l = new TGeoHMatrix();
963+
auto* t2l = new TGeoHMatrix();
964964
t2l->RotateZ(ATan2(y, x) * RadToDeg()); // rotate in direction of normal to the sensor plane
965965
t2l->SetDx(x);
966966
t2l->SetDy(y);

Detectors/ITSMFT/ITS/simulation/src/Detector.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -828,15 +828,15 @@ TGeoVolume *Detector::createWrapperVolume(Int_t id)
828828
}
829829

830830
// Now create the actual shape and volume
831-
TGeoTube *tube =
831+
auto *tube =
832832
new TGeoTube(mWrapperMinRadius[id], mWrapperMaxRadius[id], mWrapperZSpan[id] / 2.);
833833

834834
TGeoMedium *medAir = gGeoManager->GetMedium("ITS_AIR$");
835835

836836
char volnam[30];
837837
snprintf(volnam, 29, "%s%d", GeometryTGeo::getITSWrapVolPattern(), id);
838838

839-
TGeoVolume *wrapper = new TGeoVolume(volnam, tube, medAir);
839+
auto *wrapper = new TGeoVolume(volnam, tube, medAir);
840840

841841
return wrapper;
842842
}
@@ -1021,13 +1021,13 @@ void Detector::createServiceBarrel(const Bool_t innerBarrel, TGeoVolume *dest,
10211021
if (innerBarrel) {
10221022
zLenOB = ((TGeoTube *) (dest->GetShape()))->GetDz();
10231023
// TGeoTube*ibSuppSh = new TGeoTubeSeg(rminIB,rminIB+cInt,zLenOB,phi1,phi2);
1024-
TGeoTube *ibSuppSh = new TGeoTube(rminIB, rminIB + cInt, zLenOB);
1025-
TGeoVolume *ibSupp = new TGeoVolume("ibSuppCyl", ibSuppSh, medCarbonFleece);
1024+
auto *ibSuppSh = new TGeoTube(rminIB, rminIB + cInt, zLenOB);
1025+
auto *ibSupp = new TGeoVolume("ibSuppCyl", ibSuppSh, medCarbonFleece);
10261026
dest->AddNode(ibSupp, 1);
10271027
} else {
10281028
zLenOB = ((TGeoTube *) (dest->GetShape()))->GetDz();
1029-
TGeoTube *obSuppSh = new TGeoTube(rminOB, rminOB + cExt, zLenOB);
1030-
TGeoVolume *obSupp = new TGeoVolume("obSuppCyl", obSuppSh, medCarbonFleece);
1029+
auto *obSuppSh = new TGeoTube(rminOB, rminOB + cExt, zLenOB);
1030+
auto *obSupp = new TGeoVolume("obSuppCyl", obSuppSh, medCarbonFleece);
10311031
dest->AddNode(obSupp, 1);
10321032
}
10331033

Detectors/ITSMFT/ITS/simulation/src/DigitWriteoutBuffer.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void DigitWriteoutBuffer::AddNewDataToTClonesArray(FairTimeStamp *timestamp)
4545
double DigitWriteoutBuffer::FindTimeForData(FairTimeStamp *timestamp)
4646
{
4747
Digit itsdigit = *(static_cast<Digit *>(timestamp));
48-
std::map<Digit, double>::iterator result = mData_map.find(itsdigit);
48+
auto result = mData_map.find(itsdigit);
4949
if (result != mData_map.end()) {
5050
return result->second;
5151
}

0 commit comments

Comments
 (0)