Skip to content

Commit

Permalink
fix cppcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkenburg committed Feb 23, 2022
1 parent 1bb3801 commit 6e5a6b7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions simulation/g4simulation/g4gdml/PHG4GDMLWriteMaterials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void PHG4GDMLWriteMaterials::PropertyWrite(xercesc::DOMElement* matElement,
std::map<G4int, G4double,
std::less<G4int> >::const_iterator cpos;

for (mpos = pmap->begin(); mpos != pmap->end(); mpos++)
for (mpos = pmap->begin(); mpos != pmap->end(); ++mpos)
{
propElement = NewElement("property");
propElement->setAttributeNode(NewAttribute("name",
Expand All @@ -372,7 +372,7 @@ void PHG4GDMLWriteMaterials::PropertyWrite(xercesc::DOMElement* matElement,
}
}

for (cpos = cmap->begin(); cpos != cmap->end(); cpos++)
for (cpos = cmap->begin(); cpos != cmap->end(); ++cpos)
{
propElement = NewElement("property");
propElement->setAttributeNode(NewAttribute("name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ G4LogicalVolume* PHG4MicromegasDetector::construct_micromegas_tile( int tileid )
struct LayerStruct
{
// constructor
LayerStruct( float thickness, G4Material* material, G4Colour color, double dy, double dz, double y_offset, double z_offset ):
LayerStruct( float thickness, G4Material* material, const G4Colour &color, double dy, double dz, double y_offset, double z_offset ):
m_thickness( thickness ),
m_material( material ),
m_color( color ),
Expand Down Expand Up @@ -479,7 +479,7 @@ G4LogicalVolume* PHG4MicromegasDetector::construct_fee_board( int id )
struct LayerStruct
{
// constructor
LayerStruct( const std::string& name, float thickness, G4Material* material, G4Colour color ):
LayerStruct( const std::string& name, float thickness, G4Material* material, const G4Colour &color ):
m_name( name ),
m_thickness( thickness ),
m_material( material ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PHG4MicromegasDisplayAction : public PHG4DisplayAction
~PHG4MicromegasDisplayAction() override;

void ApplyDisplayAction(G4VPhysicalVolume *physvol) override;
void AddVolume(G4LogicalVolume *logvol, G4Colour col ) { m_LogicalVolumeMap[logvol] = col; }
void AddVolume(G4LogicalVolume *logvol, const G4Colour &col ) { m_LogicalVolumeMap[logvol] = col; }

private:
std::map<G4LogicalVolume *, G4Colour> m_LogicalVolumeMap;
Expand Down
2 changes: 1 addition & 1 deletion simulation/g4simulation/g4tpc/PHG4TpcEndCapDetector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void PHG4TpcEndCapDetector ::CreateCompositeMaterial(
void PHG4TpcEndCapDetector ::AddLayer( //
G4AssemblyVolume *assemblyvol,
G4double &z_start,
std::string _name, //! name base for this layer
const std::string &_name, //! name base for this layer
std::string _material, //! material name in G4
G4double _depth, //! depth in G4 units
double _percentage_filled //! percentage filled//
Expand Down
2 changes: 1 addition & 1 deletion simulation/g4simulation/g4tpc/PHG4TpcEndCapDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class PHG4TpcEndCapDetector : public PHG4Detector
AddLayer( //
G4AssemblyVolume *assmeblyvol,
G4double &z_start,
std::string _name, //! name base for this layer
const std::string &_name, //! name base for this layer
std::string _material, //! material name in G4
G4double _depth, //! depth in G4 units
double _percentage_filled = 100 //! percentage filled//
Expand Down

0 comments on commit 6e5a6b7

Please sign in to comment.