1. Fixed copy paste error in append_board_to_current.cpp ruining a if else condition, should fix a possible bounding box computation bug

2. Whole bunch of pointless casts removed
3. Unused variables removed
4. Fix bug caused by JP on April 25, 2015 where strings were adjusted for translation and the hotkeys section table accidentally swapped the footprint editor title with tag, resulting in "footprint editor" being exported instead of "[footprinteditor]"
No functional changes besides #4, technically it'll "break" imports hotkeys files but April 25 broke imports as well.
This commit is contained in:
unknown 2015-11-04 09:48:34 +01:00 committed by jean-pierre charras
parent 33419ee4bf
commit 1ee7458140
43 changed files with 64 additions and 118 deletions

View File

@ -337,7 +337,7 @@ struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[] =
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[] =
{
{ &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
{ &schematicSectionTitle, schematic_Hotkey_List, &schematicSectionTitle },
{ &schematicSectionTag, schematic_Hotkey_List, &schematicSectionTitle },
{ NULL, NULL, NULL }
};

View File

@ -123,9 +123,9 @@ bool PCB_EDIT_FRAME::AppendBoardFile( const wxString& aFullFileName, int aCtl )
if( bboxInit )
bbox = track->GetBoundingBox();
else
bbox.Merge( track->GetBoundingBox() );
bboxInit = false;
bbox.Merge(track->GetBoundingBox() );
}
if( module )

View File

@ -669,11 +669,9 @@ void PCB_EDIT_FRAME::Block_Delete()
void PCB_EDIT_FRAME::Block_Rotate()
{
wxPoint oldpos;
wxPoint centre; // rotation cent-re for the rotation transform
int rotAngle = m_rotationAngle; // rotation angle in 0.1 deg.
oldpos = GetCrossHairPosition();
centre = GetScreen()->m_BlockLocate.Centre();
OnModify();
@ -738,7 +736,6 @@ void PCB_EDIT_FRAME::Block_Rotate()
void PCB_EDIT_FRAME::Block_Flip()
{
#define INVERT( pos ) (pos) = center.y - ( (pos) - center.y )
wxPoint memo;
wxPoint center; // Position of the axis for inversion of all elements
OnModify();
@ -746,8 +743,6 @@ void PCB_EDIT_FRAME::Block_Flip()
PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.GetItems();
itemsList->m_Status = UR_FLIPPED;
memo = GetCrossHairPosition();
center = GetScreen()->m_BlockLocate.Centre();
for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ )

View File

@ -557,7 +557,6 @@ void D_PAD:: TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer
int aCircleToSegmentsCount,
double aCorrectionFactor ) const
{
wxPoint corner_position;
double angle = m_Orient;
int dx = (m_Size.x / 2) + aClearanceValue;
int dy = (m_Size.y / 2) + aClearanceValue;
@ -1087,7 +1086,6 @@ void CreateThermalReliefPadPolygon( SHAPE_POLY_SET& aCornerBuffer,
SHAPE_POLY_SET stub; // A basic stub ( a rectangle)
SHAPE_POLY_SET stubs; // the full stubs shape
SHAPE_POLY_SET thermalShape; // the holes in copper zone
// We now substract the stubs (connections to the copper zone)

View File

@ -310,11 +310,12 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( BOARD_ITEM* aItem,
if( aItem->Type() == PCB_MODULE_TEXT_T )
{
aItem = aItem->GetParent();
wxASSERT( aItem->Type() == PCB_MODULE_T );
aCommandType = UR_CHANGED;
if( aItem == NULL )
return;
wxASSERT( aItem->Type() == PCB_MODULE_T );
aCommandType = UR_CHANGED;
}
PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
@ -391,11 +392,12 @@ void PCB_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
if( item->Type() == PCB_MODULE_TEXT_T || item->Type() == PCB_PAD_T )
{
item = item->GetParent();
wxASSERT( item->Type() == PCB_MODULE_T );
if( item == NULL )
continue;
wxASSERT( item->Type() == PCB_MODULE_T );
commandToUndo->SetPickedItem( item, ii );
commandToUndo->SetPickedItemStatus( UR_CHANGED, ii );
}

View File

@ -2001,7 +2001,7 @@ MODULE* BOARD::GetFootprint( const wxPoint& aPosition, LAYER_ID aActiveLayer,
int alt_min_dim = 0x7FFFFFFF;
bool current_layer_back = IsBackLayer( aActiveLayer );
for( pt_module = m_Modules; pt_module; pt_module = (MODULE*) pt_module->Next() )
for( pt_module = m_Modules; pt_module; pt_module = pt_module->Next() )
{
// is the ref point within the module's bounds?
if( !pt_module->HitTest( aPosition ) )
@ -2736,11 +2736,9 @@ wxString BOARD::GetNextModuleReferenceWithPrefix( const wxString& aPrefix,
usedNumbers.insert( number );
}
int nextNum = 1;
if( usedNumbers.size() )
{
nextNum = getNextNumberInSequence( usedNumbers, aFillSequenceGaps );
int nextNum = getNextNumberInSequence( usedNumbers, aFillSequenceGaps );
nextRef = wxString::Format( wxT( "%s%i" ), aPrefix, nextNum );
}

View File

@ -63,7 +63,8 @@ bool BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode, bool aNoAssert )
if( !aNoAssert )
assert( m_netinfo );
return m_netinfo;
return ( m_netinfo != NULL );
}

View File

@ -357,8 +357,6 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
void DRAWSEGMENT::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
{
wxString msg;
wxString coords;
wxASSERT( m_Parent );
msg = _( "Drawing" );
@ -606,7 +604,7 @@ wxString DRAWSEGMENT::GetSelectMenuText() const
wxString temp = ::LengthDoubleToString( GetLength() );
text.Printf( _( "Pcb Graphic: %s, length %s on %s" ),
GetChars( ShowShape( (STROKE_T) m_Shape ) ),
GetChars( ShowShape( m_Shape ) ),
GetChars( temp ), GetChars( GetLayerName() ) );
return text;

View File

@ -274,7 +274,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const
{
wxString text;
text.Printf( _( "Graphic (%s) on %s of %s" ),
GetChars( ShowShape( (STROKE_T) m_Shape ) ),
GetChars( ShowShape( m_Shape ) ),
GetChars( GetLayerName() ),
GetChars( ((MODULE*) GetParent())->GetReference() ) );
@ -326,8 +326,6 @@ void EDGE_MODULE::Mirror( wxPoint aCentre, bool aMirrorAroundXAxis )
{
// Mirror an edge of the footprint. the layer is not modified
// This is a footprint shape modification.
wxPoint pt;
switch( GetShape() )
{
case S_ARC:

View File

@ -29,7 +29,6 @@
*/
#include "class_footprint_wizard.h"
#include <stdio.h>
FOOTPRINT_WIZARD::~FOOTPRINT_WIZARD()
@ -77,8 +76,6 @@ int FOOTPRINT_WIZARDS::GetWizardsCount()
void FOOTPRINT_WIZARDS::register_wizard( FOOTPRINT_WIZARD* aWizard )
{
wxString name = aWizard->GetName();
m_FootprintWizards.push_back( aWizard );
}

View File

@ -163,8 +163,6 @@ bool PCB_TARGET::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy
return arect.Contains( GetBoundingBox() );
else
return GetBoundingBox().Intersects( arect );
return false;
}

View File

@ -321,9 +321,9 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, bool doAppend )
case PCB_MODULE_EDGE_T:
if( doAppend )
m_Drawings.PushBack( static_cast<BOARD_ITEM*>( aBoardItem ) );
m_Drawings.PushBack( aBoardItem );
else
m_Drawings.PushFront( static_cast<BOARD_ITEM*>( aBoardItem ) );
m_Drawings.PushFront( aBoardItem );
break;
case PCB_PAD_T:
@ -359,7 +359,7 @@ BOARD_ITEM* MODULE::Remove( BOARD_ITEM* aBoardItem )
// no break
case PCB_MODULE_EDGE_T:
return m_Drawings.Remove( static_cast<BOARD_ITEM*>( aBoardItem ) );
return m_Drawings.Remove( aBoardItem );
case PCB_PAD_T:
return m_Pads.Remove( static_cast<D_PAD*>( aBoardItem ) );
@ -647,10 +647,7 @@ void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
bool MODULE::HitTest( const wxPoint& aPosition ) const
{
if( m_BoundaryBox.Contains( aPosition ) )
return true;
return false;
return m_BoundaryBox.Contains( aPosition );
}
@ -1099,7 +1096,6 @@ void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
void MODULE::SetOrientation( double newangle )
{
double angleChange = newangle - m_Orient; // change in rotation
wxPoint pt;
NORMALIZE_ANGLE_POS( newangle );

View File

@ -586,7 +586,7 @@ wxSize D_PAD::GetSolderPasteMargin() const
ZoneConnection D_PAD::GetZoneConnection() const
{
MODULE* module = (MODULE*) GetParent();
MODULE* module = GetParent();
if( m_ZoneConnection == PAD_ZONE_CONN_INHERITED && module )
return module->GetZoneConnection();
@ -597,7 +597,7 @@ ZoneConnection D_PAD::GetZoneConnection() const
int D_PAD::GetThermalWidth() const
{
MODULE* module = (MODULE*) GetParent();
MODULE* module = GetParent();
if( m_ThermalWidth == 0 && module )
return module->GetThermalWidth();
@ -608,7 +608,7 @@ int D_PAD::GetThermalWidth() const
int D_PAD::GetThermalGap() const
{
MODULE* module = (MODULE*) GetParent();
MODULE* module = GetParent();
if( m_ThermalGap == 0 && module )
return module->GetThermalGap();
@ -910,13 +910,13 @@ wxString D_PAD::GetSelectMenuText() const
{
text.Printf( _( "Pad on %s of %s" ),
GetChars( padlayers ),
GetChars(( (MODULE*) GetParent() )->GetReference() ) );
GetChars(GetParent()->GetReference() ) );
}
else
{
text.Printf( _( "Pad %s on %s of %s" ),
GetChars(GetPadName() ), GetChars( padlayers ),
GetChars(( (MODULE*) GetParent() )->GetReference() ) );
GetChars(GetParent()->GetReference() ) );
}
return text;

View File

@ -278,7 +278,7 @@ STATUS_FLAGS TRACK::IsPointOnEnds( const wxPoint& point, int min_dist )
const EDA_RECT TRACK::GetBoundingBox() const
{
// end of track is round, this is its radius, rounded up
int radius = ( m_Width + 1 ) / 2;
int radius;
int ymax;
int xmax;
@ -939,7 +939,7 @@ void VIA::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode, const w
int ax = 0, ay = radius, bx = 0, by = drill_radius;
LAYER_ID layer_top, layer_bottom;
( (VIA*) this )->LayerPair( &layer_top, &layer_bottom );
LayerPair( &layer_top, &layer_bottom );
// lines for the top layer
RotatePoint( &ax, &ay, layer_top * 3600.0 / brd->GetCopperLayerCount( ) );

View File

@ -214,7 +214,6 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE aDrawMod
void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
wxDC* DC, GR_DRAWMODE aDrawMode, const wxPoint& offset )
{
static std::vector <char> CornersTypeBuffer;
static std::vector <wxPoint> CornersBuffer;
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
@ -356,7 +355,6 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC,
{
GR_DRAWMODE current_gr_mode = draw_mode;
bool is_close_segment = false;
wxPoint seg_start, seg_end;
if( !DC )
return;
@ -645,7 +643,7 @@ void ZONE_CONTAINER::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
if( !m_FilledPolysList.IsEmpty() )
{
msg.Printf( wxT( "%d" ), (int) m_FilledPolysList.TotalVertices() );
msg.Printf( wxT( "%d" ), m_FilledPolysList.TotalVertices() );
aList.push_back( MSG_PANEL_ITEM( _( "Corner Count" ), msg, BLUE ) );
}
}

View File

@ -690,7 +690,7 @@ bool PCB_EDIT_FRAME::RemoveMisConnectedTracks()
int net_code_s, net_code_e;
bool isModified = false;
for( segment = GetBoard()->m_Track; segment; segment = (TRACK*) segment->Next() )
for( segment = GetBoard()->m_Track; segment; segment = segment->Next() )
{
segment->SetState( FLAG0, false );
@ -741,7 +741,7 @@ bool PCB_EDIT_FRAME::RemoveMisConnectedTracks()
// Remove tracks having a flagged segment
for( segment = GetBoard()->m_Track; segment; segment = next )
{
next = (TRACK*) segment->Next();
next = segment->Next();
if( segment->GetState( FLAG0 ) ) // Segment is flagged to be removed
{

View File

@ -68,14 +68,14 @@ void DRAG_SEGM_PICKER::SetAuxParameters()
if( m_Pad_Start )
{
module = (MODULE *) m_Pad_Start->GetParent();
module = m_Pad_Start->GetParent();
m_PadStartOffset = m_Track->GetStart() - m_Pad_Start->GetPosition();
}
if( m_Pad_End )
{
if( module == NULL )
module = (MODULE *) m_Pad_End->GetParent();
module = m_Pad_End->GetParent();
m_PadEndOffset = m_Track->GetEnd() - m_Pad_End->GetPosition();
}
@ -104,10 +104,10 @@ void DRAG_SEGM_PICKER::SetTrackEndsCoordinates( wxPoint aOffset )
bool flip = false;
if( m_Pad_Start )
module = (MODULE *) m_Pad_Start->GetParent();
module = m_Pad_Start->GetParent();
if( module == NULL && m_Pad_End )
module = (MODULE *) m_Pad_End->GetParent();
module = m_Pad_End->GetParent();
if( module )
{

View File

@ -750,7 +750,6 @@ void DRC::testTexts()
for( unsigned jj = 0; jj < textShape.size(); jj += 2 )
{
SEG segtest( textShape[jj], textShape[jj+1] );
/* In order to make some calculations more easier or faster,
* pads and tracks coordinates will be made relative
* to the segment origin

View File

@ -235,7 +235,7 @@ void PCB_EDIT_FRAME::Show_1_Ratsnest( EDA_ITEM* item, wxDC* DC )
if( item->Type() == PCB_PAD_T )
{
pt_pad = (D_PAD*) item;
Module = (MODULE*) pt_pad->GetParent();
Module = pt_pad->GetParent();
}
if( pt_pad ) // Displaying the ratsnest of the corresponding net.
@ -277,7 +277,7 @@ void PCB_EDIT_FRAME::Show_1_Ratsnest( EDA_ITEM* item, wxDC* DC )
SetMsgPanel( Module );
pt_pad = Module->Pads();
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Next() )
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
{
for( unsigned ii = 0; ii < GetBoard()->GetRatsnestsCount(); ii++ )
{

View File

@ -1320,7 +1320,6 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString& aFullFileName, double aMMt
bool aUsePlainPCB, const wxString& a3D_Subdir,
double aXRef, double aYRef )
{
wxString msg;
BOARD* pcb = GetBoard();
bool ok = true;

View File

@ -171,7 +171,6 @@ void DIALOG_GEN_MODULE_POSITION::OnOutputDirectoryBrowseClicked( wxCommandEvent&
{
// Build the absolute path of current output plot directory
// to preselect it when opening the dialog.
wxFileName fn( m_outputDirectoryName->GetValue() );
wxString path = Prj().AbsolutePath( m_outputDirectoryName->GetValue() );
wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
@ -595,7 +594,7 @@ bool PCB_EDIT_FRAME::DoGenFootprintsReport( const wxString& aFullFilename, bool
{
D_PAD* pad;
char line[1024];
wxString fnFront, msg;
wxString msg;
FILE* rptfile;
wxPoint module_pos;
@ -810,7 +809,6 @@ void WriteDrawSegmentPcb( DRAWSEGMENT* PtDrawSegment, FILE* rptfile, double aCon
int endx = PtDrawSegment->GetEnd().x;
int endy = PtDrawSegment->GetEnd().y;
radius = Distance( ux0, uy0, dx, dy );
RotatePoint( &endx,
&endy,
PtDrawSegment->GetStart().x,

View File

@ -274,7 +274,7 @@ void GITHUB_PLUGIN::FootprintSave( const wxString& aLibraryPath,
// even legal, so I spend no time on internationalization here:
string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.",
(const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR );
TO_UTF8( aLibraryPath ), PRETTY_DIR );
THROW_IO_ERROR( msg );
}
@ -316,7 +316,7 @@ void GITHUB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxStrin
// even legal, so I spend no time on internationalization here:
string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.",
(const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR );
TO_UTF8( aLibraryPath ), PRETTY_DIR );
THROW_IO_ERROR( msg );
}

View File

@ -414,7 +414,6 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader ) throw( IO_ERROR,
int paramCnt;
double conv_unit = NEW_GPCB_UNIT_CONV; // GPCB unit = 0.01 mils and Pcbnew 0.1
wxPoint refPos( 0, 0 );
wxPoint textPos;
wxString msg;
wxArrayString parameters;
@ -476,8 +475,6 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader ) throw( IO_ERROR,
if( paramCnt == 14 )
{
refPos = wxPoint( parseInt( parameters[6], conv_unit ),
parseInt( parameters[7], conv_unit ) );
textPos = wxPoint( parseInt( parameters[8], conv_unit ),
parseInt( parameters[9], conv_unit ) );
}

View File

@ -43,9 +43,6 @@
#include <collectors.h>
#define Pad_fill ( Pad_Fill_Item.State == RUN )
void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event )
{
NETINFO_ITEM* net;

View File

@ -356,7 +356,7 @@ static wxString moduleEditSectionTitle( _HKI( "Footprint Editor" ) );
struct EDA_HOTKEY_CONFIG g_Pcbnew_Editor_Hokeys_Descr[] = {
{ &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
{ &boardEditorSectionTag, board_edit_Hotkey_List, &boardEditorSectionTitle },
{ &moduleEditSectionTitle, module_edit_Hotkey_List, &moduleEditSectionTitle },
{ &moduleEditSectionTag, module_edit_Hotkey_List, &moduleEditSectionTitle },
{ NULL, NULL, NULL }
};
@ -372,7 +372,7 @@ struct EDA_HOTKEY_CONFIG g_Board_Editor_Hokeys_Descr[] = {
// (used to list current hotkeys in the module editor)
struct EDA_HOTKEY_CONFIG g_Module_Editor_Hokeys_Descr[] = {
{ &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
{ &moduleEditSectionTitle, module_edit_Hotkey_List, &moduleEditSectionTitle },
{ &moduleEditSectionTag, module_edit_Hotkey_List, &moduleEditSectionTitle },
{ NULL, NULL, NULL }
};

View File

@ -83,8 +83,6 @@ void KICAD_NETLIST_PARSER::skipCurrent() throw( IO_ERROR, PARSE_ERROR )
void KICAD_NETLIST_PARSER::Parse() throw( IO_ERROR, PARSE_ERROR, boost::bad_pointer )
{
wxString text;
int plevel = 0; // the count of ')' to read and end of file,
// after parsing all sections
@ -286,7 +284,6 @@ void KICAD_NETLIST_PARSER::parseComponent() throw( IO_ERROR, PARSE_ERROR, boost:
*/
FPID fpid;
wxString footprint;
wxString tmp;
wxString ref;
wxString value;
wxString library;

View File

@ -526,7 +526,7 @@ void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
m_out->Print( aNestLevel+1, "(tracks %d)\n", aBoard->GetNumSegmTrack() );
m_out->Print( aNestLevel+1, "(zones %d)\n", aBoard->GetNumSegmZone() );
m_out->Print( aNestLevel+1, "(modules %d)\n", aBoard->m_Modules.GetCount() );
m_out->Print( aNestLevel+1, "(nets %d)\n", (int) m_mapping->GetSize() );
m_out->Print( aNestLevel+1, "(nets %d)\n", m_mapping->GetSize() );
m_out->Print( aNestLevel, ")\n\n" );
aBoard->GetPageSettings().Format( m_out, aNestLevel, m_ctl );
@ -729,7 +729,7 @@ void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
}
// Save the modules.
for( MODULE* module = aBoard->m_Modules; module; module = (MODULE*) module->Next() )
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
{
Format( module, aNestLevel );
m_out->Print( 0, "\n" );
@ -774,7 +774,7 @@ void PCB_IO::format( DIMENSION* aDimension, int aNestLevel ) const
m_out->Print( 0, "\n" );
Format( (TEXTE_PCB*) &aDimension->Text(), aNestLevel+1 );
Format( &aDimension->Text(), aNestLevel+1 );
m_out->Print( aNestLevel+1, "(feature1 (pts (xy %s %s) (xy %s %s)))\n",
FMT_IU( aDimension->m_featureLineDO.x ).c_str(),

View File

@ -389,7 +389,6 @@ wxString PCB_BASE_EDIT_FRAME::CreateNewLibrary()
// Kicad cannot write legacy format libraries, only .pretty new format
// because the legacy format cannot handle current features.
// The footprint library is actually a directory
wxString wildcard = wxGetTranslation( KiCadFootprintLibPathWildcard );
// prompt user for footprint library name, ending by ".pretty"
// Because there are constraints for the directory name to create,

View File

@ -411,7 +411,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
source_module = mainpcb->m_Modules;
for( ; source_module != NULL; source_module = (MODULE*) source_module->Next() )
for( ; source_module != NULL; source_module = source_module->Next() )
{
if( module_in_edit->GetLink() == source_module->GetTimeStamp() )
break;

View File

@ -666,8 +666,6 @@ EDA_COLOR_T FOOTPRINT_VIEWER_FRAME::GetGridColor() const
void FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList( wxCommandEvent& event )
{
wxString msg;
switch( event.GetId() )
{
case ID_MODVIEW_NEXT:

View File

@ -508,7 +508,8 @@ int BuildCornersList_S_Shape( std::vector <wxPoint>& aBuffer,
pt = aBuffer.back();
centre = pt;
centre.y += radius;
gen_arc( aBuffer, pt, centre, 900 * sign ); pt = aBuffer.back();
gen_arc( aBuffer, pt, centre, 900 * sign );
aBuffer.back();
// Rotate point
angle += 900;
@ -970,7 +971,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape()
pad1->SetX0( offset.x );
pad1->SetX( pad1->GetPos0().x );
pad2 = (D_PAD*) pad1->Next();
pad2 = pad1->Next();
pad2->SetX0( offset.x + ShapeSize.x );
pad2->SetX( pad2->GetPos0().x );
@ -988,7 +989,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape()
// Init start point coord:
polyPoints.push_back( wxPoint( offset.x, 0 ) );
wxPoint first_coordinate, last_coordinate;
wxPoint last_coordinate;
for( unsigned ii = 0; ii < PolyEdges.size(); ii++ ) // Copy points
{
@ -1002,8 +1003,6 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape()
if( last_coordinate.y != 0 )
polyPoints.push_back( wxPoint( last_coordinate.x, 0 ) );
first_coordinate.y = polyPoints[1].y;
switch( PolyShapeType )
{
case 0: // shape from file
@ -1051,7 +1050,7 @@ void PCB_EDIT_FRAME::Edit_Gap( wxDC* DC, MODULE* aModule )
return;
}
next_pad = (D_PAD*) pad->Next();
next_pad = pad->Next();
if( next_pad == NULL )
{

View File

@ -972,7 +972,7 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
menu->Append( ID_POPUP_PCB_AUTOROUTE_NET, _( "Automatically Route Net" ) );
}
MODULE* module = (MODULE*) Pad->GetParent();
MODULE* module = Pad->GetParent();
if( module )
{

View File

@ -201,7 +201,7 @@ void PCB_BASE_FRAME::DeletePad( D_PAD* aPad, bool aQuery )
if( aPad == NULL )
return;
MODULE* module = (MODULE*) aPad->GetParent();
MODULE* module = aPad->GetParent();
module->SetLastEditTime();
// aQuery = true to prompt for confirmation, false to delete silently

View File

@ -163,7 +163,7 @@ int StrToIntUnits( wxString aStr, char aAxe, wxString aActualConversion )
wxString GetAndCutWordWithMeasureUnits( wxString* aStr, wxString aDefaultMeasurementUnit )
{
wxString s1, s2, result;
wxString result;
aStr->Trim( false );
result = wxEmptyString;

View File

@ -187,7 +187,7 @@ KIFACE_I& Kiface() { return kiface; }
// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
MY_API( KIFACE* ) KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BASE* aProgram )
{
process = (PGM_BASE*) aProgram;
process = aProgram;
return &kiface;
}

View File

@ -485,7 +485,6 @@ void PCB_EDIT_FRAME::SaveMacros()
void PCB_EDIT_FRAME::ReadMacros()
{
wxString str;
wxFileName fn;
fn = GetBoard()->GetFileName();
@ -527,7 +526,7 @@ void PCB_EDIT_FRAME::ReadMacros()
{
m_Macros[number].m_Record.clear();
XNODE *hotkeyNode = (XNODE*) macrosNode->GetChildren();
XNODE *hotkeyNode = macrosNode->GetChildren();
while( hotkeyNode )
{
@ -544,11 +543,11 @@ void PCB_EDIT_FRAME::ReadMacros()
m_Macros[number].m_Record.push_back( macros_record );
}
hotkeyNode = (XNODE*) hotkeyNode->GetNext();
hotkeyNode = hotkeyNode->GetNext();
}
}
}
macrosNode = (XNODE*) macrosNode->GetNext();
macrosNode = macrosNode->GetNext();
}
}

View File

@ -358,7 +358,7 @@ static DRAWSEGMENT* findPoint( const wxPoint& aPoint, ::PCB_TYPE_COLLECTOR* item
printf( "item %d, type=%s, start=%.6g %.6g end=%.6g,%.6g\n",
i + 1,
TO_UTF8( BOARD_ITEM::ShowShape( (STROKE_T) graphic->GetShape() ) ),
TO_UTF8( BOARD_ITEM::ShowShape( graphic->GetShape() ) ),
IU2um( graphic->GetStart().x )/1000,
IU2um( graphic->GetStart().y )/1000,
IU2um( graphic->GetEnd().x )/1000,
@ -816,7 +816,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
case S_ARC:
default:
DBG( printf( "makeIMAGE(): unsupported shape %s\n",
TO_UTF8( BOARD_ITEM::ShowShape( (STROKE_T) graphic->GetShape() ) ) ); )
TO_UTF8( BOARD_ITEM::ShowShape( graphic->GetShape() ) ) ); )
continue;
}
}
@ -1023,7 +1023,7 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary )
default:
{
wxString error = wxString::Format( _( "Unsupported DRAWSEGMENT type %s" ),
GetChars( BOARD_ITEM::ShowShape( (STROKE_T) graphic->GetShape() ) ) );
GetChars( BOARD_ITEM::ShowShape( graphic->GetShape() ) ) );
ThrowIOError( error );
}
@ -1130,7 +1130,7 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary )
default:
{
wxString error = wxString::Format( _( "Unsupported DRAWSEGMENT type %s" ),
GetChars( BOARD_ITEM::ShowShape( (STROKE_T) graphic->GetShape() ) ) );
GetChars( BOARD_ITEM::ShowShape( graphic->GetShape() ) ) );
ThrowIOError( error );
}
@ -1266,7 +1266,7 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary )
{
wxString error = wxString::Format(
_( "Unsupported DRAWSEGMENT type %s" ),
GetChars( BOARD_ITEM::ShowShape( (STROKE_T) graphic->GetShape() ) ) );
GetChars( BOARD_ITEM::ShowShape( graphic->GetShape() ) ) );
ThrowIOError( error );
}
@ -1439,8 +1439,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
// Unless they are unique, we cannot import the session file which comes
// back to us later from the router.
{
PCB_TYPE_COLLECTOR padItems;
items.Collect( aBoard, scanMODULEs );
STRINGSET refs; // holds module reference designators

View File

@ -29,7 +29,6 @@
#include <fctsys.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <wxPcbStruct.h>
#include <dialog_shim.h>

View File

@ -531,8 +531,6 @@ void PCB_EDIT_FRAME::ReCreateMicrowaveVToolbar()
void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
{
wxString msg;
wxWindowUpdateLocker dummy( this );
if( m_auxiliaryToolBar )

View File

@ -82,8 +82,6 @@ void PCB_EDIT_FRAME::OnUpdateSelectCustomTrackWidth( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent )
{
wxString msg;
if( aEvent.GetId() == ID_AUX_TOOLBAR_PCB_VIA_SIZE )
{
if( m_SelViaSizeBox->GetSelection() != (int) GetDesignSettings().GetViaSizeIndex() )

View File

@ -397,9 +397,6 @@ bool DIALOG_EXCHANGE_MODULE::change_1_Module( MODULE* aModule,
aNewFootprintFPID.Format().c_str() );
m_WinMessages->AppendText( line );
wxString moduleName = aNewFootprintFPID.GetFootprintName();
wxString libName = aNewFootprintFPID.GetLibNickname();
newModule = m_parent->LoadFootprint( aNewFootprintFPID );
if( newModule == NULL ) // New module not found, redraw the old one.

View File

@ -365,8 +365,6 @@ void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode )
continue;
}
zone_subnet = old_zone_subnet;
// 2 successive items already from the same cluster: nothing to do
if( subnet == old_subnet )
continue;

View File

@ -323,7 +323,6 @@ bool BOARD::CombineAreas( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_
int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_Examine,
bool aCreate_Markers )
{
wxString str;
int nerrors = 0;
// iterate through all areas
@ -509,8 +508,6 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
if( !aArea->IsOnCopperLayer() ) // Cannot have a Drc error if not on copper layer
return true;
wxString str;
wxPoint start = aArea->GetCornerPosition( aCornerIndex );
wxPoint end;