From b556fb23249e6466d151de4090ece4dc405c8244 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 29 Jan 2015 17:01:48 +0100 Subject: [PATCH] Class BOARD: Rename an overloaded method named SetLayer with the better name SetLayerDescr, and comment it. It also remove some warnings when compiled with option -Woverloaded-virtual --- pcbnew/class_board.cpp | 2 +- pcbnew/class_board.h | 10 +++++++++- pcbnew/pcb_parser.cpp | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 2f93772d39..8fbc69dda5 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -303,7 +303,7 @@ void BOARD::PopHighLight() } -bool BOARD::SetLayer( LAYER_ID aIndex, const LAYER& aLayer ) +bool BOARD::SetLayerDescr( LAYER_ID aIndex, const LAYER& aLayer ) { if( unsigned( aIndex ) < DIM( m_Layer ) ) { diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index f25da375bb..84891f780c 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -661,7 +661,15 @@ public: return LSET::Name( aLayerId ); } - bool SetLayer( LAYER_ID aIndex, const LAYER& aLayer ); + /** + * Function SetLayerDescr + * returns the type of the copper layer given by aLayer. + * + * @param aIndex A layer index in m_Layer + * @param aLayer A reference to a LAYER description. + * @return false if the index was out of range. + */ + bool SetLayerDescr( LAYER_ID aIndex, const LAYER& aLayer ); /** * Function GetLayerType diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index a4c8785f3e..b08e4527f6 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -800,7 +800,7 @@ void PCB_PARSER::parseLayers() throw( IO_ERROR, PARSE_ERROR ) if( it->m_visible ) visibleLayers.set( it->m_number ); - m_board->SetLayer( LAYER_ID( it->m_number ), *it ); + m_board->SetLayerDescr( LAYER_ID( it->m_number ), *it ); UTF8 name = it->m_name; @@ -838,7 +838,7 @@ void PCB_PARSER::parseLayers() throw( IO_ERROR, PARSE_ERROR ) // DBG( printf( "aux m_visible:%s\n", layer.m_visible ? "true" : "false" );) - m_board->SetLayer( it->second, layer ); + m_board->SetLayerDescr( it->second, layer ); token = NextTok();