Skip to content

Commit 3e860a5

Browse files
committed
[r] Avoid suggest-override warnings in R bindings
1 parent 152798a commit 3e860a5

File tree

11 files changed

+65
-84
lines changed

11 files changed

+65
-84
lines changed

bindings/r/inc/RExports.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
4747
#pragma GCC diagnostic ignored "-Wextra"
4848
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
49+
#pragma GCC diagnostic ignored "-Wsuggest-override"
4950
// disable warning for macos
5051
#if defined(__APPLE__)
5152
#pragma GCC diagnostic ignored "-Wnonportable-include-path"

bindings/r/inc/TRDataFrame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ namespace ROOT {
434434
print(df[label]);
435435
}
436436
}
437-
ClassDef(TRDataFrame, 0) //
437+
ClassDefOverride(TRDataFrame, 0) //
438438
};
439439
}
440440
}

bindings/r/inc/TRFunctionExport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ namespace ROOT {
180180
f = new TRInternalFunction(fun);
181181
}
182182

183-
ClassDef(TRFunctionExport, 0) //
183+
ClassDefOverride(TRFunctionExport, 0) //
184184
};
185185
}
186186
}

bindings/r/inc/TRFunctionImport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ namespace ROOT {
165165
return (*f)();
166166
}
167167
#include<TRFunctionImport__oprtr.h>
168-
ClassDef(TRFunctionImport, 0) //
168+
ClassDefOverride(TRFunctionImport, 0) //
169169
};
170170

171171
template<> inline TRObject::operator TRFunctionImport()

bindings/r/inc/TRInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ namespace ROOT {
317317
*/
318318
static TRInterface *InstancePtr();
319319

320-
ClassDef(TRInterface, 0)
320+
ClassDefOverride(TRInterface, 0)
321321
};
322322
}
323323
}

bindings/r/inc/TRObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ namespace ROOT {
191191
return T();
192192
}
193193
}
194-
ClassDef(TRObject, 0) //
194+
ClassDefOverride(TRObject, 0) //
195195
};
196196

197197
}

tmva/rmva/inc/TMVA/MethodC50.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,34 +45,34 @@ namespace TMVA {
4545

4646

4747
~MethodC50(void);
48-
void Train();
48+
void Train() override;
4949
// options treatment
50-
void Init();
51-
void DeclareOptions();
52-
void ProcessOptions();
50+
void Init() override;
51+
void DeclareOptions() override;
52+
void ProcessOptions() override;
5353
// create ranking
54-
const Ranking *CreateRanking()
54+
const Ranking *CreateRanking() override
5555
{
5656
return nullptr; // = 0;
5757
}
5858

5959

60-
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
60+
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override;
6161

6262
// performs classifier testing
63-
virtual void TestClassification();
63+
void TestClassification() override;
6464

6565

66-
Double_t GetMvaValue(Double_t *errLower = nullptr, Double_t *errUpper = nullptr);
67-
virtual void MakeClass(const TString &classFileName = TString("")) const; //required for model persistence
66+
Double_t GetMvaValue(Double_t *errLower = nullptr, Double_t *errUpper = nullptr) override;
67+
void MakeClass(const TString &classFileName = TString("")) const override; //required for model persistence
6868
using MethodBase::ReadWeightsFromStream;
6969
// the actual "weights"
70-
virtual void AddWeightsXMLTo(void * /*parent*/) const {} // = 0;
71-
virtual void ReadWeightsFromXML(void * /*weight*/) {} // = 0;
72-
virtual void ReadWeightsFromStream(std::istream &) {} //= 0; // backward compatibility
70+
void AddWeightsXMLTo(void * /*parent*/) const override {} // = 0;
71+
void ReadWeightsFromXML(void * /*weight*/) override {} // = 0;
72+
void ReadWeightsFromStream(std::istream &) override {} //= 0; // backward compatibility
7373

7474
// signal/background classification response for all current set of data
75-
virtual std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false);
75+
std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false) override;
7676

7777
void ReadModelFromFile();
7878
private :
@@ -109,9 +109,9 @@ namespace TMVA {
109109

110110

111111
// get help message text
112-
void GetHelpMessage() const;
112+
void GetHelpMessage() const override;
113113

114-
ClassDef(MethodC50, 0)
114+
ClassDefOverride(MethodC50, 0)
115115
};
116116
} // namespace TMVA
117117
#endif

tmva/rmva/inc/TMVA/MethodRSNNS.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,36 @@ namespace TMVA {
4545

4646

4747
~MethodRSNNS(void);
48-
void Train();
48+
void Train() override;
4949
// options treatment
50-
void Init();
51-
void DeclareOptions();
52-
void ProcessOptions();
50+
void Init() override;
51+
void DeclareOptions() override;
52+
void ProcessOptions() override;
5353
// create ranking
54-
const Ranking *CreateRanking()
54+
const Ranking *CreateRanking() override
5555
{
5656
return nullptr; // = 0;
5757
}
5858

5959

60-
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
60+
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override;
6161

6262
// performs classifier testing
63-
virtual void TestClassification();
63+
void TestClassification() override;
6464

6565

66-
Double_t GetMvaValue(Double_t *errLower = nullptr, Double_t *errUpper = nullptr);
66+
Double_t GetMvaValue(Double_t *errLower = nullptr, Double_t *errUpper = nullptr) override;
6767

6868
using MethodBase::ReadWeightsFromStream;
6969
// the actual "weights"
70-
virtual void AddWeightsXMLTo(void * /*parent*/) const {} // = 0;
71-
virtual void ReadWeightsFromXML(void * /*wghtnode*/) {} // = 0;
72-
virtual void ReadWeightsFromStream(std::istream &) {} //= 0; // backward compatibility
70+
void AddWeightsXMLTo(void * /*parent*/) const override {} // = 0;
71+
void ReadWeightsFromXML(void * /*wghtnode*/) override {} // = 0;
72+
void ReadWeightsFromStream(std::istream &) override {} //= 0; // backward compatibility
7373

7474
void ReadModelFromFile();
7575

7676
// signal/background classification response for all current set of data
77-
virtual std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false);
77+
virtual std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false) override;
7878

7979
private :
8080
DataSetManager *fDataSetManager; // DSMTEST
@@ -115,9 +115,9 @@ namespace TMVA {
115115
ROOT::R::TRFunctionImport asfactor;
116116
ROOT::R::TRObject *fModel;
117117
// get help message text
118-
void GetHelpMessage() const;
118+
void GetHelpMessage() const override;
119119

120-
ClassDef(MethodRSNNS, 0)
120+
ClassDefOverride(MethodRSNNS, 0)
121121
};
122122
} // namespace TMVA
123123
#endif

tmva/rmva/inc/TMVA/MethodRSVM.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,35 @@ namespace TMVA {
4545

4646

4747
~MethodRSVM(void);
48-
void Train();
48+
void Train() override;
4949
// options treatment
50-
void Init();
51-
void DeclareOptions();
52-
void ProcessOptions();
50+
void Init() override;
51+
void DeclareOptions() override;
52+
void ProcessOptions() override;
5353
// create ranking
54-
const Ranking *CreateRanking()
54+
const Ranking *CreateRanking() override
5555
{
5656
return nullptr; // = 0;
5757
}
5858

5959

60-
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
60+
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override;
6161

6262
// performs classifier testing
63-
virtual void TestClassification();
63+
void TestClassification() override;
6464

6565

66-
Double_t GetMvaValue(Double_t *errLower = nullptr, Double_t *errUpper = nullptr);
66+
Double_t GetMvaValue(Double_t *errLower = nullptr, Double_t *errUpper = nullptr) override;
6767

6868
using MethodBase::ReadWeightsFromStream;
6969
// the actual "weights"
70-
virtual void AddWeightsXMLTo(void * /*parent*/) const {} // = 0;
71-
virtual void ReadWeightsFromXML(void * /*wghtnode*/) {} // = 0;
72-
virtual void ReadWeightsFromStream(std::istream &) {} //= 0; // backward compatibility
70+
void AddWeightsXMLTo(void * /*parent*/) const override {} // = 0;
71+
void ReadWeightsFromXML(void * /*wghtnode*/) override {} // = 0;
72+
void ReadWeightsFromStream(std::istream &) override {} //= 0; // backward compatibility
7373
void ReadModelFromFile();
7474

7575
// signal/background classification response for all current set of data
76-
virtual std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false);
76+
std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false) override;
7777

7878
private :
7979
DataSetManager *fDataSetManager; // DSMTEST
@@ -130,9 +130,9 @@ namespace TMVA {
130130
ROOT::R::TRFunctionImport asfactor;
131131
ROOT::R::TRObject *fModel;
132132
// get help message text
133-
void GetHelpMessage() const;
133+
void GetHelpMessage() const override;
134134

135-
ClassDef(MethodRSVM, 0)
135+
ClassDefOverride(MethodRSVM, 0)
136136
};
137137
} // namespace TMVA
138138
#endif

tmva/rmva/inc/TMVA/MethodRXGB.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,36 @@ namespace TMVA {
4545

4646

4747
~MethodRXGB(void);
48-
void Train();
48+
void Train() override;
4949
// options treatment
50-
void Init();
51-
void DeclareOptions();
52-
void ProcessOptions();
50+
void Init() override;
51+
void DeclareOptions() override;
52+
void ProcessOptions() override;
5353
// create ranking
54-
const Ranking *CreateRanking()
54+
const Ranking *CreateRanking() override
5555
{
5656
return nullptr; // = 0;
5757
}
5858

5959

60-
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
60+
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override;
6161

6262
// performs classifier testing
63-
virtual void TestClassification();
63+
void TestClassification() override;
6464

6565

66-
Double_t GetMvaValue(Double_t *errLower = nullptr, Double_t *errUpper = nullptr);
67-
virtual void MakeClass(const TString &classFileName = TString("")) const; //required for model persistence
66+
Double_t GetMvaValue(Double_t *errLower = nullptr, Double_t *errUpper = nullptr) override;
67+
void MakeClass(const TString &classFileName = TString("")) const override; //required for model persistence
6868
using MethodBase::ReadWeightsFromStream;
6969
// the actual "weights"
70-
virtual void AddWeightsXMLTo(void * /*parent*/) const {} // = 0;
71-
virtual void ReadWeightsFromXML(void * /*wghtnode*/) {} // = 0;
72-
virtual void ReadWeightsFromStream(std::istream &) {} //= 0; // backward compatibility
70+
void AddWeightsXMLTo(void * /*parent*/) const override {} // = 0;
71+
void ReadWeightsFromXML(void * /*wghtnode*/) override {} // = 0;
72+
void ReadWeightsFromStream(std::istream &) override {} //= 0; // backward compatibility
7373

7474
void ReadModelFromFile();
7575

7676
// signal/background classification response for all current set of data
77-
virtual std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false);
77+
std::vector<Double_t> GetMvaValues(Long64_t firstEvt = 0, Long64_t lastEvt = -1, Bool_t logProgress = false) override;
7878

7979
private :
8080
DataSetManager *fDataSetManager; // DSMTEST
@@ -104,9 +104,9 @@ namespace TMVA {
104104

105105

106106
// get help message text
107-
void GetHelpMessage() const;
107+
void GetHelpMessage() const override;
108108

109-
ClassDef(MethodRXGB, 0)
109+
ClassDefOverride(MethodRXGB, 0)
110110
};
111111
} // namespace TMVA
112112
#endif

0 commit comments

Comments
 (0)