Skip to content

Commit aeaf83e

Browse files
committed
Fix Megalint cppcheck cstyleCast and uninitialized member warnings
1 parent bd8dd6b commit aeaf83e

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎PWGCF/Core/CorrelationContainer.cxx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ CorrelationContainer::CorrelationContainer(const CorrelationContainer& c) : TNam
159159
// CorrelationContainer copy constructor
160160
//
161161

162-
((CorrelationContainer&)c).Copy(*this);
162+
c.Copy(*this);
163163
}
164164

165165
//____________________________________________________________________
@@ -199,7 +199,7 @@ CorrelationContainer& CorrelationContainer::operator=(const CorrelationContainer
199199
// assigment operator
200200

201201
if (this != &c) {
202-
((CorrelationContainer&)c).Copy(*this);
202+
c.Copy(*this);
203203
}
204204

205205
return *this;
@@ -210,7 +210,7 @@ void CorrelationContainer::Copy(TObject& c) const
210210
{
211211
// copy function
212212

213-
CorrelationContainer& target = (CorrelationContainer&)c;
213+
CorrelationContainer& target = static_cast<CorrelationContainer&>(c);
214214

215215
if (mPairHist) {
216216
target.mPairHist = dynamic_cast<StepTHn*>(mPairHist->Clone());

‎PWGCF/TwoParticleCorrelations/Tasks/mftcorrelations.cxx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ struct Mftcorrelations {
201201
std::vector<float> phiWeightCache;
202202
std::vector<float> phiWeightCache1;
203203
std::unique_ptr<TFormula> multCutFormula;
204-
std::array<uint32_t, aod::mftmultset::NMultiplicityEstimators> multCutFormulaParamIndex;
204+
std::array<uint32_t, aod::mftmultset::NMultiplicityEstimators> multCutFormulaParamIndex{};
205205

206206
// Collisions are expected to already carry the joined centrality/multiplicity estimator tables.
207207
using ExtendedCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms, aod::Mults>;
@@ -393,7 +393,7 @@ struct Mftcorrelations {
393393
if (cfg.mEfficiencyTrigger == nullptr) {
394394
LOGF(fatal, "Could not load trigger efficiency from %s", cfgEfficiencyTrigger.value.c_str());
395395
}
396-
LOGF(info, "Loaded MFT trigger efficiency from %s (%p)", cfgEfficiencyTrigger.value.c_str(), (void*)cfg.mEfficiencyTrigger);
396+
LOGF(info, "Loaded MFT trigger efficiency from %s (%p)", cfgEfficiencyTrigger.value.c_str(), static_cast<void*>(cfg.mEfficiencyTrigger));
397397
}
398398
if (!cfgEfficiencyAssociated.value.empty()) {
399399
if (cfgLocalEfficiency > 0) {
@@ -405,7 +405,7 @@ struct Mftcorrelations {
405405
if (cfg.mEfficiencyAssociated == nullptr) {
406406
LOGF(fatal, "Could not load associated efficiency from %s", cfgEfficiencyAssociated.value.c_str());
407407
}
408-
LOGF(info, "Loaded MFT associated efficiency from %s (%p)", cfgEfficiencyAssociated.value.c_str(), (void*)cfg.mEfficiencyAssociated);
408+
LOGF(info, "Loaded MFT associated efficiency from %s (%p)", cfgEfficiencyAssociated.value.c_str(), static_cast<void*>(cfg.mEfficiencyAssociated));
409409
}
410410
// FIX #6d
411411
if (!cfgEfficiencyGlobal.value.empty()) {
@@ -418,7 +418,7 @@ struct Mftcorrelations {
418418
if (cfg.mEfficiencyGlobal == nullptr) {
419419
LOGF(fatal, "Could not load global-track efficiency from %s", cfgEfficiencyGlobal.value.c_str());
420420
}
421-
LOGF(info, "Loaded global-track efficiency from %s (%p)", cfgEfficiencyGlobal.value.c_str(), (void*)cfg.mEfficiencyGlobal);
421+
LOGF(info, "Loaded global-track efficiency from %s (%p)", cfgEfficiencyGlobal.value.c_str(), static_cast<void*>(cfg.mEfficiencyGlobal));
422422
}
423423
cfg.efficiencyLoaded = true;
424424
}
@@ -532,7 +532,7 @@ struct Mftcorrelations {
532532
LOGF(fatal, "Could not find object %s in %s", cfgPhiWeightName.value.c_str(), cfgPhiWeightFile.value.c_str());
533533
}
534534
f->Close();
535-
LOGF(info, "Loaded phi weight '%s' from %s (%p)", cfgPhiWeightName.value.c_str(), cfgPhiWeightFile.value.c_str(), (void*)cfg.mPhiWeight);
535+
LOGF(info, "Loaded phi weight '%s' from %s (%p)", cfgPhiWeightName.value.c_str(), cfgPhiWeightFile.value.c_str(), static_cast<void*>(cfg.mPhiWeight));
536536
}
537537

538538
// Looks up a bin-content-based weight from a 1-D phi map.

0 commit comments

Comments
 (0)