diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index c10549cd4a..599422054e 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -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 } }; diff --git a/pcbnew/append_board_to_current.cpp b/pcbnew/append_board_to_current.cpp index e6de984939..06e0630113 100644 --- a/pcbnew/append_board_to_current.cpp +++ b/pcbnew/append_board_to_current.cpp @@ -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 ) @@ -143,7 +143,7 @@ bool PCB_EDIT_FRAME::AppendBoardFile( const wxString& aFullFileName, int aCtl ) if( bboxInit ) bbox = module->GetBoundingBox(); else - bbox.Merge(module->GetBoundingBox() ); + bbox.Merge( module->GetBoundingBox() ); bboxInit = false; } @@ -163,7 +163,7 @@ bool PCB_EDIT_FRAME::AppendBoardFile( const wxString& aFullFileName, int aCtl ) if( bboxInit ) bbox = drawing->GetBoundingBox(); else - bbox.Merge(drawing->GetBoundingBox() ); + bbox.Merge( drawing->GetBoundingBox() ); bboxInit = false; } @@ -180,7 +180,7 @@ bool PCB_EDIT_FRAME::AppendBoardFile( const wxString& aFullFileName, int aCtl ) if( bboxInit ) bbox = zone->GetBoundingBox(); else - bbox.Merge(zone->GetBoundingBox() ); + bbox.Merge( zone->GetBoundingBox() ); bboxInit = false; } diff --git a/pcbnew/block.cpp b/pcbnew/block.cpp index 0340d34718..fdb366a44f 100644 --- a/pcbnew/block.cpp +++ b/pcbnew/block.cpp @@ -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++ ) diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index 8e7577e6b7..9063f9e307 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -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) diff --git a/pcbnew/board_undo_redo.cpp b/pcbnew/board_undo_redo.cpp index dd221f74d5..48bf7eb84e 100644 --- a/pcbnew/board_undo_redo.cpp +++ b/pcbnew/board_undo_redo.cpp @@ -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 ); } diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 977d7b15c4..a9090500ea 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -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 ); } diff --git a/pcbnew/class_board_connected_item.cpp b/pcbnew/class_board_connected_item.cpp index 82a2153190..166667454a 100644 --- a/pcbnew/class_board_connected_item.cpp +++ b/pcbnew/class_board_connected_item.cpp @@ -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 ); } diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index f9bce50676..71b0f39eaa 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -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; diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index 9d9abd1006..5398c3183c 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -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: diff --git a/pcbnew/class_footprint_wizard.cpp b/pcbnew/class_footprint_wizard.cpp index bbc2318f82..2d503c2a8b 100644 --- a/pcbnew/class_footprint_wizard.cpp +++ b/pcbnew/class_footprint_wizard.cpp @@ -29,7 +29,6 @@ */ #include "class_footprint_wizard.h" -#include 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 ); } diff --git a/pcbnew/class_mire.cpp b/pcbnew/class_mire.cpp index 6c1c2921a7..63c2dc10a0 100644 --- a/pcbnew/class_mire.cpp +++ b/pcbnew/class_mire.cpp @@ -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; } diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index b5233fa5c4..bd194eccc1 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -321,9 +321,9 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, bool doAppend ) case PCB_MODULE_EDGE_T: if( doAppend ) - m_Drawings.PushBack( static_cast( aBoardItem ) ); + m_Drawings.PushBack( aBoardItem ); else - m_Drawings.PushFront( static_cast( 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( aBoardItem ) ); + return m_Drawings.Remove( aBoardItem ); case PCB_PAD_T: return m_Pads.Remove( static_cast( 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 ); diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index dbcc411c24..f95caa70e7 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -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(); @@ -908,15 +908,15 @@ wxString D_PAD::GetSelectMenuText() const if( padname.IsEmpty() ) { - text.Printf( _( "Pad on %s of %s" ), - GetChars( padlayers ), - GetChars(( (MODULE*) GetParent() )->GetReference() ) ); + text.Printf( _( "Pad on %s of %s" ), + GetChars( padlayers ), + 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; diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 3aa14f3b7b..fcaef9e0d1 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -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( ) ); diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 219c2ede5f..f06a85e0b7 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -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 CornersTypeBuffer; static std::vector 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 ) ); } } diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index 7ce12892f8..7ee4083875 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -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 { diff --git a/pcbnew/dragsegm.cpp b/pcbnew/dragsegm.cpp index 52e73274b5..7e48f5c2a7 100644 --- a/pcbnew/dragsegm.cpp +++ b/pcbnew/dragsegm.cpp @@ -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 ) { diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index 8d72d0afca..b9002f8368 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -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 diff --git a/pcbnew/editrack-part2.cpp b/pcbnew/editrack-part2.cpp index 868e5a72e0..0d114f14f5 100644 --- a/pcbnew/editrack-part2.cpp +++ b/pcbnew/editrack-part2.cpp @@ -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++ ) { diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index a52aa7e09a..c59a1b796a 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -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; diff --git a/pcbnew/exporters/gen_modules_placefile.cpp b/pcbnew/exporters/gen_modules_placefile.cpp index 9a8158ace6..442a264083 100644 --- a/pcbnew/exporters/gen_modules_placefile.cpp +++ b/pcbnew/exporters/gen_modules_placefile.cpp @@ -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, diff --git a/pcbnew/github/github_plugin.cpp b/pcbnew/github/github_plugin.cpp index 8d1da4fc1b..5da5c40a49 100644 --- a/pcbnew/github/github_plugin.cpp +++ b/pcbnew/github/github_plugin.cpp @@ -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 ); } diff --git a/pcbnew/gpcb_plugin.cpp b/pcbnew/gpcb_plugin.cpp index e9c0f7ecac..0cff5706a7 100644 --- a/pcbnew/gpcb_plugin.cpp +++ b/pcbnew/gpcb_plugin.cpp @@ -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 ) ); } diff --git a/pcbnew/highlight.cpp b/pcbnew/highlight.cpp index 48452a3cd7..a7ae4e963f 100644 --- a/pcbnew/highlight.cpp +++ b/pcbnew/highlight.cpp @@ -43,9 +43,6 @@ #include -#define Pad_fill ( Pad_Fill_Item.State == RUN ) - - void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event ) { NETINFO_ITEM* net; diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index d80a4e52b2..48d0168008 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -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 } }; diff --git a/pcbnew/kicad_netlist_reader.cpp b/pcbnew/kicad_netlist_reader.cpp index cf101a5a9f..18e75cf47a 100644 --- a/pcbnew/kicad_netlist_reader.cpp +++ b/pcbnew/kicad_netlist_reader.cpp @@ -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; diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index d8a2934ecb..5ae07fd9ad 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -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(), diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index 2fb89e0c7e..1e0b6d7b24 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -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, diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index 99b1c923d3..9e8ca54ebc 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -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; diff --git a/pcbnew/modview_frame.cpp b/pcbnew/modview_frame.cpp index 44c071efb9..ee88cc6c43 100644 --- a/pcbnew/modview_frame.cpp +++ b/pcbnew/modview_frame.cpp @@ -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: diff --git a/pcbnew/muonde.cpp b/pcbnew/muonde.cpp index 11ba66880f..4e551b35a6 100644 --- a/pcbnew/muonde.cpp +++ b/pcbnew/muonde.cpp @@ -508,7 +508,8 @@ int BuildCornersList_S_Shape( std::vector & 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 ) { diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 8675bdfd1b..603355e22c 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -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 ) { diff --git a/pcbnew/pad_edition_functions.cpp b/pcbnew/pad_edition_functions.cpp index e1b87ed90a..eaa2400541 100644 --- a/pcbnew/pad_edition_functions.cpp +++ b/pcbnew/pad_edition_functions.cpp @@ -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 diff --git a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp index 17feb05f65..f588bbce1b 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp @@ -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; diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index bc010d8426..0abbd00038 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -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; } diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 2937fae15f..deb126f233 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -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(); } } diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index e0e0ca6fa9..7ffec7ee61 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -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 diff --git a/pcbnew/swap_layers.cpp b/pcbnew/swap_layers.cpp index c5f0e05f66..f27fe8eaa9 100644 --- a/pcbnew/swap_layers.cpp +++ b/pcbnew/swap_layers.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #include diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index f2eb7c77a2..ee27942216 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -531,8 +531,6 @@ void PCB_EDIT_FRAME::ReCreateMicrowaveVToolbar() void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar() { - wxString msg; - wxWindowUpdateLocker dummy( this ); if( m_auxiliaryToolBar ) diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index a4156663ad..8bd2aaf845 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -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() ) diff --git a/pcbnew/xchgmod.cpp b/pcbnew/xchgmod.cpp index 838c7aa39c..fa29048136 100644 --- a/pcbnew/xchgmod.cpp +++ b/pcbnew/xchgmod.cpp @@ -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. diff --git a/pcbnew/zones_polygons_test_connections.cpp b/pcbnew/zones_polygons_test_connections.cpp index 958c064248..ad6db25958 100644 --- a/pcbnew/zones_polygons_test_connections.cpp +++ b/pcbnew/zones_polygons_test_connections.cpp @@ -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; diff --git a/pcbnew/zones_test_and_combine_areas.cpp b/pcbnew/zones_test_and_combine_areas.cpp index 4f8c080305..9793756298 100644 --- a/pcbnew/zones_test_and_combine_areas.cpp +++ b/pcbnew/zones_test_and_combine_areas.cpp @@ -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;