diff --git a/eeschema/lib_export.cpp b/eeschema/lib_export.cpp index d4d5c1d4c1..8b51884750 100644 --- a/eeschema/lib_export.cpp +++ b/eeschema/lib_export.cpp @@ -59,12 +59,12 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event ) m_mruPath = fn.GetPath(); - std::auto_ptr lib; + std::unique_ptr lib; try { - std::auto_ptr new_lib( PART_LIB::LoadLibrary( fn.GetFullPath() ) ); - lib = new_lib; + std::unique_ptr new_lib( PART_LIB::LoadLibrary( fn.GetFullPath() ) ); + lib = std::move( new_lib ); } catch( const IO_ERROR& ioe ) { diff --git a/eeschema/libarch.cpp b/eeschema/libarch.cpp index 100b6aa7a3..ef001af5b5 100644 --- a/eeschema/libarch.cpp +++ b/eeschema/libarch.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2004 Jean-Pierre Charras, jp.charras ar wanadoo.fr * Copyright (C) 2008-2011 Wayne Stambaugh - * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2004-2016 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 @@ -61,7 +61,7 @@ bool SCH_EDIT_FRAME::CreateArchiveLibrary( const wxString& aFileName ) SCH_SCREENS screens; PART_LIBS* libs = Prj().SchLibs(); - std::auto_ptr libCache( new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ) ); + std::unique_ptr libCache( new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ) ); libCache->SetCache(); diff --git a/eeschema/project_rescue.cpp b/eeschema/project_rescue.cpp index f1fdd4ec9d..374a7df0a7 100644 --- a/eeschema/project_rescue.cpp +++ b/eeschema/project_rescue.cpp @@ -317,7 +317,7 @@ class RESCUE_CACHE_CANDIDATE: public RESCUE_CANDIDATE LIB_PART* m_cache_candidate; LIB_PART* m_lib_candidate; - static std::auto_ptr m_rescue_lib; + static std::unique_ptr m_rescue_lib; static wxFileName m_library_fn; public: @@ -403,10 +403,10 @@ public: m_library_fn.SetName( fn.GetName() ); m_library_fn.SetExt( wxT( "lib" ) ); - std::auto_ptr rescue_lib( new PART_LIB( LIBRARY_TYPE_EESCHEMA, + std::unique_ptr rescue_lib( new PART_LIB( LIBRARY_TYPE_EESCHEMA, fn.GetFullPath() ) ); - m_rescue_lib = rescue_lib; + m_rescue_lib = std::move( rescue_lib ); } virtual bool PerformAction( RESCUER* aRescuer ) @@ -441,7 +441,7 @@ public: } }; -std::auto_ptr RESCUE_CACHE_CANDIDATE::m_rescue_lib; +std::unique_ptr RESCUE_CACHE_CANDIDATE::m_rescue_lib; wxFileName RESCUE_CACHE_CANDIDATE::m_library_fn; RESCUER::RESCUER( SCH_EDIT_FRAME& aEditFrame, PROJECT& aProject ) diff --git a/pcb_calculator/transline/microstrip.cpp b/pcb_calculator/transline/microstrip.cpp index 7cf0eab811..1a158785b4 100644 --- a/pcb_calculator/transline/microstrip.cpp +++ b/pcb_calculator/transline/microstrip.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2001 Gopal Narayanan * Copyright (C) 2002 Claudio Girardi * Copyright (C) 2005, 2006 Stefan Jahn - * Modified for Kicad: 2015 jean-pierre.charras + * Modified for Kicad: 2015 Jean-Pierre Charras * * 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 @@ -69,11 +69,11 @@ MICROSTRIP::MICROSTRIP() : TRANSLINE() */ double MICROSTRIP::Z0_homogeneous( double u ) { - double f, Z0; + double freq, Z0_value; - f = 6.0 + (2.0 * M_PI - 6.0) * exp( -pow( 30.666 / u, 0.7528 ) ); - Z0 = ( ZF0 / (2.0 * M_PI) ) * log( f / u + sqrt( 1.0 + 4.0 / (u * u) ) ); - return Z0; + freq = 6.0 + (2.0 * M_PI - 6.0) * exp( -pow( 30.666 / u, 0.7528 ) ); + Z0_value = ( ZF0 / (2.0 * M_PI) ) * log( freq / u + sqrt( 1.0 + 4.0 / (u * u) ) ); + return Z0_value; } @@ -386,28 +386,19 @@ void MICROSTRIP::attenuation() */ void MICROSTRIP::mur_eff_ms() { - double mureff; - - mureff = (2.0 * mur) / ( (1.0 + mur) + ( (1.0 - mur) * pow( ( 1.0 + (10.0 * h / w) ), -0.5 ) ) ); - - mur_eff = mureff; + mur_eff = (2.0 * mur) / ( (1.0 + mur) + ( (1.0 - mur) * pow( ( 1.0 + (10.0 * h / w) ), -0.5 ) ) ); } -/* - * synth_width - calculate width given Z0 and e_r - */ +// synth_width - calculate width given Z0 and e_r double MICROSTRIP::synth_width() { double e_r, a, b; - double w_h, w; + double w_h, width; + e_r = 0;//er; - e_r = er; - - - a = - ( (Z0 / ZF0 / 2 / + a = ( (Z0 / ZF0 / 2 / M_PI) * sqrt( (e_r + 1) / 2. ) ) + ( (e_r - 1) / (e_r + 1) * ( 0.23 + (0.11 / e_r) ) ); b = ZF0 / 2 * M_PI / ( Z0 * sqrt( e_r ) ); @@ -417,23 +408,16 @@ double MICROSTRIP::synth_width() } else { - w_h = - (2. / - M_PI) * - ( b - 1. - + w_h = (2. / M_PI) * ( b - 1. - log( (2 * b) - 1. ) + ( (e_r - 1) / (2 * e_r) ) * (log( b - 1. ) + 0.39 - 0.61 / e_r) ); } if( h > 0.0 ) - { - w = w_h * h; - return w; - } + width = w_h * h; else - { - w = 0; - } - return w; + width = 0; + + return width; } diff --git a/pcbnew/ratsnest_data.cpp b/pcbnew/ratsnest_data.cpp index 71b297a3cf..04d379ae49 100644 --- a/pcbnew/ratsnest_data.cpp +++ b/pcbnew/ratsnest_data.cpp @@ -710,11 +710,12 @@ std::list RN_NET::GetNodes( const BOARD_CONNECTED_ITEM* aItem ) con case PCB_ZONE_AREA_T: { - ZONE_DATA_MAP::const_iterator it = m_zones.find( static_cast( aItem ) ); + ZONE_DATA_MAP::const_iterator itz = m_zones.find( static_cast( aItem ) ); - if( it != m_zones.end() ) + if( itz != m_zones.end() ) { - const std::deque& polys = it->second.m_Polygons; + const std::deque& polys = itz->second.m_Polygons; + for( std::deque::const_iterator it = polys.begin(); it != polys.end(); ++it ) nodes.push_back( it->GetNode() ); }