Lots of Coverity scan error fixes.
This commit is contained in:
parent
bd5d468251
commit
d1d1e2b58a
|
@ -5,7 +5,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -83,6 +83,8 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) :
|
||||||
m_use_modelfile_ambientIntensity = true;
|
m_use_modelfile_ambientIntensity = true;
|
||||||
m_use_modelfile_transparency = true;
|
m_use_modelfile_transparency = true;
|
||||||
m_use_modelfile_shininess = true;
|
m_use_modelfile_shininess = true;
|
||||||
|
m_loadTransparentObjects = true;
|
||||||
|
m_loadNonTransparentObjects = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,10 @@ VRML2_MODEL_PARSER::VRML2_MODEL_PARSER( S3D_MASTER* aMaster ) :
|
||||||
S3D_MODEL_PARSER( aMaster )
|
S3D_MODEL_PARSER( aMaster )
|
||||||
{
|
{
|
||||||
m_model = NULL;
|
m_model = NULL;
|
||||||
|
m_file = NULL;
|
||||||
|
m_Materials = NULL;
|
||||||
|
m_normalPerVertex = true;
|
||||||
|
colorPerVertex = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,8 @@ LAYER_BOX_SELECTOR::LAYER_BOX_SELECTOR( wxWindow* parent, wxWindowID id,
|
||||||
{
|
{
|
||||||
if( choices != NULL )
|
if( choices != NULL )
|
||||||
ResyncBitmapOnly();
|
ResyncBitmapOnly();
|
||||||
|
|
||||||
|
m_hotkeys = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -379,7 +379,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
|
||||||
|
|
||||||
|
|
||||||
void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const
|
void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const
|
||||||
throw( IO_ERROR )
|
throw( IO_ERROR, boost::interprocess::lock_exception )
|
||||||
{
|
{
|
||||||
out->Print( nestLevel, "(fp_lib_table\n" );
|
out->Print( nestLevel, "(fp_lib_table\n" );
|
||||||
|
|
||||||
|
|
|
@ -1050,7 +1050,7 @@ const wxString PART_LIBS::CacheName( const wxString& aFullProjectFilename )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR )
|
void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
wxString filename;
|
wxString filename;
|
||||||
|
|
|
@ -152,7 +152,7 @@ public:
|
||||||
* loads all of the project's libraries into this container, which should
|
* loads all of the project's libraries into this container, which should
|
||||||
* be cleared before calling it.
|
* be cleared before calling it.
|
||||||
*/
|
*/
|
||||||
void LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR );
|
void LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function LibNamesAndPaths
|
* Function LibNamesAndPaths
|
||||||
|
|
|
@ -785,6 +785,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::setRowItem( int aFieldNdx, const SCH_FI
|
||||||
|
|
||||||
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
|
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
|
||||||
{
|
{
|
||||||
|
wxCHECK_RET( m_cmp != NULL, wxT( "Component pointer not initialized." ) );
|
||||||
|
|
||||||
unsigned fieldNdx = getSelectedFieldNdx();
|
unsigned fieldNdx = getSelectedFieldNdx();
|
||||||
|
|
||||||
if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too
|
if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 1992-2013 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
#include <build_version.h>
|
#include <build_version.h>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#define INTERMEDIATE_NETLIST_EXT wxT("xml")
|
#define INTERMEDIATE_NETLIST_EXT wxT( "xml" )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UNIQUE_STRINGS
|
* Class UNIQUE_STRINGS
|
||||||
|
@ -87,7 +87,7 @@ bool UNIQUE_STRINGS::Lookup( const wxString& aString )
|
||||||
/**
|
/**
|
||||||
* Class NETLIST_EXPORT_TOOL
|
* Class NETLIST_EXPORT_TOOL
|
||||||
* is a private implementation class used in this source file to keep track
|
* is a private implementation class used in this source file to keep track
|
||||||
* of and recycle datastructures used in the generation of various exported netlist
|
* of and recycle data structures used in the generation of various exported netlist
|
||||||
* files. Since it is private it is not in a header file.
|
* files. Since it is private it is not in a header file.
|
||||||
*/
|
*/
|
||||||
class NETLIST_EXPORT_TOOL
|
class NETLIST_EXPORT_TOOL
|
||||||
|
@ -305,8 +305,8 @@ public:
|
||||||
* .-PSpice or .-gnucap put at beginning of the netlist
|
* .-PSpice or .-gnucap put at beginning of the netlist
|
||||||
* .+PSpice or .-genucap are put at end of the netList
|
* .+PSpice or .-genucap are put at end of the netList
|
||||||
* @param f = the file to write to
|
* @param f = the file to write to
|
||||||
* @param aUsePrefix = true, adds an 'X' prefix to any reference designator starting with "U" or "IC",
|
* @param aUsePrefix = true, adds an 'X' prefix to any reference designator starting
|
||||||
* false to leave reference designator unchanged.
|
* with "U" or "IC", false to leave reference designator unchanged.
|
||||||
* @param aUseNetcodeAsNetName = true to use numbers (net codes) as net names.
|
* @param aUseNetcodeAsNetName = true to use numbers (net codes) as net names.
|
||||||
* false to use net names from schematic.
|
* false to use net names from schematic.
|
||||||
*/
|
*/
|
||||||
|
@ -353,25 +353,14 @@ wxString NETLIST_EXPORT_TOOL::MakeCommandLine( const wxString& aFormatString,
|
||||||
wxFileName in = aTempfile;
|
wxFileName in = aTempfile;
|
||||||
wxFileName out = aFinalFile;
|
wxFileName out = aFinalFile;
|
||||||
|
|
||||||
ret.Replace( wxT("%B"), out.GetName().GetData(), true );
|
ret.Replace( wxT( "%B" ), out.GetName().GetData(), true );
|
||||||
ret.Replace( wxT("%I"), in.GetFullPath().GetData(), true );
|
ret.Replace( wxT( "%I" ), in.GetFullPath().GetData(), true );
|
||||||
ret.Replace( wxT("%O"), out.GetFullPath().GetData(), true );
|
ret.Replace( wxT( "%O" ), out.GetFullPath().GetData(), true );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Function WriteNetListFile
|
|
||||||
* creates the netlist file. Netlist info must be existing
|
|
||||||
* (call BuildNetListBase() to create this info )
|
|
||||||
* param aConnectedItemsList = the initialized list of connected items
|
|
||||||
* param aFormat = netlist format (NET_TYPE_PCBNEW ...)
|
|
||||||
* param aFullFileName = full netlist file name
|
|
||||||
* param aNetlistOptions = netlist options using OR'ed bits.
|
|
||||||
* For SPICE netlist only:
|
|
||||||
* if NET_USE_X_PREFIX is set : change "U" and "IC" refernce prefix to "X"
|
|
||||||
* return true if success.
|
|
||||||
*/
|
|
||||||
bool SCH_EDIT_FRAME::WriteNetListFile( NETLIST_OBJECT_LIST * aConnectedItemsList,
|
bool SCH_EDIT_FRAME::WriteNetListFile( NETLIST_OBJECT_LIST * aConnectedItemsList,
|
||||||
int aFormat, const wxString& aFullFileName,
|
int aFormat, const wxString& aFullFileName,
|
||||||
unsigned aNetlistOptions )
|
unsigned aNetlistOptions )
|
||||||
|
@ -382,6 +371,7 @@ bool SCH_EDIT_FRAME::WriteNetListFile( NETLIST_OBJECT_LIST * aConnectedItemsList
|
||||||
NETLIST_EXPORT_TOOL helper( aConnectedItemsList, Prj().SchLibs() );
|
NETLIST_EXPORT_TOOL helper( aConnectedItemsList, Prj().SchLibs() );
|
||||||
|
|
||||||
bool open_file = (aFormat < NET_TYPE_CUSTOM1) && (aFormat >= 0);
|
bool open_file = (aFormat < NET_TYPE_CUSTOM1) && (aFormat >= 0);
|
||||||
|
|
||||||
if( (aFormat == NET_TYPE_PCBNEW) && (aNetlistOptions & NET_PCBNEW_USE_NEW_FORMAT ) )
|
if( (aFormat == NET_TYPE_PCBNEW) && (aNetlistOptions & NET_PCBNEW_USE_NEW_FORMAT ) )
|
||||||
open_file = false;
|
open_file = false;
|
||||||
|
|
||||||
|
@ -405,57 +395,51 @@ bool SCH_EDIT_FRAME::WriteNetListFile( NETLIST_OBJECT_LIST * aConnectedItemsList
|
||||||
if( (aNetlistOptions & NET_PCBNEW_USE_NEW_FORMAT ) )
|
if( (aNetlistOptions & NET_PCBNEW_USE_NEW_FORMAT ) )
|
||||||
ret = helper.WriteKiCadNetList( aFullFileName );
|
ret = helper.WriteKiCadNetList( aFullFileName );
|
||||||
else
|
else
|
||||||
{
|
|
||||||
ret = helper.WriteNetListPCBNEW( f, true );
|
ret = helper.WriteNetListPCBNEW( f, true );
|
||||||
fclose( f );
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NET_TYPE_ORCADPCB2:
|
case NET_TYPE_ORCADPCB2:
|
||||||
ret = helper.WriteNetListPCBNEW( f, false );
|
ret = helper.WriteNetListPCBNEW( f, false );
|
||||||
fclose( f );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NET_TYPE_CADSTAR:
|
case NET_TYPE_CADSTAR:
|
||||||
ret = helper.WriteNetListCADSTAR( f );
|
ret = helper.WriteNetListCADSTAR( f );
|
||||||
fclose( f );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NET_TYPE_SPICE:
|
case NET_TYPE_SPICE:
|
||||||
ret = helper.WriteNetListPspice( f, aNetlistOptions & NET_USE_X_PREFIX,
|
ret = helper.WriteNetListPspice( f, aNetlistOptions & NET_USE_X_PREFIX,
|
||||||
aNetlistOptions & NET_USE_NETCODES_AS_NETNAMES );
|
aNetlistOptions & NET_USE_NETCODES_AS_NETNAMES );
|
||||||
fclose( f );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
wxFileName tmpFile = aFullFileName;
|
wxFileName tmpFile = aFullFileName;
|
||||||
tmpFile.SetExt( INTERMEDIATE_NETLIST_EXT );
|
tmpFile.SetExt( INTERMEDIATE_NETLIST_EXT );
|
||||||
|
|
||||||
DBG(printf("tmpFile:'%s'\n", TO_UTF8( tmpFile.GetFullPath() ) );)
|
ret = helper.WriteGENERICNetList( tmpFile.GetFullPath() );
|
||||||
|
|
||||||
ret = helper.WriteGENERICNetList( tmpFile.GetFullPath() );
|
if( !ret )
|
||||||
if( !ret )
|
break;
|
||||||
break;
|
|
||||||
|
|
||||||
// If user provided no plugin command line, return now.
|
// If user provided no plugin command line, return now.
|
||||||
if( m_netListerCommand.IsEmpty() )
|
if( m_netListerCommand.IsEmpty() )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// build full command line from user's format string, e.g.:
|
// build full command line from user's format string, e.g.:
|
||||||
// "xsltproc -o %O /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl %I"
|
// "xsltproc -o %O /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl %I"
|
||||||
// becomes, after the user selects /tmp/s1.net as the output file from the file dialog:
|
// becomes, after the user selects /tmp/s1.net as the output file from the file dialog:
|
||||||
// "xsltproc -o /tmp/s1.net /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl /tmp/s1.xml"
|
// "xsltproc -o /tmp/s1.net /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl /tmp/s1.xml"
|
||||||
wxString commandLine = NETLIST_EXPORT_TOOL::MakeCommandLine( m_netListerCommand,
|
wxString commandLine = NETLIST_EXPORT_TOOL::MakeCommandLine( m_netListerCommand,
|
||||||
tmpFile.GetFullPath(),
|
tmpFile.GetFullPath(),
|
||||||
aFullFileName );
|
aFullFileName );
|
||||||
|
|
||||||
DBG(printf("commandLine:'%s'\n", TO_UTF8( commandLine ) );)
|
ProcessExecute( commandLine, wxEXEC_SYNC );
|
||||||
|
|
||||||
ProcessExecute( commandLine, wxEXEC_SYNC );
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( f != NULL )
|
||||||
|
fclose( f );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1276,19 +1260,22 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool aUsePrefix, bool aUs
|
||||||
for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ )
|
for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ )
|
||||||
{
|
{
|
||||||
// Case of Alt Sequence definition with Unused/Invalid Node index:
|
// Case of Alt Sequence definition with Unused/Invalid Node index:
|
||||||
// Valid used Node Indexes are in the set {0,1,2,...m_SortedComponentPinList.size()-1}
|
// Valid used Node Indexes are in the set
|
||||||
|
// {0,1,2,...m_SortedComponentPinList.size()-1}
|
||||||
if( pinSequence.size() )
|
if( pinSequence.size() )
|
||||||
{
|
{
|
||||||
// All Vector values must be less <= max package size
|
// All Vector values must be less <= max package size
|
||||||
// And Total Vector size should be <= package size
|
// And Total Vector size should be <= package size
|
||||||
if( ( (unsigned) pinSequence[ii] < m_SortedComponentPinList.size() ) && ( ii < pinSequence.size() ) )
|
if( ( (unsigned) pinSequence[ii] < m_SortedComponentPinList.size() )
|
||||||
|
&& ( ii < pinSequence.size() ) )
|
||||||
{
|
{
|
||||||
// Case of Alt Pin Sequence in control good Index:
|
// Case of Alt Pin Sequence in control good Index:
|
||||||
activePinIndex = pinSequence[ii];
|
activePinIndex = pinSequence[ii];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Case of Alt Pin Sequence in control Bad Index or not using all pins for simulation:
|
// Case of Alt Pin Sequence in control Bad Index or not using all
|
||||||
|
// pins for simulation:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1358,6 +1345,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool aUsePrefix, bool aUs
|
||||||
|
|
||||||
// Print texts starting with [+]pspice or [+]gnucap
|
// Print texts starting with [+]pspice or [+]gnucap
|
||||||
nbitems = spiceCommandAtEndFile.GetCount();
|
nbitems = spiceCommandAtEndFile.GetCount();
|
||||||
|
|
||||||
if( nbitems )
|
if( nbitems )
|
||||||
{
|
{
|
||||||
ret |= fprintf( f, "\n" );
|
ret |= fprintf( f, "\n" );
|
||||||
|
@ -1452,16 +1440,19 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPCBNEW( FILE* f, bool with_pcbnew )
|
||||||
field.Replace( wxT( " " ), wxT( "_" ) );
|
field.Replace( wxT( " " ), wxT( "_" ) );
|
||||||
ret |= fprintf( f, " {Lib=%s}", TO_UTF8( field ) );
|
ret |= fprintf( f, " {Lib=%s}", TO_UTF8( field ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
ret |= fprintf( f, "\n" );
|
ret |= fprintf( f, "\n" );
|
||||||
|
|
||||||
// Write pin list:
|
// Write pin list:
|
||||||
for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ )
|
for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ )
|
||||||
{
|
{
|
||||||
NETLIST_OBJECT* pin = m_SortedComponentPinList[ii];
|
NETLIST_OBJECT* pin = m_SortedComponentPinList[ii];
|
||||||
|
|
||||||
if( !pin )
|
if( !pin )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
sprintPinNetName( netName, wxT( "N-%.6d" ), pin );
|
sprintPinNetName( netName, wxT( "N-%.6d" ), pin );
|
||||||
|
|
||||||
if( netName.IsEmpty() )
|
if( netName.IsEmpty() )
|
||||||
netName = wxT( "?" );
|
netName = wxT( "?" );
|
||||||
|
|
||||||
|
@ -1524,7 +1515,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPCBNEW( FILE* f, bool with_pcbnew )
|
||||||
|
|
||||||
|
|
||||||
bool NETLIST_EXPORT_TOOL::addPinToComponentPinList( SCH_COMPONENT* aComponent,
|
bool NETLIST_EXPORT_TOOL::addPinToComponentPinList( SCH_COMPONENT* aComponent,
|
||||||
SCH_SHEET_PATH* aSheetPath, LIB_PIN* aPin )
|
SCH_SHEET_PATH* aSheetPath, LIB_PIN* aPin )
|
||||||
{
|
{
|
||||||
// Search the PIN description for Pin in g_NetObjectslist
|
// Search the PIN description for Pin in g_NetObjectslist
|
||||||
for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
|
for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
|
||||||
|
@ -1558,14 +1549,7 @@ bool NETLIST_EXPORT_TOOL::addPinToComponentPinList( SCH_COMPONENT* aComponent,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* remove duplicate pins from aPinList (list of pins relative to a given component)
|
|
||||||
* (i.e. set pointer to duplicate pins to NULL in this list).
|
|
||||||
* also set .m_Flag member of "removed" NETLIST_OBJECT pins to 1
|
|
||||||
* When pins are duplicated, not connected duplicate is removed
|
|
||||||
* (for instance when a multiple part per package component has its power pins connected
|
|
||||||
* only on a part).
|
|
||||||
*/
|
|
||||||
void NETLIST_EXPORT_TOOL::eraseDuplicatePins( )
|
void NETLIST_EXPORT_TOOL::eraseDuplicatePins( )
|
||||||
{
|
{
|
||||||
for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ )
|
for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ )
|
||||||
|
@ -1582,6 +1566,7 @@ void NETLIST_EXPORT_TOOL::eraseDuplicatePins( )
|
||||||
* are necessary successive in list
|
* are necessary successive in list
|
||||||
*/
|
*/
|
||||||
int idxref = ii;
|
int idxref = ii;
|
||||||
|
|
||||||
for( unsigned jj = ii + 1; jj < m_SortedComponentPinList.size(); jj++ )
|
for( unsigned jj = ii + 1; jj < m_SortedComponentPinList.size(); jj++ )
|
||||||
{
|
{
|
||||||
if( m_SortedComponentPinList[jj] == NULL ) // Already removed
|
if( m_SortedComponentPinList[jj] == NULL ) // Already removed
|
||||||
|
@ -1618,8 +1603,8 @@ void NETLIST_EXPORT_TOOL::eraseDuplicatePins( )
|
||||||
|
|
||||||
|
|
||||||
void NETLIST_EXPORT_TOOL::findAllInstancesOfComponent( SCH_COMPONENT* aComponent,
|
void NETLIST_EXPORT_TOOL::findAllInstancesOfComponent( SCH_COMPONENT* aComponent,
|
||||||
LIB_PART* aEntry,
|
LIB_PART* aEntry,
|
||||||
SCH_SHEET_PATH* aSheetPath )
|
SCH_SHEET_PATH* aSheetPath )
|
||||||
{
|
{
|
||||||
wxString ref = aComponent->GetRef( aSheetPath );
|
wxString ref = aComponent->GetRef( aSheetPath );
|
||||||
wxString ref2;
|
wxString ref2;
|
||||||
|
@ -1847,6 +1832,7 @@ bool NETLIST_EXPORT_TOOL::writeListOfNetsCADSTAR( FILE* f )
|
||||||
|
|
||||||
Cmp = nitem->GetComponentParent();
|
Cmp = nitem->GetComponentParent();
|
||||||
wxString refstr = Cmp->GetRef( &nitem->m_SheetPath );
|
wxString refstr = Cmp->GetRef( &nitem->m_SheetPath );
|
||||||
|
|
||||||
if( refstr[0] == '#' )
|
if( refstr[0] == '#' )
|
||||||
continue; // Power supply symbols.
|
continue; // Power supply symbols.
|
||||||
|
|
||||||
|
@ -1860,10 +1846,10 @@ bool NETLIST_EXPORT_TOOL::writeListOfNetsCADSTAR( FILE* f )
|
||||||
buf[4] = 0;
|
buf[4] = 0;
|
||||||
str_pinnum = FROM_UTF8( buf );
|
str_pinnum = FROM_UTF8( buf );
|
||||||
InitNetDescLine.Printf( wxT( "\n%s %s %.4s %s" ),
|
InitNetDescLine.Printf( wxT( "\n%s %s %.4s %s" ),
|
||||||
GetChars( InitNetDesc ),
|
GetChars( InitNetDesc ),
|
||||||
GetChars( refstr ),
|
GetChars( refstr ),
|
||||||
GetChars( str_pinnum ),
|
GetChars( str_pinnum ),
|
||||||
GetChars( netcodeName ) );
|
GetChars( netcodeName ) );
|
||||||
}
|
}
|
||||||
print_ter++;
|
print_ter++;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -356,7 +356,8 @@ public:
|
||||||
* @param nestLevel is the indentation level to base all lines of the output.
|
* @param nestLevel is the indentation level to base all lines of the output.
|
||||||
* Actual indentation will be 2 spaces for each nestLevel.
|
* Actual indentation will be 2 spaces for each nestLevel.
|
||||||
*/
|
*/
|
||||||
void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR );
|
void Format( OUTPUTFORMATTER* out, int nestLevel ) const
|
||||||
|
throw( IO_ERROR, boost::interprocess::lock_exception );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetLogicalLibs
|
* Function GetLogicalLibs
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <boost/interprocess/exceptions.hpp>
|
||||||
|
|
||||||
#include <draw_frame.h>
|
#include <draw_frame.h>
|
||||||
#include <base_struct.h>
|
#include <base_struct.h>
|
||||||
|
@ -103,7 +104,7 @@ protected:
|
||||||
* occurs while reading footprint library files.
|
* occurs while reading footprint library files.
|
||||||
*/
|
*/
|
||||||
MODULE* loadFootprint( const FPID& aFootprintId )
|
MODULE* loadFootprint( const FPID& aFootprintId )
|
||||||
throw( IO_ERROR, PARSE_ERROR );
|
throw( IO_ERROR, PARSE_ERROR, boost::interprocess::lock_exception );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
using namespace NL_T;
|
using namespace NL_T;
|
||||||
|
|
||||||
|
|
||||||
void KICAD_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR )
|
void KICAD_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
m_parser->Parse();
|
m_parser->Parse();
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,7 @@
|
||||||
#include <netlist_reader.h>
|
#include <netlist_reader.h>
|
||||||
|
|
||||||
|
|
||||||
|
void LEGACY_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR, boost::bad_pointer )
|
||||||
void LEGACY_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR )
|
|
||||||
{
|
{
|
||||||
int state = 0;
|
int state = 0;
|
||||||
bool is_comment = false;
|
bool is_comment = false;
|
||||||
|
|
|
@ -323,7 +323,7 @@ MODULE* PCB_BASE_FRAME::LoadFootprint( const FPID& aFootprintId )
|
||||||
|
|
||||||
|
|
||||||
MODULE* PCB_BASE_FRAME::loadFootprint( const FPID& aFootprintId )
|
MODULE* PCB_BASE_FRAME::loadFootprint( const FPID& aFootprintId )
|
||||||
throw( IO_ERROR, PARSE_ERROR )
|
throw( IO_ERROR, PARSE_ERROR, boost::interprocess::lock_exception )
|
||||||
{
|
{
|
||||||
FP_LIB_TABLE* fptbl = Prj().PcbFootprintLibs();
|
FP_LIB_TABLE* fptbl = Prj().PcbFootprintLibs();
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ public:
|
||||||
* @throw IO_ERROR if a file IO error occurs.
|
* @throw IO_ERROR if a file IO error occurs.
|
||||||
* @throw PARSE_ERROR if an error occurs while parsing the file.
|
* @throw PARSE_ERROR if an error occurs while parsing the file.
|
||||||
*/
|
*/
|
||||||
virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR ) = 0;
|
virtual void LoadNetlist() throw( IO_ERROR, PARSE_ERROR, boost::bad_pointer ) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetLineReader()
|
* Function GetLineReader()
|
||||||
|
@ -277,7 +277,7 @@ public:
|
||||||
* @throw IO_ERROR if a file IO error occurs.
|
* @throw IO_ERROR if a file IO error occurs.
|
||||||
* @throw PARSE_ERROR if an error occurs while parsing the file.
|
* @throw PARSE_ERROR if an error occurs while parsing the file.
|
||||||
*/
|
*/
|
||||||
virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR );
|
virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR, boost::bad_pointer );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ public:
|
||||||
delete m_parser;
|
delete m_parser;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR );
|
virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR, boost::bad_pointer );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ bool PCB_PARSER::parseBool() throw( PARSE_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxPoint PCB_PARSER::parseXY() throw( PARSE_ERROR )
|
wxPoint PCB_PARSER::parseXY() throw( PARSE_ERROR, IO_ERROR )
|
||||||
{
|
{
|
||||||
if( CurTok() != T_LEFT )
|
if( CurTok() != T_LEFT )
|
||||||
NeedLEFT();
|
NeedLEFT();
|
||||||
|
@ -200,7 +200,7 @@ void PCB_PARSER::parseXY( int* aX, int* aY ) throw( PARSE_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR )
|
void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR, IO_ERROR )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( CurTok() == T_effects,
|
wxCHECK_RET( CurTok() == T_effects,
|
||||||
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as EDA_TEXT." ) );
|
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as EDA_TEXT." ) );
|
||||||
|
|
|
@ -172,7 +172,7 @@ class PCB_PARSER : public PCB_LEXER
|
||||||
* @throw PARSE_ERROR if the coordinate pair syntax is incorrect.
|
* @throw PARSE_ERROR if the coordinate pair syntax is incorrect.
|
||||||
* @return A wxPoint object containing the coordinate pair.
|
* @return A wxPoint object containing the coordinate pair.
|
||||||
*/
|
*/
|
||||||
wxPoint parseXY() throw( PARSE_ERROR );
|
wxPoint parseXY() throw( PARSE_ERROR, IO_ERROR );
|
||||||
|
|
||||||
void parseXY( int* aX, int* aY ) throw( PARSE_ERROR );
|
void parseXY( int* aX, int* aY ) throw( PARSE_ERROR );
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ class PCB_PARSER : public PCB_LEXER
|
||||||
* @throw PARSE_ERROR if the text syntax is not valid.
|
* @throw PARSE_ERROR if the text syntax is not valid.
|
||||||
* @param aText A point to the #EDA_TEXT object to save the parsed settings into.
|
* @param aText A point to the #EDA_TEXT object to save the parsed settings into.
|
||||||
*/
|
*/
|
||||||
void parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR );
|
void parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR, IO_ERROR );
|
||||||
|
|
||||||
S3D_MASTER* parse3DModel() throw( PARSE_ERROR, IO_ERROR );
|
S3D_MASTER* parse3DModel() throw( PARSE_ERROR, IO_ERROR );
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ class PCB_PARSER : public PCB_LEXER
|
||||||
return KiROUND( parseDouble( aExpected ) * IU_PER_MM );
|
return KiROUND( parseDouble( aExpected ) * IU_PER_MM );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int parseBoardUnits( PCB_KEYS_T::T aToken ) throw( PARSE_ERROR )
|
inline int parseBoardUnits( PCB_KEYS_T::T aToken ) throw( PARSE_ERROR, IO_ERROR )
|
||||||
{
|
{
|
||||||
return parseBoardUnits( GetTokenText( aToken ) );
|
return parseBoardUnits( GetTokenText( aToken ) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -517,13 +517,16 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::pushVia( PNS_VIA* aVia, const VECTOR2I& aForc
|
||||||
m_currentNode->Remove( aVia );
|
m_currentNode->Remove( aVia );
|
||||||
m_currentNode->Add ( pushedVia );
|
m_currentNode->Add ( pushedVia );
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
m_logger.Log( aVia, 0, "obstacle-via" );
|
||||||
|
#endif
|
||||||
|
|
||||||
if( aVia->BelongsTo( m_currentNode ) )
|
if( aVia->BelongsTo( m_currentNode ) )
|
||||||
delete aVia;
|
delete aVia;
|
||||||
|
|
||||||
pushedVia->SetRank( aCurrentRank - 1 );
|
pushedVia->SetRank( aCurrentRank - 1 );
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
m_logger.Log( aVia, 0, "obstacle-via" );
|
|
||||||
m_logger.Log( pushedVia, 1, "pushed-via" );
|
m_logger.Log( pushedVia, 1, "pushed-via" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,7 @@ void SPECCTRA_DB::readTIME( time_t* time_stamp ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IO_ERROR )
|
void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
FILE_LINE_READER reader( filename );
|
FILE_LINE_READER reader( filename );
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IO_ERROR )
|
void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
FILE_LINE_READER reader( filename );
|
FILE_LINE_READER reader( filename );
|
||||||
|
|
||||||
|
@ -1748,7 +1748,7 @@ void SPECCTRA_DB::doLAYER_RULE( LAYER_RULE* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doPLACE( PLACE* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doPLACE( PLACE* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok = NextTok();
|
T tok = NextTok();
|
||||||
|
|
||||||
|
|
|
@ -3717,7 +3717,7 @@ class SPECCTRA_DB : public SPECCTRA_LEXER
|
||||||
void doLAYER_RULE( LAYER_RULE* growth ) throw( IO_ERROR );
|
void doLAYER_RULE( LAYER_RULE* growth ) throw( IO_ERROR );
|
||||||
void doCLASSES( CLASSES* growth ) throw( IO_ERROR );
|
void doCLASSES( CLASSES* growth ) throw( IO_ERROR );
|
||||||
void doGRID( GRID* growth ) throw( IO_ERROR );
|
void doGRID( GRID* growth ) throw( IO_ERROR );
|
||||||
void doPLACE( PLACE* growth ) throw( IO_ERROR );
|
void doPLACE( PLACE* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
void doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
void doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doPROPERTIES( PROPERTIES* growth ) throw( IO_ERROR );
|
void doPROPERTIES( PROPERTIES* growth ) throw( IO_ERROR );
|
||||||
|
@ -3895,7 +3895,7 @@ public:
|
||||||
* @param filename The name of the dsn file to load.
|
* @param filename The name of the dsn file to load.
|
||||||
* @throw IO_ERROR if there is a lexer or parser error.
|
* @throw IO_ERROR if there is a lexer or parser error.
|
||||||
*/
|
*/
|
||||||
void LoadPCB( const wxString& filename ) throw( IO_ERROR );
|
void LoadPCB( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function LoadSESSION
|
* Function LoadSESSION
|
||||||
|
@ -3907,7 +3907,7 @@ public:
|
||||||
* @param filename The name of the dsn file to load.
|
* @param filename The name of the dsn file to load.
|
||||||
* @throw IO_ERROR if there is a lexer or parser error.
|
* @throw IO_ERROR if there is a lexer or parser error.
|
||||||
*/
|
*/
|
||||||
void LoadSESSION( const wxString& filename ) throw( IO_ERROR );
|
void LoadSESSION( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
|
|
||||||
void ThrowIOError( const wxString& fmt, ... ) throw( IO_ERROR );
|
void ThrowIOError( const wxString& fmt, ... ) throw( IO_ERROR );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue