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 );
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_unique_pad_count = 0;
}
else
{
m_pad_count = m->GetPadCount( DO_NOT_INCLUDE_NPTH );
m_unique_pad_count = m->GetUniquePadCount( DO_NOT_INCLUDE_NPTH );
m_keywords = m->GetKeywords();
m_doc = m->GetDescription();
m_pad_count = footprint->GetPadCount( DO_NOT_INCLUDE_NPTH );
m_unique_pad_count = footprint->GetUniquePadCount( DO_NOT_INCLUDE_NPTH );
m_keywords = footprint->GetKeywords();
m_doc = footprint->GetDescription();
// tell ensure_loaded() I'm loaded.
m_loaded = true;

View File

@ -572,7 +572,7 @@ bool SHAPE_LINE_CHAIN::Parse( std::stringstream& aStream )
aStream >> n_pts;
// 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;
aStream >> m_closed;

View File

@ -37,11 +37,7 @@ unsigned GetRunningMicroSecs()
FILETIME now;
GetSystemTimeAsFileTime( &now );
typedef unsigned long long UINT64;
UINT64 t = (UINT64(now.dwHighDateTime) << 32) + now.dwLowDateTime;
unsigned long long t = (UINT64(now.dwHighDateTime) << 32) + now.dwLowDateTime;
t /= 10;
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,
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() )
{
@ -334,14 +334,14 @@ void PROJECT::ConfigSave( const SEARCH_STACK& aSList, const wxString& aGroupName
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,
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() )
{

View File

@ -104,7 +104,7 @@ class COMPONENT
FPID m_altFpid;
/// 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.
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 );
@ -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 )
{
FILE_OUTPUTFORMATTER formatter( filename, wxT( "wt" ), quote_char[0] );
FILE_OUTPUTFORMATTER formatter( aFilename, wxT( "wt" ), quote_char[0] );
if( aNameChange )
pcb->pcbname = TO_UTF8( filename );
pcb->pcbname = TO_UTF8( aFilename );
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
* 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.
*/
void LoadPCB( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer );
void LoadPCB( const wxString& aFilename ) throw( IO_ERROR, boost::bad_pointer );
/**
* Function LoadSESSION

View File

@ -415,7 +415,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList_NG( BOARD* aPcb )
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 ) );
// Set the number of segments in arc approximations

View File

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