Very minor changes: minor coding style fixes, and 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-12 17:50:42 +02:00
parent f239aee1ad
commit 95962cd2ba
7 changed files with 12 additions and 15 deletions

View File

@ -861,12 +861,12 @@ void PGM_BASE::SetLocalEnvVariables( const ENV_VAR_MAP& aEnvVarMap )
void PGM_BASE::ConfigurePaths( wxWindow* aParent )
{
DIALOG_ENV_VAR_CONFIG dlg( aParent, GetLocalEnvVariables() );
DIALOG_ENV_VAR_CONFIG dlg_envvars( aParent, GetLocalEnvVariables() );
if( dlg.ShowModal() == wxID_CANCEL )
if( dlg_envvars.ShowModal() == wxID_CANCEL )
return;
ENV_VAR_MAP envVarMap = dlg.GetEnvVarMap();
ENV_VAR_MAP envVarMap = dlg_envvars.GetEnvVarMap();
for( ENV_VAR_MAP_ITER it = envVarMap.begin(); it != envVarMap.end(); ++it )
{
@ -878,7 +878,7 @@ void PGM_BASE::ConfigurePaths( wxWindow* aParent )
// If any of the environment variables are defined externally, warn the user that the
// next time kicad is run that the externally defined variables will be used instead of
// the user's settings. This is by design.
if( dlg.ExternalDefsChanged() && m_show_env_var_dialog )
if( dlg_envvars.ExternalDefsChanged() && m_show_env_var_dialog )
{
wxString msg1 = _( "Warning! Some of paths you have configured have been defined \n"
"externally to the running process and will be temporarily overwritten." );
@ -894,5 +894,5 @@ void PGM_BASE::ConfigurePaths( wxWindow* aParent )
m_show_env_var_dialog = !dlg.IsCheckBoxChecked();
}
SetLocalEnvVariables( dlg.GetEnvVarMap() );
SetLocalEnvVariables( dlg_envvars.GetEnvVarMap() );
}

View File

@ -55,7 +55,7 @@ public:
*/
TRANSFORM() : x1( 1 ), y1( 0 ), x2( 0 ), y2( -1 ) {}
TRANSFORM( int x1, int y1, int x2, int y2 ) : x1( x1 ), y1( y1 ), x2( x2 ), y2( y2 ) {}
TRANSFORM( int ax1, int ay1, int ax2, int ay2 ) : x1( ax1 ), y1( ay1 ), x2( ax2 ), y2( ay2 ) {}
TRANSFORM& operator=( const TRANSFORM& aTransform );

View File

@ -238,11 +238,11 @@ public:
class TERMINATE_HANDLER : public wxProcess
{
private:
wxString appName;
wxString m_appName;
public:
TERMINATE_HANDLER( const wxString& appName ) :
appName(appName)
m_appName(appName)
{
}

View File

@ -243,7 +243,7 @@ void KICAD_MANAGER_FRAME::OnExit( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::TERMINATE_HANDLER::OnTerminate( int pid, int status )
{
wxString msg = wxString::Format( _( "%s closed [pid=%d]\n" ),
GetChars( appName ), pid );
GetChars( m_appName ), pid );
wxWindow* window = wxWindow::FindWindowByName( KICAD_MANAGER_FRAME_NAME );

View File

@ -618,8 +618,8 @@ void TREE_PROJECT_FRAME::ReCreateTreePrj()
// Now adding all current files if available
if( prjOpened )
{
wxString pro_dir = wxPathOnly( m_Parent->GetProjectFileName() );
wxDir dir( pro_dir );
pro_dir = wxPathOnly( m_Parent->GetProjectFileName() );
wxDir dir( pro_dir );
if( dir.IsOpened() ) // protected dirs will not open, see "man opendir()"
{

View File

@ -118,7 +118,6 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
filename = openFileDialog.GetPath();
if( ! InsertPageLayoutDescrFile( filename ) )
{
wxString msg;
msg.Printf( _("Unable to load %s file"), GetChars( filename ) );
wxMessageBox( msg );
}
@ -144,7 +143,6 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
filename = openFileDialog.GetPath();
if( ! LoadPageLayoutDescrFile( filename ) )
{
wxString msg;
msg.Printf( _("Unable to load %s file"), GetChars( filename ) );
wxMessageBox( msg );
}
@ -190,7 +188,6 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
if( !SavePageLayoutDescrFile( filename ) )
{
wxString msg;
msg.Printf( _("Unable to create <%s>"), GetChars( filename ) );
wxMessageBox( msg );
}

View File

@ -113,7 +113,7 @@ private:
void OnPaintShowPanel( wxPaintEvent& event );
// Called when corner setup value is changed for rounded rect pads
void onCornerSizePercentChange( wxCommandEvent& event );
void onCornerSizePercentChange( wxCommandEvent& event );
/// Called when a dimension has changed.
/// Update the graphical pad shown in the panel.