Remove some unused variables.

This commit is contained in:
Alex Shvartzkop 2025-07-02 16:48:26 +03:00
parent 5ab735eb93
commit 4a5039c2cf
43 changed files with 29 additions and 104 deletions

View File

@ -134,7 +134,6 @@ void ARRAY_AXIS::SetStep( int aStep )
wxString ARRAY_AXIS::GetItemNumber( int n ) const
{
wxString itemNum;
const wxString& alphabet = GetAlphabet();
const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( m_type );

View File

@ -254,8 +254,7 @@ bool PROJECT_ARCHIVER::Archive( const wxString& aSrcDir, const wxString& aDestFi
wxZipOutputStream zipstream( ostream, -1, wxConvUTF8 );
wxDir projectDir( aSrcDir );
wxString currFilename;
wxDir projectDir( aSrcDir );
if( !projectDir.IsOpened() )
{

View File

@ -1273,8 +1273,6 @@ bool SETTINGS_MANAGER::BackupProject( REPORTER& aReporter, wxFileName& aTarget )
aTarget.SetExt( FILEEXT::ArchiveFileExtension );
}
wxString test = aTarget.GetPath();
if( !aTarget.DirExists() && !wxMkdir( aTarget.GetPath() ) )
{
wxLogTrace( traceSettings, wxT( "Could not create project backup path %s" ),

View File

@ -151,8 +151,7 @@ LIB_TREE::LIB_TREE( wxWindow* aParent, const wxString& aRecentSearchesKey, LIB_T
m_query_ctrl->Bind( wxEVT_MENU,
[this]( wxCommandEvent& aEvent )
{
wxString search;
size_t idx = aEvent.GetId() - 1;
size_t idx = aEvent.GetId() - 1;
if( idx < g_recentSearches[ m_recentSearchesKey ].size() )
m_query_ctrl->SetValue( g_recentSearches[ m_recentSearchesKey ][idx] );

View File

@ -1030,9 +1030,7 @@ void CVPCB_MAINFRAME::BuildLibrariesList()
if( tbl )
{
wxArrayString libNames;
std::vector< wxString > libNickNames = tbl->GetLogicalLibs();
std::vector<wxString> libNickNames = tbl->GetLogicalLibs();
for( const wxString& libNickName : libNickNames )
process( libNickName );

View File

@ -525,7 +525,6 @@ int DIALOG_CHANGE_SYMBOLS::processMatchingSymbols( SCH_COMMIT* aCommit )
wxCHECK( frame, false );
LIB_ID newId;
wxString msg;
int matchesProcessed = 0;
SCH_SYMBOL* symbol = nullptr;

View File

@ -101,9 +101,6 @@ static COL_ORDER GetColTypeForString( const wxString& aStr )
{
for( int i = 0; i < COL_COUNT; i++ )
{
const wxString nativeLabel = GetPinTableColLabel( i );
const wxString translatedLabel = wxGetTranslation( nativeLabel );
if( MatchTranslationOrNative( aStr, GetPinTableColLabel( i ), false ) )
return (COL_ORDER) i;
}

View File

@ -63,8 +63,6 @@ DIALOG_TABLE_PROPERTIES::DIALOG_TABLE_PROPERTIES( SCH_EDIT_FRAME* aFrame, SCH_TA
m_gridSizer->Add( m_grid, 1, wxEXPAND, 5 );
m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) );
wxColor coveredColor = wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT );
for( int row = 0; row < m_table->GetRowCount(); ++row )
{
for( int col = 0; col < m_table->GetColCount(); ++col )

View File

@ -207,7 +207,6 @@ void SCH_EDIT_FRAME::MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemI
wxCHECK( connectionGraph, /* void */ );
wxString sheetPathPrefix;
std::set<CONNECTION_SUBGRAPH*> subgraphs;
{

View File

@ -41,10 +41,7 @@ bool NETLIST_EXPORTER_ALLEGRO::WriteNetlist( const wxString& aOutFileName,
REPORTER& aReporter )
{
m_f = nullptr;
wxString field;
wxString footprint;
int ret = 0; // zero now, OR in the sign bit on error
wxString netName;
int ret = 0; // zero now, OR in the sign bit on error
// Create the devices directory
m_exportPath = wxFileName( aOutFileName ).GetPath( wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR )
@ -188,10 +185,6 @@ void NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo()
}
}
wxString netCodeTxt;
wxString netName;
wxString ref;
struct NET_RECORD
{
NET_RECORD( const wxString& aName ) :
@ -275,7 +268,6 @@ void NETLIST_EXPORTER_ALLEGRO::extractComponentsInfo()
for( const NET_NODE& netNode : net_record->m_Nodes )
{
wxString refText = netNode.m_Pin->GetParentSymbol()->GetRef( &netNode.m_Sheet );
wxString pinText = netNode.m_Pin->GetShownNumber();
// Skip power symbols and virtual symbols
if( refText[0] == wxChar( '#' ) )

View File

@ -100,9 +100,7 @@ bool NETLIST_EXPORTER_PADS::WriteNetlist( const wxString& aOutFileName,
bool NETLIST_EXPORTER_PADS::writeListOfNets( FILE* f )
{
int ret = 0;
wxString initialSignalLine;
int ret = 0;
wxString netName;
ret |= fputs( "*NET*\n", f );

View File

@ -121,7 +121,6 @@ void NETLIST_EXPORTER_SPICE::WriteTail( OUTPUTFORMATTER& aFormatter, unsigned aN
bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions,
REPORTER& aReporter )
{
wxString msg;
std::set<std::string> refNames; // Set of reference names to check for duplication.
int ncCounter = 1;
@ -297,7 +296,6 @@ const SPICE_ITEM* NETLIST_EXPORTER_SPICE::FindItem( const wxString& aRefName ) c
void NETLIST_EXPORTER_SPICE::ReadDirectives( unsigned aNetlistOptions )
{
wxString msg;
wxString text;
m_directives.clear();

View File

@ -806,12 +806,9 @@ XNODE* NETLIST_EXPORTER_XML::makeLibParts()
XNODE* NETLIST_EXPORTER_XML::makeListOfNets( unsigned aCtl )
{
XNODE* xnets = node( wxT( "nets" ) ); // auto_ptr if exceptions ever get used.
wxString netCodeTxt;
wxString netName;
wxString ref;
XNODE* xnet = nullptr;
wxString netCodeTxt;
XNODE* xnets = node( wxT( "nets" ) ); // auto_ptr if exceptions ever get used.
XNODE* xnet = nullptr;
/* output:
<net code="123" name="/cfcard.sch/WAIT#" class="signal">

View File

@ -445,7 +445,7 @@ void SCH_CONNECTION::SetSuffix( const wxString& aSuffix )
void SCH_CONNECTION::AppendInfoToMsgPanel( std::vector<MSG_PANEL_ITEM>& aList ) const
{
wxString msg, group_name, members;
wxString msg, group_name;
std::vector<wxString> group_members;
aList.emplace_back( _( "Connection Name" ), UnescapeString( Name() ) );

View File

@ -956,8 +956,8 @@ void SCH_IO_ALTIUM::ParseStorage( const ALTIUM_COMPOUND_FILE& aAltiumSchFile )
ALTIUM_BINARY_PARSER reader( aAltiumSchFile, file );
std::map<wxString, wxString> properties = reader.ReadProperties();
wxString header = ALTIUM_PROPS_UTILS::ReadString( properties, "HEADER", "" );
int weight = ALTIUM_PROPS_UTILS::ReadInt( properties, "WEIGHT", 0 );
ALTIUM_PROPS_UTILS::ReadString( properties, "HEADER", "" );
int weight = ALTIUM_PROPS_UTILS::ReadInt( properties, "WEIGHT", 0 );
if( weight < 0 )
THROW_IO_ERROR( "Storage weight is negative!" );

View File

@ -1719,7 +1719,6 @@ const LIB_SYMBOL* CADSTAR_SCH_ARCHIVE_LOADER::loadSymdef( const SYMDEF_ID& aSymd
{
wxArrayString strings;
wxStringSplit( csText.Text, strings, '\n' );
wxPoint firstLinePos;
for( size_t ii = 0; ii < strings.size(); ++ii )
{

View File

@ -2159,7 +2159,6 @@ bool SCH_IO_EAGLE::loadSymbol( const std::unique_ptr<ESYMBOL>& aEsymbol,
{
wxCHECK( aEsymbol && aSymbol && aDevice, false );
wxString symbolName = aEsymbol->name;
std::vector<SCH_ITEM*> items;
bool showRefDes = false;

View File

@ -717,7 +717,7 @@ void SCH_EASYEDA_PARSER::ParseSymbolShapes( LIB_SYMBOL* aSymbol
wxString pinName = pinNameParts[4];
bool numVisible = pinNumParts[0] != wxS( "0" );
wxString ptSize = pinNumParts[4];
// wxString ptSize = pinNumParts[4];
VECTOR2D startPoint;
bool vertical = false;
@ -846,7 +846,7 @@ void SCH_EASYEDA_PARSER::ParseSymbolShapes( LIB_SYMBOL* aSymbol
wxString textType = arr[1];
VECTOR2D pos( Convert( arr[2] ), Convert( arr[3] ) );
int angle = Convert( arr[4] );
wxString color = arr[5];
// wxString color = arr[5];
wxString fontname = arr[6];
wxString fontSize = arr[7];
wxString baselineAlign = arr[10];
@ -1145,8 +1145,8 @@ void SCH_EASYEDA_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRoot
sepShapeStr.Replace( wxS( "^^" ), wxS( "\n" ) );
wxArrayString segments = wxSplit( sepShapeStr, '\n', '\0' );
wxArrayString mainParts = wxSplit( segments[0], '~', '\0' );
wxArrayString uselessParts = wxSplit( segments[1], '~', '\0' );
// wxArrayString mainParts = wxSplit( segments[0], '~', '\0' );
// wxArrayString uselessParts = wxSplit( segments[1], '~', '\0' );
wxArrayString valueParts = wxSplit( segments[2], '~', '\0' );
wxString flagTypename = arr[1];
@ -1305,10 +1305,10 @@ void SCH_EASYEDA_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRoot
else if( rootType == wxS( "W" ) )
{
wxArrayString ptArr = wxSplit( arr[1], ' ', '\0' );
wxString strokeColor = arr[2];
//wxString strokeColor = arr[2];
//double lineWidth = Convert( arr[3] );
//LINE_STYLE strokeStyle = ConvertStrokeStyle( arr[4] );
wxString fillColor = arr[5].Lower();
//wxString fillColor = arr[5].Lower();
//bool locked = arr[7] != wxS( "0" );
SHAPE_LINE_CHAIN chain;
@ -1335,8 +1335,8 @@ void SCH_EASYEDA_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRoot
VECTOR2D text_pos( Convert( arr[8] ),
Convert( arr[9] ) ); // TODO: detect top/bottom align
wxString fontname = arr[10];
wxString fontSize = arr[11];
// wxString fontname = arr[10];
// wxString fontSize = arr[11];
std::unique_ptr<SCH_LABEL> label =
std::make_unique<SCH_LABEL>( RelPos( pos ), netname );
@ -1376,7 +1376,7 @@ void SCH_EASYEDA_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRoot
{
VECTOR2D pos( Convert( arr[2] ), Convert( arr[3] ) );
int angle = Convert( arr[4] );
wxString color = arr[5];
// wxString color = arr[5];
wxString fontname = arr[6];
wxString fontSize = arr[7];
wxString baselineAlign = arr[10];

View File

@ -1665,10 +1665,8 @@ void SCH_IO_KICAD_LEGACY::Format( SELECTION* aSelection, OUTPUTFORMATTER* aForma
void SCH_IO_KICAD_LEGACY::saveSymbol( SCH_SYMBOL* aSymbol )
{
std::string name1;
std::string name2;
static wxString delimiters( wxT( " " ) );
std::string name1;
std::string name2;
// This is redundant with the AR entries below, but it makes the files backwards-compatible.
if( aSymbol->GetInstances().size() > 0 )

View File

@ -1589,8 +1589,6 @@ SCH_PIN* SCH_IO_KICAD_SEXPR_PARSER::parseSymbolPin()
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a pin token." ) );
T token;
wxString tmp;
wxString error;
std::unique_ptr<SCH_PIN> pin = std::make_unique<SCH_PIN>( nullptr );
pin->SetUnit( m_unit );

View File

@ -1004,7 +1004,7 @@ std::vector<LTSPICE_SCHEMATIC::LT_ASC> LTSPICE_SCHEMATIC::StructureBuilder()
{
tokensSizeRangeCheck( tokens.size(), 6, 7, lineNumber, fileName );
wxString lineWidth = tokens[1];
// wxString lineWidth = tokens[1];
wxString botRightX = tokens[2];
wxString botRightY = tokens[3];
wxString topLeftX = tokens[4];

View File

@ -625,8 +625,6 @@ bool SCH_ITEM::RenderAsBitmap( double aWorldScale ) const
void SCH_ITEM::getSymbolEditorMsgPanelInfo( EDA_DRAW_FRAME* aFrame,
std::vector<MSG_PANEL_ITEM>& aList )
{
wxString msg;
aList.emplace_back( _( "Type" ), GetFriendlyName() );
if( const SYMBOL* parent = GetParentSymbol() )

View File

@ -1311,8 +1311,6 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, i
return true;
}
wxString upperToken = token->Upper();
for( const SCH_FIELD& field : m_fields )
{
wxString fieldName = field.IsMandatory() ? field.GetCanonicalName()

View File

@ -1219,7 +1219,6 @@ wxString SIMULATOR_FRAME_UI::vectorNameFromSignalName( SIM_PLOT_TAB* aPlotTab,
}
}
wxString suffix;
wxString name = aSignalName;
for( const auto& [ candidate, type ] : suffixes )
@ -1429,9 +1428,8 @@ void SIMULATOR_FRAME_UI::onMeasurementsGridCellChanged( wxGridEvent& aEvent )
if( !plotTab )
return;
int row = aEvent.GetRow();
int col = aEvent.GetCol();
wxString text = m_measurementsGrid->GetCellValue( row, col );
int row = aEvent.GetRow();
int col = aEvent.GetCol();
if( col == COL_MEASUREMENT )
{
@ -1711,8 +1709,7 @@ void SIMULATOR_FRAME_UI::AddMeasurement( const wxString& aCmd )
if( !plotTab )
return;
wxString simType = simulator()->TypeToName( plotTab->GetSimType(), true );
int row;
int row;
for( row = 0; row < m_measurementsGrid->GetNumberRows(); ++row )
{

View File

@ -344,7 +344,6 @@ void SYMBOL_EDIT_FRAME::CreateNewSymbol( const wxString& aInheritFrom )
{
m_toolManager->RunAction( ACTIONS::cancelInteractive );
wxArrayString symbolNames;
wxString lib = getTargetLib();
if( !m_libMgr->LibraryExists( lib ) )

View File

@ -1824,7 +1824,6 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
{
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
SCH_FIELD* nameField = sheet->GetField( FIELD_T::SHEET_NAME );
wxString baseName = nameField->GetText();
wxFileName srcFn = sheet->GetFileName();
if( srcFn.IsRelative() )

View File

@ -700,9 +700,6 @@ void SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties( SCH_FIELD* aField )
if( dlg.ShowQuasiModal() != wxID_OK )
return;
wxString newFieldValue = EscapeString( dlg.GetText(), CTX_LIBID );
wxString oldFieldValue = aField->GetFullText( m_frame->GetUnit() );
SCH_COMMIT commit( m_toolMgr );
commit.Modify( aField, m_frame->GetScreen() );

View File

@ -134,7 +134,6 @@ void HIERARCHY_PANE::buildHierarchyTree( SCH_SHEET_PATH* aList, const wxTreeItem
wxString sheetNameBase = sheet->GetField( FIELD_T::SHEET_NAME )->GetShownText( false );
wxString sheetName = formatPageString( sheetNameBase, aList->GetPageNumber() );
wxString sheetNumber = aList->GetPageNumber();
wxTreeItemId child = m_tree->AppendItem( aParent, sheetName, 0, 1 );
m_tree->SetItemData( child, new TREE_ITEM_DATA( *aList ) );

View File

@ -195,9 +195,7 @@ bool doConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aShapeList, SHAPE_POLY_
if( aShapeList.size() == 0 )
return true;
bool selfIntersecting = false;
wxString msg;
bool selfIntersecting = false;
PCB_SHAPE* graphic = nullptr;
std::set<PCB_SHAPE*> startCandidates( aShapeList.begin(), aShapeList.end() );

View File

@ -72,8 +72,6 @@
void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
{
char line[1024];
wxString msg;
wxString modName;
char* idcmd;
char* text;
int netcode = -1;

View File

@ -367,7 +367,6 @@ bool DIALOG_EXPORT_2581::TransferDataFromWindow()
}
PROJECT_FILE& prj = Prj().GetProjectFile();
wxString empty;
prj.m_IP2581Bom.id = GetOEM();
prj.m_IP2581Bom.mfg = GetMfg();

View File

@ -437,8 +437,6 @@ void DIALOG_EXPORT_ODBPP::GenerateODBPPFiles( const JOB_EXPORT_PCB_ODB& aJob, BO
}
}
wxString upperTxt;
wxString lowerTxt;
std::map<std::string, UTF8> props;
props["units"] = aJob.m_units == JOB_EXPORT_PCB_ODB::ODB_UNITS::MM ? "mm" : "inch";

View File

@ -403,8 +403,6 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem( BOARD_COMMIT& aCommit, B
else if(( m_italic->Get3StateValue() != wxCHK_UNDETERMINED
|| m_bold->Get3StateValue() != wxCHK_UNDETERMINED ) )
{
wxString fontName = text->GetFontName();
if( !text->GetFontName().IsEmpty() )
{
text->SetFont( KIFONT::FONT::GetFont( text->GetFontName(), text->IsBold(),

View File

@ -776,7 +776,6 @@ void PANEL_FP_LIB_TABLE::onMigrateLibraries( wxCommandEvent& event )
for( int row : rowsToMigrate )
{
wxString libName = m_cur_grid->GetCellValue( row, COL_NICKNAME );
wxString relPath = m_cur_grid->GetCellValue( row, COL_URI );
wxString resolvedPath = ExpandEnvVarSubstitutions( relPath, m_project );
wxFileName legacyLib( resolvedPath );

View File

@ -198,7 +198,6 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
m_textEditor->SearchAnchor();
wxString rules = m_textEditor->GetText();
int currentPos = m_textEditor->GetCurrentPos();
int startPos = 0;

View File

@ -290,7 +290,6 @@ bool PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow()
return false;
}
wxString msg;
std::vector<int> trackWidths;
std::vector<VIA_DIMENSION> vias;
std::vector<DIFF_PAIR_DIMENSION> diffPairs;

View File

@ -384,7 +384,7 @@ bool IPC356D_WRITER::Write( const wxString& aFilename )
int BOARD_EDITOR_CONTROL::GenD356File( const TOOL_EVENT& aEvent )
{
wxFileName fn = m_frame->GetBoard()->GetFileName();
wxString ext, wildcard, msg;
wxString ext, wildcard;
ext = FILEEXT::IpcD356FileExtension;
wildcard = FILEEXT::IpcD356FileWildcard();

View File

@ -391,8 +391,6 @@ int BOARD_EDITOR_CONTROL::New( const TOOL_EVENT& aEvent )
bool PCB_EDIT_FRAME::SaveBoard( bool aSaveAs, bool aSaveCopy )
{
wxString msg;
if( !aSaveAs )
{
if( !GetBoard()->GetFileName().IsEmpty() )
@ -599,8 +597,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
else
setProject = Prj().GetProjectFullName().IsEmpty();
wxString path = wxPathOnly( Prj().GetProjectFullName() );
if( setProject )
{
// calls SaveProject

View File

@ -599,9 +599,7 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr
DisplayInfoMessage( this, _( "No footprints to export!" ) );
return;
}
wxString footprintName;
auto resetReference =
[]( FOOTPRINT* aFootprint )
{

View File

@ -83,8 +83,6 @@ void NETINFO_ITEM::SetNetClass( const std::shared_ptr<NETCLASS>& aNetClass )
void NETINFO_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
wxString msg;
aList.emplace_back( _( "Net Name" ), UnescapeString( GetNetname() ) );
aList.emplace_back( _( "Net Code" ), fmt::format( "{}", GetNetCode() ) );

View File

@ -1230,7 +1230,6 @@ void PCB_BASE_FRAME::OnFpChangeDebounceTimer( wxTimerEvent& aEvent )
for( const EDA_ITEM* item : GetCurrentSelection() )
{
wxString uuidStr = item->m_Uuid.AsString();
selectedItems.emplace_back( item->m_Uuid );
}

View File

@ -1499,8 +1499,6 @@ void PCB_IO_KICAD_SEXPR::formatLayers( LSET aLayerMask, bool aEnumerateLayers )
}
// output any individual layers not handled in wildcard combos above
wxString layerName;
for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
{
if( aLayerMask[layer] )

View File

@ -1324,8 +1324,6 @@ void PCB_IO_KICAD_SEXPR_PARSER::resolveGroups( BOARD_ITEM* aParent )
static_cast<BOARD*>( groupInfo->parent )->Add( group, ADD_MODE::INSERT, true );
}
wxString error;
for( const GROUP_INFO* groupInfo : groupTypeObjects )
{
if( PCB_GROUP* group = dynamic_cast<PCB_GROUP*>( getItem( groupInfo->uuid ) ) )
@ -4623,8 +4621,6 @@ FOOTPRINT* PCB_IO_KICAD_SEXPR_PARSER::parseFOOTPRINT_unchecked( wxArrayString* a
case T_property:
{
wxString value;
NeedSYMBOL();
wxString pName = FromUTF8();
NeedSYMBOL();