Skip to content

Commit bde97a4

Browse files
denniskleinkarabowi
authored andcommitted
fix(base): -Wunused-but-set-parameter
fix #1145 (cherry picked from commit fc80d18)
1 parent 75abd96 commit bde97a4

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ file an issue, so that we can see how to handle this.
8686
* `FairFieldFactory::fCreator` points to `this`.
8787
* `FairRootManager::FillEventHeader` is only a wrapper around
8888
`FairSource::FillEventHeader`.
89+
* `FairModule::ConstructASCIIGeometry(T*, TString, U*)`, use
90+
`FairModule::ConstructASCIIGeometry(TString)` instead.
8991
* Many items were already deprecated in prior versions.
9092
Marked them with proper C++14 deprecation warnings.
9193
Scheduled them for removal in v20.

base/sim/FairModule.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -90,9 +90,14 @@ class FairModule : public TNamed
9090
/** Finish worker run (used in MT mode only) */
9191
virtual void FinishWorkerRun() const { ; }
9292

93-
/**template function to construct geometry. to be used in derived classes.*/
93+
/** @deprecated template function to construct geometry. to be used in derived classes.
94+
* The first and the third argument are meaningless, just pass nullptr */
9495
template<class T, class U>
95-
void ConstructASCIIGeometry(T* dataType1, TString containerName = "", U* datatype2 = nullptr);
96+
[[deprecated("Broken signature, use ConstructASCIIGeometry(TString) instead")]] void
97+
ConstructASCIIGeometry(T*, TString containerName = "", U* = nullptr);
98+
/** Helper function to construct geometry. */
99+
template<class T, class U>
100+
void ConstructASCIIGeometry(TString containerName = "");
96101

97102
/**Set the sensitivity flag for volumes, called from ConstructASCIIRootGeometry(), and has to be implimented for
98103
* detectors which use ConstructASCIIRootGeometry() to build the geometry */
@@ -169,14 +174,14 @@ class FairModule : public TNamed
169174
};
170175

171176
template<class T, class U>
172-
void FairModule::ConstructASCIIGeometry(T* dataType1, TString containerName, U*)
177+
void FairModule::ConstructASCIIGeometry(TString containerName)
173178
{
174179
FairGeoLoader* loader = FairGeoLoader::Instance();
175180
FairGeoInterface* GeoInterface = loader->getGeoInterface();
176181
T* MGeo = new T();
177182
MGeo->print();
178183
MGeo->setGeomFile(GetGeometryFileName());
179-
GeoInterface->addGeoModule(MGeo);
184+
GeoInterface->addGeoModule(MGeo); // takes ownership!
180185
Bool_t rc = GeoInterface->readSet(MGeo);
181186
if (rc) {
182187
MGeo->create(loader->getGeoBuilder());
@@ -187,8 +192,6 @@ void FairModule::ConstructASCIIGeometry(T* dataType1, TString containerName, U*)
187192
FairRun* fRun = FairRun::Instance();
188193
FairRuntimeDb* rtdb = FairRun::Instance()->GetRuntimeDb();
189194

190-
dataType1 = MGeo;
191-
192195
if ("" != containerName) {
193196
LOG(info) << "Add GeoNodes for " << MGeo->getDescription() << " to container " << containerName;
194197

@@ -215,4 +218,10 @@ void FairModule::ConstructASCIIGeometry(T* dataType1, TString containerName, U*)
215218
}
216219
}
217220

221+
template<class T, class U>
222+
void FairModule::ConstructASCIIGeometry(T*, TString containerName, U*)
223+
{
224+
ConstructASCIIGeometry<T, U>(containerName);
225+
}
226+
218227
#endif // FAIRMODULE_H

0 commit comments

Comments
 (0)