Fix a bunch of compiler warnings
This commit is contained in:
parent
6fb30398ca
commit
0c049eccc7
|
@ -52,7 +52,7 @@ bool ASSET_ARCHIVE::Load()
|
||||||
|
|
||||||
size_t offset = 0;
|
size_t offset = 0;
|
||||||
|
|
||||||
while( ( entry = tarStream.GetNextEntry() ) )
|
while( ( entry = tarStream.GetNextEntry() ) != nullptr )
|
||||||
{
|
{
|
||||||
if( entry->IsDir() )
|
if( entry->IsDir() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -321,7 +321,7 @@ int EDA_PATTERN_MATCH_RELATIONAL::FindOne( const wxString& aCandidate ) const
|
||||||
wxString val = m_regex_description.GetMatch( aCandidate, 2 );
|
wxString val = m_regex_description.GetMatch( aCandidate, 2 );
|
||||||
wxString unit = m_regex_description.GetMatch( aCandidate, 3 );
|
wxString unit = m_regex_description.GetMatch( aCandidate, 3 );
|
||||||
|
|
||||||
int istart = ( start > std::numeric_limits<int>::max() ) ? std::numeric_limits<int>::max() : start;
|
int istart = static_cast<int>( CLAMPED_VAL_INT_MAX( start ) );
|
||||||
|
|
||||||
if( key.Lower() != m_key )
|
if( key.Lower() != m_key )
|
||||||
return EDA_PATTERN_NOT_FOUND;
|
return EDA_PATTERN_NOT_FOUND;
|
||||||
|
|
|
@ -53,7 +53,7 @@ static std::string strValue( double aValue )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double div = 1e3;
|
double div = 1e3;
|
||||||
int unit = 'K';
|
char unit = 'K';
|
||||||
|
|
||||||
if( aValue >= 1e6 )
|
if( aValue >= 1e6 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -136,7 +136,7 @@ int SHADER::AddParameter( const std::string& aParameterName )
|
||||||
else
|
else
|
||||||
throw std::runtime_error( "Could not find shader uniform: " + aParameterName );
|
throw std::runtime_error( "Could not find shader uniform: " + aParameterName );
|
||||||
|
|
||||||
return parameterLocation.size() - 1;
|
return static_cast<int>( parameterLocation.size() ) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ bool SHADER::loadShaderFromStringArray( SHADER_TYPE aShaderType, const char** aA
|
||||||
programInfo( programNumber );
|
programInfo( programNumber );
|
||||||
|
|
||||||
// Attach the sources
|
// Attach the sources
|
||||||
glShaderSource( shaderNumber, aSize, (const GLchar**) aArray, nullptr );
|
glShaderSource( shaderNumber, static_cast<GLsizei>( aSize ), (const GLchar**) aArray, nullptr );
|
||||||
programInfo( programNumber );
|
programInfo( programNumber );
|
||||||
|
|
||||||
// Compile and attach shader to the program
|
// Compile and attach shader to the program
|
||||||
|
|
|
@ -75,7 +75,7 @@ wxString FindKicadFile( const wxString& shortname )
|
||||||
// kicad can be installed highly portably on Windows, anywhere and concurrently
|
// kicad can be installed highly portably on Windows, anywhere and concurrently
|
||||||
// either the "kicad file" is immediately adjacent to the exe or it's not a valid install
|
// either the "kicad file" is immediately adjacent to the exe or it's not a valid install
|
||||||
return shortname;
|
return shortname;
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
// Path list for KiCad binary files
|
// Path list for KiCad binary files
|
||||||
const static wxChar* possibilities[] = {
|
const static wxChar* possibilities[] = {
|
||||||
|
@ -109,6 +109,8 @@ wxString FindKicadFile( const wxString& shortname )
|
||||||
}
|
}
|
||||||
|
|
||||||
return shortname;
|
return shortname;
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -526,7 +526,7 @@ bool checkHeaderHelper( INPUT_TYPE& aInput )
|
||||||
if( !parse<VALID_HEADER>( aInput ) )
|
if( !parse<VALID_HEADER>( aInput ) )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch( const parse_error& e )
|
catch( const parse_error& )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ VECTOR2I ARC_GEOM_MANAGER::GetOrigin() const
|
||||||
|
|
||||||
VECTOR2I ARC_GEOM_MANAGER::GetStartRadiusEnd() const
|
VECTOR2I ARC_GEOM_MANAGER::GetStartRadiusEnd() const
|
||||||
{
|
{
|
||||||
VECTOR2I vec( m_radius, 0 );
|
VECTOR2I vec( static_cast<int>( m_radius ), 0 );
|
||||||
RotatePoint( vec, -m_startAngle );
|
RotatePoint( vec, -m_startAngle );
|
||||||
return m_origin +vec;
|
return m_origin +vec;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ VECTOR2I ARC_GEOM_MANAGER::GetStartRadiusEnd() const
|
||||||
|
|
||||||
VECTOR2I ARC_GEOM_MANAGER::GetEndRadiusEnd() const
|
VECTOR2I ARC_GEOM_MANAGER::GetEndRadiusEnd() const
|
||||||
{
|
{
|
||||||
VECTOR2I vec( m_radius, 0 );
|
VECTOR2I vec( static_cast<int>( m_radius ), 0 );
|
||||||
RotatePoint( vec, -m_endAngle );
|
RotatePoint( vec, -m_endAngle );
|
||||||
return m_origin + vec;
|
return m_origin + vec;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2696,19 +2696,16 @@ bool mpWindow::SaveScreenshot( const wxString& filename, wxBitmapType type, wxSi
|
||||||
bool fit )
|
bool fit )
|
||||||
{
|
{
|
||||||
int sizeX, sizeY;
|
int sizeX, sizeY;
|
||||||
int bk_scrX, bk_scrY;
|
|
||||||
|
|
||||||
if( imageSize == wxDefaultSize )
|
if( imageSize == wxDefaultSize )
|
||||||
{
|
{
|
||||||
sizeX = m_scrX;
|
sizeX = m_scrX;
|
||||||
sizeY = m_scrY;
|
sizeY = m_scrY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sizeX = imageSize.x;
|
sizeX = imageSize.x;
|
||||||
sizeY = imageSize.y;
|
sizeY = imageSize.y;
|
||||||
bk_scrX = m_scrX;
|
|
||||||
bk_scrY = m_scrY;
|
|
||||||
SetScr( sizeX, sizeY );
|
SetScr( sizeX, sizeY );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2733,6 +2730,8 @@ bool mpWindow::SaveScreenshot( const wxString& filename, wxBitmapType type, wxSi
|
||||||
if( imageSize != wxDefaultSize )
|
if( imageSize != wxDefaultSize )
|
||||||
{
|
{
|
||||||
// Restore dimensions
|
// Restore dimensions
|
||||||
|
int bk_scrX = m_scrX;
|
||||||
|
int bk_scrY = m_scrY;
|
||||||
SetScr( bk_scrX, bk_scrY );
|
SetScr( bk_scrX, bk_scrY );
|
||||||
Fit( m_desiredXmin, m_desiredXmax, m_desiredYmin, m_desiredYmax, &bk_scrX, &bk_scrY );
|
Fit( m_desiredXmin, m_desiredXmax, m_desiredYmin, m_desiredYmax, &bk_scrX, &bk_scrY );
|
||||||
UpdateAll();
|
UpdateAll();
|
||||||
|
|
|
@ -439,7 +439,7 @@ bool WX_GRID::CancelPendingChanges()
|
||||||
wxGridCellAttr* attr = GetCellAttr( row, col );
|
wxGridCellAttr* attr = GetCellAttr( row, col );
|
||||||
wxGridCellEditor* editor = attr->GetEditor( this, row, col );
|
wxGridCellEditor* editor = attr->GetEditor( this, row, col );
|
||||||
|
|
||||||
bool changed = editor->EndEdit( row, col, this, oldval, &newval );
|
editor->EndEdit( row, col, this, oldval, &newval );
|
||||||
|
|
||||||
editor->DecRef();
|
editor->DecRef();
|
||||||
attr->DecRef();
|
attr->DecRef();
|
||||||
|
|
|
@ -112,7 +112,7 @@ void DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::OnItemClicked( wxMouseEvent& event
|
||||||
long idx = m_listFp->HitTest( pos, flgs );
|
long idx = m_listFp->HitTest( pos, flgs );
|
||||||
|
|
||||||
// Try to find the column clicked (must be COL_SELCMP or COL_SELSCH)
|
// Try to find the column clicked (must be COL_SELCMP or COL_SELSCH)
|
||||||
int colclr = -1, colset;
|
int colclr = -1, colset = -1;
|
||||||
int minpx = m_listFp->GetColumnWidth( 0 ) + m_listFp->GetColumnWidth( 1 );
|
int minpx = m_listFp->GetColumnWidth( 0 ) + m_listFp->GetColumnWidth( 1 );
|
||||||
int maxpx = minpx + m_listFp->GetColumnWidth( 2 );
|
int maxpx = minpx + m_listFp->GetColumnWidth( 2 );
|
||||||
|
|
||||||
|
|
|
@ -209,6 +209,3 @@ SCH_IO_MGR::SCH_FILE_T SCH_IO_MGR::GuessPluginTypeFromSchPath( const wxString& a
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DECLARE_ENUM_VECTOR( SCH_IO_MGR, SCH_FILE_T )
|
|
||||||
|
|
|
@ -25,34 +25,23 @@
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io_mgr.h>
|
||||||
#include <wx/translation.h>
|
#include <wx/translation.h>
|
||||||
|
|
||||||
#define FMT_UNIMPLEMENTED "Plugin \"%s\" does not implement the \"%s\" function."
|
#define FMT_UNIMPLEMENTED wxT( "Plugin \"%s\" does not implement the \"%s\" function." )
|
||||||
|
#define NOT_IMPLEMENTED( aCaller ) \
|
||||||
/**
|
THROW_IO_ERROR( wxString::Format( FMT_UNIMPLEMENTED, \
|
||||||
* Function not_implemented
|
GetName().GetData(), \
|
||||||
* throws an IO_ERROR and complains of an API function not being implemented.
|
|
||||||
*
|
|
||||||
* @param aPlugin is a SCH_PLUGIN instance
|
|
||||||
* @param aCaller is the name of the unimplemented API function.
|
|
||||||
*/
|
|
||||||
static void not_implemented( const SCH_PLUGIN* aPlugin, const char* aCaller )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( wxString::Format( FMT_UNIMPLEMENTED,
|
|
||||||
aPlugin->GetName().GetData(),
|
|
||||||
wxString::FromUTF8( aCaller ).GetData() ) );
|
wxString::FromUTF8( aCaller ).GetData() ) );
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties )
|
void SCH_PLUGIN::SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SCH_SHEET* SCH_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
SCH_SHEET* SCH_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||||
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +49,7 @@ void SCH_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC*
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +58,7 @@ void SCH_PLUGIN::EnumerateSymbolLib( wxArrayString& aAliasNameList,
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +67,7 @@ void SCH_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,8 +75,7 @@ LIB_SYMBOL* SCH_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,7 +83,7 @@ void SCH_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSy
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,30 +91,28 @@ void SCH_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSy
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
void SCH_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
bool SCH_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_PLUGIN::IsSymbolLibWritable( const wxString& aLibraryPath )
|
bool SCH_PLUGIN::IsSymbolLibWritable( const wxString& aLibraryPath )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -169,15 +155,12 @@ void SCH_PLUGIN::SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
|
||||||
bool SCH_PLUGIN::CheckHeader( const wxString& aFileName )
|
bool SCH_PLUGIN::CheckHeader( const wxString& aFileName )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const wxString& SCH_PLUGIN::GetError() const
|
const wxString& SCH_PLUGIN::GetError() const
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
static wxString error;
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2658,7 +2658,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadItemOntoKiCadSheet( LAYER_ID aCadstarSheetI
|
||||||
|
|
||||||
if( aCadstarSheetID == "ALL_SHEETS" )
|
if( aCadstarSheetID == "ALL_SHEETS" )
|
||||||
{
|
{
|
||||||
SCH_ITEM* duplicateItem;
|
SCH_ITEM* duplicateItem = nullptr;
|
||||||
|
|
||||||
for( std::pair<LAYER_ID, SHEET_NAME> sheetPair : Sheets.SheetNames )
|
for( std::pair<LAYER_ID, SHEET_NAME> sheetPair : Sheets.SheetNames )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1498,7 +1498,7 @@ std::vector<std::pair<int, double>> KIBIS_WAVEFORM_PRBS::GenerateBitSequence()
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
uint8_t lsb = lfsr & 0x01;
|
uint8_t lsb = lfsr & 0x01;
|
||||||
bitSequence.emplace_back( ( inverted ^ lsb ? 1 : 0 ), t );
|
bitSequence.emplace_back( ( static_cast<uint8_t>( inverted ) ^ lsb ? 1 : 0 ), t );
|
||||||
lfsr = lfsr >> 1;
|
lfsr = lfsr >> 1;
|
||||||
|
|
||||||
if ( lsb )
|
if ( lsb )
|
||||||
|
|
|
@ -447,7 +447,7 @@ std::unique_ptr<SIM_MODEL> SIM_MODEL::Create( TYPE aType, const std::vector<LIB_
|
||||||
// Passing nullptr to ReadDataFields will make it act as if all fields were empty.
|
// Passing nullptr to ReadDataFields will make it act as if all fields were empty.
|
||||||
model->ReadDataFields( static_cast<const std::vector<SCH_FIELD>*>( nullptr ), aPins );
|
model->ReadDataFields( static_cast<const std::vector<SCH_FIELD>*>( nullptr ), aPins );
|
||||||
}
|
}
|
||||||
catch( IO_ERROR& err )
|
catch( IO_ERROR& )
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( "Shouldn't throw reading empty fields!" );
|
wxFAIL_MSG( "Shouldn't throw reading empty fields!" );
|
||||||
}
|
}
|
||||||
|
@ -484,7 +484,7 @@ std::unique_ptr<SIM_MODEL> SIM_MODEL::Create( const SIM_MODEL* aBaseModel,
|
||||||
{
|
{
|
||||||
model->ReadDataFields( static_cast<const std::vector<SCH_FIELD>*>( nullptr ), aPins );
|
model->ReadDataFields( static_cast<const std::vector<SCH_FIELD>*>( nullptr ), aPins );
|
||||||
}
|
}
|
||||||
catch( IO_ERROR& err )
|
catch( IO_ERROR& )
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( "Shouldn't throw reading empty fields!" );
|
wxFAIL_MSG( "Shouldn't throw reading empty fields!" );
|
||||||
}
|
}
|
||||||
|
|
|
@ -557,7 +557,7 @@ void SIM_PLOT_PANEL::prepareDCAxes( int aNewTraceType )
|
||||||
|
|
||||||
if( sim_cmd.StartsWith( ".dc", &rem ) )
|
if( sim_cmd.StartsWith( ".dc", &rem ) )
|
||||||
{
|
{
|
||||||
wxChar ch;
|
wxChar ch = 0;
|
||||||
|
|
||||||
rem.Trim( false );
|
rem.Trim( false );
|
||||||
|
|
||||||
|
|
|
@ -1364,7 +1364,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
else if( isSheetPin )
|
else if( isSheetPin )
|
||||||
{
|
{
|
||||||
EDA_ITEM* i;
|
EDA_ITEM* i = nullptr;
|
||||||
|
|
||||||
// If we didn't have a sheet selected, try to find one under the cursor
|
// If we didn't have a sheet selected, try to find one under the cursor
|
||||||
if( !sheet && m_selectionTool->SelectPoint( cursorPos, { SCH_SHEET_T }, &i ) )
|
if( !sheet && m_selectionTool->SelectPoint( cursorPos, { SCH_SHEET_T }, &i ) )
|
||||||
|
|
|
@ -461,7 +461,7 @@ bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aR
|
||||||
bool reported_no_more_layer = false;
|
bool reported_no_more_layer = false;
|
||||||
KIGFX::VIEW* view = GetCanvas()->GetView();
|
KIGFX::VIEW* view = GetCanvas()->GetView();
|
||||||
|
|
||||||
while( ( entry = zipArchive.GetNextEntry() ) )
|
while( ( entry = zipArchive.GetNextEntry() ) != nullptr )
|
||||||
{
|
{
|
||||||
if( entry->IsDir() )
|
if( entry->IsDir() )
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -195,7 +195,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
|
||||||
char* line;
|
char* line;
|
||||||
wxString data;
|
wxString data;
|
||||||
|
|
||||||
while( ( line = jobfileReader.ReadLine() ) )
|
while( ( line = jobfileReader.ReadLine() ) != nullptr )
|
||||||
data << line << '\n';
|
data << line << '\n';
|
||||||
|
|
||||||
// detect the file format: old (deprecated) gerber format or official JSON format
|
// detect the file format: old (deprecated) gerber format or official JSON format
|
||||||
|
|
|
@ -132,7 +132,7 @@ bool GERBER_JOBFILE_READER::ReadGerberJobFile()
|
||||||
|
|
||||||
if( json_format )
|
if( json_format )
|
||||||
{
|
{
|
||||||
while( ( line = jobfileReader.ReadLine() ) )
|
while( ( line = jobfileReader.ReadLine() ) != nullptr )
|
||||||
data << '\n' << line;
|
data << '\n' << line;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -967,7 +967,6 @@ char* GERBER_FILE_IMAGE::GetNextLine( char *aBuff, unsigned int aBuffSize, char*
|
||||||
return aText;
|
return aText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return aText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -128,8 +128,8 @@ void TransformEllipseToBeziers( const ELLIPSE<T>& aEllipse, std::vector<BEZIER<T
|
||||||
const int minBeziersPerCircle = 4;
|
const int minBeziersPerCircle = 4;
|
||||||
|
|
||||||
/// The number of Beziers needed for the given arc
|
/// The number of Beziers needed for the given arc
|
||||||
const int numBeziers = std::ceil( std::abs( arcAngle.AsRadians() /
|
const int numBeziers = static_cast<int>(
|
||||||
( 2 * M_PI / minBeziersPerCircle ) ) );
|
std::ceil( std::abs( arcAngle.AsRadians() / ( 2 * M_PI / minBeziersPerCircle ) ) ) );
|
||||||
|
|
||||||
/// Angle occupied by each Bezier
|
/// Angle occupied by each Bezier
|
||||||
const double angleIncrement = arcAngle.AsRadians() / numBeziers;
|
const double angleIncrement = arcAngle.AsRadians() / numBeziers;
|
||||||
|
|
|
@ -34,8 +34,8 @@ EDA_ANGLE EDA_ANGLE::KeepUpright() const
|
||||||
EDA_ANGLE inAngle( *this );
|
EDA_ANGLE inAngle( *this );
|
||||||
inAngle.Normalize();
|
inAngle.Normalize();
|
||||||
|
|
||||||
int inDegrees = inAngle.AsDegrees();
|
double inDegrees = inAngle.AsDegrees();
|
||||||
int outDegrees;
|
double outDegrees;
|
||||||
|
|
||||||
if( inDegrees <= 45 || inDegrees >= 315 || ( inDegrees > 135 && inDegrees <= 225 ) )
|
if( inDegrees <= 45 || inDegrees >= 315 || ( inDegrees > 135 && inDegrees <= 225 ) )
|
||||||
outDegrees = 0;
|
outDegrees = 0;
|
||||||
|
|
|
@ -354,7 +354,7 @@ int SEG::LineDistance( const VECTOR2I& aP, bool aDetermineSide ) const
|
||||||
|
|
||||||
ecoord dist = isqrt( dist_sq );
|
ecoord dist = isqrt( dist_sq );
|
||||||
|
|
||||||
return aDetermineSide ? dist : std::abs( dist );
|
return static_cast<int>( aDetermineSide ? dist : std::abs( dist ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1478,8 +1478,6 @@ static inline void addIntersection( SHAPE_LINE_CHAIN::INTERSECTIONS& aIps, int a
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& last = aIps.back();
|
|
||||||
|
|
||||||
aIps.push_back( aP );
|
aIps.push_back( aP );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ public:
|
||||||
Vertex* match = nullptr;
|
Vertex* match = nullptr;
|
||||||
|
|
||||||
// Only run the expensive search if we don't already have a match for the point
|
// Only run the expensive search if we don't already have a match for the point
|
||||||
if( ( all_hits.empty() || all_hits.count( p ) == 0 ) && ( match = getKink( p ) ) )
|
if( ( all_hits.empty() || all_hits.count( p ) == 0 ) && ( match = getKink( p ) ) != nullptr )
|
||||||
{
|
{
|
||||||
if( !all_hits.count( match ) && m_hits.emplace( p->i, match->i ).second )
|
if( !all_hits.count( match ) && m_hits.emplace( p->i, match->i ).second )
|
||||||
{
|
{
|
||||||
|
|
|
@ -641,8 +641,8 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
|
||||||
|
|
||||||
std::shared_ptr<SHAPE> otherShape = other->GetEffectiveShape( aLayer );
|
std::shared_ptr<SHAPE> otherShape = other->GetEffectiveShape( aLayer );
|
||||||
DRC_CONSTRAINT constraint;
|
DRC_CONSTRAINT constraint;
|
||||||
int clearance;
|
int clearance = 0;
|
||||||
int actual;
|
int actual = 0;
|
||||||
VECTOR2I pos;
|
VECTOR2I pos;
|
||||||
|
|
||||||
if( otherPad && pad->SameLogicalPadAs( otherPad ) )
|
if( otherPad && pad->SameLogicalPadAs( otherPad ) )
|
||||||
|
|
|
@ -131,7 +131,7 @@ void DRC_TEST_PROVIDER_HOLE_SIZE::checkPadHole( PAD* aPad )
|
||||||
UNDEFINED_LAYER /* holes are not layer-specific */ );
|
UNDEFINED_LAYER /* holes are not layer-specific */ );
|
||||||
bool fail_min = false;
|
bool fail_min = false;
|
||||||
bool fail_max = false;
|
bool fail_max = false;
|
||||||
int constraintValue;
|
int constraintValue = 0;
|
||||||
|
|
||||||
if( constraint.GetSeverity() == RPT_SEVERITY_IGNORE )
|
if( constraint.GetSeverity() == RPT_SEVERITY_IGNORE )
|
||||||
return;
|
return;
|
||||||
|
@ -200,7 +200,7 @@ void DRC_TEST_PROVIDER_HOLE_SIZE::checkViaHole( PCB_VIA* via, bool aExceedMicro,
|
||||||
UNDEFINED_LAYER /* holes are not layer-specific */ );
|
UNDEFINED_LAYER /* holes are not layer-specific */ );
|
||||||
bool fail_min = false;
|
bool fail_min = false;
|
||||||
bool fail_max = false;
|
bool fail_max = false;
|
||||||
int constraintValue;
|
int constraintValue = 0;
|
||||||
|
|
||||||
if( constraint.GetSeverity() == RPT_SEVERITY_IGNORE )
|
if( constraint.GetSeverity() == RPT_SEVERITY_IGNORE )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -104,7 +104,7 @@ bool DRC_TEST_PROVIDER_TRACK_WIDTH::Run()
|
||||||
item->GetLayer() );
|
item->GetLayer() );
|
||||||
bool fail_min = false;
|
bool fail_min = false;
|
||||||
bool fail_max = false;
|
bool fail_max = false;
|
||||||
int constraintWidth;
|
int constraintWidth = 0;
|
||||||
|
|
||||||
if( constraint.GetSeverity() != RPT_SEVERITY_IGNORE )
|
if( constraint.GetSeverity() != RPT_SEVERITY_IGNORE )
|
||||||
{
|
{
|
||||||
|
|
|
@ -407,7 +407,7 @@ bool FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
|
||||||
|
|
||||||
( *m_internals )[m_internals->PointerFromString( "appearance.color_theme" )] = "user_footprints";
|
( *m_internals )[m_internals->PointerFromString( "appearance.color_theme" )] = "user_footprints";
|
||||||
|
|
||||||
double x, y;
|
double x = 0, y = 0;
|
||||||
f = "ModEditFrame";
|
f = "ModEditFrame";
|
||||||
|
|
||||||
if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) )
|
if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) )
|
||||||
|
|
|
@ -175,7 +175,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter )
|
||||||
KIID_PATH path = component->GetPath();
|
KIID_PATH path = component->GetPath();
|
||||||
path.push_back( uuid );
|
path.push_back( uuid );
|
||||||
|
|
||||||
if( ( fpOnBoard = m_pcb->FindFootprintByPath( path ) ) )
|
if( ( fpOnBoard = m_pcb->FindFootprintByPath( path ) ) != nullptr )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -889,7 +889,7 @@ bool PCBNEW_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
|
||||||
|
|
||||||
Set( "appearance.color_theme", cs->GetFilename() );
|
Set( "appearance.color_theme", cs->GetFilename() );
|
||||||
|
|
||||||
double x, y;
|
double x = 0, y = 0;
|
||||||
|
|
||||||
if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) )
|
if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,40 +27,30 @@
|
||||||
#include <wx/translation.h>
|
#include <wx/translation.h>
|
||||||
|
|
||||||
|
|
||||||
#define FMT_UNIMPLEMENTED wxT( "Plugin \"%s\" does not implement the \"%s\" function." )
|
#define FMT_UNIMPLEMENTED wxT( "Plugin \"%s\" does not implement the \"%s\" function." )
|
||||||
|
#define NOT_IMPLEMENTED( aCaller ) \
|
||||||
/**
|
THROW_IO_ERROR( wxString::Format( FMT_UNIMPLEMENTED, \
|
||||||
* Throw an #IO_ERROR and complains of an API function not being implemented.
|
PluginName(), \
|
||||||
*
|
|
||||||
* @param aPlugin is a #PLUGIN instance.
|
|
||||||
* @param aCaller is the name of the unimplemented API function.
|
|
||||||
*/
|
|
||||||
static void not_implemented( PLUGIN* aPlugin, const char* aCaller )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( wxString::Format( FMT_UNIMPLEMENTED,
|
|
||||||
aPlugin->PluginName(),
|
|
||||||
wxString::FromUTF8( aCaller ) ) );
|
wxString::FromUTF8( aCaller ) ) );
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BOARD* PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
|
BOARD* PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
|
||||||
PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter )
|
PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter )
|
||||||
{
|
{
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::vector<FOOTPRINT*> PLUGIN::GetImportedCachedLibraryFootprints()
|
std::vector<FOOTPRINT*> PLUGIN::GetImportedCachedLibraryFootprints()
|
||||||
{
|
{
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return std::vector<FOOTPRINT*>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const STRING_UTF8_MAP* aProperties )
|
void PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +58,7 @@ void PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString&
|
||||||
bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
|
bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,8 +88,7 @@ FOOTPRINT* PLUGIN::FootprintLoad( const wxString& aLibraryPath, const wxString&
|
||||||
bool aKeepUUID, const STRING_UTF8_MAP* aProperties )
|
bool aKeepUUID, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,7 +96,7 @@ void PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFoot
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,30 +104,28 @@ void PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFoo
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
void PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
bool PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath )
|
bool PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
|
||||||
not_implemented( this, __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ bool WRL2INLINE::Read( WRLPROC& proc, WRL2BASE* aTopNode )
|
||||||
|
|
||||||
proc.Pop();
|
proc.Pop();
|
||||||
|
|
||||||
while( ( tok = proc.Peek() ) )
|
while( ( tok = proc.Peek() ) != 0 )
|
||||||
{
|
{
|
||||||
std::string glob;
|
std::string glob;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ int main( int argc, char **argv )
|
||||||
string dname; // DXF filename
|
string dname; // DXF filename
|
||||||
string gname; // Geometry Name
|
string gname; // Geometry Name
|
||||||
string pname; // Part Name
|
string pname; // Part Name
|
||||||
double height; // extrusion height
|
double height = 0; // extrusion height
|
||||||
bool inch = false; // true = inches, false = mm
|
bool inch = false; // true = inches, false = mm
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
|
|
|
@ -759,7 +759,7 @@ bool MakeComponents( IDF3_BOARD& board, std::ostream& file, bool compact )
|
||||||
tY += vY;
|
tY += vY;
|
||||||
tA += vA;
|
tA += vA;
|
||||||
|
|
||||||
if( ( pout = (IDF3_COMP_OUTLINE*)((*so)->GetOutline()) ) )
|
if( ( pout = (IDF3_COMP_OUTLINE*)((*so)->GetOutline()) ) != nullptr )
|
||||||
{
|
{
|
||||||
vcp = GetColor( cmap, cidx, pout->GetUID() );
|
vcp = GetColor( cmap, cidx, pout->GetUID() );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue