Coverity cleanup and remove unused variables
This commit is contained in:
parent
65bd1ee9a4
commit
89dcc46898
|
@ -268,7 +268,6 @@ int COMMON_TOOLS::doZoomFit( ZOOM_FIT_TYPE_T aFitType )
|
|||
|
||||
BOX2I bBox = frame->GetDocumentExtents();
|
||||
BOX2I defaultBox = canvas->GetDefaultViewBBox();
|
||||
VECTOR2D scrollbarSize = VECTOR2D( canvas->GetSize() - canvas->GetClientSize() );
|
||||
|
||||
view->SetScale( 1.0 ); // The best scale will be determined later, but this initial
|
||||
// value ensures all view parameters are up to date (especially
|
||||
|
@ -277,7 +276,6 @@ int COMMON_TOOLS::doZoomFit( ZOOM_FIT_TYPE_T aFitType )
|
|||
|
||||
// Currently "Zoom to Objects" is only supported on Eeschema. Support for other
|
||||
// programs in the suite can be added as needed.
|
||||
|
||||
if( aFitType == ZOOM_FIT_OBJECTS )
|
||||
{
|
||||
if( frame->IsType( FRAME_SCH ) )
|
||||
|
@ -287,7 +285,6 @@ int COMMON_TOOLS::doZoomFit( ZOOM_FIT_TYPE_T aFitType )
|
|||
}
|
||||
|
||||
// If the screen is empty then use the default view bbox
|
||||
|
||||
if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
|
||||
bBox = defaultBox;
|
||||
|
||||
|
@ -302,7 +299,6 @@ int COMMON_TOOLS::doZoomFit( ZOOM_FIT_TYPE_T aFitType )
|
|||
{
|
||||
case ZOOM_FIT_ALL:
|
||||
// Leave a bigger margin for library editors & viewers
|
||||
|
||||
if( frame->IsType( FRAME_FOOTPRINT_VIEWER ) || frame->IsType( FRAME_FOOTPRINT_VIEWER_MODAL )
|
||||
|| frame->IsType( FRAME_SCH_VIEWER ) || frame->IsType( FRAME_SCH_VIEWER_MODAL ) )
|
||||
{
|
||||
|
|
|
@ -343,7 +343,7 @@ int ERC_TESTER::TestMultiunitFootprints()
|
|||
const wxString secondFp = secondRef.GetFootprint();
|
||||
wxString msg;
|
||||
|
||||
if( !secondFp.IsEmpty() && unitFP != secondFp )
|
||||
if( unit && !secondFp.IsEmpty() && unitFP != secondFp )
|
||||
{
|
||||
msg.Printf( _( "Different footprints assigned to %s and %s" ),
|
||||
unitName, secondName );
|
||||
|
|
|
@ -2117,7 +2117,7 @@ wxString BOARD::GroupsSanityCheckInternal( bool repair )
|
|||
// This check of childIdx should never fail, because if a group
|
||||
// is not found in the groups list, then the board.GetItem()
|
||||
// check above should have failed.
|
||||
wxCHECK( childIdx >= 0 && childIdx < groups.size(),
|
||||
wxCHECK( childIdx < groups.size(),
|
||||
wxString::Format( "Group %s not found in groups list",
|
||||
item->m_Uuid.AsString() ) );
|
||||
wxCHECK( parentGroupIdx[childIdx] == -1,
|
||||
|
|
|
@ -671,7 +671,6 @@ void VIA::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>&
|
|||
wxString msg;
|
||||
wxString msg2;
|
||||
wxString source;
|
||||
BOARD* board = GetBoard();
|
||||
|
||||
// Display basic infos
|
||||
switch( GetViaType() )
|
||||
|
|
|
@ -402,6 +402,8 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent )
|
|||
{
|
||||
MARKER_PCB* marker = dynamic_cast<MARKER_PCB*>( node->m_RcItem->GetParent() );
|
||||
|
||||
if( marker )
|
||||
{
|
||||
marker->SetExcluded( false );
|
||||
m_brdEditor->GetCanvas()->GetView()->Update( marker );
|
||||
|
||||
|
@ -409,12 +411,15 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent )
|
|||
static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->ValueChanged( node );
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
{
|
||||
MARKER_PCB* marker = dynamic_cast<MARKER_PCB*>( node->m_RcItem->GetParent() );
|
||||
|
||||
if( marker )
|
||||
{
|
||||
marker->SetExcluded( true );
|
||||
m_brdEditor->GetCanvas()->GetView()->Update( marker );
|
||||
|
||||
|
@ -426,6 +431,7 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent )
|
|||
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
|
|
@ -554,7 +554,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRulesForItems( DRC_CONSTRAINT_TYPE_T aConstraintI
|
|||
// Unfortunately implicit rules don't work for local clearances (such as zones) because
|
||||
// they have to be max'ed with netclass values (which are already implicit rules), and our
|
||||
// rule selection paradigm is "winner takes all".
|
||||
if( aConstraintId == DRC_CONSTRAINT_TYPE_CLEARANCE && implicit )
|
||||
if( constraintRef && aConstraintId == DRC_CONSTRAINT_TYPE_CLEARANCE && implicit )
|
||||
{
|
||||
int global = constraintRef->m_Value.Min();
|
||||
int localA = connectedA ? connectedA->GetLocalClearance( nullptr ) : 0;
|
||||
|
|
|
@ -532,7 +532,10 @@ int CONVERT_TOOL::SegmentToArc( const TOOL_EVENT& aEvent )
|
|||
BOARD_ITEM_CONTAINER* parent = frame->GetModel();
|
||||
|
||||
BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( source );
|
||||
wxASSERT( boardItem );
|
||||
|
||||
// Don't continue processing if we don't actually have a board item
|
||||
if( !boardItem )
|
||||
return 0;
|
||||
|
||||
PCB_LAYER_ID layer = boardItem->GetLayer();
|
||||
|
||||
|
|
|
@ -208,6 +208,7 @@ void DRC_TOOL::RunTests( PROGRESS_REPORTER* aProgressReporter, bool aTestTracksA
|
|||
m_drcEngine->SetProgressReporter( nullptr );
|
||||
m_drcEngine->ClearViolationHandler();
|
||||
|
||||
if( m_drcDialog )
|
||||
m_drcDialog->SetDrcRun();
|
||||
|
||||
if( !netlist.IsEmpty() )
|
||||
|
|
|
@ -294,10 +294,9 @@ int PCB_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
|||
r->Report( _( "Items belong to the same net. Clearance is 0." ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
else if( ac )
|
||||
{
|
||||
// Different nets (or second unconnected)....
|
||||
|
||||
reportCopperClearance( layer, ac, b, r );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2173,7 +2173,7 @@ void APPEARANCE_CONTROLS::onLayerPresetChanged( wxCommandEvent& aEvent )
|
|||
|
||||
m_lastSelectedUserPreset = ( !preset || preset->readOnly ) ? nullptr : preset;
|
||||
|
||||
if( !preset )
|
||||
if( preset )
|
||||
doApplyLayerPreset( *preset );
|
||||
|
||||
if( !m_currentPreset->name.IsEmpty() )
|
||||
|
|
|
@ -161,27 +161,35 @@ public:
|
|||
|
||||
APPEARANCE_SETTING( const wxString& aLabel, int aId,
|
||||
const wxString& aTooltip = wxEmptyString,
|
||||
bool aCanControlOpacity = false )
|
||||
bool aCanControlOpacity = false ) :
|
||||
id( aId ),
|
||||
label( aLabel ),
|
||||
tooltip( aTooltip ),
|
||||
visible( true ),
|
||||
can_control_opacity( aCanControlOpacity ),
|
||||
spacer( false ),
|
||||
ctl_panel( nullptr ),
|
||||
ctl_indicator( nullptr ),
|
||||
ctl_visibility( nullptr ),
|
||||
ctl_color( nullptr ),
|
||||
ctl_text( nullptr ),
|
||||
ctl_opacity( nullptr )
|
||||
{
|
||||
label = aLabel;
|
||||
id = aId;
|
||||
tooltip = aTooltip;
|
||||
spacer = false;
|
||||
visible = true;
|
||||
|
||||
can_control_opacity = aCanControlOpacity;
|
||||
|
||||
ctl_panel = nullptr;
|
||||
ctl_indicator = nullptr;
|
||||
ctl_visibility = nullptr;
|
||||
ctl_color = nullptr;
|
||||
ctl_text = nullptr;
|
||||
ctl_opacity = nullptr;
|
||||
}
|
||||
|
||||
APPEARANCE_SETTING() :
|
||||
id( -1 ), label( "" ), tooltip( "" ), visible( false ),
|
||||
can_control_opacity( false ), spacer( true )
|
||||
id( -1 ),
|
||||
label( "" ),
|
||||
tooltip( "" ),
|
||||
visible( false ),
|
||||
can_control_opacity( false ),
|
||||
spacer( true ),
|
||||
ctl_panel( nullptr ),
|
||||
ctl_indicator( nullptr ),
|
||||
ctl_visibility( nullptr ),
|
||||
ctl_color( nullptr ),
|
||||
ctl_text( nullptr ),
|
||||
ctl_opacity( nullptr )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue