mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 23:11:41 +00:00
Mostly formatting cleanup but a few type-casting cleanups too.
This commit is contained in:
parent
31a26e7d25
commit
9c7c05c161
3d-viewer
3d_canvas
3d_rendering
3d_render_ogl_legacy
3d_render_raytracing
common_ogl
common
cvpcb
eeschema
connection_graph.cpp
dialogs
lib_pin.cpppin_type.cppsch_base_frame.cppsch_plugin.cppsch_sheet.cppsim
tools
gerbview
kicad/dialogs
libs/kimath/src/geometry
pagelayout_editor
pcbnew
action_plugin.cppbuild_BOM_from_board.cppconvert_drawsegment_list_to_polygon.cpp
dialogs
dialog_edit_footprint_for_fp_editor.cppdialog_exchange_footprints.cppdialog_footprint_properties.cppdialog_net_inspector.cppdialog_plot.cpp
drc
drc_test_provider_annulus.cppdrc_test_provider_connectivity.cppdrc_test_provider_copper_clearance.cppdrc_test_provider_diff_pair_coupling.cppdrc_test_provider_disallow.cppdrc_test_provider_hole_size.cppdrc_test_provider_lvs.cppdrc_test_provider_matched_length.cppdrc_test_provider_misc.cppdrc_test_provider_via_diameter.cpp
exporters
footprint_libraries_utils.cppgraphics_cleaner.cppnetlist_reader
pcb_edit_frame.cpppcb_shape.cppplot_brditems_plotter.cppplugins
router
pns_diff_pair.cpppns_dragger.cpppns_item.hpns_kicad_iface.cpppns_line.cpppns_meander.cpppns_meander_placer_base.cpppns_node.cpppns_shove.cpppns_walkaround.cpp
specctra_import_export
text_mod_grid_table.cpptools
qa/libeval_compiler
@ -110,7 +110,7 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const PCB_TEXT* aText,
|
||||
wxStringSplit( aText->GetShownText(), strings_list, '\n' );
|
||||
std::vector<wxPoint> positions;
|
||||
positions.reserve( strings_list.Count() );
|
||||
aText->GetLinePositions( positions, strings_list.Count());
|
||||
aText->GetLinePositions( positions, strings_list.Count() );
|
||||
|
||||
for( unsigned ii = 0; ii < strings_list.Count(); ++ii )
|
||||
{
|
||||
@ -494,8 +494,7 @@ void BOARD_ADAPTER::AddPadsWithClearanceToContainer( const FOOTPRINT* aFootprint
|
||||
// shape size and pos is the same as their hole:
|
||||
if( aSkipNPTHPadsWihNoCopper && ( pad->GetAttribute() == PAD_ATTRIB_NPTH ) )
|
||||
{
|
||||
if( (pad->GetDrillSize() == pad->GetSize()) &&
|
||||
(pad->GetOffset() == wxPoint( 0, 0 )) )
|
||||
if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) )
|
||||
{
|
||||
switch( pad->GetShape() )
|
||||
{
|
||||
@ -735,7 +734,7 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const PCB_SHAPE* aShape,
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( "BOARD_ADAPTER::AddShapeWithClearanceToContainer no implementation for "
|
||||
+ PCB_SHAPE_TYPE_T_asString( aShape->GetShape()) );
|
||||
+ PCB_SHAPE_TYPE_T_asString( aShape->GetShape() ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -622,7 +622,7 @@ void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent &event )
|
||||
float delta_move = m_delta_move_step_factor * m_camera.ZoomGet();
|
||||
|
||||
if( m_boardAdapter.GetFlag( FL_MOUSEWHEEL_PANNING ) )
|
||||
delta_move *= (0.01f * event.GetWheelRotation());
|
||||
delta_move *= 0.01f * event.GetWheelRotation();
|
||||
else
|
||||
if( event.GetWheelRotation() < 0 )
|
||||
delta_move = -delta_move;
|
||||
|
@ -1287,7 +1287,7 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models_selected( bool aRenderTopOrBot,
|
||||
|
||||
if( !fp->Models().empty() )
|
||||
{
|
||||
if( m_boardAdapter.ShouldFPBeDisplayed((FOOTPRINT_ATTR_T) fp->GetAttributes()) )
|
||||
if( m_boardAdapter.ShouldFPBeDisplayed( (FOOTPRINT_ATTR_T) fp->GetAttributes() ) )
|
||||
{
|
||||
if( ( aRenderTopOrBot && !fp->IsFlipped() )
|
||||
|| ( !aRenderTopOrBot && fp->IsFlipped() ) )
|
||||
|
@ -829,7 +829,7 @@ void C3D_RENDER_RAYTRACING::Reload( REPORTER* aStatusReporter,
|
||||
static_cast<const CBVHCONTAINER2D *>(ii->second);
|
||||
|
||||
// Only get the Solder mask layers
|
||||
if( !((layer_id == B_Mask) || (layer_id == F_Mask)) )
|
||||
if( !( layer_id == B_Mask || layer_id == F_Mask ) )
|
||||
continue;
|
||||
|
||||
SFVEC3F layerColor;
|
||||
@ -1403,7 +1403,7 @@ void C3D_RENDER_RAYTRACING::load_3D_models( CCONTAINER &aDstContainer, bool aSki
|
||||
for( FOOTPRINT* fp : m_boardAdapter.GetBoard()->Footprints() )
|
||||
{
|
||||
if( !fp->Models().empty()
|
||||
&& m_boardAdapter.ShouldFPBeDisplayed((FOOTPRINT_ATTR_T) fp->GetAttributes()) )
|
||||
&& m_boardAdapter.ShouldFPBeDisplayed( (FOOTPRINT_ATTR_T) fp->GetAttributes() ) )
|
||||
{
|
||||
double zpos = m_boardAdapter.GetModulesZcoord3DIU( fp->IsFlipped() );
|
||||
|
||||
|
@ -245,9 +245,9 @@ bool CBBOX::Inside( const SFVEC3F &aPoint ) const
|
||||
{
|
||||
wxASSERT( IsInitialized() );
|
||||
|
||||
return (( aPoint.x >= m_min.x ) && ( aPoint.x <= m_max.x ) &&
|
||||
( aPoint.y >= m_min.y ) && ( aPoint.y <= m_max.y ) &&
|
||||
( aPoint.z >= m_min.z ) && ( aPoint.z <= m_max.z ));
|
||||
return ( aPoint.x >= m_min.x ) && ( aPoint.x <= m_max.x ) &&
|
||||
( aPoint.y >= m_min.y ) && ( aPoint.y <= m_max.y ) &&
|
||||
( aPoint.z >= m_min.z ) && ( aPoint.z <= m_max.z );
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,7 +86,7 @@ GLuint OGL_LoadTexture( const CIMAGE &aImage )
|
||||
unsigned char* dst = rgbaBuffer;
|
||||
const unsigned char* ori = aImage.GetBuffer();
|
||||
|
||||
for( unsigned int i = 0; i < (aImage.GetWidth() * aImage.GetHeight()); ++i )
|
||||
for( unsigned int i = 0; i < ( aImage.GetWidth() * aImage.GetHeight() ); ++i )
|
||||
{
|
||||
unsigned char v = *ori;
|
||||
|
||||
|
@ -65,7 +65,7 @@ FOOTPRINT_INFO* FOOTPRINT_LIST::GetFootprintInfo( const wxString& aFootprintName
|
||||
wxCHECK_MSG( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) < 0, NULL,
|
||||
wxString::Format( wxT( "\"%s\" is not a valid LIB_ID." ), aFootprintName ) );
|
||||
|
||||
return GetFootprintInfo( fpid.GetLibNickname(), fpid.GetLibItemName());
|
||||
return GetFootprintInfo( fpid.GetLibNickname(), fpid.GetLibItemName() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +103,7 @@ void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in )
|
||||
|
||||
in->NeedLEFT(); // begin (name ...)
|
||||
|
||||
if( (tok = in->NextTok()) != T_name )
|
||||
if( ( tok = in->NextTok() ) != T_name )
|
||||
in->Expecting( T_name );
|
||||
|
||||
in->NeedSYMBOLorNUMBER();
|
||||
|
@ -218,7 +218,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndFpFiles( const std::string& aNetlist )
|
||||
if( component->GetAltFPID().empty() )
|
||||
continue;
|
||||
|
||||
if( component->GetFPID().IsLegacy() || component->GetAltFPID().IsLegacy())
|
||||
if( component->GetFPID().IsLegacy() || component->GetAltFPID().IsLegacy() )
|
||||
continue;
|
||||
|
||||
m_indexes.push_back( ii );
|
||||
|
@ -2667,7 +2667,7 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph )
|
||||
// For a hier label, check if the parent pin is connected
|
||||
if( aSubgraph->m_hier_parent &&
|
||||
( aSubgraph->m_hier_parent->m_strong_driver ||
|
||||
aSubgraph->m_hier_parent->m_drivers.size() > 1))
|
||||
aSubgraph->m_hier_parent->m_drivers.size() > 1) )
|
||||
{
|
||||
// For now, a simple check: if there is more than one driver, the parent is probably
|
||||
// connected elsewhere (because at least one driver will be the hier pin itself)
|
||||
|
@ -99,7 +99,7 @@ GRIDCELL_AUTOWRAP_STRINGRENDERER::GetTextLines(wxGrid& grid,
|
||||
const wxRect& rect,
|
||||
int row, int col)
|
||||
{
|
||||
dc.SetFont(attr.GetFont());
|
||||
dc.SetFont( attr.GetFont() );
|
||||
const wxCoord maxWidth = rect.GetWidth();
|
||||
|
||||
// Transform logical lines into physical ones, wrapping the longer ones.
|
||||
@ -215,7 +215,7 @@ GRIDCELL_AUTOWRAP_STRINGRENDERER::BreakWord(wxDC& dc,
|
||||
n = 1;
|
||||
}
|
||||
|
||||
lines.push_back(word.substr(0, n));
|
||||
lines.push_back( word.substr(0, n) );
|
||||
|
||||
// Check if the remainder of the string fits in one line.
|
||||
//
|
||||
@ -225,6 +225,7 @@ GRIDCELL_AUTOWRAP_STRINGRENDERER::BreakWord(wxDC& dc,
|
||||
// recompute it.
|
||||
const wxString rest = word.substr(n);
|
||||
const wxCoord restWidth = dc.GetTextExtent(rest).x;
|
||||
|
||||
if ( restWidth <= maxWidth )
|
||||
{
|
||||
line = rest;
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
{
|
||||
wxString fieldValue;
|
||||
|
||||
if( pins.empty())
|
||||
if( pins.empty() )
|
||||
return fieldValue;
|
||||
|
||||
for( LIB_PIN* pin : pins )
|
||||
|
@ -222,10 +222,9 @@ END_EVENT_TABLE()
|
||||
|
||||
|
||||
|
||||
NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
|
||||
const wxString& title,
|
||||
NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title,
|
||||
NETLIST_TYPE_ID id_NetType ) :
|
||||
wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL )
|
||||
wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL )
|
||||
{
|
||||
m_IdNetType = id_NetType;
|
||||
m_pageNetFmtName = title;
|
||||
@ -234,7 +233,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
|
||||
m_IsCurrentFormat = NULL;
|
||||
m_AdjustPassiveValues = NULL;
|
||||
|
||||
wxString netfmtName = ((NETLIST_DIALOG*)parent->GetParent())->m_DefaultNetFmtName;
|
||||
wxString netfmtName = static_cast<NETLIST_DIALOG*>( parent->GetParent() )->m_DefaultNetFmtName;
|
||||
|
||||
bool selected = m_pageNetFmtName == netfmtName;
|
||||
|
||||
@ -262,7 +261,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
|
||||
m_IsCurrentFormat->SetValue( selected );
|
||||
|
||||
if( selected )
|
||||
((NETLIST_DIALOG*)parent->GetParent())->m_asFormatSelected = true;
|
||||
( (NETLIST_DIALOG*)parent->GetParent() )->m_asFormatSelected = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1013,7 +1013,7 @@ const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles, bool aPinOnly )
|
||||
wxPoint begin;
|
||||
wxPoint end;
|
||||
int nameTextOffset = 0;
|
||||
bool showName = !m_name.IsEmpty() && (m_name != wxT( "~" ));
|
||||
bool showName = !m_name.IsEmpty() && ( m_name != wxT( "~" ) );
|
||||
bool showNum = !m_number.IsEmpty();
|
||||
int minsizeV = TARGET_PIN_RADIUS;
|
||||
|
||||
@ -1140,14 +1140,14 @@ wxString LIB_PIN::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||
m_number,
|
||||
m_name,
|
||||
GetElectricalTypeName(),
|
||||
PinShapeGetText( m_shape ));
|
||||
PinShapeGetText( m_shape ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return wxString::Format( _( "Pin %s [%s, %s]" ),
|
||||
m_number,
|
||||
GetElectricalTypeName(),
|
||||
PinShapeGetText( m_shape ));
|
||||
PinShapeGetText( m_shape ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ void InitTables()
|
||||
|
||||
const wxArrayString& PinTypeNames()
|
||||
{
|
||||
if( g_typeNames.empty())
|
||||
if( g_typeNames.empty() )
|
||||
InitTables();
|
||||
|
||||
return g_typeNames;
|
||||
@ -194,7 +194,7 @@ const wxArrayString& PinTypeNames()
|
||||
|
||||
const std::vector<BITMAP_DEF>& PinTypeIcons()
|
||||
{
|
||||
if( g_typeIcons.empty())
|
||||
if( g_typeIcons.empty() )
|
||||
InitTables();
|
||||
|
||||
return g_typeIcons;
|
||||
@ -203,7 +203,7 @@ const std::vector<BITMAP_DEF>& PinTypeIcons()
|
||||
|
||||
const wxArrayString& PinShapeNames()
|
||||
{
|
||||
if( g_shapeNames.empty())
|
||||
if( g_shapeNames.empty() )
|
||||
InitTables();
|
||||
|
||||
return g_shapeNames;
|
||||
@ -212,7 +212,7 @@ const wxArrayString& PinShapeNames()
|
||||
|
||||
const std::vector<BITMAP_DEF>& PinShapeIcons()
|
||||
{
|
||||
if( g_shapeIcons.empty())
|
||||
if( g_shapeIcons.empty() )
|
||||
InitTables();
|
||||
|
||||
return g_shapeIcons;
|
||||
@ -221,7 +221,7 @@ const std::vector<BITMAP_DEF>& PinShapeIcons()
|
||||
|
||||
const wxArrayString& PinOrientationNames()
|
||||
{
|
||||
if( g_orientationNames.empty())
|
||||
if( g_orientationNames.empty() )
|
||||
InitTables();
|
||||
|
||||
return g_orientationNames;
|
||||
@ -230,7 +230,7 @@ const wxArrayString& PinOrientationNames()
|
||||
|
||||
const std::vector<BITMAP_DEF>& PinOrientationIcons()
|
||||
{
|
||||
if( g_orientationIcons.empty())
|
||||
if( g_orientationIcons.empty() )
|
||||
InitTables();
|
||||
|
||||
return g_orientationIcons;
|
||||
|
@ -295,7 +295,7 @@ void SCH_BASE_FRAME::createCanvas()
|
||||
}
|
||||
|
||||
SetCanvas( new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_frameSize,
|
||||
GetGalDisplayOptions(), m_canvasType ));
|
||||
GetGalDisplayOptions(), m_canvasType ) );
|
||||
ActivateGalCanvas();
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ void SCH_PLUGIN::SymbolLibOptions( PROPERTIES* aListToAppendTo ) const
|
||||
|
||||
(*aListToAppendTo)["username"] = UTF8( _(
|
||||
"User name for <b>login</b> to some special library server."
|
||||
));
|
||||
) );
|
||||
|
||||
(*aListToAppendTo)["password"] = UTF8( _(
|
||||
"Password for <b>login</b> to some special library server."
|
||||
|
@ -1037,10 +1037,10 @@ bool SCH_SHEET::operator <( const SCH_ITEM& aItem ) const
|
||||
|
||||
auto sheet = static_cast<const SCH_SHEET*>( &aItem );
|
||||
|
||||
if (m_fields[ SHEETNAME ].GetText() != sheet->m_fields[ SHEETNAME ].GetText())
|
||||
if (m_fields[ SHEETNAME ].GetText() != sheet->m_fields[ SHEETNAME ].GetText() )
|
||||
return m_fields[ SHEETNAME ].GetText() < sheet->m_fields[ SHEETNAME ].GetText();
|
||||
|
||||
if (m_fields[ SHEETFILENAME ].GetText() != sheet->m_fields[ SHEETFILENAME ].GetText())
|
||||
if (m_fields[ SHEETFILENAME ].GetText() != sheet->m_fields[ SHEETFILENAME ].GetText() )
|
||||
return m_fields[ SHEETFILENAME ].GetText() < sheet->m_fields[ SHEETFILENAME ].GetText();
|
||||
|
||||
return false;
|
||||
|
@ -956,14 +956,10 @@ bool SIM_PLOT_FRAME::loadWorkbook( const wxString& aPath )
|
||||
|
||||
bool SIM_PLOT_FRAME::saveWorkbook( const wxString& aPath )
|
||||
{
|
||||
|
||||
wxString savePath = aPath;
|
||||
|
||||
if( !savePath.Lower().EndsWith(".wbk"))
|
||||
{
|
||||
if( !savePath.Lower().EndsWith(".wbk") )
|
||||
savePath += ".wbk";
|
||||
};
|
||||
|
||||
|
||||
wxTextFile file( savePath );
|
||||
|
||||
|
@ -310,7 +310,7 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
|
||||
void LIB_MOVE_TOOL::moveItem( EDA_ITEM* aItem, VECTOR2I aDelta )
|
||||
{
|
||||
static_cast<LIB_ITEM*>( aItem )->Offset( mapCoords( aDelta ));
|
||||
static_cast<LIB_ITEM*>( aItem )->Offset( mapCoords( aDelta ) );
|
||||
aItem->SetFlags( IS_MOVED );
|
||||
}
|
||||
|
||||
|
@ -1350,7 +1350,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
||||
auto editor = (SYMBOL_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH_SYMBOL_EDITOR, true );
|
||||
|
||||
editor->LoadSymbolAndSelectLib( component->GetLibId(), component->GetUnit(),
|
||||
component->GetConvert());
|
||||
component->GetConvert() );
|
||||
|
||||
editor->Show( true );
|
||||
editor->Raise();
|
||||
|
@ -229,7 +229,7 @@ static wxFindReplaceData g_markersOnly;
|
||||
|
||||
int SCH_EDITOR_CONTROL::FindAndReplace( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->ShowFindReplaceDialog( aEvent.IsAction( &ACTIONS::findAndReplace ));
|
||||
m_frame->ShowFindReplaceDialog( aEvent.IsAction( &ACTIONS::findAndReplace ) );
|
||||
return UpdateFind( aEvent );
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName )
|
||||
if( gerber->GetMessages().size() > 0 )
|
||||
{
|
||||
HTML_MESSAGE_BOX dlg( this, _("Errors") );
|
||||
dlg.ListSet(gerber->GetMessages());
|
||||
dlg.ListSet( gerber->GetMessages() );
|
||||
dlg.ShowModal();
|
||||
}
|
||||
|
||||
|
@ -275,7 +275,7 @@ int LAYER_WIDGET::findLayerRow( LAYER_NUM aLayer ) const
|
||||
wxWindow* w = getLayerComp( row, 0 );
|
||||
wxASSERT( w );
|
||||
|
||||
if( aLayer == getDecodedId( w->GetId() ))
|
||||
if( aLayer == getDecodedId( w->GetId() ) )
|
||||
return row;
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ int LAYER_WIDGET::findRenderRow( int aId ) const
|
||||
wxWindow* w = getRenderComp( row, 0 );
|
||||
wxASSERT( w );
|
||||
|
||||
if( aId == getDecodedId( w->GetId() ))
|
||||
if( aId == getDecodedId( w->GetId() ) )
|
||||
return row;
|
||||
}
|
||||
|
||||
|
@ -80,8 +80,8 @@ void TEMPLATE_WIDGET::Unselect()
|
||||
void TEMPLATE_WIDGET::SetTemplate(PROJECT_TEMPLATE* aTemplate)
|
||||
{
|
||||
m_currTemplate = aTemplate;
|
||||
m_staticTitle->SetLabel( *(aTemplate->GetTitle()) );
|
||||
m_bitmapIcon->SetBitmap( *(aTemplate->GetIcon()) );
|
||||
m_staticTitle->SetLabel( *(aTemplate->GetTitle() ) );
|
||||
m_bitmapIcon->SetBitmap( *(aTemplate->GetIcon() ) );
|
||||
}
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user