Skip to content

Commit

Permalink
Fix some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored and tmadlener committed Jan 15, 2024
1 parent 4b103d0 commit 2577d40
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
@@ -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. ;
}
}
@@ -188,7 +188,7 @@ namespace gear {
return _rows.at( rowNum ).PhiPad;

}
catch(std::out_of_range){
catch(std::out_of_range const&){
return 0. ;
}
}
6 changes: 3 additions & 3 deletions src/gearimpl/GearMgrImpl.cc
Original file line number Diff line number Diff line change
@@ -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 ;
@@ -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 ;
@@ -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 ;
2 changes: 1 addition & 1 deletion src/gearxml/GearParametersXML.cc
Original file line number Diff line number Diff line change
@@ -233,7 +233,7 @@ namespace gear {

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

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

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

global.SetAttribute( "detectorName" , detName ) ;

3 changes: 3 additions & 0 deletions src/gearxml/tinyxmlparser.cc
Original file line number Diff line number Diff line change
@@ -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]);
4 changes: 2 additions & 2 deletions src/test/testgear.cc
Original file line number Diff line number Diff line change
@@ -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 ) ;
}

4 changes: 2 additions & 2 deletions src/test/testtpcproto.cc
Original file line number Diff line number Diff line change
@@ -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 ) ;
}

0 comments on commit 2577d40

Please sign in to comment.