Skip to content

Commit

Permalink
fix more uninitialized variables
Browse files Browse the repository at this point in the history
  • Loading branch information
gaede committed Jan 12, 2018
1 parent b840c19 commit 2b5105c
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 46 deletions.
2 changes: 1 addition & 1 deletion include/gear/GearMaterialProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace gear {


protected:
ConfigMap _cfg ;
ConfigMap _cfg{} ;


}; // class
Expand Down
10 changes: 5 additions & 5 deletions include/gear/gearimpl/CalorimeterParametersImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ class LayerLayoutImpl ;

protected:

int _type ;
int _sym ;
double _phi ;
LayerLayoutImpl _layout ;
mutable std::vector<double> _extent ;
int _type {};
int _sym {};
double _phi {};
LayerLayoutImpl _layout {};
mutable std::vector<double> _extent {};

}; // class
} // namespace gear
Expand Down
2 changes: 1 addition & 1 deletion include/gear/gearimpl/GearMgrImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ namespace gear {
typedef std::map< std::string,const SimpleMaterial* > MatMap ;
MatMap _matMap{} ;

MeasurementSurfaceStore* _surfaceStore ;
MeasurementSurfaceStore* _surfaceStore = nullptr ;

mutable StringVec _keys{} ;

Expand Down
6 changes: 3 additions & 3 deletions include/gear/gearsurf/CartesianCoordinateSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ namespace gear{
private:

/** The translation vector (= the origin of the Coordinate System ) */
CLHEP::Hep3Vector _T;
CLHEP::Hep3Vector _T{};

/** Rotation Matrix
* Definition: global = R* local
*/
CLHEP::HepRotation _R;
CLHEP::HepRotation _R_inv;
CLHEP::HepRotation _R{};
CLHEP::HepRotation _R_inv{};
};

} // end of gear namespace
Expand Down
10 changes: 5 additions & 5 deletions include/gear/gearsurf/MeasurementSurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ namespace gear{

private:

int _ID;
ICoordinateSystem* _coordinateSystem;
int _ID{};
ICoordinateSystem* _coordinateSystem = nullptr ;

IBoundary* _boundary;
IBoundary* _boundary = nullptr ;

MeasurementSurface(const MeasurementSurface& m){}; // copy constructor is private --> no cpoying allowed
MeasurementSurface& operator= (MeasurementSurface const& m); // assignment not allowed either
MeasurementSurface(const MeasurementSurface&){}; // copy constructor is private --> no cpoying allowed
MeasurementSurface& operator= (MeasurementSurface const&); // assignment not allowed either


};
Expand Down
6 changes: 3 additions & 3 deletions include/gear/gearsurf/MeasurementSurfaceStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ namespace gear{
void addMeasurementSurface(MeasurementSurface* ms);

// private member variables
std::map<int,MeasurementSurface* > _measurement_surface_map;
std::map<int,MeasurementSurface* > _measurement_surface_map{};

typedef std::map<int, MeasurementSurface*>::const_iterator ms_map_it ;

bool _store_filled;
bool _store_filled{};

std::string _fillerName;
std::string _fillerName{};

};

Expand Down
2 changes: 1 addition & 1 deletion include/gear/geartgeo/GearMaterialProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace gear {


private:
ConfigMap _cfg ;
ConfigMap _cfg{} ;


}; // class
Expand Down
18 changes: 9 additions & 9 deletions include/gear/geartgeo/MaterialMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ namespace gear {


protected:
double _xmin, _xmax;
int _nxsteps;
double _ymin, _ymax;
int _nysteps;
double _zmin, _zmax;
int _nzsteps;
double _xstep,_ystep,_zstep;
std::pair<double,double> _values;
std::vector< std::vector< std::vector< std::pair<double,double> > > > _myMap;
double _xmin{}, _xmax{};
int _nxsteps{};
double _ymin{}, _ymax{};
int _nysteps{};
double _zmin{}, _zmax{};
int _nzsteps{};
double _xstep{},_ystep{},_zstep{};
std::pair<double,double> _values{};
std::vector< std::vector< std::vector< std::pair<double,double> > > > _myMap{};
void calculateGridIndex(std::vector<int> & gpos,double x, double y, double z) const throw (Exception, std::exception );
void interpolateOnGrid(std::pair<double,double> &result, double x, double y, double z) const;
}; // class
Expand Down
10 changes: 7 additions & 3 deletions include/gear/geartgeo/MaterialMapFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ namespace gear {
*/
class MaterialMapFactory {

public:
public:
MaterialMapFactory(const MaterialMapFactory&) = delete ;
MaterialMapFactory& operator=(const MaterialMapFactory&) = delete ;


MaterialMapFactory(GearMgr *gearMgr);
/// Destructor.
virtual ~MaterialMapFactory() {
Expand All @@ -47,8 +51,8 @@ namespace gear {


protected:
GearMgr *_gearMgr;
std::map< std::vector<double> , MaterialMap* > _managerMap;
GearMgr *_gearMgr = nullptr ;
std::map< std::vector<double> , MaterialMap* > _managerMap{};
}; // class
} // namespace gear
#endif /* ifndef GEAR_MATERIALMAPFACTORY_H */
22 changes: 13 additions & 9 deletions include/gear/geartgeo/TGeoGearDistanceProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ namespace gear {
*/
class TGeoGearDistanceProperties: public GearDistanceProperties {

public:
public:

TGeoGearDistanceProperties( const TGeoGearDistanceProperties&) = delete ;
TGeoGearDistanceProperties& operator=( const TGeoGearDistanceProperties&) = delete ;

TGeoGearDistanceProperties(TGeoManager *geoMgr);

/// Destructor.
Expand Down Expand Up @@ -61,19 +65,19 @@ class TGeoGearDistanceProperties: public GearDistanceProperties {

protected:
void beamOn(const Vector3D & p0, const Vector3D & p1)const throw (OutsideGeometryException, std::exception );
TGeoManager *_tgeomanager;
TGeoManager *_tgeomanager = nullptr ;
//two points to keep track of what has already been called and in memory at the moment
mutable Vector3D _p0;
mutable Vector3D _p1;
mutable Vector3D _p0{};
mutable Vector3D _p1{};
//containers for data evaluated during tracking in beamOn
//they have to be mutable in order to be changed by beamOn
//beamOn is const otherwise it could not be called,
//but should still be able to change the private variables
mutable std::vector<std::string> _volNames;
mutable std::vector<std::string> _matNames;
mutable std::vector<double> _distance;
mutable std::vector<double> _intLen;
mutable std::vector<double> _radLen;
mutable std::vector<std::string> _volNames{};
mutable std::vector<std::string> _matNames{};
mutable std::vector<double> _distance{};
mutable std::vector<double> _intLen{};
mutable std::vector<double> _radLen{};

}; // class
} // namespace gear
Expand Down
7 changes: 5 additions & 2 deletions include/gear/geartgeo/TGeoGearPointProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ namespace gear {
*/
class TGeoGearPointProperties: public GearPointProperties {

public:
public:
TGeoGearPointProperties(const TGeoGearPointProperties&) = delete ;
TGeoGearPointProperties& operator=(const TGeoGearPointProperties&) = delete ;

TGeoGearPointProperties(TGeoManager *geoMgr);

/// Destructor.
Expand Down Expand Up @@ -91,7 +94,7 @@ class TGeoGearPointProperties: public GearPointProperties {
virtual bool isCalorimeter(const Vector3D & pos) const throw (NotImplementedException, std::exception );

protected:
TGeoManager *_tgeomanager;
TGeoManager *_tgeomanager = nullptr ;

};//class
} // namespace gear
Expand Down
7 changes: 5 additions & 2 deletions include/gear/geartgeo/TGeoGeometryInitializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ namespace gear {
*/
class TGeoGeometryInitializer {

public:
public:
TGeoGeometryInitializer(const TGeoGeometryInitializer&) = delete;
TGeoGeometryInitializer& operator=(const TGeoGeometryInitializer&) = delete;

/// Destructor.
virtual ~TGeoGeometryInitializer() {
;}
Expand All @@ -32,7 +35,7 @@ class TGeoGeometryInitializer {


//static TGeoGeometryInitializer *theInitializer;
TGeoManager *_geoMgr;
TGeoManager *_geoMgr = nullptr ;
}; // class
} // namespace gear
#endif /* ifndef GEAR_TGeoGEOMETRYINITIALIZER_H */
2 changes: 1 addition & 1 deletion include/gear/gearxml/TPCParametersXML.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace gear {
private:
/** An instance of the parser for modules
*/
TPCModuleXML _tpcModuleXML;
TPCModuleXML _tpcModuleXML{};

}; // class
} // namespace gear
Expand Down
2 changes: 1 addition & 1 deletion src/geartgeo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# @author Jan Engels, DESY
########################################

INCLUDE_DIRECTORIES( ${ROOT_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES( SYSTEM ${ROOT_INCLUDE_DIRS} )

# -------- libgeartgeo -------------------------------
AUX_SOURCE_DIRECTORY( . libgeartgeo_srcs )
Expand Down

0 comments on commit 2b5105c

Please sign in to comment.