Clean up compiler warning.

This commit is contained in:
Jeff Young 2020-03-29 13:22:22 +01:00
parent 41b5872f12
commit 132d4d3ffa
2 changed files with 20 additions and 20 deletions

View File

@ -617,10 +617,10 @@ void NETLIST_OBJECT_LIST::TestforSimilarLabels()
// build global labels and compare // build global labels and compare
std::set<NETLIST_OBJECT*, compare_label_names> loc_labelList; std::set<NETLIST_OBJECT*, compare_label_names> loc_labelList;
for( auto it = uniqueLabelList.begin(); it != uniqueLabelList.end(); ++it ) for( NETLIST_OBJECT* label : uniqueLabelList )
{ {
if( (*it)->IsLabelGlobal() ) if( label->IsLabelGlobal() )
loc_labelList.insert( *it ); loc_labelList.insert( label );
} }
// compare global labels (same label names appears only once in list) // compare global labels (same label names appears only once in list)
@ -702,7 +702,7 @@ static int countIndenticalLabels( std::vector<NETLIST_OBJECT*>& aList, NETLIST_O
if( aRef->IsLabelGlobal() ) if( aRef->IsLabelGlobal() )
{ {
for( auto i : aList) for( NETLIST_OBJECT* i : aList )
{ {
if( i->IsLabelGlobal() && i->m_Label == aRef->m_Label ) if( i->IsLabelGlobal() && i->m_Label == aRef->m_Label )
count++; count++;
@ -710,7 +710,7 @@ static int countIndenticalLabels( std::vector<NETLIST_OBJECT*>& aList, NETLIST_O
} }
else else
{ {
for( auto i : aList) for( NETLIST_OBJECT* i : aList )
{ {
if( i->m_Label == aRef->m_Label && i->m_SheetPath.Path() == aRef->m_SheetPath.Path() ) if( i->m_Label == aRef->m_Label && i->m_SheetPath.Path() == aRef->m_SheetPath.Path() )
count++; count++;

View File

@ -186,8 +186,8 @@ int SCH_EDITOR_CONTROL::UpdateFind( const TOOL_EVENT& aEvent )
} }
SCH_ITEM* SCH_EDITOR_CONTROL::nextMatch( SCH_ITEM* SCH_EDITOR_CONTROL::nextMatch( SCH_SCREEN* aScreen, SCH_ITEM* aAfter,
SCH_SCREEN* aScreen, SCH_ITEM* aAfter, wxFindReplaceData* aData ) wxFindReplaceData* aData )
{ {
bool past_item = true; bool past_item = true;
@ -200,7 +200,7 @@ SCH_ITEM* SCH_EDITOR_CONTROL::nextMatch(
} }
for( auto item : aScreen->Items() ) for( SCH_ITEM* item : aScreen->Items() )
{ {
if( item == aAfter ) if( item == aAfter )
{ {
@ -216,15 +216,15 @@ SCH_ITEM* SCH_EDITOR_CONTROL::nextMatch(
if( item->Type() == SCH_COMPONENT_T ) if( item->Type() == SCH_COMPONENT_T )
{ {
auto cmp = static_cast<SCH_COMPONENT*>( item ); SCH_COMPONENT* cmp = static_cast<SCH_COMPONENT*>( item );
for( auto field : cmp->GetFields() ) for( SCH_FIELD& field : cmp->GetFields() )
{ {
if( field.Matches( *aData, nullptr ) ) if( field.Matches( *aData, nullptr ) )
return &field; return &field;
} }
for( auto pin : cmp->GetSchPins() ) for( SCH_PIN* pin : cmp->GetSchPins() )
{ {
if( pin->Matches( *aData, nullptr ) ) if( pin->Matches( *aData, nullptr ) )
return pin; return pin;
@ -233,7 +233,7 @@ SCH_ITEM* SCH_EDITOR_CONTROL::nextMatch(
if( item->Type() == SCH_SHEET_T ) if( item->Type() == SCH_SHEET_T )
{ {
auto sheet = static_cast<SCH_SHEET*>( item ); SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
for( SCH_FIELD& field : sheet->GetFields() ) for( SCH_FIELD& field : sheet->GetFields() )
{ {
@ -766,7 +766,7 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
if( !screen ) if( !screen )
return 0; return 0;
for( auto item : screen->Items() ) for( SCH_ITEM* item : screen->Items() )
{ {
SCH_CONNECTION* conn = item->Connection( *g_CurrentSheet ); SCH_CONNECTION* conn = item->Connection( *g_CurrentSheet );
bool redraw = item->IsBrightened(); bool redraw = item->IsBrightened();
@ -790,7 +790,7 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
for( LIB_PIN* pin : pins ) for( LIB_PIN* pin : pins )
{ {
auto pin_conn = comp->GetConnectionForPin( pin, *g_CurrentSheet ); SCH_CONNECTION* pin_conn = comp->GetConnectionForPin( pin, *g_CurrentSheet );
if( pin_conn && pin_conn->Name( false ) == selectedNetName ) if( pin_conn && pin_conn->Name( false ) == selectedNetName )
{ {
@ -803,8 +803,8 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
{ {
for( SCH_SHEET_PIN* pin : static_cast<SCH_SHEET*>( item )->GetPins() ) for( SCH_SHEET_PIN* pin : static_cast<SCH_SHEET*>( item )->GetPins() )
{ {
auto pin_conn = pin->Connection( *g_CurrentSheet ); SCH_CONNECTION* pin_conn = pin->Connection( *g_CurrentSheet );
bool redrawPin = pin->IsBrightened(); bool redrawPin = pin->IsBrightened();
if( pin_conn && pin_conn->Name() == selectedNetName ) if( pin_conn && pin_conn->Name() == selectedNetName )
pin->SetBrightened(); pin->SetBrightened();
@ -825,7 +825,7 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
// Be sure highlight change will be redrawn // Be sure highlight change will be redrawn
KIGFX::VIEW* view = getView(); KIGFX::VIEW* view = getView();
for( auto redrawItem : itemsToRedraw ) for( EDA_ITEM* redrawItem : itemsToRedraw )
view->Update( (KIGFX::VIEW_ITEM*)redrawItem, KIGFX::VIEW_UPDATE_FLAGS::REPAINT ); view->Update( (KIGFX::VIEW_ITEM*)redrawItem, KIGFX::VIEW_UPDATE_FLAGS::REPAINT );
m_frame->GetCanvas()->Refresh(); m_frame->GetCanvas()->Refresh();
@ -1055,7 +1055,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
if( destFn.IsRelative() ) if( destFn.IsRelative() )
destFn.MakeAbsolute( m_frame->Prj().GetProjectPath() ); destFn.MakeAbsolute( m_frame->Prj().GetProjectPath() );
for( auto item : paste_screen.Items() ) for( SCH_ITEM* item : paste_screen.Items() )
{ {
loadedItems.push_back( item ); loadedItems.push_back( item );
@ -1063,7 +1063,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
{ {
if( !dropAnnotations && !forceKeepAnnotations ) if( !dropAnnotations && !forceKeepAnnotations )
{ {
for( auto existingItem : m_frame->GetScreen()->Items() ) for( SCH_ITEM* existingItem : m_frame->GetScreen()->Items() )
{ {
if( item->m_Uuid == existingItem->m_Uuid ) if( item->m_Uuid == existingItem->m_Uuid )
{ {
@ -1374,7 +1374,7 @@ int SCH_EDITOR_CONTROL::ToggleHiddenPins( const TOOL_EVENT& aEvent )
{ {
m_frame->SetShowAllPins( !m_frame->GetShowAllPins() ); m_frame->SetShowAllPins( !m_frame->GetShowAllPins() );
auto painter = static_cast<KIGFX::SCH_PAINTER*>( getView()->GetPainter() ); KIGFX::SCH_PAINTER* painter = static_cast<KIGFX::SCH_PAINTER*>( getView()->GetPainter() );
painter->GetSettings()->m_ShowHiddenPins = m_frame->GetShowAllPins(); painter->GetSettings()->m_ShowHiddenPins = m_frame->GetShowAllPins();
getView()->UpdateAllItems( KIGFX::REPAINT ); getView()->UpdateAllItems( KIGFX::REPAINT );