Skip to content

Commit

Permalink
Fix more warnings and allow debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jul 1, 2024
1 parent 3b0eb21 commit 60041d3
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 25 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ INSTALL_DIRECTORY( ./include DESTINATION . FILES_MATCHING PATTERN "*.h" )

# ------- symlinks in include directory for backwards compatibility ---------
# FIXME: this symlinks are needed to build Mokka. Should fix this code in Mokka
INSTALL( CODE "EXEC_PROGRAM( \"${CMAKE_COMMAND}\" \"${CMAKE_INSTALL_PREFIX}/include\" ARGS -E create_symlink gear/gearimpl gearimpl )" )
INSTALL( CODE "EXEC_PROGRAM( \"${CMAKE_COMMAND}\" \"${CMAKE_INSTALL_PREFIX}/include\" ARGS -E create_symlink gear/gearxml gearxml )" )
INSTALL( CODE "EXEC_PROGRAM( \"${CMAKE_COMMAND}\" \"${CMAKE_INSTALL_PREFIX}/include\" ARGS -E create_symlink gear/gearsurf gearsurf )" )
INSTALL( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_PREFIX}/include/gear/gearimpl ${CMAKE_INSTALL_PREFIX}/include/gearimpl )" )
INSTALL( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_PREFIX}/include/gear/gearxml ${CMAKE_INSTALL_PREFIX}/include/gearxml )" )
INSTALL( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_PREFIX}/include/gear/gearsurf ${CMAKE_INSTALL_PREFIX}/include/gearsurf )" )

IF( GEAR_TGEO )
INSTALL( CODE "EXEC_PROGRAM( \"${CMAKE_COMMAND}\" \"${CMAKE_INSTALL_PREFIX}/include\" ARGS -E create_symlink gear/geartgeo geartgeo )" )
INSTALL( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_PREFIX}/include/gear/geartgeo ${CMAKE_INSTALL_PREFIX}/include/geartgeo )" )
ENDIF()


Expand Down
7 changes: 6 additions & 1 deletion include/gear/gearimpl/GearParametersImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ namespace gear {
typedef std::map< std::string, StringVec > StringVecMap ;


GearParametersImpl() = default ;
GearParametersImpl(const GearParametersImpl&) = default ;
GearParametersImpl& operator = (const GearParametersImpl&) = default ;

/// Destructor.
virtual ~GearParametersImpl() ;
virtual ~GearParametersImpl() = default ;


/** Integer value for key.
* @throws UnknownParameterException
Expand Down
4 changes: 3 additions & 1 deletion include/gear/gearimpl/GlobalPadIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class GlobalPadIndex {
public:

GlobalPadIndex(int padIndex, int moduleID);
virtual ~GlobalPadIndex();
virtual ~GlobalPadIndex() = default;
GlobalPadIndex(const GlobalPadIndex&) = default;
GlobalPadIndex& operator=(const GlobalPadIndex&) = default;

bool operator < (const GlobalPadIndex & cmp) const
{
Expand Down
2 changes: 0 additions & 2 deletions include/gear/gearxml/GearParametersXML.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include "gearimpl/GearParametersImpl.h"

#include <string>


namespace gear {

Expand Down
4 changes: 0 additions & 4 deletions src/gearimpl/GearParametersImpl.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#include "gearimpl/GearParametersImpl.h"

#include <algorithm>

namespace gear{

GearParametersImpl::~GearParametersImpl() { /* nop */; }

int GearParametersImpl::getIntVal(const std::string & key) const {

IntMap::const_iterator it = _intMap.find( key ) ;
Expand Down
2 changes: 0 additions & 2 deletions src/gearimpl/GlobalPadIndex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ namespace gear {
_padIndex( padIndex) ,
_moduleID (moduleID) {
}
GlobalPadIndex::~GlobalPadIndex(){
}
int GlobalPadIndex::getPadIndex() const {
return _padIndex;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gearimpl/TPCParametersImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace gear {

// call the assignment operator of the GearParametersImpl mother class:
// *dynamic_cast<GearParametersImpl*>(this) = *dynamic_cast<GearParametersImpl const *>(&right);
GearParametersImpl::operator = (right);
this->operator = (right);
}

/// Destructor.
Expand Down
3 changes: 0 additions & 3 deletions src/gearxml/GearParametersXML.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ namespace gear {

}

~Tokenizer(){
}

std::vector<std::string> & result() {

return _tokens ;
Expand Down
3 changes: 0 additions & 3 deletions src/gearxml/RectangularPadRowLayoutXML.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ namespace gear {
RectangularPadRowLayout* padRowLayout = new RectangularPadRowLayout( xMin, xMax, yMin ) ;

// ----- rows ------------
int rowId = 0 ;

const TiXmlNode* row = 0 ;
while( ( row = xmlElement->IterateChildren( "row", row ) ) != 0 ){

Expand All @@ -103,7 +101,6 @@ namespace gear {

padRowLayout->addRow( nRow, nPad, padWidth, padHeight, rowHeight, leftOffset, rightOffset ) ;

rowId+= nRow ;
}

padRowLayout->repeatRows( repeatRowCount ) ;
Expand Down
6 changes: 4 additions & 2 deletions src/test/testgear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,14 @@ 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 ) {
pl.getRightNeighbour( pl.getPadIndex( iRow , iPad ) ) ;
int ln = pl.getRightNeighbour( pl.getPadIndex( iRow , iPad ) ) ;
(void) ln ;
assert( pl.getPadNumber( ln ) == nPad-1 ) ;
}

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

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

if( j != 0 ) {

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

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

if( j != nPad-1 ) {

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

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

0 comments on commit 60041d3

Please sign in to comment.