Skip to content

Commit

Permalink
Fix some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jul 15, 2023
1 parent 2658a68 commit d08be62
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/gearimpl/FixedPadSizeDiskLayout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ namespace gear {
return _padWidth / _rows.at( rowNum ).RCenter ;

}
catch(std::out_of_range){
catch(std::out_of_range const&){
return 0. ;
}
}
Expand All @@ -188,7 +188,7 @@ namespace gear {
return _rows.at( rowNum ).PhiPad;

}
catch(std::out_of_range){
catch(std::out_of_range const&){
return 0. ;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/gearimpl/GearMgrImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ namespace gear{

lcalParameters->getDoubleVal("beam_crossing_angle") ;

}catch( UnknownParameterException ){
}catch( UnknownParameterException const& ){

std::cout << "WARNING GearMgrImpl::setLcalParameters: added "
" missing parameter beam_crossing_angle 0.0 ! " << std::endl ;
Expand All @@ -488,7 +488,7 @@ namespace gear{

lhcalParameters->getDoubleVal("beam_crossing_angle") ;

}catch( UnknownParameterException ){
}catch( UnknownParameterException const& ){

std::cout << "WARNING GearMgrImpl::setLHcalParameters: added "
" missing parameter beam_crossing_angle 0.0 ! " << std::endl ;
Expand All @@ -509,7 +509,7 @@ namespace gear{

beamcalParameters->getDoubleVal("beam_crossing_angle") ;

}catch( UnknownParameterException ){
}catch( UnknownParameterException const& ){

std::cout << "WARNING GearMgrImpl::setBeamCalParameters: added "
" missing parameter beam_crossing_angle 0.0 ! " << std::endl ;
Expand Down
2 changes: 1 addition & 1 deletion src/gearxml/GearParametersXML.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ namespace gear {

value = getXMLAttribute( par , "value" ) ;
}
catch( ParseException ) {
catch( ParseException const& ) {

if( par->FirstChild() )
value = par->FirstChild()->Value() ;
Expand Down
2 changes: 1 addition & 1 deletion src/gearxml/GearXML.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace gear{

try{ detName = mgr->getDetectorName() ;
}
catch( UnknownParameterException ){}
catch( UnknownParameterException const& ){}

global.SetAttribute( "detectorName" , detName ) ;

Expand Down
3 changes: 3 additions & 0 deletions src/gearxml/tinyxmlparser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,17 @@ void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* leng
--output;
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
input >>= 6;
[[fallthrough]];
case 3:
--output;
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
input >>= 6;
[[fallthrough]];
case 2:
--output;
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
input >>= 6;
[[fallthrough]];
case 1:
--output;
*output = (char)(input | FIRST_BYTE_MARK[*length]);
Expand Down
4 changes: 2 additions & 2 deletions src/test/testgear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ void testFixedPadSizeDiskLayout( const FixedPadSizeDiskLayout& pl ) {
// in the other implementations, because there are pads at the edge of the pad plane
// which have no neighbour.
if( j == 0 ) {
int ln = pl.getRightNeighbour( pl.getPadIndex( iRow , iPad ) ) ;
pl.getRightNeighbour( pl.getPadIndex( iRow , iPad ) ) ;
assert( pl.getPadNumber( ln ) == nPad-1 ) ;
}

if( j == nPad-1 ) {
int rn = pl.getLeftNeighbour( pl.getPadIndex( iRow , iPad ) ) ;
pl.getLeftNeighbour( pl.getPadIndex( iRow , iPad ) ) ;
assert( pl.getPadNumber( rn ) == 0 ) ;
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/testtpcproto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ void testRectangularPadRowLayout( const RectangularPadRowLayout& pl ) {

if( j != 0 ) {

int ln = pl.getLeftNeighbour( pl.getPadIndex( iRow , iPad ) ) ;
pl.getLeftNeighbour( pl.getPadIndex( iRow , iPad ) ) ;

assert( pl.getPadNumber( ln ) == iPad - 1 ) ;
}

if( j != nPad-1 ) {

int rn = pl.getRightNeighbour( pl.getPadIndex( iRow , iPad ) ) ;
pl.getRightNeighbour( pl.getPadIndex( iRow , iPad ) ) ;

assert( pl.getPadNumber( rn ) == iPad + 1 ) ;
}
Expand Down

0 comments on commit d08be62

Please sign in to comment.