Very minor changes: remove a few local shadowed variables (mainly local variables having the same name in the same function) detected using " -Wshadow" gcc compil option ( No bug, just a better code readability )

This commit is contained in:
jean-pierre charras 2016-04-16 11:57:42 +02:00
parent 698197ec8d
commit f0e2628e40
6 changed files with 23 additions and 26 deletions

View File

@ -245,7 +245,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles( const std::string& aNetlist )
}
catch( const IO_ERROR& ioe )
{
wxString msg = ioe.errorText;
msg = ioe.errorText;
msg += wxT( "\n\n" );
msg += _( "First check your footprint library table entries." );

View File

@ -57,7 +57,6 @@ bool NETLIST_EXPORTER_PSPICE::WriteNetlist( const wxString& aOutFileName, unsign
if( ( f = wxFopen( aOutFileName, wxT( "wt" ) ) ) == NULL )
{
wxString msg;
msg.Printf( _( "Failed to create file '%s'" ),
GetChars( aOutFileName ) );
DisplayError( NULL, msg );
@ -162,13 +161,14 @@ bool NETLIST_EXPORTER_PSPICE::WriteNetlist( const wxString& aOutFileName, unsign
m_ReferencesAlreadyFound.Clear();
for( unsigned i = 0; i < sheetList.size(); i++ )
for( unsigned sheet_idx = 0; sheet_idx < sheetList.size(); sheet_idx++ )
{
ret |= fprintf( f, "* Sheet Name: %s\n", TO_UTF8( sheetList[i].PathHumanReadable() ) );
ret |= fprintf( f, "* Sheet Name: %s\n",
TO_UTF8( sheetList[sheet_idx].PathHumanReadable() ) );
for( EDA_ITEM* item = sheetList[i].LastDrawList(); item; item = item->Next() )
for( EDA_ITEM* item = sheetList[sheet_idx].LastDrawList(); item; item = item->Next() )
{
SCH_COMPONENT* comp = findNextComponentAndCreatePinList( item, &sheetList[i] );
SCH_COMPONENT* comp = findNextComponentAndCreatePinList( item, &sheetList[sheet_idx] );
if( !comp )
break;
@ -235,7 +235,7 @@ bool NETLIST_EXPORTER_PSPICE::WriteNetlist( const wxString& aOutFileName, unsign
}
//Get Standard Reference Designator:
wxString RefName = comp->GetRef( &sheetList[i] );
wxString RefName = comp->GetRef( &sheetList[sheet_idx] );
//Conditionally add Prefix only for devices that begin with U or IC:
if( aUsePrefix )
@ -314,14 +314,14 @@ bool NETLIST_EXPORTER_PSPICE::WriteNetlist( const wxString& aOutFileName, unsign
ret |= fprintf( f, " %s\t\t",TO_UTF8( CompValue ) );
// Show Seq Spec on same line as component using line-comment ";":
for( unsigned i = 0; i < pinSequence.size(); ++i )
for( unsigned ii = 0; ii < pinSequence.size(); ++ii )
{
if( i==0 )
if( ii == 0 )
ret |= fprintf( f, ";Node Sequence Spec.<" );
ret |= fprintf( f, "%s", TO_UTF8( stdPinNameArray.Item( pinSequence[i] ) ) );
ret |= fprintf( f, "%s", TO_UTF8( stdPinNameArray.Item( pinSequence[ii] ) ) );
if( i < pinSequence.size()-1 )
if( ii < pinSequence.size()-1 )
ret |= fprintf( f, "," );
else
ret |= fprintf( f, ">" );

View File

@ -1157,7 +1157,6 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
// Remark: avoid using sscanf to read texts entered by user
// which are UTF8 encoded, because sscanf does not work well on Windows
// with some UTF8 values.
int ii;
char name1[256], char1[256], char2[256], char3[256];
int newfmt = 0;
char* ptcar;
@ -1377,7 +1376,7 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
GetField( fieldNdx )->SetText( fieldText );
memset( char3, 0, sizeof(char3) );
int x, y, w, attr;
int ii, x, y, w, attr;
if( ( ii = sscanf( ptcar, "%255s %d %d %d %X %255s %255s", char1, &x, &y, &w, &attr,
char2, char3 ) ) < 4 )

View File

@ -167,7 +167,7 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
for( int ii = 0; ii < parts_count; ii++ )
{
wxString msg = wxString::Format( _( "Unit %c" ), 'A' + ii );
msg.Printf( _( "Unit %c" ), 'A' + ii );
m_selpartBox->Append( msg );
}

View File

@ -201,8 +201,7 @@ void COAX::synthesize()
*/
void COAX::show_results()
{
double fc;
short m, n;
int m, n;
char text[256], txt[256];
atten_dielectric = alphad_coax() * l;

View File

@ -175,20 +175,20 @@ void PCB_CALCULATOR_FRAME::TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType
m_Message7, NULL
};
unsigned ii = 0;
for( ; ii < tr_ident->m_Messages.GetCount(); ii++ )
unsigned jj = 0;
for( ; jj < tr_ident->m_Messages.GetCount(); jj++ )
{
if( left_msg_list[ii] == NULL )
if( left_msg_list[jj] == NULL )
break;
left_msg_list[ii]->SetLabel( tr_ident->m_Messages[ii] );
msg_list[ii]->SetLabel( wxEmptyString );
left_msg_list[jj]->SetLabel( tr_ident->m_Messages[jj] );
msg_list[jj]->SetLabel( wxEmptyString );
}
while( left_msg_list[ii] )
while( left_msg_list[jj] )
{
left_msg_list[ii]->SetLabel( wxEmptyString );
msg_list[ii]->SetLabel( wxEmptyString );
ii++;
left_msg_list[jj]->SetLabel( wxEmptyString );
msg_list[jj]->SetLabel( wxEmptyString );
jj++;
}
// Init parameters dialog items
@ -286,7 +286,6 @@ void PCB_CALCULATOR_FRAME::TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType
data->unit->Enable( prm->m_ConvUnit );
data->unit->SetSelection( prm->m_UnitSelection );
}
}
// Clear all unused params