From 59d2523c49c05e97c3bff2cc3de2c3078674806f Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Wed, 23 Jan 2013 10:13:42 -0600 Subject: [PATCH] fix compiler warnings with gcc 4.6.3 on x86_64 linux --- common/class_layer_box_selector.cpp | 2 +- gerbview/class_gbr_layer_box_selector.cpp | 8 +++++--- pcbnew/class_pcb_layer_box_selector.cpp | 5 ++++- pcbnew/printout_controler.cpp | 2 ++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/common/class_layer_box_selector.cpp b/common/class_layer_box_selector.cpp index ae94bf27df..d38943a7bb 100644 --- a/common/class_layer_box_selector.cpp +++ b/common/class_layer_box_selector.cpp @@ -78,7 +78,7 @@ int LAYER_BOX_SELECTOR::SetLayerSelection( int layer ) for( int i = 0; i < elements; i++ ) { - if( GetClientData( i ) == (void*) layer ) + if( GetClientData( i ) == (void*)(intptr_t) layer ) { if( GetSelection() != i ) // Element (i) is not selected { diff --git a/gerbview/class_gbr_layer_box_selector.cpp b/gerbview/class_gbr_layer_box_selector.cpp index a931aca56d..45918ec131 100644 --- a/gerbview/class_gbr_layer_box_selector.cpp +++ b/gerbview/class_gbr_layer_box_selector.cpp @@ -48,8 +48,8 @@ void GBR_LAYER_BOX_SELECTOR::Resync() for( int layerid = 0; layerid < LAYER_COUNT; layerid++ ) { - wxBitmap layerbmp( 14, 14 ); - wxString layername; + wxBitmap layerbmp( 14, 14 ); + wxString layername; if( !IsLayerEnabled( layerid ) ) continue; @@ -59,10 +59,11 @@ void GBR_LAYER_BOX_SELECTOR::Resync() layername = GetLayerName( layerid ); - Append( layername, layerbmp, (void*) layerid ); + Append( layername, layerbmp, (void*)(intptr_t) layerid ); } } + // Returns a color index from the layer id EDA_COLOR_T GBR_LAYER_BOX_SELECTOR::GetLayerColor( int aLayerIndex ) const { @@ -71,6 +72,7 @@ EDA_COLOR_T GBR_LAYER_BOX_SELECTOR::GetLayerColor( int aLayerIndex ) const return frame->GetLayerColor( aLayerIndex ); } + // Returns the name of the layer id wxString GBR_LAYER_BOX_SELECTOR::GetLayerName( int aLayerIndex ) const { diff --git a/pcbnew/class_pcb_layer_box_selector.cpp b/pcbnew/class_pcb_layer_box_selector.cpp index a5f138b3fd..e44dabaa7d 100644 --- a/pcbnew/class_pcb_layer_box_selector.cpp +++ b/pcbnew/class_pcb_layer_box_selector.cpp @@ -77,10 +77,11 @@ void PCB_LAYER_BOX_SELECTOR::Resync() if( m_layerhotkeys && m_hotkeys != NULL ) layername = AddHotkeyName( layername, m_hotkeys, layerhk[layerid], IS_COMMENT ); - Append( layername, layerbmp, (void*) layerid ); + Append( layername, layerbmp, (void*)(intptr_t) layerid ); } } + // Returns true if the layer id is enabled (i.e. is it should be displayed) bool PCB_LAYER_BOX_SELECTOR::IsLayerEnabled( int aLayerIndex ) const { @@ -91,6 +92,7 @@ bool PCB_LAYER_BOX_SELECTOR::IsLayerEnabled( int aLayerIndex ) const return board->IsLayerEnabled( aLayerIndex ); } + // Returns a color index from the layer id EDA_COLOR_T PCB_LAYER_BOX_SELECTOR::GetLayerColor( int aLayerIndex ) const { @@ -101,6 +103,7 @@ EDA_COLOR_T PCB_LAYER_BOX_SELECTOR::GetLayerColor( int aLayerIndex ) const return board->GetLayerColor( aLayerIndex ); } + // Returns the name of the layer id wxString PCB_LAYER_BOX_SELECTOR::GetLayerName( int aLayerIndex ) const { diff --git a/pcbnew/printout_controler.cpp b/pcbnew/printout_controler.cpp index 8fdb70033a..052d29d6a1 100644 --- a/pcbnew/printout_controler.cpp +++ b/pcbnew/printout_controler.cpp @@ -319,6 +319,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage() wxLogTrace( tracePrinting, wxT( "Logical origin: x=%d, y=%d" ), offset.x, offset.y ); +#if defined(DEBUG) wxRect paperRect = GetPaperRectPixels(); wxLogTrace( tracePrinting, wxT( "Paper rectangle: left=%d, top=%d, " "right=%d, bottom=%d" ), @@ -332,6 +333,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage() wxLogTrace( tracePrinting, wxT( "Final device rectangle: left=%d, top=%d, " "right=%d, bottom=%d\n" ), devLeft, devTop, devRight, devBottom ); +#endif g_DrawBgColor = WHITE;