diff --git a/common/lset.cpp b/common/lset.cpp index b7776c6902..1c49af19eb 100644 --- a/common/lset.cpp +++ b/common/lset.cpp @@ -1,18 +1,41 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck + * Copyright (C) 2014 KiCad Developers, see change_log.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ +#include +#include + #include #include - LSET::LSET( const LAYER_ID* aArray, unsigned aCount ) { for( unsigned i=0; i -#include LSET::LSET( size_t aIdCount, ... ) { @@ -224,7 +247,7 @@ std::string LSET::FmtHex() const for( int nibble=0; nibble= 'a' && cc <= 'f' ) nibble = cc - 'a' + 10; + else if( cc >= 'A' && cc <= 'F' ) + nibble = cc - 'A' + 10; else break; @@ -300,7 +325,7 @@ LSEQ LSET::Seq( const LAYER_ID* aWishListSequence, unsigned aCount ) const { LSEQ ret; -#if defined(DEBUG) +#if defined(DEBUG) && 0 LSET dup_detector; for( unsigned i=0; i>= 1 ) + for( int i = 0; aMask; ++i, aMask >>= 1 ) { if( aMask & 1 ) ++count; @@ -334,7 +334,7 @@ LAYER_ID LEGACY_PLUGIN::leg_layer2new( int cu_count, LAYER_NUM aLayerNum ) // this is a speed critical function, be careful. - if( old <= LAYER_N_FRONT ) + if( unsigned( old ) <= unsigned( LAYER_N_FRONT ) ) { if( old == LAYER_N_FRONT ) newid = F_Cu; @@ -385,7 +385,7 @@ LSET LEGACY_PLUGIN::leg_mask2new( int cu_count, unsigned aMask ) aMask &= ~ALL_CU_LAYERS; } - for( int i=0; i>= 1 ) + for( int i=0; aMask; ++i, aMask >>= 1 ) { if( aMask & 1 ) ret.set( leg_layer2new( cu_count, i ) );