Fix some compiler warnings

This commit is contained in:
JamesJCode 2025-09-01 14:50:07 +01:00
parent 82c61efcbd
commit bd04d508e0
4 changed files with 42 additions and 44 deletions

View File

@ -146,11 +146,11 @@ void EC_CIRCLE::Apply( EDIT_POINT& aHandle, const GRID_HELPER& aGrid )
EC_CONVERGING::EC_CONVERGING( EDIT_LINE& aLine, EDIT_POINTS& aPoints ) :
EDIT_CONSTRAINT<EDIT_LINE>( aLine ),
m_colinearConstraint( nullptr ),
m_prevOrigin( aPoints.Previous( aLine.GetOrigin(), false ) ),
m_nextEnd( aPoints.Next( aLine.GetEnd(), false ) ),
m_editPoints( aPoints )
EDIT_CONSTRAINT<EDIT_LINE>( aLine ),
m_colinearConstraint( nullptr ),
m_prevOrigin( aPoints.Previous( aLine.GetOrigin(), false ) ),
m_editPoints( aPoints ),
m_nextEnd( aPoints.Next( aLine.GetEnd(), false ) )
{
// Dragged segment endings
EDIT_POINT& origin = aLine.GetOrigin();

View File

@ -150,7 +150,7 @@ bool DIALOG_SHAPE_PROPERTIES::TransferDataToWindow()
else
wxFAIL_MSG( wxT( "Line type not found in the type lookup map" ) );
if( SYMBOL_EDIT_FRAME* symbolEditor = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame ) )
if( dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame ) )
{
m_rbFillNone->Enable( true );
m_rbFillOutline->Enable( true );

View File

@ -48,48 +48,46 @@ protected:
&& SELECTION_CONDITIONS::OnlyTypes( { SCH_TABLECELL_T,
PCB_TABLECELL_T } );
auto cellBlockSelection =
[this]( const SELECTION& sel )
auto cellBlockSelection = []( const SELECTION& sel )
{
if( sel.Size() < 2 )
return false;
int colMin = std::numeric_limits<int>::max();
int colMax = 0;
int rowMin = std::numeric_limits<int>::max();
int rowMax = 0;
int selectedArea = 0;
for( EDA_ITEM* item : sel )
{
if( T_TABLECELL* cell = dynamic_cast<T_TABLECELL*>( item ) )
{
if( sel.Size() < 2 )
return false;
colMin = std::min( colMin, cell->GetColumn() );
colMax = std::max( colMax, cell->GetColumn() + cell->GetColSpan() );
rowMin = std::min( rowMin, cell->GetRow() );
rowMax = std::max( rowMax, cell->GetRow() + cell->GetRowSpan() );
int colMin = std::numeric_limits<int>::max();
int colMax = 0;
int rowMin = std::numeric_limits<int>::max();
int rowMax = 0;
int selectedArea = 0;
selectedArea += cell->GetColSpan() * cell->GetRowSpan();
}
}
for( EDA_ITEM* item : sel )
{
if( T_TABLECELL* cell = dynamic_cast<T_TABLECELL*>( item ) )
{
colMin = std::min( colMin, cell->GetColumn() );
colMax = std::max( colMax, cell->GetColumn() + cell->GetColSpan() );
rowMin = std::min( rowMin, cell->GetRow() );
rowMax = std::max( rowMax, cell->GetRow() + cell->GetRowSpan() );
return selectedArea == ( colMax - colMin ) * ( rowMax - rowMin );
};
selectedArea += cell->GetColSpan() * cell->GetRowSpan();
}
}
return selectedArea == ( colMax - colMin ) * ( rowMax - rowMin );
};
auto mergedCellsSelection =
[this]( const SELECTION& sel )
auto mergedCellsSelection = []( const SELECTION& sel )
{
for( EDA_ITEM* item : sel )
{
if( T_TABLECELL* cell = dynamic_cast<T_TABLECELL*>( item ) )
{
for( EDA_ITEM* item : sel )
{
if( T_TABLECELL* cell = dynamic_cast<T_TABLECELL*>( item ) )
{
if( cell->GetColSpan() > 1 || cell->GetRowSpan() > 1 )
return true;
}
}
if( cell->GetColSpan() > 1 || cell->GetRowSpan() > 1 )
return true;
}
}
return false;
};
return false;
};
//
// Add editing actions to the selection tool menu

View File

@ -231,8 +231,8 @@ PCB_VIA* SPECCTRA_DB::makeVIA( WIRE_VIA* aVia, PADSTACK* aPadstack, const POINT&
drillEndNdx-drillStartNdx );
double drill_um{};
auto res = fast_float::from_chars( diam_txt.data(), diam_txt.data() + diam_txt.size(), drill_um,
fast_float::chars_format::skip_white_space );
fast_float::from_chars( diam_txt.data(), diam_txt.data() + diam_txt.size(), drill_um,
fast_float::chars_format::skip_white_space );
drill_diam_iu = static_cast<int>( drill_um * ( pcbIUScale.IU_PER_MM / 1000.0 ) );