From bd6bb510f8e5d44495004ba98568e867cec167c8 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 10 Sep 2013 10:47:42 +0200 Subject: [PATCH] Changed D() macro to DBG() because of conflict with glm::D(). Added const to GetColor() and GetType() functions in WS_DRAW_ITEM. --- 3d-viewer/3d_draw_basic_functions.cpp | 2 +- 3d-viewer/vrmlmodelparser.cpp | 8 +++---- 3d-viewer/x3dmodelparser.cpp | 18 +++++++------- include/fctsys.h | 4 ++-- include/worksheet_shape_builder.h | 5 ++-- ...board_items_to_polygon_shape_transform.cpp | 2 +- pcbnew/deltrack.cpp | 4 ++-- pcbnew/dialogs/dialog_fp_lib_table.cpp | 10 ++++---- pcbnew/eagle_plugin.cpp | 2 +- pcbnew/editrack.cpp | 24 +++++++++---------- pcbnew/gen_modules_placefile.cpp | 4 ++-- pcbnew/specctra_export.cpp | 6 ++--- 12 files changed, 44 insertions(+), 45 deletions(-) diff --git a/3d-viewer/3d_draw_basic_functions.cpp b/3d-viewer/3d_draw_basic_functions.cpp index bb08b572b3..fbe1fb6277 100644 --- a/3d-viewer/3d_draw_basic_functions.cpp +++ b/3d-viewer/3d_draw_basic_functions.cpp @@ -415,6 +415,6 @@ void CALLBACK tessErrorCB( GLenum errorCode ) errorStr = gluErrorString( errorCode ); // DEBUG // - D( printf( "Tess ERROR: %s\n", errorStr ); ) + DBG( printf( "Tess ERROR: %s\n", errorStr ); ) #endif } diff --git a/3d-viewer/vrmlmodelparser.cpp b/3d-viewer/vrmlmodelparser.cpp index 20ec219991..fa90c6ada8 100644 --- a/3d-viewer/vrmlmodelparser.cpp +++ b/3d-viewer/vrmlmodelparser.cpp @@ -115,7 +115,7 @@ int VRML_MODEL_PARSER::readMaterial( FILE* file, int* LineNum ) } } - D( printf( "ReadMaterial error: material not found\n" ) ); + DBG( printf( "ReadMaterial error: material not found\n" ) ); return 0; } @@ -207,7 +207,7 @@ int VRML_MODEL_PARSER::readChildren( FILE* file, int* LineNum ) } else { - D( printf( "ReadChildren error line %d <%s> \n", *LineNum, text ) ); + DBG( printf( "ReadChildren error line %d <%s> \n", *LineNum, text ) ); break; } } @@ -241,7 +241,7 @@ int VRML_MODEL_PARSER::readShape( FILE* file, int* LineNum ) } else { - D( printf( "ReadShape error line %d <%s> \n", *LineNum, text ) ); + DBG( printf( "ReadShape error line %d <%s> \n", *LineNum, text ) ); break; } } @@ -271,7 +271,7 @@ int VRML_MODEL_PARSER::readAppearance( FILE* file, int* LineNum ) } else { - D( printf( "ReadAppearance error line %d <%s> \n", *LineNum, text ) ); + DBG( printf( "ReadAppearance error line %d <%s> \n", *LineNum, text ) ); break; } } diff --git a/3d-viewer/x3dmodelparser.cpp b/3d-viewer/x3dmodelparser.cpp index 8205726ce1..0ca02d9157 100644 --- a/3d-viewer/x3dmodelparser.cpp +++ b/3d-viewer/x3dmodelparser.cpp @@ -197,19 +197,19 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode ) if( !parseDoubleTriplet( properties[ wxT( "diffuseColor" ) ], material->m_DiffuseColor ) ) { - D( printf("diffuseColor parsing error") ); + DBG( printf("diffuseColor parsing error") ); } if( !parseDoubleTriplet( properties[ wxT( "specularColor" ) ], material->m_SpecularColor ) ) { - D( printf("specularColor parsing error") ); + DBG( printf("specularColor parsing error") ); } if( !parseDoubleTriplet( properties[ wxT( "emissiveColor" ) ], material->m_EmissiveColor ) ) { - D( printf("emissiveColor parsing error") ); + DBG( printf("emissiveColor parsing error") ); } wxStringTokenizer values; @@ -221,7 +221,7 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode ) } else { - D( printf( "ambienterror" ) ); + DBG( printf( "ambienterror" ) ); } values.SetString( properties[ wxT( "shininess" ) ] ); @@ -232,7 +232,7 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode ) } else { - D( printf( "shininess error" ) ); + DBG( printf( "shininess error" ) ); } values.SetString( properties[ wxT( "transparency" ) ] ); @@ -243,7 +243,7 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode ) } else { - D( printf( "trans error") ); + DBG( printf( "trans error") ); } material->SetMaterial(); @@ -303,7 +303,7 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode ) } } - D( printf( "ReadMaterial error: material not found\n" ) ); + DBG( printf( "ReadMaterial error: material not found\n" ) ); } } @@ -373,7 +373,7 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode, tokens.GetNextToken().ToDouble( &rotation.z ) && tokens.GetNextToken().ToDouble( &angle ) ) ) { - D( printf("rotation read error") ); + DBG( printf("rotation read error") ); } double vrmlunits_to_3Dunits = g_Parm_3D_Visu.m_BiuTo3Dunits * @@ -407,7 +407,7 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode, if( points.size() % 3 != 0 ) { - D( printf( "Number of points is incorrect" ) ); + DBG( printf( "Number of points is incorrect" ) ); return; } diff --git a/include/fctsys.h b/include/fctsys.h index 2d07a11413..ff239ce9de 100644 --- a/include/fctsys.h +++ b/include/fctsys.h @@ -21,9 +21,9 @@ #define WIN_STRING_DIR_SEP wxT( "\\" ) #ifdef DEBUG -#define D(x) x +#define DBG(x) x #else -#define D(x) // nothing +#define DBG(x) // nothing #endif /** diff --git a/include/worksheet_shape_builder.h b/include/worksheet_shape_builder.h index af6051c353..a7d4644172 100644 --- a/include/worksheet_shape_builder.h +++ b/include/worksheet_shape_builder.h @@ -39,7 +39,6 @@ protected: // to the parent WORKSHEET_DATAITEM item, // in page layout editor -protected: WS_DRAW_ITEM_BASE( WORKSHEET_DATAITEM* aParent, WS_DRAW_TYPE aType, EDA_COLOR_T aColor ) { @@ -53,8 +52,8 @@ public: virtual ~WS_DRAW_ITEM_BASE() {} // Accessors: - EDA_COLOR_T GetColor() { return m_color; } - WS_DRAW_TYPE GetType() { return m_type; }; + EDA_COLOR_T GetColor() const { return m_color; } + WS_DRAW_TYPE GetType() const { return m_type; }; WORKSHEET_DATAITEM* GetParent() { return m_parent; } diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index 9b801d452e..c18dbc3d19 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -143,7 +143,7 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( break; default: - D( printf( "Error: Shape %d not implemented!\n", + DBG( printf( "Error: Shape %d not implemented!\n", outline->GetShape() ); ) break; } diff --git a/pcbnew/deltrack.cpp b/pcbnew/deltrack.cpp index f85c787f69..2a77f9faec 100644 --- a/pcbnew/deltrack.cpp +++ b/pcbnew/deltrack.cpp @@ -55,7 +55,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) { LAYER_NUM previous_layer = getActiveLayer(); - D( g_CurrentTrackList.VerifyListIntegrity(); ) + DBG( g_CurrentTrackList.VerifyListIntegrity(); ) // Delete the current trace ShowNewTrackWhenMovingCursor( m_canvas, DC, wxDefaultPosition, false ); @@ -215,7 +215,7 @@ void PCB_EDIT_FRAME::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) next_track = tracksegment->Next(); tracksegment->SetState( BUSY, false ); - D( std::cout << __func__ << ": track " << tracksegment << " status=" \ + DBG( std::cout << __func__ << ": track " << tracksegment << " status=" \ << TO_UTF8( TRACK::ShowState( tracksegment->GetStatus() ) ) \ << std::endl; ) diff --git a/pcbnew/dialogs/dialog_fp_lib_table.cpp b/pcbnew/dialogs/dialog_fp_lib_table.cpp index 34eccd06f2..4bc9fc9d7e 100644 --- a/pcbnew/dialogs/dialog_fp_lib_table.cpp +++ b/pcbnew/dialogs/dialog_fp_lib_table.cpp @@ -252,7 +252,7 @@ class DIALOG_FP_LIB_TABLE : public DIALOG_FP_LIB_TABLE_BASE wxArrayInt cols = m_cur_grid->GetSelectedCols(); wxArrayInt rows = m_cur_grid->GetSelectedRows(); - D(printf("topLeft.Count():%zd botRight:Count():%zd\n", topLeft.Count(), botRight.Count() );) + DBG(printf("topLeft.Count():%zd botRight:Count():%zd\n", topLeft.Count(), botRight.Count() );) if( topLeft.Count() && botRight.Count() ) { @@ -284,7 +284,7 @@ class DIALOG_FP_LIB_TABLE : public DIALOG_FP_LIB_TABLE_BASE selColCount = 0; } - // D(printf("selRowStart:%d selColStart:%d selRowCount:%d selColCount:%d\n", selRowStart, selColStart, selRowCount, selColCount );) + // DBG(printf("selRowStart:%d selColStart:%d selRowCount:%d selColCount:%d\n", selRowStart, selColStart, selRowCount, selColCount );) } void rightClickCellPopupMenu() @@ -353,7 +353,7 @@ class DIALOG_FP_LIB_TABLE : public DIALOG_FP_LIB_TABLE_BASE break; case ID_PASTE: - D(printf( "paste\n" );) + DBG(printf( "paste\n" );) // assume format came from a spreadsheet or us. if( wxTheClipboard->Open() ) { @@ -471,7 +471,7 @@ class DIALOG_FP_LIB_TABLE : public DIALOG_FP_LIB_TABLE_BASE m_cur_grid->SetGridCursor( curRow, curCol ); } - D(printf("%s\n", __func__);) + DBG(printf("%s\n", __func__);) } void onCancelButtonClick( wxCommandEvent& event ) @@ -522,7 +522,7 @@ class DIALOG_FP_LIB_TABLE : public DIALOG_FP_LIB_TABLE_BASE m_cur_row = event.GetRow(); m_cur_col = event.GetCol(); - D(printf("change cursor(%d,%d)\n", m_cur_row, m_cur_col );) + DBG(printf("change cursor(%d,%d)\n", m_cur_row, m_cur_col );) // somebody else wants this event.Skip(); diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 00df1c0879..e9b77f57d1 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -2674,7 +2674,7 @@ LAYER_NUM EAGLE_PLUGIN::kicad_layer( int aEagleLayer ) const case 95: kiLayer = ECO1_N; break; case 96: kiLayer = ECO2_N; break; default: - D( printf( "unsupported eagle layer: %d\n", aEagleLayer );) + DBG( printf( "unsupported eagle layer: %d\n", aEagleLayer );) kiLayer = -1; break; // some layers do not map to KiCad } } diff --git a/pcbnew/editrack.cpp b/pcbnew/editrack.cpp index ab538b6a9c..8df058fddf 100644 --- a/pcbnew/editrack.cpp +++ b/pcbnew/editrack.cpp @@ -153,11 +153,11 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) GetBoard()->SetHighLightNet( zone->GetNet() ); } - D( g_CurrentTrackList.VerifyListIntegrity() ); + DBG( g_CurrentTrackList.VerifyListIntegrity() ); BuildAirWiresTargetsList( LockPoint, wxPoint( 0, 0 ), true ); - D( g_CurrentTrackList.VerifyListIntegrity() ); + DBG( g_CurrentTrackList.VerifyListIntegrity() ); GetBoard()->HighLightON(); GetBoard()->DrawHighLight( m_canvas, aDC, GetBoard()->GetHighLightNetCode() ); @@ -191,7 +191,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) // Create 2nd segment g_CurrentTrackList.PushBack( (TRACK*)g_CurrentTrackSegment->Clone() ); - D( g_CurrentTrackList.VerifyListIntegrity(); ); + DBG( g_CurrentTrackList.VerifyListIntegrity(); ); g_CurrentTrackSegment->start = g_FirstTrackSegment; g_FirstTrackSegment->end = g_CurrentTrackSegment; @@ -199,7 +199,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) g_FirstTrackSegment->SetState( BEGIN_ONPAD | END_ONPAD, false ); } - D( g_CurrentTrackList.VerifyListIntegrity(); ); + DBG( g_CurrentTrackList.VerifyListIntegrity(); ); SetMsgPanel( g_CurrentTrackSegment ); SetCurItem( g_CurrentTrackSegment, false ); @@ -246,11 +246,11 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) if( CanCreateNewSegment ) { // Erase old track on screen - D( g_CurrentTrackList.VerifyListIntegrity(); ); + DBG( g_CurrentTrackList.VerifyListIntegrity(); ); ShowNewTrackWhenMovingCursor( m_canvas, aDC, wxDefaultPosition, false ); - D( g_CurrentTrackList.VerifyListIntegrity(); ); + DBG( g_CurrentTrackList.VerifyListIntegrity(); ); if( g_Raccord_45_Auto ) Add45DegreeSegment( aDC ); @@ -273,7 +273,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) newTrack->start = previousTrack->end; - D( g_CurrentTrackList.VerifyListIntegrity(); ); + DBG( g_CurrentTrackList.VerifyListIntegrity(); ); newTrack->SetStart( newTrack->GetEnd() ); @@ -282,7 +282,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) if( !GetBoard()->GetDesignSettings().m_UseConnectedTrackWidth ) newTrack->SetWidth( GetBoard()->GetCurrentTrackWidth() ); - D( g_CurrentTrackList.VerifyListIntegrity(); ); + DBG( g_CurrentTrackList.VerifyListIntegrity(); ); // Show the new position ShowNewTrackWhenMovingCursor( m_canvas, aDC, wxDefaultPosition, false ); @@ -422,7 +422,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC ) // Saving the coordinate of end point of the trace wxPoint pos = g_CurrentTrackSegment->GetEnd(); - D( g_CurrentTrackList.VerifyListIntegrity(); ); + DBG( g_CurrentTrackList.VerifyListIntegrity(); ); if( Begin_Route( aTrack, aDC ) == NULL ) return false; @@ -439,7 +439,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC ) * } */ - D( g_CurrentTrackList.VerifyListIntegrity(); ); + DBG( g_CurrentTrackList.VerifyListIntegrity(); ); /* The track here is now chained to the list of track segments. @@ -670,7 +670,7 @@ inline void DrawViaCirclesWhenEditingNewTrack( EDA_RECT* aPanelClipBox, void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase ) { -// D( g_CurrentTrackList.VerifyListIntegrity(); ); +// DBG( g_CurrentTrackList.VerifyListIntegrity(); ); PCB_SCREEN* screen = (PCB_SCREEN*) aPanel->GetScreen(); PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) aPanel->GetParent(); @@ -764,7 +764,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo } // Redraw the new track - D( g_CurrentTrackList.VerifyListIntegrity(); ); + DBG( g_CurrentTrackList.VerifyListIntegrity(); ); DrawTraces( aPanel, aDC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR ); if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) diff --git a/pcbnew/gen_modules_placefile.cpp b/pcbnew/gen_modules_placefile.cpp index f78316ef81..950b3e0758 100644 --- a/pcbnew/gen_modules_placefile.cpp +++ b/pcbnew/gen_modules_placefile.cpp @@ -376,7 +376,7 @@ int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, if( module->GetAttributes() & MOD_VIRTUAL ) { - D( printf( "skipping module %s because it's virtual\n", + DBG( printf( "skipping module %s because it's virtual\n", TO_UTF8( module->GetReference() ) );) continue; } @@ -393,7 +393,7 @@ int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, } else { - D(printf( "skipping %s because its attribute is not CMS and it has non SMD pins\n", + DBG(printf( "skipping %s because its attribute is not CMS and it has non SMD pins\n", TO_UTF8(module->GetReference()) ) ); continue; } diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index 96b027c217..36ed48d018 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -601,7 +601,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad ) polygon->AppendPoint( lowerRight ); } - D( printf( "m_DeltaSize: %d,%d\n", aPad->GetDelta().x, aPad->GetDelta().y ); ) + DBG( printf( "m_DeltaSize: %d,%d\n", aPad->GetDelta().x, aPad->GetDelta().y ); ) // this string _must_ be unique for a given physical shape snprintf( name, sizeof(name), "Trapz%sPad_%.6gx%.6g_%c%.6gx%c%.6g_um", @@ -793,7 +793,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule ) case S_RECT: case S_ARC: default: - D( printf( "makeIMAGE(): unsupported shape %s\n", + DBG( printf( "makeIMAGE(): unsupported shape %s\n", TO_UTF8( BOARD_ITEM::ShowShape( (STROKE_T) graphic->GetShape() ) ) ); ) continue; } @@ -908,7 +908,7 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IO_ER } else // remove graphics not on EDGE_N layer { - D( items[i]->Show( 0, std::cout );) + DBG( items[i]->Show( 0, std::cout );) ++i; } }