Fix some warnings detected by PVS-STUDIO (not used vars)

This commit is contained in:
jean-pierre charras 2022-07-26 11:58:35 +02:00
parent ee0f93ed17
commit 4d48376eae
30 changed files with 8 additions and 48 deletions

View File

@ -124,7 +124,6 @@ bool DIALOG_PRINT_GERBVIEW::TransferDataToWindow()
// Create layer list // Create layer list
for( unsigned ii = 0; ii < images->ImagesMaxCount(); ++ii ) for( unsigned ii = 0; ii < images->ImagesMaxCount(); ++ii )
{ {
wxString layerName;
unsigned int listIdx = itemIdx / LAYER_PER_LIST; unsigned int listIdx = itemIdx / LAYER_PER_LIST;
if( listIdx >= LAYER_LIST_COUNT ) if( listIdx >= LAYER_LIST_COUNT )

View File

@ -115,7 +115,6 @@ bool GERBER_JOBFILE_READER::ReadGerberJobFile()
FILE_LINE_READER jobfileReader( jobFile, m_filename.GetFullPath() ); // Will close jobFile FILE_LINE_READER jobfileReader( jobFile, m_filename.GetFullPath() ); // Will close jobFile
wxString msg;
wxString data; wxString data;
// detect the file format: old (deprecated) gerber format of official JSON format // detect the file format: old (deprecated) gerber format of official JSON format

View File

@ -173,7 +173,6 @@ void PROJECT_TREE_ITEM::Delete()
void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame ) void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame )
{ {
wxString sep = wxFileName::GetPathSeparator();
wxString fullFileName = GetFileName(); wxString fullFileName = GetFileName();
wxTreeItemId id = GetId(); wxTreeItemId id = GetId();
std::string packet; std::string packet;

View File

@ -647,8 +647,6 @@ void PROJECT_TREE_PANE::onRight( wxTreeEvent& Event )
can_delete = item->CanDelete(); can_delete = item->CanDelete();
can_rename = item->CanRename(); can_rename = item->CanRename();
wxString full_file_name = item->GetFileName();
switch( item->GetType() ) switch( item->GetType() )
{ {
case TREE_FILE_TYPE::LEGACY_PROJECT: case TREE_FILE_TYPE::LEGACY_PROJECT:

View File

@ -138,7 +138,6 @@ int KICAD_MANAGER_CONTROL::NewFromTemplate( const TOOL_EVENT& aEvent )
DIALOG_TEMPLATE_SELECTOR* ps = new DIALOG_TEMPLATE_SELECTOR( m_frame ); DIALOG_TEMPLATE_SELECTOR* ps = new DIALOG_TEMPLATE_SELECTOR( m_frame );
wxFileName templatePath; wxFileName templatePath;
wxString envStr;
// KiCad system template path. // KiCad system template path.
ENV_VAR_MAP_CITER it = Pgm().GetLocalEnvVariables().find( "KICAD6_TEMPLATE_DIR" ); ENV_VAR_MAP_CITER it = Pgm().GetLocalEnvVariables().find( "KICAD6_TEMPLATE_DIR" );
@ -212,7 +211,6 @@ int KICAD_MANAGER_CONTROL::NewFromTemplate( const TOOL_EVENT& aEvent )
fn.AppendDir( fn.GetName() ); fn.AppendDir( fn.GetName() );
// Check if the project directory is empty if it already exists. // Check if the project directory is empty if it already exists.
wxDir directory( fn.GetPath() );
if( !fn.DirExists() ) if( !fn.DirExists() )
{ {

View File

@ -40,8 +40,6 @@ void PL_EDITOR_FRAME::ReCreateHToolbar()
m_mainToolBar->SetAuiManager( &m_auimgr ); m_mainToolBar->SetAuiManager( &m_auimgr );
} }
wxString msg;
m_mainToolBar->Add( ACTIONS::doNew ); m_mainToolBar->Add( ACTIONS::doNew );
m_mainToolBar->Add( ACTIONS::open ); m_mainToolBar->Add( ACTIONS::open );
m_mainToolBar->Add( ACTIONS::save ); m_mainToolBar->Add( ACTIONS::save );

View File

@ -146,7 +146,6 @@ void PANEL_CABLE_SIZE::OnCableSizeChange( wxCommandEvent& aEvent )
{ {
double value; double value;
int index = m_sizeChoice->GetSelection(); int index = m_sizeChoice->GetSelection();
wxString str;
if( ( index >= 0 ) && ( index < m_entries.size() ) ) if( ( index >= 0 ) && ( index < m_entries.size() ) )
{ {

View File

@ -41,7 +41,6 @@ PANEL_FUSING_CURRENT::PANEL_FUSING_CURRENT( wxWindow * parent, wxWindowID id,
PANEL_FUSING_CURRENT_BASE( parent, id, pos, size, style, name ) PANEL_FUSING_CURRENT_BASE( parent, id, pos, size, style, name )
{ {
// Set some defaults // Set some defaults
wxString wxs( "" );
m_ambientValue->SetValue( wxString::Format( wxT( "%i" ), 25 ) ); m_ambientValue->SetValue( wxString::Format( wxT( "%i" ), 25 ) );
m_meltingValue->SetValue( wxString::Format( wxT( "%i" ), 1084 ) ); // Value for copper m_meltingValue->SetValue( wxString::Format( wxT( "%i" ), 1084 ) ); // Value for copper
m_meltingValue->SetEditable( false ); // For now, this panel only works for copper. m_meltingValue->SetEditable( false ); // For now, this panel only works for copper.

View File

@ -445,8 +445,6 @@ double PANEL_TRACK_WIDTH::TWCalculateCurrent( double aWidth, double aThickness,
void PANEL_TRACK_WIDTH::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) void PANEL_TRACK_WIDTH::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg )
{ {
wxString msg;
// Disable calculations while we initialise. // Disable calculations while we initialise.
m_TWNested = true; m_TWNested = true;

View File

@ -182,7 +182,6 @@ void E_SERIE::combine4( uint32_t aSize )
{ {
uint32_t i,j; uint32_t i,j;
double tmp; double tmp;
std::string s;
m_results.at( S4R ).e_use = false; // disable 4R solution, until m_results.at( S4R ).e_use = false; // disable 4R solution, until
m_results.at( S4R ).e_value = m_results.at( S3R ).e_value; // 4R becomes better than 3R solution m_results.at( S4R ).e_value = m_results.at( S3R ).e_value; // 4R becomes better than 3R solution

View File

@ -611,11 +611,12 @@ int AR_AUTOPLACER::getOptimalFPPlacement( FOOTPRINT* aFootprint )
{ {
lastPosOK = m_curPosition; lastPosOK = m_curPosition;
min_cost = Score; min_cost = Score;
/*
wxString msg; wxString msg;
/* msg.Printf( wxT( "Score %g, pos %s, %s" ), msg.Printf( wxT( "Score %g, pos %s, %s" ),
min_cost, min_cost,
GetChars( ::CoordinateToString( LastPosOK.x ) ), ::CoordinateToString( LastPosOK.x ),
GetChars( ::CoordinateToString( LastPosOK.y ) ) ); ::CoordinateToString( LastPosOK.y ) );
m_frame->SetStatusText( msg );*/ m_frame->SetStatusText( msg );*/
} }
} }
@ -882,7 +883,6 @@ AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<FOOTPRINT*>& aFootprin
int cnt = 0; int cnt = 0;
wxString msg;
if( m_progressReporter ) if( m_progressReporter )
{ {
@ -900,7 +900,6 @@ AR_RESULT AR_AUTOPLACER::AutoplaceFootprints( std::vector<FOOTPRINT*>& aFootprin
while( ( footprint = pickFootprint() ) != nullptr ) while( ( footprint = pickFootprint() ) != nullptr )
{ {
// Display some info about activity, footprint placement can take a while: // Display some info about activity, footprint placement can take a while:
//m_frame->SetStatusText( msg );
if( m_progressReporter ) if( m_progressReporter )
m_progressReporter->SetTitle( wxString::Format( _( "Autoplacing %s" ), m_progressReporter->SetTitle( wxString::Format( _( "Autoplacing %s" ),

View File

@ -140,7 +140,6 @@ int FROM_TO_CACHE::cacheFromToPaths( const wxString& aFrom, const wxString& aTo
for( FT_PATH& path : paths ) for( FT_PATH& path : paths )
{ {
int count = 0; int count = 0;
auto netName = path.from->GetNetname();
wxString fromName = path.from->GetParent()->GetReference() + wxT( "-" ) wxString fromName = path.from->GetParent()->GetReference() + wxT( "-" )
+ path.from->GetNumber(); + path.from->GetNumber();

View File

@ -300,8 +300,6 @@ void DIALOG_BOARD_REANNOTATE::OnApplyClick( wxCommandEvent& event )
void DIALOG_BOARD_REANNOTATE::MakeSampleText( wxString& aMessage ) void DIALOG_BOARD_REANNOTATE::MakeSampleText( wxString& aMessage )
{ {
wxString tmp;
aMessage.Printf( _( "\n%s footprints will be reannotated." ), aMessage.Printf( _( "\n%s footprints will be reannotated." ),
_( AnnotateString[m_annotationScope] ) ); _( AnnotateString[m_annotationScope] ) );

View File

@ -315,7 +315,6 @@ void DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked( wxCommandEvent& event )
void DIALOG_EXCHANGE_FOOTPRINTS::processMatchingFootprints() void DIALOG_EXCHANGE_FOOTPRINTS::processMatchingFootprints()
{ {
LIB_ID newFPID; LIB_ID newFPID;
wxString value;
if( m_parent->GetBoard()->Footprints().empty() ) if( m_parent->GetBoard()->Footprints().empty() )
return; return;

View File

@ -107,7 +107,6 @@ void DIALOG_FOOTPRINT_WIZARD_LIST::initLists()
FOOTPRINT_WIZARD *wizard = FOOTPRINT_WIZARD_LIST::GetWizard( ii ); FOOTPRINT_WIZARD *wizard = FOOTPRINT_WIZARD_LIST::GetWizard( ii );
wxString name = wizard->GetName(); wxString name = wizard->GetName();
wxString description = wizard->GetDescription(); wxString description = wizard->GetDescription();
wxString image = wizard->GetImage();
m_footprintGeneratorsGrid->SetCellValue( ii, FP_GEN_ROW_NUMBER, num ); m_footprintGeneratorsGrid->SetCellValue( ii, FP_GEN_ROW_NUMBER, num );
m_footprintGeneratorsGrid->SetCellValue( ii, FP_GEN_ROW_NAME, name ); m_footprintGeneratorsGrid->SetCellValue( ii, FP_GEN_ROW_NAME, name );

View File

@ -326,8 +326,6 @@ void DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
void DIALOG_GENDRILL::UpdateDrillParams() void DIALOG_GENDRILL::UpdateDrillParams()
{ {
wxString msg;
// Set output directory and replace backslashes with forward ones // Set output directory and replace backslashes with forward ones
wxString dirStr; wxString dirStr;
dirStr = m_outputDirectoryName->GetValue(); dirStr = m_outputDirectoryName->GetValue();

View File

@ -1245,7 +1245,6 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
wxArrayString error_msgs; wxArrayString error_msgs;
wxArrayString warning_msgs; wxArrayString warning_msgs;
wxString msg;
VECTOR2I pad_size = m_dummyPad->GetSize(); VECTOR2I pad_size = m_dummyPad->GetSize();
VECTOR2I drill_size = m_dummyPad->GetDrillSize(); VECTOR2I drill_size = m_dummyPad->GetDrillSize();
@ -1732,14 +1731,15 @@ void DIALOG_PAD_PROPERTIES::updatePadSizeControls()
bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad ) bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad )
{ {
wxString msg;
if( !Validate() ) if( !Validate() )
return false; return false;
if( !m_panelGeneral->Validate() ) if( !m_panelGeneral->Validate() )
return false; return false;
if( !m_localSettingsPanel->Validate() ) if( !m_localSettingsPanel->Validate() )
return false; return false;
if( !m_spokeWidth.Validate( 0, INT_MAX ) ) if( !m_spokeWidth.Validate( 0, INT_MAX ) )
return false; return false;

View File

@ -419,7 +419,6 @@ void PANEL_SETUP_LAYERS::OnCheckBox( wxCommandEvent& event )
void PANEL_SETUP_LAYERS::DenyChangeCheckBox( wxCommandEvent& event ) void PANEL_SETUP_LAYERS::DenyChangeCheckBox( wxCommandEvent& event )
{ {
wxObject* source = event.GetEventObject(); wxObject* source = event.GetEventObject();
wxString msg;
for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq ) for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq )
{ {

View File

@ -102,7 +102,6 @@ void PANEL_SETUP_RULES::onCharHook( wxKeyEvent& aEvent )
void PANEL_SETUP_RULES::OnContextMenu(wxMouseEvent &event) void PANEL_SETUP_RULES::OnContextMenu(wxMouseEvent &event)
{ {
wxMenu menu; wxMenu menu;
wxString msg;
menu.Append( wxID_UNDO, _( "Undo" ) ); menu.Append( wxID_UNDO, _( "Undo" ) );
menu.Append( wxID_REDO, _( "Redo" ) ); menu.Append( wxID_REDO, _( "Redo" ) );

View File

@ -370,7 +370,7 @@ void IPC356D_WRITER::Write( const wxString& aFilename )
void PCB_EDIT_FRAME::GenD356File( wxCommandEvent& aEvent ) void PCB_EDIT_FRAME::GenD356File( wxCommandEvent& aEvent )
{ {
wxFileName fn = GetBoard()->GetFileName(); wxFileName fn = GetBoard()->GetFileName();
wxString msg, ext, wildcard; wxString ext, wildcard;
ext = IpcD356FileExtension; ext = IpcD356FileExtension;
wildcard = IpcD356FileWildcard(); wildcard = IpcD356FileWildcard();

View File

@ -166,8 +166,6 @@ bool GERBER_JOBFILE_WRITER::CreateJobFile( const wxString& aFullFilename )
void GERBER_JOBFILE_WRITER::addJSONHeader() void GERBER_JOBFILE_WRITER::addJSONHeader()
{ {
wxString text;
m_json["Header"] = { m_json["Header"] = {
{ {
"GenerationSoftware", "GenerationSoftware",

View File

@ -1241,8 +1241,6 @@ void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTe
void FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng( wxCommandEvent& event ) void FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng( wxCommandEvent& event )
{ {
wxString fullFileName;
LIB_ID id = GetLoadedFPID(); LIB_ID id = GetLoadedFPID();
if( id.empty() ) if( id.empty() )

View File

@ -1163,7 +1163,6 @@ void FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList( wxCommandEvent& event )
void FOOTPRINT_VIEWER_FRAME::UpdateTitle() void FOOTPRINT_VIEWER_FRAME::UpdateTitle()
{ {
wxString title; wxString title;
wxString path;
if( !getCurNickname().IsEmpty() ) if( !getCurNickname().IsEmpty() )
{ {

View File

@ -1084,8 +1084,6 @@ void PCB_DIM_LEADER::updateGeometry()
void PCB_DIM_LEADER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) void PCB_DIM_LEADER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{ {
wxString msg;
aList.emplace_back( _( "Leader" ), m_text.GetShownText() ); aList.emplace_back( _( "Leader" ), m_text.GetShownText() );
ORIGIN_TRANSFORMS originTransforms = aFrame->GetOriginTransforms(); ORIGIN_TRANSFORMS originTransforms = aFrame->GetOriginTransforms();

View File

@ -852,8 +852,6 @@ void PCB_VIA::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
void PCB_TRACK::GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame, void PCB_TRACK::GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame,
std::vector<MSG_PANEL_ITEM>& aList ) const std::vector<MSG_PANEL_ITEM>& aList ) const
{ {
wxString msg;
aList.emplace_back( _( "Net" ), UnescapeString( GetNetname() ) ); aList.emplace_back( _( "Net" ), UnescapeString( GetNetname() ) );
aList.emplace_back( _( "Net Class" ), UnescapeString( GetNetClass()->GetName() ) ); aList.emplace_back( _( "Net Class" ), UnescapeString( GetNetClass()->GetName() ) );

View File

@ -117,7 +117,6 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::CallRetArrayStrMethod( const char* aMet
PyObject* aArglist ) PyObject* aArglist )
{ {
wxArrayString ret; wxArrayString ret;
wxString str_item;
PyLOCK lock; PyLOCK lock;
PyObject* result = CallMethod( aMethod, aArglist ); PyObject* result = CallMethod( aMethod, aArglist );

View File

@ -260,7 +260,6 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat,
wxFileName pro = aFileName; wxFileName pro = aFileName;
pro.SetExt( ProjectFileExtension ); pro.SetExt( ProjectFileExtension );
pro.MakeAbsolute(); pro.MakeAbsolute();
wxString projectPath = pro.GetFullPath();
GetSettingsManager()->SaveProjectAs( pro.GetFullPath(), aBoard->GetProject() ); GetSettingsManager()->SaveProjectAs( pro.GetFullPath(), aBoard->GetProject() );
} }

View File

@ -54,8 +54,6 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->SetAuiManager( &m_auimgr ); m_mainToolBar->SetAuiManager( &m_auimgr );
} }
wxString msg;
// Set up toolbar // Set up toolbar
m_mainToolBar->Add( PCB_ACTIONS::newFootprint ); m_mainToolBar->Add( PCB_ACTIONS::newFootprint );
m_mainToolBar->Add( PCB_ACTIONS::createFootprint ); m_mainToolBar->Add( PCB_ACTIONS::createFootprint );

View File

@ -367,8 +367,6 @@ int FOOTPRINT_EDITOR_CONTROL::PasteFootprint( const TOOL_EVENT& aEvent )
int FOOTPRINT_EDITOR_CONTROL::DuplicateFootprint( const TOOL_EVENT& aEvent ) int FOOTPRINT_EDITOR_CONTROL::DuplicateFootprint( const TOOL_EVENT& aEvent )
{ {
LIB_ID fpID = m_frame->GetTreeFPID(); LIB_ID fpID = m_frame->GetTreeFPID();
wxString libraryName = fpID.GetLibNickname();
wxString footprintName = fpID.GetLibItemName();
FOOTPRINT* footprint; FOOTPRINT* footprint;
if( fpID == m_frame->GetLoadedFPID() ) if( fpID == m_frame->GetLoadedFPID() )

View File

@ -332,7 +332,6 @@ bool S3D_RESOLVER::addPath( const SEARCH_PATH& aPath )
#endif #endif
} }
wxString pname = path.GetPath();
std::list< SEARCH_PATH >::iterator sPL = m_Paths.begin(); std::list< SEARCH_PATH >::iterator sPL = m_Paths.begin();
std::list< SEARCH_PATH >::iterator ePL = m_Paths.end(); std::list< SEARCH_PATH >::iterator ePL = m_Paths.end();