Cleanup compiler warnings

This commit is contained in:
Ian McInerney 2020-11-25 00:08:09 +00:00
parent 1cae0b6c08
commit d50d728d19
6 changed files with 20 additions and 17 deletions

View File

@ -165,7 +165,7 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
// Here a "suffix" == an extension with a preceding '.', // Here a "suffix" == an extension with a preceding '.',
// so skip the preceding '.' to get an extension // so skip the preceding '.' to get an extension
fn.SetExt( KIFACE_SUFFIX + 1 ); // + 1 => &KIFACE_SUFFIX[1] fn.SetExt( &KIFACE_SUFFIX[1] );
return fn.GetFullPath(); return fn.GetFullPath();
} }

View File

@ -210,7 +210,8 @@ bool SCH_EDIT_TOOL::Init()
SCH_ITEM* firstItem = dynamic_cast<SCH_ITEM*>( aSel.Front() ); SCH_ITEM* firstItem = dynamic_cast<SCH_ITEM*>( aSel.Front() );
const EE_SELECTION* eeSelection = dynamic_cast<const EE_SELECTION*>( &aSel ); const EE_SELECTION* eeSelection = dynamic_cast<const EE_SELECTION*>( &aSel );
wxCHECK( firstItem, false ); if( !firstItem || !eeSelection )
return false;
switch( firstItem->Type() ) switch( firstItem->Type() )
{ {

View File

@ -87,14 +87,14 @@ void DIALOG_FOOTPRINT_CHECKER::runChecks()
} }
OUTLINE_ERROR_HANDLER errorHandler = OUTLINE_ERROR_HANDLER errorHandler =
[&]( const wxString& msg, BOARD_ITEM* itemA, BOARD_ITEM* itemB, const wxPoint& pt ) [&]( const wxString& aMsg, BOARD_ITEM* aItemA, BOARD_ITEM* aItemB, const wxPoint& aPt )
{ {
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_MALFORMED_COURTYARD ); std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_MALFORMED_COURTYARD );
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg ); drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + aMsg );
drcItem->SetItems( itemA, itemB ); drcItem->SetItems( aItemA, aItemB );
PCB_MARKER* marker = new PCB_MARKER( drcItem, pt ); PCB_MARKER* marker = new PCB_MARKER( drcItem, aPt );
board->Add( marker ); board->Add( marker );
m_frame->GetCanvas()->GetView()->Add( marker ); m_frame->GetCanvas()->GetView()->Add( marker );
}; };

View File

@ -162,19 +162,21 @@ void MWAVE_POLYGONAL_SHAPE_DLG::OnOkClick( wxCommandEvent& event )
void MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr( wxCommandEvent& event ) void MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr( wxCommandEvent& event )
{ {
static wxString lastpath; // To remember the last open path during a session static wxString lastpath; // To remember the last open path during a session
wxString fullFileName;
wxString mask = wxFileSelectorDefaultWildcardStr; wxString mask = wxFileSelectorDefaultWildcardStr;
wxString FullFileName = EDA_FILE_SELECTOR( _( "Read descr shape file" ), lastpath, fullFileName = EDA_FILE_SELECTOR( _( "Read descr shape file" ), lastpath,
FullFileName, wxEmptyString, mask, this, fullFileName, wxEmptyString, mask, this,
wxFD_OPEN, true ); wxFD_OPEN, true );
if( FullFileName.IsEmpty() )
if( fullFileName.IsEmpty() )
return; return;
wxFileName fn( FullFileName ); wxFileName fn( fullFileName );
lastpath = fn.GetPath(); lastpath = fn.GetPath();
PolyEdges.clear(); PolyEdges.clear();
FILE* File = wxFopen( FullFileName, wxT( "rt" ) ); FILE* File = wxFopen( fullFileName, wxT( "rt" ) );
if( File == NULL ) if( File == NULL )
{ {
@ -185,7 +187,7 @@ void MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr( wxCommandEvent& event )
double unitconv = IU_PER_MM; double unitconv = IU_PER_MM;
ShapeScaleX = ShapeScaleY = 1.0; ShapeScaleX = ShapeScaleY = 1.0;
FILE_LINE_READER fileReader( File, FullFileName ); FILE_LINE_READER fileReader( File, fullFileName );
FILTER_READER reader( fileReader ); FILTER_READER reader( fileReader );
LOCALE_IO toggle; LOCALE_IO toggle;

View File

@ -2032,14 +2032,14 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
evt->SetPassEvent(); evt->SetPassEvent();
} }
} }
else if( evt->IsAction( &ACTIONS::updateUnits ) ) /*else if( evt->IsAction( &ACTIONS::updateUnits ) )
{ {
// If we ever have an assistant here that reports dimensions, we'll want to // If we ever have an assistant here that reports dimensions, we'll want to
// update its units here.... // update its units here....
// zoneAsst.SetUnits( frame()->GetUserUnits() ); // zoneAsst.SetUnits( frame()->GetUserUnits() );
// m_view->Update( &zoneAsst ); // m_view->Update( &zoneAsst );
evt->SetPassEvent(); evt->SetPassEvent();
} }*/
else else
{ {
evt->SetPassEvent(); evt->SetPassEvent();

View File

@ -609,7 +609,7 @@ void GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos, bo
break; break;
case S_POLYGON: case S_POLYGON:
for( const VECTOR2I& p : shape->BuildPolyPointsList() ) for( const wxPoint& p : shape->BuildPolyPointsList() )
addAnchor( p, CORNER | SNAPPABLE, shape ); addAnchor( p, CORNER | SNAPPABLE, shape );
break; break;