From 6333a307ca632b8fa39915096c66ebd77b2e28b6 Mon Sep 17 00:00:00 2001
From: Guilherme Amadio <amadio@cern.ch>
Date: Wed, 8 Aug 2018 17:14:11 +0200
Subject: [PATCH] Fix constness issues in TUnfoldBinning

Use pointer to const object rather than const pointer to non-const
object.
---
 hist/unfold/inc/TUnfoldBinning.h   | 2 +-
 hist/unfold/src/TUnfoldBinning.cxx | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hist/unfold/inc/TUnfoldBinning.h b/hist/unfold/inc/TUnfoldBinning.h
index 2384ab90762..db3202e8435 100644
--- a/hist/unfold/inc/TUnfoldBinning.h
+++ b/hist/unfold/inc/TUnfoldBinning.h
@@ -162,7 +162,7 @@ class TUnfoldBinning : public TNamed {
       return (TVectorD const *)fAxisList->At(axis); }
    /// get name of an axis
    inline TString GetDistributionAxisLabel(Int_t axis) const {
-      return ((TObjString * const)fAxisLabelList->At(axis))->GetString(); }
+      return ((TObjString const *)fAxisLabelList->At(axis))->GetString(); }
 
    virtual Double_t GetDistributionUnderflowBinWidth(Int_t axis) const; // width of underflow bin on the given axis
    virtual Double_t GetDistributionOverflowBinWidth(Int_t axis) const; // width of overflow bin on the given axis
diff --git a/hist/unfold/src/TUnfoldBinning.cxx b/hist/unfold/src/TUnfoldBinning.cxx
index 360457ab863..3aecbf53c23 100644
--- a/hist/unfold/src/TUnfoldBinning.cxx
+++ b/hist/unfold/src/TUnfoldBinning.cxx
@@ -1906,10 +1906,10 @@ Bool_t TUnfoldBinning::HasUnconnectedBins(void) const
 /// \param[in] bin local bin number
 
 const TObjString *TUnfoldBinning::GetUnconnectedBinName(Int_t bin) const {
-   TObjString *r=0;
+   TObjString const *r = nullptr;
    if(HasUnconnectedBins()) {
       if(bin<fAxisLabelList->GetEntriesFast()) {
-         r=((TObjString * const)fAxisLabelList->At(bin));
+         r = ((TObjString const *)fAxisLabelList->At(bin));
       }
    }
    return r;
@@ -2142,7 +2142,7 @@ void TUnfoldBinning::DecodeAxisSteering
      Int_t nPattern=patterns->GetEntries();
      Int_t nAxis=fAxisLabelList->GetEntries();
      for(Int_t i=0;i<nPattern;i++) {
-        TString const &pattern=((TObjString * const)patterns->At(i))
+        TString const &pattern=((TObjString const *)patterns->At(i))
            ->GetString();
         Int_t bracketBegin=pattern.Last('[');
         Int_t len=pattern.Length();
-- 
GitLab