Fix compil issues (especially easyeda_parser_base.xx) and compil warnings

Compil issues can be gcc13/msys2 specific.
This commit is contained in:
jean-pierre charras 2023-09-07 13:41:25 +02:00
parent 9b85942b80
commit 3e6f7ab3e5
7 changed files with 19 additions and 23 deletions

View File

@ -66,13 +66,6 @@ double EASYEDA_PARSER_BASE::RelPosY( const wxString& aValue )
}
template <typename T>
VECTOR2<T> EASYEDA_PARSER_BASE::RelPos( const VECTOR2<T>& aVec )
{
return ScalePos( aVec - m_relOrigin );
}
SHAPE_POLY_SET EASYEDA_PARSER_BASE::ParsePolygons( const wxString& data, int aArcMinSegLen )
{
SHAPE_POLY_SET result;

View File

@ -53,7 +53,10 @@ public:
double RelPosY( const wxString& aValue );
template <typename T>
VECTOR2<T> RelPos( const VECTOR2<T>& aVec );
VECTOR2<T> RelPos( const VECTOR2<T>& aVec )
{
return ScalePos( aVec - m_relOrigin );
}
SHAPE_POLY_SET ParsePolygons( const wxString& aData, int aArcMinSegLen );

View File

@ -637,11 +637,11 @@ void SHAPE_POLY_SET::RebuildHolesFromContours()
for( SHAPE_LINE_CHAIN& contour : contours )
contour.GenerateBBoxCache();
for( int i = 0; i < contours.size(); i++ )
for( size_t i = 0; i < contours.size(); i++ )
{
const SHAPE_LINE_CHAIN& outline = contours[i];
for( int j = 0; j < contours.size(); j++ )
for( size_t j = 0; j < contours.size(); j++ )
{
if( i == j )
continue;
@ -659,7 +659,7 @@ void SHAPE_POLY_SET::RebuildHolesFromContours()
std::set<int> topLevelParents;
for( int i = 0; i < contours.size(); i++ )
for( size_t i = 0; i < contours.size(); i++ )
{
if( childToParents[i].size() == 0 )
{

View File

@ -207,14 +207,14 @@ void ConnectBoardShapes( std::vector<PCB_SHAPE*>& aShapeList,
{
graphic = *startCandidates.begin();
auto walkFrom = [&]( PCB_SHAPE* graphic, VECTOR2I startPt )
auto walkFrom = [&]( PCB_SHAPE* curr_graphic, VECTOR2I startPt )
{
VECTOR2I prevPt = startPt;
for( ;; )
{
// Get next closest segment.
PCB_SHAPE* nextGraphic = findNext( graphic, prevPt, aShapeList, aChainingEpsilon );
PCB_SHAPE* nextGraphic = findNext( curr_graphic, prevPt, aShapeList, aChainingEpsilon );
if( !nextGraphic )
break;
@ -225,8 +225,8 @@ void ConnectBoardShapes( std::vector<PCB_SHAPE*>& aShapeList,
if( !closer_to_first( prevPt, nstart, nend ) )
std::swap( nstart, nend );
if( !connectPair( graphic, nextGraphic ) )
addSegment( prevPt, nstart, graphic->GetWidth(), graphic->GetLayer() );
if( !connectPair( curr_graphic, nextGraphic ) )
addSegment( prevPt, nstart, curr_graphic->GetWidth(), curr_graphic->GetLayer() );
// Shape might've changed
nstart = nextGraphic->GetStart();
@ -236,9 +236,9 @@ void ConnectBoardShapes( std::vector<PCB_SHAPE*>& aShapeList,
std::swap( nstart, nend );
prevPt = nend;
graphic = nextGraphic;
graphic->SetFlags( SKIP_STRUCT );
startCandidates.erase( graphic );
curr_graphic = nextGraphic;
curr_graphic->SetFlags( SKIP_STRUCT );
startCandidates.erase( curr_graphic );
}
};

View File

@ -62,7 +62,7 @@ public:
bool aBestEfforts,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints();
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,

View File

@ -64,7 +64,7 @@ public:
bool aBestEfforts,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints();
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,

View File

@ -215,7 +215,7 @@ UTILS_STEP_MODEL* UTILS_STEP_MODEL::LoadSTEP( const wxString& aFileName )
m_app->NewDocument( "MDTV-XCAF", data->m_backDoc );
STEPCAFControl_Reader reader;
IFSelect_ReturnStatus stat = reader.ReadFile( aFileName );
IFSelect_ReturnStatus stat = reader.ReadFile( aFileName.ToStdString().c_str() );
if( stat != IFSelect_RetDone )
return nullptr;
@ -314,7 +314,7 @@ void UTILS_STEP_MODEL::Scale( double aScale )
std::swap( m_data->m_frontDoc, m_data->m_backDoc );
Handle( XCAFApp_Application ) m_app = XCAFApp_Application::GetApplication();
m_data->m_backDoc->Main().ForgetAllAttributes();
m_app->Close( m_data->m_backDoc );
m_app->NewDocument( "MDTV-XCAF", m_data->m_backDoc );
@ -334,7 +334,7 @@ bool UTILS_STEP_MODEL::SaveSTEP( const wxString& aFileName )
if( !writer.Transfer( m_data->m_frontDoc, STEPControl_AsIs ) )
return false;
if( writer.Write( aFileName ) != IFSelect_RetDone )
if( writer.Write( aFileName.ToStdString().c_str() ) != IFSelect_RetDone )
return false;
Handle( XCAFApp_Application ) m_app = XCAFApp_Application::GetApplication();