diff --git a/pcbnew/class_netinfolist.cpp b/pcbnew/class_netinfolist.cpp index 34b2eded9a..ac8962958e 100644 --- a/pcbnew/class_netinfolist.cpp +++ b/pcbnew/class_netinfolist.cpp @@ -1,3 +1,27 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.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 + */ + /** * @file class_netinfolist.cpp */ @@ -230,7 +254,8 @@ void NETINFO_MAPPING::Update() // Prepare the new mapping m_netMapping.clear(); - // Now the nets variable stores all the used net codes (not only for pads) + // Now the nets variable stores all the used net codes (not only for pads) and we are ready to + // assign new consecutive net numbers int newNetCode = 0; for( std::set::const_iterator it = nets.begin(), itEnd = nets.end(); it != itEnd; ++it ) m_netMapping[*it] = newNetCode++; @@ -249,5 +274,6 @@ NETINFO_ITEM* NETINFO_MAPPING::iterator::operator->() const } -const NETINFO_ITEM NETINFO_LIST::ORPHANED = NETINFO_ITEM( NULL, wxString::FromUTF8( "orphaned" ), -1 ); const int NETINFO_LIST::UNCONNECTED = 0; +const NETINFO_ITEM NETINFO_LIST::ORPHANED = NETINFO_ITEM( NULL, wxEmptyString, + NETINFO_LIST::UNCONNECTED ); diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index cdb598ad27..97777200ea 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -1303,7 +1303,10 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule ) // read Netname ReadDelimitedText( buf, data, sizeof(buf) ); - assert( m_board->FindNet( netcode )->GetNetname() == FROM_UTF8( StrPurge( buf ) ) ); +#ifndef NDEBUG + if( m_board ) + assert( m_board->FindNet( netcode )->GetNetname() == FROM_UTF8( StrPurge( buf ) ) ); +#endif /* NDEBUG */ } else if( TESTLINE( "Po" ) ) // (Po)sition