Fix compil and Coverity warnings.

This commit is contained in:
jean-pierre charras 2022-11-08 11:53:13 +01:00
parent e5d132beec
commit cb3d215b6a
3 changed files with 16 additions and 8 deletions

View File

@ -29,12 +29,18 @@ class JOB_EXPORT_PCB_POS : public JOB
{
public:
JOB_EXPORT_PCB_POS( bool aIsCli ) :
JOB( "pos", aIsCli ), m_filename(),
JOB( "pos", aIsCli ),
m_filename(),
m_outputFile(),
m_excludeFootprintsWithTh( true ),
m_useDrillPlaceFileOrigin( true ),
m_smdOnly( false )
m_smdOnly( false ),
m_excludeFootprintsWithTh( false ),
m_negateBottomX( false )
{
m_side = SIDE::BOTH;
m_units = UNITS::MILLIMETERS;
m_format = FORMAT::ASCII;
m_gerberBoardEdge = true;
}
wxString m_filename;

View File

@ -434,10 +434,9 @@ int PCBNEW_JOBS_HANDLER::JobExportPos( JOB* aJob )
{
PLACEFILE_GERBER_WRITER exporter( brd );
PCB_LAYER_ID gbrLayer;
if( aPosJob->m_side == JOB_EXPORT_PCB_POS::SIDE::FRONT )
gbrLayer = F_Cu;
else if( aPosJob->m_side == JOB_EXPORT_PCB_POS::SIDE::BACK )
PCB_LAYER_ID gbrLayer = F_Cu;
if( aPosJob->m_side == JOB_EXPORT_PCB_POS::SIDE::BACK )
gbrLayer = B_Cu;
exporter.CreatePlaceFile( aPosJob->m_outputFile, gbrLayer, aPosJob->m_gerberBoardEdge );

View File

@ -2485,7 +2485,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
if( !board()->IsLayerVisible( aItem->GetLayer() ) )
return false;
int controlLayer;
int controlLayer = UNDEFINED_LAYER;
switch( static_cast<const FP_TEXT*>( aItem )->GetType() )
{
@ -2494,6 +2494,9 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
case FP_TEXT::TEXT_is_DIVERS: controlLayer = LAYER_MOD_TEXT; break;
}
if( controlLayer == UNDEFINED_LAYER )
return false;
if( !view()->IsLayerVisible( controlLayer ) )
return false;
}