Fix very minor issues: compil warnings (mainly deprecated and shadowed vars warnings).

This commit is contained in:
jean-pierre charras 2016-05-22 19:39:20 +02:00
parent f8ae428428
commit bbe42d0f47
9 changed files with 22 additions and 26 deletions

View File

@ -105,19 +105,19 @@ void FOOTPRINT_INFO::load()
wxASSERT( fptable ); wxASSERT( fptable );
std::auto_ptr<MODULE> m( fptable->FootprintLoad( m_nickname, m_fpname ) ); std::unique_ptr<MODULE> footprint( fptable->FootprintLoad( m_nickname, m_fpname ) );
if( m.get() == NULL ) // Should happen only with malformed/broken libraries if( footprint.get() == NULL ) // Should happen only with malformed/broken libraries
{ {
m_pad_count = 0; m_pad_count = 0;
m_unique_pad_count = 0; m_unique_pad_count = 0;
} }
else else
{ {
m_pad_count = m->GetPadCount( DO_NOT_INCLUDE_NPTH ); m_pad_count = footprint->GetPadCount( DO_NOT_INCLUDE_NPTH );
m_unique_pad_count = m->GetUniquePadCount( DO_NOT_INCLUDE_NPTH ); m_unique_pad_count = footprint->GetUniquePadCount( DO_NOT_INCLUDE_NPTH );
m_keywords = m->GetKeywords(); m_keywords = footprint->GetKeywords();
m_doc = m->GetDescription(); m_doc = footprint->GetDescription();
// tell ensure_loaded() I'm loaded. // tell ensure_loaded() I'm loaded.
m_loaded = true; m_loaded = true;

View File

@ -572,7 +572,7 @@ bool SHAPE_LINE_CHAIN::Parse( std::stringstream& aStream )
aStream >> n_pts; aStream >> n_pts;
// Rough sanity check, just make sure the loop bounds aren't absolutely outlandish // Rough sanity check, just make sure the loop bounds aren't absolutely outlandish
if( n_pts < 0 || n_pts > aStream.str().size() ) if( n_pts < 0 || n_pts > int( aStream.str().size() ) )
return false; return false;
aStream >> m_closed; aStream >> m_closed;

View File

@ -37,11 +37,7 @@ unsigned GetRunningMicroSecs()
FILETIME now; FILETIME now;
GetSystemTimeAsFileTime( &now ); GetSystemTimeAsFileTime( &now );
unsigned long long t = (UINT64(now.dwHighDateTime) << 32) + now.dwLowDateTime;
typedef unsigned long long UINT64;
UINT64 t = (UINT64(now.dwHighDateTime) << 32) + now.dwLowDateTime;
t /= 10; t /= 10;
return unsigned( t ); return unsigned( t );

View File

@ -306,7 +306,7 @@ wxConfigBase* PROJECT::configCreate( const SEARCH_STACK& aSList,
void PROJECT::ConfigSave( const SEARCH_STACK& aSList, const wxString& aGroupName, void PROJECT::ConfigSave( const SEARCH_STACK& aSList, const wxString& aGroupName,
const PARAM_CFG_ARRAY& aParams, const wxString& aFileName ) const PARAM_CFG_ARRAY& aParams, const wxString& aFileName )
{ {
std::auto_ptr<wxConfigBase> cfg( configCreate( aSList, aGroupName, aFileName ) ); std::unique_ptr<wxConfigBase> cfg( configCreate( aSList, aGroupName, aFileName ) );
if( !cfg.get() ) if( !cfg.get() )
{ {
@ -334,14 +334,14 @@ void PROJECT::ConfigSave( const SEARCH_STACK& aSList, const wxString& aGroupName
cfg->SetPath( wxT( "/" ) ); cfg->SetPath( wxT( "/" ) );
// cfg is deleted here by std::auto_ptr, that saves the *.pro file to disk // cfg is deleted here by std::unique_ptr, that saves the *.pro file to disk
} }
bool PROJECT::ConfigLoad( const SEARCH_STACK& aSList, const wxString& aGroupName, bool PROJECT::ConfigLoad( const SEARCH_STACK& aSList, const wxString& aGroupName,
const PARAM_CFG_ARRAY& aParams, const wxString& aForeignProjectFileName ) const PARAM_CFG_ARRAY& aParams, const wxString& aForeignProjectFileName )
{ {
std::auto_ptr<wxConfigBase> cfg( configCreate( aSList, aGroupName, aForeignProjectFileName ) ); std::unique_ptr<wxConfigBase> cfg( configCreate( aSList, aGroupName, aForeignProjectFileName ) );
if( !cfg.get() ) if( !cfg.get() )
{ {

View File

@ -104,7 +104,7 @@ class COMPONENT
FPID m_altFpid; FPID m_altFpid;
/// The #MODULE loaded for #m_fpid. /// The #MODULE loaded for #m_fpid.
std::auto_ptr< MODULE > m_footprint; std::unique_ptr< MODULE > m_footprint;
/// Set to true if #m_fpid was changed when the footprint link file was read. /// Set to true if #m_fpid was changed when the footprint link file was read.
bool m_footprintChanged; bool m_footprintChanged;

View File

@ -240,9 +240,9 @@ void SPECCTRA_DB::readTIME( time_t* time_stamp ) throw( IO_ERROR )
} }
void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer ) void SPECCTRA_DB::LoadPCB( const wxString& aFilename ) throw( IO_ERROR, boost::bad_pointer )
{ {
FILE_LINE_READER reader( filename ); FILE_LINE_READER reader( aFilename );
PushReader( &reader ); PushReader( &reader );
@ -3430,14 +3430,14 @@ void SPECCTRA_DB::doSUPPLY_PIN( SUPPLY_PIN* growth ) throw( IO_ERROR )
} }
void SPECCTRA_DB::ExportPCB( wxString filename, bool aNameChange ) throw( IO_ERROR ) void SPECCTRA_DB::ExportPCB( wxString aFilename, bool aNameChange ) throw( IO_ERROR )
{ {
if( pcb ) if( pcb )
{ {
FILE_OUTPUTFORMATTER formatter( filename, wxT( "wt" ), quote_char[0] ); FILE_OUTPUTFORMATTER formatter( aFilename, wxT( "wt" ), quote_char[0] );
if( aNameChange ) if( aNameChange )
pcb->pcbname = TO_UTF8( filename ); pcb->pcbname = TO_UTF8( aFilename );
pcb->Format( &formatter, 0 ); pcb->Format( &formatter, 0 );
} }

View File

@ -3902,10 +3902,10 @@ public:
* A design file is nearly a full description of a PCB (seems to be * A design file is nearly a full description of a PCB (seems to be
* missing only the silkscreen stuff). * missing only the silkscreen stuff).
* *
* @param filename The name of the dsn file to load. * @param aFilename The name of the dsn file to load.
* @throw IO_ERROR if there is a lexer or parser error. * @throw IO_ERROR if there is a lexer or parser error.
*/ */
void LoadPCB( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer ); void LoadPCB( const wxString& aFilename ) throw( IO_ERROR, boost::bad_pointer );
/** /**
* Function LoadSESSION * Function LoadSESSION

View File

@ -415,7 +415,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList_NG( BOARD* aPcb )
int outline_half_thickness = m_ZoneMinThickness / 2; int outline_half_thickness = m_ZoneMinThickness / 2;
std::auto_ptr<SHAPE_FILE_IO> dumper( new SHAPE_FILE_IO( std::unique_ptr<SHAPE_FILE_IO> dumper( new SHAPE_FILE_IO(
g_DumpZonesWhenFilling ? "zones_dump.txt" : "", SHAPE_FILE_IO::IOM_APPEND ) ); g_DumpZonesWhenFilling ? "zones_dump.txt" : "", SHAPE_FILE_IO::IOM_APPEND ) );
// Set the number of segments in arc approximations // Set the number of segments in arc approximations

View File

@ -863,8 +863,8 @@ void CPolyLine::Hatch()
} }
else else
{ {
double dy = pointbuffer[ip + 1].y - pointbuffer[ip].y; double dy = pointbuffer[ip + 1].y - pointbuffer[ip].y;
double slope = dy / dx; slope = dy / dx;
if( dx > 0 ) if( dx > 0 )
dx = hatch_line_len; dx = hatch_line_len;