From 0da9086397924f3b979255d0857001837e961115 Mon Sep 17 00:00:00 2001 From: Lorenzo Marcantonio Date: Thu, 28 Mar 2013 07:40:19 +0100 Subject: [PATCH] Extremely trivial stuff (mostly cosmetics) --- eeschema/dialogs/dialog_edit_label.cpp | 2 +- .../dialogs/dialog_print_using_printer.cpp | 2 +- pcbnew/attribut.cpp | 2 +- pcbnew/class_text_mod.h | 11 -------- pcbnew/clean.cpp | 22 ++++++++-------- pcbnew/connect.cpp | 2 +- pcbnew/deltrack.cpp | 2 +- pcbnew/dialogs/dialog_edit_module_text.cpp | 2 +- pcbnew/dragsegm.cpp | 8 +++--- pcbnew/modules.cpp | 8 +++--- pcbnew/move-drag_pads.cpp | 4 +-- pcbnew/tr_modif.cpp | 26 +++++++++---------- 12 files changed, 40 insertions(+), 51 deletions(-) diff --git a/eeschema/dialogs/dialog_edit_label.cpp b/eeschema/dialogs/dialog_edit_label.cpp index a4bd0f3ca4..70424476a2 100644 --- a/eeschema/dialogs/dialog_edit_label.cpp +++ b/eeschema/dialogs/dialog_edit_label.cpp @@ -140,7 +140,7 @@ void DIALOG_LABEL_EDITOR::InitDialog() break; } - int MINTEXTWIDTH = 40; // M's are big characters, a few establish a lot of width + const int MINTEXTWIDTH = 40; // M's are big characters, a few establish a lot of width int max_len = 0; diff --git a/gerbview/dialogs/dialog_print_using_printer.cpp b/gerbview/dialogs/dialog_print_using_printer.cpp index ab2ff965ba..c5619e3d2b 100644 --- a/gerbview/dialogs/dialog_print_using_printer.cpp +++ b/gerbview/dialogs/dialog_print_using_printer.cpp @@ -138,7 +138,7 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) s_Parameters.m_PageSetupData = g_pageSetupData; layer_max = 32; - /* Create layer list */ + // Create layer list int mask = 1, ii; for( ii = 0; ii < layer_max; ii++, mask <<= 1 ) { diff --git a/pcbnew/attribut.cpp b/pcbnew/attribut.cpp index 6d8eba2471..2bc380abf1 100644 --- a/pcbnew/attribut.cpp +++ b/pcbnew/attribut.cpp @@ -80,7 +80,7 @@ void PCB_EDIT_FRAME::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- ) { Track->SetState( TRACK_LOCKED, Flag_On ); - Track->SetState( BUSY, OFF ); + Track->SetState( BUSY, false ); Track = Track->Next(); } diff --git a/pcbnew/class_text_mod.h b/pcbnew/class_text_mod.h index 5042b27875..6394f0a7c8 100644 --- a/pcbnew/class_text_mod.h +++ b/pcbnew/class_text_mod.h @@ -132,17 +132,6 @@ public: bool IsOnLayer( int aLayer ) const; - /* - * Function IsOnOneOfTheseLayers - * returns true if this object is on one of the given layers. Is virtual - * so objects like D_PAD, which reside on multiple layers, can do their own - * form of testing. - * virtual inheritance from BOARD_ITEM. (not yet written) - * @param aLayerMask The bit-mapped set of layers to test for. - * @return bool - true if on one of the given layers, else false. - * bool IsOnOneOfTheseLayers( int aLayerMask ) const; - */ - wxString GetClass() const { diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index ec60732ccb..b2b5e7a1fe 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -345,7 +345,7 @@ bool TRACKS_CLEANER::deleteUnconnectedTracks() if( other && other->Type() == PCB_VIA_T ) { // search for another segment following the via - track->SetState( BUSY, ON ); + track->SetState( BUSY, true ); SEGVIA* via = (SEGVIA*) other; other = via->GetTrace( m_Brd->m_Track, NULL, FLG_START ); @@ -360,7 +360,7 @@ bool TRACKS_CLEANER::deleteUnconnectedTracks() if( (other == NULL) && (zone == NULL) ) flag_erase |= 2; - track->SetState( BUSY, OFF ); + track->SetState( BUSY, false ); } } } @@ -401,7 +401,7 @@ bool TRACKS_CLEANER::deleteUnconnectedTracks() { // search for another segment following the via - track->SetState( BUSY, ON ); + track->SetState( BUSY, true ); SEGVIA* via = (SEGVIA*) other; other = via->GetTrace( m_Brd->m_Track, NULL, FLG_END ); @@ -416,7 +416,7 @@ bool TRACKS_CLEANER::deleteUnconnectedTracks() if( (other == NULL) && (zone == NULL) ) flag_erase |= 0x20; - track->SetState( BUSY, OFF ); + track->SetState( BUSY, false ); } } } @@ -520,9 +520,9 @@ bool TRACKS_CLEANER::clean_segments() break; // We must have only one segment connected - segStart->SetState( BUSY, ON ); + segStart->SetState( BUSY, true ); other = segment->GetTrace( m_Brd->m_Track, NULL, FLG_START ); - segStart->SetState( BUSY, OFF ); + segStart->SetState( BUSY, false ); if( other == NULL ) flag = 1; // OK @@ -558,9 +558,9 @@ bool TRACKS_CLEANER::clean_segments() break; // We must have only one segment connected - segEnd->SetState( BUSY, ON ); + segEnd->SetState( BUSY, true ); other = segment->GetTrace( m_Brd->m_Track, NULL, FLG_END ); - segEnd->SetState( BUSY, OFF ); + segEnd->SetState( BUSY, false ); if( other == NULL ) flag |= 2; // Ok @@ -731,7 +731,7 @@ bool PCB_EDIT_FRAME::RemoveMisConnectedTracks() for( segment = GetBoard()->m_Track; segment; segment = (TRACK*) segment->Next() ) { - segment->SetState( FLAG0, OFF ); + segment->SetState( FLAG0, false ); // find the netcode for segment using anything connected to the "start" of "segment" net_code_s = -1; @@ -773,7 +773,7 @@ bool PCB_EDIT_FRAME::RemoveMisConnectedTracks() // Netcodes do not agree, so mark the segment as "to be removed" if( net_code_s != net_code_e ) { - segment->SetState( FLAG0, ON ); + segment->SetState( FLAG0, true ); } } @@ -784,7 +784,7 @@ bool PCB_EDIT_FRAME::RemoveMisConnectedTracks() if( segment->GetState( FLAG0 ) ) // Segment is flagged to be removed { - segment->SetState( FLAG0, OFF ); + segment->SetState( FLAG0, false ); isModified = true; GetBoard()->m_Status_Pcb = 0; Remove_One_Track( NULL, segment ); diff --git a/pcbnew/connect.cpp b/pcbnew/connect.cpp index 5b3699fd8f..f734899928 100644 --- a/pcbnew/connect.cpp +++ b/pcbnew/connect.cpp @@ -840,7 +840,7 @@ void PCB_BASE_FRAME::RecalculateAllTracksNetcode() curr_track->m_PadsConnected.clear(); curr_track->start = NULL; curr_track->end = NULL; - curr_track->SetState( BUSY | IN_EDIT | BEGIN_ONPAD | END_ONPAD, OFF ); + curr_track->SetState( BUSY | IN_EDIT | BEGIN_ONPAD | END_ONPAD, false ); curr_track->SetZoneSubNet( 0 ); curr_track->SetNet( 0 ); // net code = 0 means not connected } diff --git a/pcbnew/deltrack.cpp b/pcbnew/deltrack.cpp index a9a4bb78a5..b69e4bd487 100644 --- a/pcbnew/deltrack.cpp +++ b/pcbnew/deltrack.cpp @@ -213,7 +213,7 @@ void PCB_EDIT_FRAME::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) for( ; ii < segments_to_delete_count; ii++, tracksegment = next_track ) { next_track = tracksegment->Next(); - tracksegment->SetState( BUSY, OFF ); + tracksegment->SetState( BUSY, false ); D( std::cout << __func__ << ": track " << tracksegment << " status=" \ << TO_UTF8( TRACK::ShowState( tracksegment->GetState( -1 ) ) ) \ diff --git a/pcbnew/dialogs/dialog_edit_module_text.cpp b/pcbnew/dialogs/dialog_edit_module_text.cpp index d0b2b329fd..c75de02cfe 100644 --- a/pcbnew/dialogs/dialog_edit_module_text.cpp +++ b/pcbnew/dialogs/dialog_edit_module_text.cpp @@ -134,7 +134,7 @@ void DialogEditModuleText::initDlg( ) PutValueInLocalUnits( *m_TxtWidthCtlr, m_currentText->GetThickness() ); int text_orient = m_currentText->GetOrientation(); - NORMALIZE_ANGLE_90(text_orient) + NORMALIZE_ANGLE_90( text_orient ); if( (text_orient != 0) ) m_Orient->SetSelection( 1 ); diff --git a/pcbnew/dragsegm.cpp b/pcbnew/dragsegm.cpp index c9eecbcf94..0da2c00240 100644 --- a/pcbnew/dragsegm.cpp +++ b/pcbnew/dragsegm.cpp @@ -209,7 +209,7 @@ void DRAG_LIST::fillList( CONNECTIONS& aConnections ) TRACK * track = pad->m_TracksConnected[jj]; track->start = NULL; track->end = NULL; - track->SetState( START_ON_PAD|END_ON_PAD|BUSY, OFF ); + track->SetState( START_ON_PAD|END_ON_PAD|BUSY, false ); } } @@ -226,13 +226,13 @@ void DRAG_LIST::fillList( CONNECTIONS& aConnections ) if( pad->HitTest( track->GetStart() ) ) { track->start = pad; - track->SetState( START_ON_PAD, ON ); + track->SetState( START_ON_PAD, false ); } if( pad->HitTest( track->GetEnd() ) ) { track->end = pad; - track->SetState( END_ON_PAD, ON ); + track->SetState( END_ON_PAD, false ); } DRAG_SEGM_PICKER wrapper( track ); @@ -407,7 +407,7 @@ void UndrawAndMarkSegmentsToDrag( EDA_DRAW_PANEL* aCanvas, wxDC* aDC ) TRACK* track = g_DragSegmentList[ii].m_Track; track->Draw( aCanvas, aDC, GR_XOR ); - track->SetState( IN_EDIT, ON ); + track->SetState( IN_EDIT, false ); if( g_DragSegmentList[ii].m_Flag & STARTPOINT ) track->SetFlags( STARTPOINT ); diff --git a/pcbnew/modules.cpp b/pcbnew/modules.cpp index ffb9131cdb..7d5c46da58 100644 --- a/pcbnew/modules.cpp +++ b/pcbnew/modules.cpp @@ -129,7 +129,7 @@ void PCB_EDIT_FRAME::StartMoveModule( MODULE* aModule, wxDC* aDC, TRACK* segm = g_DragSegmentList[ii].m_Track; itemWrapper.SetItem( segm ); itemWrapper.SetLink( segm->Clone() ); - itemWrapper.GetLink()->SetState( IN_EDIT, OFF ); + itemWrapper.GetLink()->SetState( IN_EDIT, false ); s_PickedList.PushItem( itemWrapper ); } @@ -179,7 +179,7 @@ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC ) { pt_segm = g_DragSegmentList[ii].m_Track; pt_segm->Draw( Panel, DC, GR_XOR ); - pt_segm->SetState( IN_EDIT, OFF ); + pt_segm->SetState( IN_EDIT, false ); g_DragSegmentList[ii].RestoreInitialValues(); pt_segm->Draw( Panel, DC, GR_OR ); } @@ -276,7 +276,7 @@ bool PCB_EDIT_FRAME::Delete_Module( MODULE* aModule, wxDC* aDC, bool aAskBeforeD /* Remove module from list, and put it in undo command list */ m_Pcb->m_Modules.Remove( aModule ); - aModule->SetState( IS_DELETED, ON ); + aModule->SetState( IS_DELETED, true ); SaveCopyInUndoList( aModule, UR_DELETED ); if( aDC && GetBoard()->IsElementVisible( RATSNEST_VISIBLE ) ) @@ -404,7 +404,7 @@ void PCB_BASE_FRAME::PlaceModule( MODULE* aModule, wxDC* aDC, bool aDoNotRecreat for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ ) { TRACK * track = g_DragSegmentList[ii].m_Track; - track->SetState( IN_EDIT, OFF ); + track->SetState( IN_EDIT, false ); if( aDC ) track->Draw( m_canvas, aDC, GR_OR ); diff --git a/pcbnew/move-drag_pads.cpp b/pcbnew/move-drag_pads.cpp index 0134d48c6d..0c35d4e11a 100644 --- a/pcbnew/move-drag_pads.cpp +++ b/pcbnew/move-drag_pads.cpp @@ -46,7 +46,7 @@ static void Abort_Move_Pad( EDA_DRAW_PANEL* Panel, wxDC* DC ) { TRACK* Track = g_DragSegmentList[ii].m_Track; Track->Draw( Panel, DC, GR_XOR ); - Track->SetState( IN_EDIT, OFF ); + Track->SetState( IN_EDIT, false ); g_DragSegmentList[ii].RestoreInitialValues(); Track->Draw( Panel, DC, GR_OR ); } @@ -177,7 +177,7 @@ void PCB_BASE_FRAME::PlacePad( D_PAD* aPad, wxDC* DC ) if( g_DragSegmentList[ii].m_Pad_End ) Track->SetEnd( aPad->GetPosition() ); - Track->SetState( IN_EDIT, OFF ); + Track->SetState( IN_EDIT, false ); if( DC ) Track->Draw( m_canvas, DC, GR_OR ); diff --git a/pcbnew/tr_modif.cpp b/pcbnew/tr_modif.cpp index 8c31cc32f0..69abe49d35 100644 --- a/pcbnew/tr_modif.cpp +++ b/pcbnew/tr_modif.cpp @@ -75,7 +75,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, /* Reconstruct the complete track (the new track has to start on a segment of track). */ - ListSetState( aNewTrack, aNewTrackSegmentsCount, BUSY, OFF ); + ListSetState( aNewTrack, aNewTrackSegmentsCount, BUSY, false ); /* If the new track begins with a via, complete the track segment using * the following segment as a reference because a via is often a hub of @@ -114,7 +114,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, for( pt_del = bufStart; pt_del; pt_del = pt_del->Next() ) { // D( std::cout<<"track "<SetState( BUSY | IN_EDIT | IS_LINKED, OFF ); + pt_del->SetState( BUSY | IN_EDIT | IS_LINKED, false ); if( pt_del == bufEnd ) // Last segment reached break; @@ -162,7 +162,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, } // Mark as deleted a new track (which is not involved in the search for other connections) - ListSetState( aNewTrack, aNewTrackSegmentsCount, IS_DELETED, ON ); + ListSetState( aNewTrack, aNewTrackSegmentsCount, IS_DELETED, true ); /* A segment must be connected to the starting point, otherwise * it is unnecessary to analyze the other point @@ -172,7 +172,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, if( pt_segm == NULL ) // Not connected to the track starting point. { // Clear the delete flag. - ListSetState( aNewTrack, aNewTrackSegmentsCount, IS_DELETED, OFF ); + ListSetState( aNewTrack, aNewTrackSegmentsCount, IS_DELETED, false ); return 0; } @@ -191,7 +191,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, { if( pt_segm->GetState( IS_LINKED ) == 0 ) { - pt_segm->SetState( IS_LINKED, ON ); + pt_segm->SetState( IS_LINKED, true ); nbconnect++; } } @@ -207,7 +207,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, // Clear used flags for( pt_del = bufStart; pt_del; pt_del = pt_del->Next() ) { - pt_del->SetState( BUSY | IS_DELETED | IN_EDIT | IS_LINKED, OFF ); + pt_del->SetState( BUSY | IS_DELETED | IN_EDIT | IS_LINKED, false ); if( pt_del == bufEnd ) // Last segment reached break; @@ -217,8 +217,8 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, } // Mark trace as edited (which does not involve searching for other tracks) - ListSetState( aNewTrack, aNewTrackSegmentsCount, IS_DELETED, OFF ); - ListSetState( aNewTrack, aNewTrackSegmentsCount, IN_EDIT, ON ); + ListSetState( aNewTrack, aNewTrackSegmentsCount, IS_DELETED, false ); + ListSetState( aNewTrack, aNewTrackSegmentsCount, IN_EDIT, true ); // Test all marked segments. while( nbconnect ) @@ -233,7 +233,7 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, } nbconnect--; - pt_del->SetState( IS_LINKED, OFF ); + pt_del->SetState( IS_LINKED, false ); pt_del = GetBoard()->MarkTrace( pt_del, &nb_segm, NULL, NULL, true ); @@ -278,13 +278,13 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, { if( pt_del->GetState( IN_EDIT ) ) { - pt_del->SetState( IN_EDIT, OFF ); + pt_del->SetState( IN_EDIT, false ); if( aDC ) pt_del->Draw( m_canvas, aDC, GR_OR ); } - pt_del->SetState( IN_EDIT | IS_LINKED, OFF ); + pt_del->SetState( IN_EDIT | IS_LINKED, false ); } return 1; @@ -292,13 +292,13 @@ int PCB_EDIT_FRAME::EraseRedundantTrack( wxDC* aDC, } // Clear BUSY flag here because the track did not get marked. - ListSetState( pt_del, nb_segm, BUSY, OFF ); + ListSetState( pt_del, nb_segm, BUSY, false ); } // Clear used flags for( pt_del = m_Pcb->m_Track; pt_del; pt_del = pt_del->Next() ) { - pt_del->SetState( BUSY | IS_DELETED | IN_EDIT | IS_LINKED, OFF ); + pt_del->SetState( BUSY | IS_DELETED | IN_EDIT | IS_LINKED, false ); if( pt_del == bufEnd ) // Last segment reached break;