Browse Source

Fix some compiler warnings

master
JamesJCode 2 months ago
parent
commit
bd04d508e0
  1. 10
      common/tool/edit_constraints.cpp
  2. 2
      eeschema/dialogs/dialog_shape_properties.cpp
  3. 70
      include/tool/edit_table_tool_base.h
  4. 4
      pcbnew/specctra_import_export/specctra_import.cpp

10
common/tool/edit_constraints.cpp

@ -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();

2
eeschema/dialogs/dialog_shape_properties.cpp

@ -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 );

70
include/tool/edit_table_tool_base.h

@ -48,48 +48,46 @@ protected:
&& SELECTION_CONDITIONS::OnlyTypes( { SCH_TABLECELL_T,
PCB_TABLECELL_T } );
auto cellBlockSelection =
[this]( const SELECTION& sel )
{
if( sel.Size() < 2 )
return false;
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;
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 ) )
{
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() );
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();
}
}
auto mergedCellsSelection =
[this]( const SELECTION& sel )
return selectedArea == ( colMax - colMin ) * ( rowMax - rowMin );
};
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

4
pcbnew/specctra_import_export/specctra_import.cpp

@ -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 ) );

Loading…
Cancel
Save