From 4c3007157db5a6ea60812466192d246749dc8214 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 2 Apr 2024 22:34:55 +0200 Subject: [PATCH 1/2] Fix for `-Wnonull-compare` warning Also for not used variable --- PWGCF/GenericFramework/Core/BootstrapProfile.cxx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/PWGCF/GenericFramework/Core/BootstrapProfile.cxx b/PWGCF/GenericFramework/Core/BootstrapProfile.cxx index db349a85fe7..1affb592729 100644 --- a/PWGCF/GenericFramework/Core/BootstrapProfile.cxx +++ b/PWGCF/GenericFramework/Core/BootstrapProfile.cxx @@ -79,12 +79,7 @@ TH1* BootstrapProfile::getHist(Int_t ind) if (fPresetWeights && fMultiRebin > 0) return getWeightBasedRebin(ind); if (ind < 0) { - if (reinterpret_cast(this)) { // FIXME: -Wnonnull-compare return getHistRebinned(reinterpret_cast(this)); //((TProfile*)this)->ProjectionX(Form("%s_hist",this->GetName())); - } else { - printf("Empty BootstrapProfile addressed, cannot get a histogram\n"); - return 0; - } } else { if (!fListOfEntries) { printf("No subprofiles exist!\n"); @@ -102,12 +97,7 @@ TH1* BootstrapProfile::getHist(Int_t ind) TProfile* BootstrapProfile::getProfile(Int_t ind) { if (ind < 0) { - if (reinterpret_cast(this)) { // FIXME: -Wnonnull-compare return reinterpret_cast(this); - } else { - printf("Empty BootstrapProfile addressed, cannot get a histogram\n"); - return 0; - } } else { if (!fListOfEntries) { printf("No subprofiles exist!\n"); @@ -124,7 +114,6 @@ TProfile* BootstrapProfile::getProfile(Int_t ind) Long64_t BootstrapProfile::Merge(TCollection* collist) { Long64_t nmergedpf = TProfile::Merge(collist); - // Long64_t nmerged = 0; BootstrapProfile* l_PBS = 0; TIter all_PBS(collist); while ((l_PBS = reinterpret_cast(all_PBS()))) { @@ -139,7 +128,6 @@ Long64_t BootstrapProfile::Merge(TCollection* collist) } for (Int_t i = 0; i < fListOfEntries->GetEntries(); i++) reinterpret_cast(fListOfEntries->At(i))->Add(reinterpret_cast(tarL->At(i))); - // nmerged++; } return nmergedpf; }; From 9beb6066e2ca213cbfaf64a3a98184d3ab91f54f Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 2 Apr 2024 22:48:08 +0200 Subject: [PATCH 2/2] Fix clang-format error --- PWGCF/GenericFramework/Core/BootstrapProfile.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/GenericFramework/Core/BootstrapProfile.cxx b/PWGCF/GenericFramework/Core/BootstrapProfile.cxx index 1affb592729..1813016eb38 100644 --- a/PWGCF/GenericFramework/Core/BootstrapProfile.cxx +++ b/PWGCF/GenericFramework/Core/BootstrapProfile.cxx @@ -79,7 +79,7 @@ TH1* BootstrapProfile::getHist(Int_t ind) if (fPresetWeights && fMultiRebin > 0) return getWeightBasedRebin(ind); if (ind < 0) { - return getHistRebinned(reinterpret_cast(this)); //((TProfile*)this)->ProjectionX(Form("%s_hist",this->GetName())); + return getHistRebinned(reinterpret_cast(this)); //((TProfile*)this)->ProjectionX(Form("%s_hist",this->GetName())); } else { if (!fListOfEntries) { printf("No subprofiles exist!\n"); @@ -97,7 +97,7 @@ TH1* BootstrapProfile::getHist(Int_t ind) TProfile* BootstrapProfile::getProfile(Int_t ind) { if (ind < 0) { - return reinterpret_cast(this); + return reinterpret_cast(this); } else { if (!fListOfEntries) { printf("No subprofiles exist!\n");