Fix shadowed vars (in microstrip.cpp) and deprecated compil warnings.

This commit is contained in:
jean-pierre charras 2016-06-08 09:28:19 +02:00
parent cd30be3fd9
commit 37deba60c3
5 changed files with 28 additions and 43 deletions

View File

@ -59,12 +59,12 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
m_mruPath = fn.GetPath();
std::auto_ptr<PART_LIB> lib;
std::unique_ptr<PART_LIB> lib;
try
{
std::auto_ptr<PART_LIB> new_lib( PART_LIB::LoadLibrary( fn.GetFullPath() ) );
lib = new_lib;
std::unique_ptr<PART_LIB> new_lib( PART_LIB::LoadLibrary( fn.GetFullPath() ) );
lib = std::move( new_lib );
}
catch( const IO_ERROR& ioe )
{

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2004 Jean-Pierre Charras, jp.charras ar wanadoo.fr
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* 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<PART_LIB> libCache( new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ) );
std::unique_ptr<PART_LIB> libCache( new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ) );
libCache->SetCache();

View File

@ -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<PART_LIB> m_rescue_lib;
static std::unique_ptr<PART_LIB> 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<PART_LIB> rescue_lib( new PART_LIB( LIBRARY_TYPE_EESCHEMA,
std::unique_ptr<PART_LIB> 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<PART_LIB> RESCUE_CACHE_CANDIDATE::m_rescue_lib;
std::unique_ptr<PART_LIB> RESCUE_CACHE_CANDIDATE::m_rescue_lib;
wxFileName RESCUE_CACHE_CANDIDATE::m_library_fn;
RESCUER::RESCUER( SCH_EDIT_FRAME& aEditFrame, PROJECT& aProject )

View File

@ -4,7 +4,7 @@
* Copyright (C) 2001 Gopal Narayanan <gopal@astro.umass.edu>
* Copyright (C) 2002 Claudio Girardi <claudio.girardi@ieee.org>
* Copyright (C) 2005, 2006 Stefan Jahn <stefan@lkcc.org>
* Modified for Kicad: 2015 jean-pierre.charras
* Modified for Kicad: 2015 Jean-Pierre Charras <jp.charras at wanadoo.fr>
*
* 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;
}

View File

@ -710,11 +710,12 @@ std::list<RN_NODE_PTR> 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<const ZONE_CONTAINER*>( aItem ) );
ZONE_DATA_MAP::const_iterator itz = m_zones.find( static_cast<const ZONE_CONTAINER*>( aItem ) );
if( it != m_zones.end() )
if( itz != m_zones.end() )
{
const std::deque<RN_POLY>& polys = it->second.m_Polygons;
const std::deque<RN_POLY>& polys = itz->second.m_Polygons;
for( std::deque<RN_POLY>::const_iterator it = polys.begin(); it != polys.end(); ++it )
nodes.push_back( it->GetNode() );
}