Compile fixes

Fix compile error
Fix string format to use %ld instead to work on clang in CADSTAR Archive importers
Add virtual destructor to CONNECTION in CADSTAR_ARCHIVE_PARSER
This commit is contained in:
Roberto Fernandez Bautista 2020-09-27 22:09:16 +01:00 committed by Ian McInerney
parent db1d3ea710
commit 39995341d9
6 changed files with 10 additions and 8 deletions

View File

@ -771,7 +771,7 @@ static std::vector<TREE_NODE*> squashParamList( TREE_NODE* root )
std::reverse( args.begin(), args.end() );
for(size_t i = 0; i < args.size(); i++ )
libeval_dbg(10, "squash arg%d: %s\n", i, (const char*) *args[i]->value.str );
libeval_dbg(10, "squash arg%d: %s\n", i, *args[i]->value.str );
return args;
}

View File

@ -1046,6 +1046,8 @@ public:
void ParseIdentifiers( XNODE* aNode );
bool ParseSubNode( XNODE* aChildNode );
virtual void Parse( XNODE* aNode ) = 0;
virtual ~CONNECTION() {}
};
NET_ID ID;

View File

@ -101,7 +101,7 @@ static std::unique_ptr<SCHEMATIC> readSchematicFromFile( const std::string& aFil
bool generateSchematicNetlist( const wxString& aFilename, wxString& aNetlist )
{
std::unique_ptr<SCHEMATIC> schematic ( readSchematicFromFile( (const char*) aFilename ) );
std::unique_ptr<SCHEMATIC> schematic ( readSchematicFromFile( aFilename.ToStdString() ) );
NETLIST_EXPORTER_KICAD exporter( schematic.get() );
STRING_FORMATTER formatter;

View File

@ -486,7 +486,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadNets()
std::map<NETELEMENT_ID, SCH_LABEL*> netlabels;
if( netName.IsEmpty() )
netName = wxString::Format( "$%d", int{ net.SignalNum } );
netName = wxString::Format( "$%ld", net.SignalNum );
for( std::pair<NETELEMENT_ID, NET_SCH::SYM_TERM> terminalPair : net.Terminals )
@ -765,7 +765,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
for( std::pair<TERMINAL_ID, TERMINAL> termPair : symbol.Terminals )
{
TERMINAL term = termPair.second;
wxString pinNum = wxString::Format( "%d", int{ term.ID } );
wxString pinNum = wxString::Format( "%ld", term.ID );
wxString pinName = wxEmptyString;
if( aCadstarPart )
@ -773,7 +773,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
PART::DEFINITION::PIN csPin = getPartDefinitionPin( *aCadstarPart, aGateID, term.ID );
pinName = csPin.Name;
pinNum = wxString::Format( "%d", int{ csPin.ID } );
pinNum = wxString::Format( "%ld", csPin.ID );
if( pinName.IsEmpty() )
{
@ -1148,7 +1148,7 @@ wxString CADSTAR_SCH_ARCHIVE_LOADER::getNetName( const NET_SCH& aNet )
wxString netname = aNet.Name;
if( netname.IsEmpty() )
netname = wxString::Format( "$%d", int{ aNet.SignalNum } );
netname = wxString::Format( "$%ld", aNet.SignalNum );
return netname;
}

View File

@ -298,7 +298,7 @@ void CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::Parse( XNODE* aNode )
TerminalCodeID = GetXmlAttributeIDString( aNode, 1 );
XNODE* cNode = aNode->GetChildren();
wxString location = wxString::Format( "TERMINAL %d", int{ ID } );
wxString location = wxString::Format( "TERMINAL %ld", ID );
if( !cNode )
THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), location );

View File

@ -1134,7 +1134,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::PAD::Parse( XNODE* aNode )
Side = GetPadSide( GetXmlAttributeIDString( aNode, 3 ) );
XNODE* cNode = aNode->GetChildren();
wxString location = wxString::Format( "PAD %d", int{ ID } );
wxString location = wxString::Format( "PAD %ld", ID );
if( !cNode )
THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), location );