Fix a few shadowed local vars which make the code not so easy to analyze.

This commit is contained in:
jean-pierre charras 2016-04-29 13:10:31 +02:00
parent f532057d05
commit 8c76b92fa9
4 changed files with 11 additions and 15 deletions

View File

@ -5,8 +5,8 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -167,7 +167,6 @@ bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName )
} }
else else
{ {
wxFileName filename = aFullFileName;
filenamesList.Add( aFullFileName ); filenamesList.Add( aFullFileName );
currentPath = filename.GetPath(); currentPath = filename.GetPath();
m_mruPath = currentPath; m_mruPath = currentPath;
@ -178,7 +177,7 @@ bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName )
for( unsigned ii = 0; ii < filenamesList.GetCount(); ii++ ) for( unsigned ii = 0; ii < filenamesList.GetCount(); ii++ )
{ {
wxFileName filename = filenamesList[ii]; filename = filenamesList[ii];
if( !filename.IsAbsolute() ) if( !filename.IsAbsolute() )
filename.SetPath( currentPath ); filename.SetPath( currentPath );
@ -252,7 +251,6 @@ bool GERBVIEW_FRAME::LoadExcellonFiles( const wxString& aFullFileName )
} }
else else
{ {
wxFileName filename = aFullFileName;
filenamesList.Add( aFullFileName ); filenamesList.Add( aFullFileName );
currentPath = filename.GetPath(); currentPath = filename.GetPath();
m_mruPath = currentPath; m_mruPath = currentPath;
@ -263,7 +261,7 @@ bool GERBVIEW_FRAME::LoadExcellonFiles( const wxString& aFullFileName )
for( unsigned ii = 0; ii < filenamesList.GetCount(); ii++ ) for( unsigned ii = 0; ii < filenamesList.GetCount(); ii++ )
{ {
wxFileName filename = filenamesList[ii]; filename = filenamesList[ii];
if( !filename.IsAbsolute() ) if( !filename.IsAbsolute() )
filename.SetPath( currentPath ); filename.SetPath( currentPath );

View File

@ -158,7 +158,7 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::Init()
EDA_COLOR_T layerColor = board->GetLayerColor( layer ); EDA_COLOR_T layerColor = board->GetLayerColor( layer );
imageList->Add( makeLayerBitmap( layerColor ) ); imageList->Add( makeLayerBitmap( layerColor ) );
wxString msg = board->GetLayerName( layer ); msg = board->GetLayerName( layer );
msg.Trim(); msg.Trim();
int itemIndex = m_LayerSelectionCtrl->InsertItem( int itemIndex = m_LayerSelectionCtrl->InsertItem(

View File

@ -226,8 +226,6 @@ void DIALOG_PRINT_USING_PRINTER::initValues( )
for( seq.Rewind(); seq; ++seq ) for( seq.Rewind(); seq; ++seq )
{ {
LAYER_ID layer = *seq; LAYER_ID layer = *seq;
wxString layerKey;
bool option; bool option;
layerKey.Printf( OPTKEY_LAYERBASE, layer ); layerKey.Printf( OPTKEY_LAYERBASE, layer );

View File

@ -446,7 +446,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IO_ERROR )
NET_OUTS& net_outs = session->route->net_outs; NET_OUTS& net_outs = session->route->net_outs;
for( NET_OUTS::iterator net = net_outs.begin(); net!=net_outs.end(); ++net ) for( NET_OUTS::iterator net = net_outs.begin(); net!=net_outs.end(); ++net )
{ {
int netCode = 0; int netoutCode = 0;
// page 143 of spec says wire's net_id is optional // page 143 of spec says wire's net_id is optional
if( net->net_id.size() ) if( net->net_id.size() )
@ -455,7 +455,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IO_ERROR )
NETINFO_ITEM* netinfo = aBoard->FindNet( netName ); NETINFO_ITEM* netinfo = aBoard->FindNet( netName );
if( netinfo ) if( netinfo )
netCode = netinfo->GetNet(); netoutCode = netinfo->GetNet();
else // else netCode remains 0 else // else netCode remains 0
{ {
// int breakhere = 1; // int breakhere = 1;
@ -496,7 +496,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IO_ERROR )
} }
*/ */
TRACK* track = makeTRACK( path, pt, netCode ); TRACK* track = makeTRACK( path, pt, netoutCode );
aBoard->Add( track ); aBoard->Add( track );
} }
} }
@ -512,10 +512,10 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IO_ERROR )
if( net->net_id.size() ) if( net->net_id.size() )
{ {
wxString netName = FROM_UTF8( net->net_id.c_str() ); wxString netName = FROM_UTF8( net->net_id.c_str() );
NETINFO_ITEM* netvia = aBoard->FindNet( netName );
NETINFO_ITEM* net = aBoard->FindNet( netName ); if( netvia )
if( net ) netCode = netvia->GetNet();
netCode = net->GetNet();
// else netCode remains 0 // else netCode remains 0
} }