Remove some uses of using namespace std.

This commit is contained in:
Povilas Kanapickas 2013-12-13 10:27:30 -06:00 committed by Dick Hollenbeck
parent 5c28285cdf
commit 7f12513c7e
45 changed files with 107 additions and 163 deletions

View File

@ -93,7 +93,7 @@ macro(perform_feature_checks)
# CMakes check_cxx_symbol_exists() doesn't work for templates so we must create a # CMakes check_cxx_symbol_exists() doesn't work for templates so we must create a
# small program to verify isinf() exists in cmath. # small program to verify isinf() exists in cmath.
check_cxx_source_compiles( "#include <cmath>\nusing namespace std;\nint main(int argc, char** argv)\n{\n (void)argv;\n isinf(1.0); (void)argc;\n return 0;\n}\n" HAVE_CMATH_ISINF ) check_cxx_source_compiles( "#include <cmath>\nint main(int argc, char** argv)\n{\n (void)argv;\n std::isinf(1.0); (void)argc;\n return 0;\n}\n" HAVE_CMATH_ISINF )
#check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) non-standard library, does not work #check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) non-standard library, does not work
check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME) check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)

View File

@ -25,7 +25,6 @@
#include <geometry/shape_line_chain.h> #include <geometry/shape_line_chain.h>
#include <geometry/shape_circle.h> #include <geometry/shape_circle.h>
using namespace std;
using boost::optional; using boost::optional;
bool SHAPE_LINE_CHAIN::Collide( const VECTOR2I& aP, int aClearance ) const bool SHAPE_LINE_CHAIN::Collide( const VECTOR2I& aP, int aClearance ) const
@ -137,7 +136,7 @@ int SHAPE_LINE_CHAIN::Distance( const VECTOR2I& aP ) const
int d = INT_MAX; int d = INT_MAX;
for( int s = 0; s < SegmentCount(); s++ ) for( int s = 0; s < SegmentCount(); s++ )
d = min( d, CSegment( s ).Distance( aP ) ); d = std::min( d, CSegment( s ).Distance( aP ) );
return d; return d;
} }
@ -437,7 +436,7 @@ const optional<SHAPE_LINE_CHAIN::INTERSECTION> SHAPE_LINE_CHAIN::SelfIntersectin
SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify() SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify()
{ {
vector<VECTOR2I> pts_unique; std::vector<VECTOR2I> pts_unique;
if( PointCount() < 2 ) if( PointCount() < 2 )
{ {
@ -524,9 +523,9 @@ const VECTOR2I SHAPE_LINE_CHAIN::NearestPoint( const VECTOR2I& aP ) const
} }
const string SHAPE_LINE_CHAIN::Format() const const std::string SHAPE_LINE_CHAIN::Format() const
{ {
stringstream ss; std::stringstream ss;
ss << m_points.size() << " " << ( m_closed ? 1 : 0 ) << " "; ss << m_points.size() << " " << ( m_closed ? 1 : 0 ) << " ";

View File

@ -1358,8 +1358,8 @@ void ClipAndDrawPoly( EDA_RECT* aClipBox, wxDC* aDC, wxPoint aPoints[], int n )
} }
// A clip box exists: clip and draw the polygon. // A clip box exists: clip and draw the polygon.
static vector<wxPoint> clippedPolygon; static std::vector<wxPoint> clippedPolygon;
static pointVector inputPolygon, outputPolygon; static pointVector inputPolygon, outputPolygon;
inputPolygon.clear(); inputPolygon.clear();
outputPolygon.clear(); outputPolygon.clear();

View File

@ -31,8 +31,6 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
using namespace std;
struct FlagString struct FlagString
{ {
int flag; int flag;
@ -153,7 +151,7 @@ const std::string TOOL_EVENT::Format() const
const std::string TOOL_EVENT_LIST::Format() const const std::string TOOL_EVENT_LIST::Format() const
{ {
string s; std::string s;
BOOST_FOREACH( TOOL_EVENT e, m_events ) BOOST_FOREACH( TOOL_EVENT e, m_events )
s += e.Format() + " "; s += e.Format() + " ";

View File

@ -47,7 +47,6 @@
#include <class_drawpanel_gal.h> #include <class_drawpanel_gal.h>
using boost::optional; using boost::optional;
using namespace std;
/// Struct describing the current execution state of a TOOL /// Struct describing the current execution state of a TOOL
struct TOOL_MANAGER::TOOL_STATE struct TOOL_MANAGER::TOOL_STATE

View File

@ -26,8 +26,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <algorithm> // to use sort vector #include <algorithm>
#include <vector>
#include <fctsys.h> #include <fctsys.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>

View File

@ -30,7 +30,7 @@
#include <wx/regex.h> #include <wx/regex.h>
#include <algorithm> // to use sort vector #include <algorithm>
#include <vector> #include <vector>
#include <fctsys.h> #include <fctsys.h>

View File

@ -169,7 +169,7 @@ HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG( SCH_EDIT_FRAME* parent, wxDC* DC, cons
// Set dialog window size to be large enough // Set dialog window size to be large enough
m_TreeSize.x = itemrect.GetWidth() + 20; m_TreeSize.x = itemrect.GetWidth() + 20;
m_TreeSize.x = max( m_TreeSize.x, 250 ); m_TreeSize.x = std::max( m_TreeSize.x, 250 );
// Readjust the size of the frame to an optimal value. // Readjust the size of the frame to an optimal value.
m_TreeSize.y = m_nbsheets * itemrect.GetHeight(); m_TreeSize.y = m_nbsheets * itemrect.GetHeight();

View File

@ -246,7 +246,7 @@ bool SCH_BUS_ENTRY_BASE::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_BUS_ENTRY_BASE::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_BUS_ENTRY_BASE::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
aPoints.push_back( m_pos ); aPoints.push_back( m_pos );
aPoints.push_back( m_End() ); aPoints.push_back( m_End() );

View File

@ -96,7 +96,7 @@ public:
bool IsConnectable() const { return true; } bool IsConnectable() const { return true; }
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
BITMAP_DEF GetMenuImage() const { return add_entry_xpm; } BITMAP_DEF GetMenuImage() const { return add_entry_xpm; }

View File

@ -1605,7 +1605,7 @@ bool SCH_COMPONENT::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_COMPONENT::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_COMPONENT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
LIB_PIN* pin; LIB_PIN* pin;
LIB_COMPONENT* component = CMP_LIBRARY::FindLibraryComponent( m_ChipName ); LIB_COMPONENT* component = CMP_LIBRARY::FindLibraryComponent( m_ChipName );
@ -1876,7 +1876,7 @@ bool SCH_COMPONENT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccura
bool SCH_COMPONENT::doIsConnected( const wxPoint& aPosition ) const bool SCH_COMPONENT::doIsConnected( const wxPoint& aPosition ) const
{ {
vector< wxPoint > pts; std::vector< wxPoint > pts;
GetConnectionPoints( pts ); GetConnectionPoints( pts );

View File

@ -357,7 +357,7 @@ public:
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ); bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ); void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList );
wxPoint GetPinPhysicalPosition( LIB_PIN* Pin ); wxPoint GetPinPhysicalPosition( LIB_PIN* Pin );
@ -372,7 +372,7 @@ public:
*/ */
bool IsInNetlist() const; bool IsInNetlist() const;
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector<wxPoint>& aPoints ) const;
SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData,
const KICAD_T scanTypes[] ); const KICAD_T scanTypes[] );

View File

@ -168,7 +168,7 @@ bool SCH_JUNCTION::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_JUNCTION::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_JUNCTION::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
aPoints.push_back( m_pos ); aPoints.push_back( m_pos );
} }

View File

@ -81,7 +81,7 @@ public:
bool IsConnectable() const { return true; } bool IsConnectable() const { return true; }
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
wxString GetSelectMenuText() const { return wxString( _( "Junction" ) ); } wxString GetSelectMenuText() const { return wxString( _( "Junction" ) ); }

View File

@ -461,7 +461,7 @@ bool SCH_LINE::IsConnectable() const
} }
void SCH_LINE::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_LINE::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
aPoints.push_back( m_start ); aPoints.push_back( m_start );
aPoints.push_back( m_end ); aPoints.push_back( m_end );

View File

@ -113,9 +113,9 @@ public:
*/ */
bool MergeOverlap( SCH_LINE* aLine ); bool MergeOverlap( SCH_LINE* aLine );
void GetEndPoints( vector <DANGLING_END_ITEM>& aItemList ); void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList );
bool IsDanglingStateChanged( vector< DANGLING_END_ITEM >& aItemList ); bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList );
bool IsDangling() const { return m_startIsDangling || m_endIsDangling; } bool IsDangling() const { return m_startIsDangling || m_endIsDangling; }
@ -123,7 +123,7 @@ public:
bool IsConnectable() const; bool IsConnectable() const;
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints(std::vector< wxPoint >& aPoints ) const;
wxString GetSelectMenuText() const; wxString GetSelectMenuText() const;

View File

@ -182,7 +182,7 @@ bool SCH_NO_CONNECT::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_NO_CONNECT::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_NO_CONNECT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
aPoints.push_back( m_pos ); aPoints.push_back( m_pos );
} }

View File

@ -81,7 +81,7 @@ public:
bool IsConnectable() const { return true; } bool IsConnectable() const { return true; }
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
wxString GetSelectMenuText() const { return wxString( _( "No Connect" ) ); } wxString GetSelectMenuText() const { return wxString( _( "No Connect" ) ); }

View File

@ -1000,7 +1000,7 @@ bool SCH_SHEET::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_SHEET::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_SHEET::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
for( size_t i = 0; i < GetPins().size(); i++ ) for( size_t i = 0; i < GetPins().size(); i++ )
aPoints.push_back( GetPins()[i].GetPosition() ); aPoints.push_back( GetPins()[i].GetPosition() );

View File

@ -533,7 +533,7 @@ public:
bool IsConnectable() const { return true; } bool IsConnectable() const { return true; }
void GetConnectionPoints( vector< wxPoint >& aPoints ) const; void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData,
const KICAD_T scanTypes[] ); const KICAD_T scanTypes[] );

View File

@ -564,7 +564,7 @@ bool SCH_TEXT::IsSelectStateChanged( const wxRect& aRect )
} }
void SCH_TEXT::GetConnectionPoints( vector< wxPoint >& aPoints ) const void SCH_TEXT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
{ {
// Normal text labels do not have connection points. All others do. // Normal text labels do not have connection points. All others do.
if( Type() == SCH_TEXT_T ) if( Type() == SCH_TEXT_T )

View File

@ -189,7 +189,7 @@ public:
virtual bool IsSelectStateChanged( const wxRect& aRect ); virtual bool IsSelectStateChanged( const wxRect& aRect );
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const; virtual void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const;
virtual bool CanIncrementLabel() const { return true; } virtual bool CanIncrementLabel() const { return true; }

View File

@ -34,9 +34,6 @@
#include <class_base_screen.h> #include <class_base_screen.h>
#include <general.h> #include <general.h>
using namespace std;
class SCH_ITEM; class SCH_ITEM;
class SCH_SHEET_PATH; class SCH_SHEET_PATH;
class LINE_READER; class LINE_READER;
@ -49,7 +46,7 @@ class NETLIST_OBJECT_LIST;
typedef boost::ptr_vector< SCH_ITEM > SCH_ITEMS; typedef boost::ptr_vector< SCH_ITEM > SCH_ITEMS;
typedef SCH_ITEMS::iterator SCH_ITEMS_ITR; typedef SCH_ITEMS::iterator SCH_ITEMS_ITR;
typedef vector< SCH_ITEMS_ITR > SCH_ITEMS_ITRS; typedef std::vector< SCH_ITEMS_ITR > SCH_ITEMS_ITRS;
#define FMT_IU SCH_ITEM::FormatInternalUnits #define FMT_IU SCH_ITEM::FormatInternalUnits
@ -228,7 +225,7 @@ public:
* *
* @param aItemList - List of DANGLING_END_ITEMS to add to. * @param aItemList - List of DANGLING_END_ITEMS to add to.
*/ */
virtual void GetEndPoints( vector< DANGLING_END_ITEM >& aItemList ) {} virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) {}
/** /**
* Function IsDanglingStateChanged * Function IsDanglingStateChanged
@ -243,7 +240,7 @@ public:
* @param aItemList - List of items to test item against. * @param aItemList - List of items to test item against.
* @return True if the dangling state has changed from it's current setting. * @return True if the dangling state has changed from it's current setting.
*/ */
virtual bool IsDanglingStateChanged( vector< DANGLING_END_ITEM >& aItemList ) { return false; } virtual bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList ) { return false; }
virtual bool IsDangling() const { return false; } virtual bool IsDangling() const { return false; }
@ -273,7 +270,7 @@ public:
* *
* @param aPoints List of connection points to add to. * @param aPoints List of connection points to add to.
*/ */
virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const { } virtual void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const { }
/** /**
* Function ClearConnections * Function ClearConnections

View File

@ -3,8 +3,6 @@
#include <tool/coroutine.h> #include <tool/coroutine.h>
using namespace std;
typedef COROUTINE<int, int> MyCoroutine; typedef COROUTINE<int, int> MyCoroutine;
class MyClass class MyClass

View File

@ -3,8 +3,6 @@
#include <tool/delegate.h> #include <tool/delegate.h>
using namespace std;
class MyClass class MyClass
{ {
public: public:

View File

@ -79,7 +79,7 @@ public:
class DIALOG_TEMPLATE_SELECTOR : public DIALOG_TEMPLATE_SELECTOR_BASE class DIALOG_TEMPLATE_SELECTOR : public DIALOG_TEMPLATE_SELECTOR_BASE
{ {
protected: protected:
vector<TEMPLATE_SELECTION_PANEL*> m_panels; std::vector<TEMPLATE_SELECTION_PANEL*> m_panels;
void AddTemplate( int aPage, PROJECT_TEMPLATE* aTemplate ); void AddTemplate( int aPage, PROJECT_TEMPLATE* aTemplate );
TEMPLATE_WIDGET* m_selectedWidget; TEMPLATE_WIDGET* m_selectedWidget;

View File

@ -33,8 +33,6 @@
#include <wx/txtstrm.h> #include <wx/txtstrm.h>
#include <wx/wfstream.h> #include <wx/wfstream.h>
using namespace std;
#define SEP() wxFileName::GetPathSeparator() #define SEP() wxFileName::GetPathSeparator()
@ -71,9 +69,9 @@ PROJECT_TEMPLATE::PROJECT_TEMPLATE( const wxString& aPath )
metaIcon = new wxBitmap( templateMetaIconFile.GetFullPath(), wxBITMAP_TYPE_PNG ); metaIcon = new wxBitmap( templateMetaIconFile.GetFullPath(), wxBITMAP_TYPE_PNG );
} }
vector<wxFileName> PROJECT_TEMPLATE::GetFileList() std::vector<wxFileName> PROJECT_TEMPLATE::GetFileList()
{ {
vector<wxFileName> files; std::vector<wxFileName> files;
wxString f = templateBasePath.GetPath(); wxString f = templateBasePath.GetPath();
wxArrayString allfiles; wxArrayString allfiles;
wxFileName p; wxFileName p;
@ -122,8 +120,8 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath )
{ {
bool result = true; bool result = true;
vector<wxFileName> srcFiles = GetFileList(); std::vector<wxFileName> srcFiles = GetFileList();
vector<wxFileName> dstFiles; std::vector<wxFileName> dstFiles;
for( size_t i=0; i < srcFiles.size(); i++ ) for( size_t i=0; i < srcFiles.size(); i++ )
{ {

View File

@ -110,9 +110,6 @@
#include <wx/image.h> #include <wx/image.h>
#include <wx/filename.h> #include <wx/filename.h>
using namespace std;
/** /**
* @brief A directory which contains information about the project template and does not get * @brief A directory which contains information about the project template and does not get
* copied. This define is the default filename for this directory * copied. This define is the default filename for this directory
@ -200,7 +197,7 @@ public:
* @brief Get a vector list of filenames for the template. The files are the source files, * @brief Get a vector list of filenames for the template. The files are the source files,
* and have not yet been through any renaming * and have not yet been through any renaming
*/ */
vector<wxFileName> GetFileList(); std::vector<wxFileName> GetFileList();
}; };
#endif #endif

View File

@ -52,9 +52,6 @@
#include <errno.h> #include <errno.h>
#include <assert.h> #include <assert.h>
#include <vector>
using namespace std;
#include <sch_dir_lib_source.h> #include <sch_dir_lib_source.h>
using namespace SCH; using namespace SCH;

View File

@ -31,7 +31,6 @@
#include <sch_dir_lib_source.h> #include <sch_dir_lib_source.h>
//using namespace std; // screws up Doxygen
using namespace SCH; using namespace SCH;
using namespace LT; // tokens, enum T for LIB_TABLE using namespace LT; // tokens, enum T for LIB_TABLE

View File

@ -63,15 +63,12 @@
#include <macros.h> #include <macros.h>
#include <fp_lib_table.h> // ExpandSubstitutions() #include <fp_lib_table.h> // ExpandSubstitutions()
using namespace std;
static const char* PRETTY_DIR = "allow_pretty_writing_to_this_dir"; static const char* PRETTY_DIR = "allow_pretty_writing_to_this_dir";
typedef boost::ptr_map<string, wxZipEntry> MODULE_MAP; typedef boost::ptr_map<std::string, wxZipEntry> MODULE_MAP;
typedef MODULE_MAP::iterator MODULE_ITER; typedef MODULE_MAP::iterator MODULE_ITER;
typedef MODULE_MAP::const_iterator MODULE_CITER; typedef MODULE_MAP::const_iterator MODULE_CITER;
/** /**
@ -166,7 +163,7 @@ MODULE* GITHUB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
} }
} }
string fp_name = TO_UTF8( aFootprintName ); std::string fp_name = TO_UTF8( aFootprintName );
MODULE_CITER it = m_gh_cache->find( fp_name ); MODULE_CITER it = m_gh_cache->find( fp_name );
@ -233,7 +230,7 @@ void GITHUB_PLUGIN::FootprintSave( const wxString& aLibraryPath,
// IsFootprintLibWritable() to determine if calling FootprintSave() is // IsFootprintLibWritable() to determine if calling FootprintSave() is
// even legal, so I spend no time on internationalization here: // even legal, so I spend no time on internationalization here:
string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.", std::string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.",
(const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR ); (const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR );
THROW_IO_ERROR( msg ); THROW_IO_ERROR( msg );
@ -275,7 +272,7 @@ void GITHUB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxStrin
// IsFootprintLibWritable() to determine if calling FootprintSave() is // IsFootprintLibWritable() to determine if calling FootprintSave() is
// even legal, so I spend no time on internationalization here: // even legal, so I spend no time on internationalization here:
string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.", std::string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.",
(const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR ); (const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR );
THROW_IO_ERROR( msg ); THROW_IO_ERROR( msg );
@ -356,7 +353,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
if( aProperties ) if( aProperties )
{ {
string pretty_dir; std::string pretty_dir;
if( aProperties->Value( PRETTY_DIR, &pretty_dir ) ) if( aProperties->Value( PRETTY_DIR, &pretty_dir ) )
{ {
@ -409,7 +406,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
if( fn.GetExt() == kicad_mod ) if( fn.GetExt() == kicad_mod )
{ {
string fp_name = TO_UTF8( fn.GetName() ); // omit extension & path std::string fp_name = TO_UTF8( fn.GetName() ); // omit extension & path
m_gh_cache->insert( fp_name, entry ); m_gh_cache->insert( fp_name, entry );
} }
@ -420,7 +417,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
} }
bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, string* aZipURL ) bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, std::string* aZipURL )
{ {
// e.g. "https://github.com/liftoff-sr/pretty_footprints" // e.g. "https://github.com/liftoff-sr/pretty_footprints"
//D(printf("aRepoURL:%s\n", TO_UTF8( aRepoURL ) );) //D(printf("aRepoURL:%s\n", TO_UTF8( aRepoURL ) );)
@ -460,7 +457,7 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, string* aZipURL )
void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR ) void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR )
{ {
string zip_url; std::string zip_url;
if( !repoURL_zipURL( aRepoURL, &zip_url ) ) if( !repoURL_zipURL( aRepoURL, &zip_url ) )
{ {
@ -478,7 +475,7 @@ void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR )
try try
{ {
ostringstream os; std::ostringstream os;
h.open( zip_url ); // only one file, therefore do it synchronously. h.open( zip_url ); // only one file, therefore do it synchronously.
os << &h; os << &h;
@ -495,10 +492,8 @@ void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR )
// https "GET" has faild, report this to API caller. // https "GET" has faild, report this to API caller.
wxString fmt( _( "Cannot GET zip: '%s'\nfor lib-path: '%s'.\nWhat: '%s'" ) ); wxString fmt( _( "Cannot GET zip: '%s'\nfor lib-path: '%s'.\nWhat: '%s'" ) );
string msg = StrPrintf( TO_UTF8( fmt ), std::string msg = StrPrintf( TO_UTF8( fmt ), zip_url.c_str(),
zip_url.c_str(), TO_UTF8( aRepoURL ), e.what() );
TO_UTF8( aRepoURL ),
e.what() );
THROW_IO_ERROR( msg ); THROW_IO_ERROR( msg );
} }

View File

@ -48,9 +48,6 @@
#include <boost/ptr_container/ptr_map.hpp> #include <boost/ptr_container/ptr_map.hpp>
#include <memory.h> #include <memory.h>
using namespace std;
/** /**
* Definition for enabling and disabling footprint library trace output. See the * Definition for enabling and disabling footprint library trace output. See the
* wxWidgets documentation on using the WXTRACE environment variable. * wxWidgets documentation on using the WXTRACE environment variable.
@ -118,7 +115,7 @@ class GPCB_FPL_CACHE_ITEM
wxFileName m_file_name; ///< The the full file name and path of the footprint to cache. wxFileName m_file_name; ///< The the full file name and path of the footprint to cache.
bool m_writable; ///< Writability status of the footprint file. bool m_writable; ///< Writability status of the footprint file.
wxDateTime m_mod_time; ///< The last file modified time stamp. wxDateTime m_mod_time; ///< The last file modified time stamp.
auto_ptr< MODULE > m_module; std::auto_ptr<MODULE> m_module;
public: public:
GPCB_FPL_CACHE_ITEM( MODULE* aModule, const wxFileName& aFileName ); GPCB_FPL_CACHE_ITEM( MODULE* aModule, const wxFileName& aFileName );
@ -385,13 +382,13 @@ MODULE* GPCB_FPL_CACHE::parseMODULE( LINE_READER* aLineReader ) throw( IO_ERROR,
// Old version unit = 1 mil, so conv_unit is 10 or 0.1 // Old version unit = 1 mil, so conv_unit is 10 or 0.1
#define NEW_GPCB_UNIT_CONV ( 0.01*IU_PER_MILS ) #define NEW_GPCB_UNIT_CONV ( 0.01*IU_PER_MILS )
int paramCnt; int paramCnt;
double conv_unit = NEW_GPCB_UNIT_CONV; // GPCB unit = 0.01 mils and Pcbnew 0.1 double conv_unit = NEW_GPCB_UNIT_CONV; // GPCB unit = 0.01 mils and Pcbnew 0.1
wxPoint refPos( 0, 0 ); wxPoint refPos( 0, 0 );
wxPoint textPos; wxPoint textPos;
wxString msg; wxString msg;
wxArrayString parameters; wxArrayString parameters;
auto_ptr< MODULE > module( new MODULE( NULL ) ); std::auto_ptr<MODULE> module( new MODULE( NULL ) );
if( aLineReader->ReadLine() == NULL ) if( aLineReader->ReadLine() == NULL )

View File

@ -52,9 +52,6 @@
#include <boost/ptr_container/ptr_map.hpp> #include <boost/ptr_container/ptr_map.hpp>
#include <memory.h> #include <memory.h>
using namespace std;
#define FMTIU BOARD_ITEM::FormatInternalUnits #define FMTIU BOARD_ITEM::FormatInternalUnits
/** /**
@ -78,7 +75,7 @@ class FP_CACHE_ITEM
wxFileName m_file_name; ///< The the full file name and path of the footprint to cache. wxFileName m_file_name; ///< The the full file name and path of the footprint to cache.
bool m_writable; ///< Writability status of the footprint file. bool m_writable; ///< Writability status of the footprint file.
wxDateTime m_mod_time; ///< The last file modified time stamp. wxDateTime m_mod_time; ///< The last file modified time stamp.
auto_ptr< MODULE > m_module; std::auto_ptr<MODULE> m_module;
public: public:
FP_CACHE_ITEM( MODULE* aModule, const wxFileName& aFileName ); FP_CACHE_ITEM( MODULE* aModule, const wxFileName& aFileName );

View File

@ -51,9 +51,6 @@
#include <pcb_parser.h> #include <pcb_parser.h>
using namespace std;
void PCB_PARSER::init() void PCB_PARSER::init()
{ {
m_layerIndices.clear(); m_layerIndices.clear();
@ -263,7 +260,7 @@ S3D_MASTER* PCB_PARSER::parse3DModel() throw( PARSE_ERROR )
T token; T token;
auto_ptr< S3D_MASTER > n3D( new S3D_MASTER( NULL ) ); std::auto_ptr< S3D_MASTER > n3D( new S3D_MASTER( NULL ) );
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
n3D->m_Shape3DName = FromUTF8(); n3D->m_Shape3DName = FromUTF8();
@ -1084,7 +1081,7 @@ void PCB_PARSER::parseNETCLASS() throw( IO_ERROR, PARSE_ERROR )
T token; T token;
auto_ptr<NETCLASS> nc( new NETCLASS( m_board, wxEmptyString ) ); std::auto_ptr<NETCLASS> nc( new NETCLASS( m_board, wxEmptyString ) );
// Read netclass name (can be a name or just a number like track width) // Read netclass name (can be a name or just a number like track width)
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
@ -1164,7 +1161,7 @@ DRAWSEGMENT* PCB_PARSER::parseDRAWSEGMENT() throw( IO_ERROR, PARSE_ERROR )
T token; T token;
wxPoint pt; wxPoint pt;
auto_ptr< DRAWSEGMENT > segment( new DRAWSEGMENT( NULL ) ); std::auto_ptr< DRAWSEGMENT > segment( new DRAWSEGMENT( NULL ) );
switch( CurTok() ) switch( CurTok() )
{ {
@ -1325,7 +1322,7 @@ TEXTE_PCB* PCB_PARSER::parseTEXTE_PCB() throw( IO_ERROR, PARSE_ERROR )
T token; T token;
auto_ptr< TEXTE_PCB > text( new TEXTE_PCB( m_board ) ); std::auto_ptr<TEXTE_PCB> text( new TEXTE_PCB( m_board ) );
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
text->SetText( FromUTF8() ); text->SetText( FromUTF8() );
@ -1393,7 +1390,7 @@ DIMENSION* PCB_PARSER::parseDIMENSION() throw( IO_ERROR, PARSE_ERROR )
T token; T token;
auto_ptr< DIMENSION > dimension( new DIMENSION( NULL ) ); std::auto_ptr<DIMENSION> dimension( new DIMENSION( NULL ) );
dimension->SetValue( parseBoardUnits( "dimension value" ) ); dimension->SetValue( parseBoardUnits( "dimension value" ) );
NeedLEFT(); NeedLEFT();
@ -1545,7 +1542,7 @@ MODULE* PCB_PARSER::parseMODULE( wxArrayString* aInitialComments ) throw( IO_ERR
T token; T token;
FPID fpid; FPID fpid;
auto_ptr< MODULE > module( new MODULE( m_board ) ); std::auto_ptr<MODULE> module( new MODULE( m_board ) );
module->SetInitialComments( aInitialComments ); module->SetInitialComments( aInitialComments );
@ -1773,7 +1770,7 @@ TEXTE_MODULE* PCB_PARSER::parseTEXTE_MODULE() throw( IO_ERROR, PARSE_ERROR )
T token = NextTok(); T token = NextTok();
auto_ptr< TEXTE_MODULE > text( new TEXTE_MODULE( NULL ) ); std::auto_ptr<TEXTE_MODULE> text( new TEXTE_MODULE( NULL ) );
switch( token ) switch( token )
{ {
@ -1858,7 +1855,7 @@ EDGE_MODULE* PCB_PARSER::parseEDGE_MODULE() throw( IO_ERROR, PARSE_ERROR )
wxPoint pt; wxPoint pt;
T token; T token;
auto_ptr< EDGE_MODULE > segment( new EDGE_MODULE( NULL ) ); std::auto_ptr< EDGE_MODULE > segment( new EDGE_MODULE( NULL ) );
switch( CurTok() ) switch( CurTok() )
{ {
@ -2023,7 +2020,7 @@ D_PAD* PCB_PARSER::parseD_PAD() throw( IO_ERROR, PARSE_ERROR )
wxSize sz; wxSize sz;
wxPoint pt; wxPoint pt;
auto_ptr< D_PAD > pad( new D_PAD( NULL ) ); std::auto_ptr< D_PAD > pad( new D_PAD( NULL ) );
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
pad->SetPadName( FromUTF8() ); pad->SetPadName( FromUTF8() );
@ -2260,7 +2257,7 @@ TRACK* PCB_PARSER::parseTRACK() throw( IO_ERROR, PARSE_ERROR )
wxPoint pt; wxPoint pt;
T token; T token;
auto_ptr< TRACK > track( new TRACK( m_board ) ); std::auto_ptr< TRACK > track( new TRACK( m_board ) );
for( token = NextTok(); token != T_RIGHT; token = NextTok() ) for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{ {
@ -2322,7 +2319,7 @@ SEGVIA* PCB_PARSER::parseSEGVIA() throw( IO_ERROR, PARSE_ERROR )
wxPoint pt; wxPoint pt;
T token; T token;
auto_ptr< SEGVIA > via( new SEGVIA( m_board ) ); std::auto_ptr< SEGVIA > via( new SEGVIA( m_board ) );
for( token = NextTok(); token != T_RIGHT; token = NextTok() ) for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{ {
@ -2407,7 +2404,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
// bigger scope since each filled_polygon is concatenated in here // bigger scope since each filled_polygon is concatenated in here
CPOLYGONS_LIST pts; CPOLYGONS_LIST pts;
auto_ptr< ZONE_CONTAINER > zone( new ZONE_CONTAINER( m_board ) ); std::auto_ptr< ZONE_CONTAINER > zone( new ZONE_CONTAINER( m_board ) );
zone->SetPriority( 0 ); zone->SetPriority( 0 );
@ -2721,8 +2718,7 @@ PCB_TARGET* PCB_PARSER::parsePCB_TARGET() throw( IO_ERROR, PARSE_ERROR )
wxPoint pt; wxPoint pt;
T token; T token;
auto_ptr< PCB_TARGET > target( new PCB_TARGET( NULL ) ); std::auto_ptr< PCB_TARGET > target( new PCB_TARGET( NULL ) );
for( token = NextTok(); token != T_RIGHT; token = NextTok() ) for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{ {

View File

@ -29,7 +29,6 @@
#include "pns_utils.h" #include "pns_utils.h"
#include "pns_router.h" #include "pns_router.h"
using namespace std;
using boost::optional; using boost::optional;
PNS_LINE* PNS_LINE::Clone() const PNS_LINE* PNS_LINE::Clone() const
@ -321,10 +320,10 @@ void PNS_LINE::NewWalkaround( const SHAPE_LINE_CHAIN& aObstacle,
SHAPE_LINE_CHAIN l_orig( m_line ); SHAPE_LINE_CHAIN l_orig( m_line );
SHAPE_LINE_CHAIN l_hull; SHAPE_LINE_CHAIN l_hull;
vector<bool> outside, on_edge, inside; std::vector<bool> outside, on_edge, inside;
SHAPE_LINE_CHAIN path; SHAPE_LINE_CHAIN path;
vector<INTERSECTION> isects; std::vector<INTERSECTION> isects;
// don't calculate walkaround for empty lines // don't calculate walkaround for empty lines
if( m_line.PointCount() < 2 ) if( m_line.PointCount() < 2 )

View File

@ -18,7 +18,6 @@
* with this program. If not, see <http://www.gnu.or/licenses/>. * with this program. If not, see <http://www.gnu.or/licenses/>.
*/ */
#include <vector>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
@ -30,7 +29,6 @@
#include "pns_shove.h" #include "pns_shove.h"
#include "pns_utils.h" #include "pns_utils.h"
using namespace std;
using boost::optional; using boost::optional;
PNS_LINE_PLACER::PNS_LINE_PLACER( PNS_NODE* aWorld ) PNS_LINE_PLACER::PNS_LINE_PLACER( PNS_NODE* aWorld )
@ -528,7 +526,7 @@ bool PNS_LINE_PLACER::optimizeTailHeadTransition()
const int TailLookbackSegments = 5; const int TailLookbackSegments = 5;
int threshold = min( tail.PointCount(), TailLookbackSegments + 1 ); int threshold = std::min( tail.PointCount(), TailLookbackSegments + 1 );
if( tail.SegmentCount() < 3 ) if( tail.SegmentCount() < 3 )
return false; return false;

View File

@ -37,8 +37,6 @@
#include "pns_joint.h" #include "pns_joint.h"
#include "pns_index.h" #include "pns_index.h"
using namespace std;
using boost::unordered_set; using boost::unordered_set;
using boost::unordered_map; using boost::unordered_map;
@ -138,7 +136,7 @@ void PNS_NODE::unlinkParent()
if( isRoot() ) if( isRoot() )
return; return;
for( vector<PNS_NODE*>::iterator i = m_parent->m_children.begin(); for( std::vector<PNS_NODE*>::iterator i = m_parent->m_children.begin();
i != m_parent->m_children.end(); ++i ) i != m_parent->m_children.end(); ++i )
{ {
if( *i == this ) if( *i == this )
@ -284,7 +282,7 @@ PNS_NODE::OptObstacle PNS_NODE::NearestObstacle( const PNS_LINE* aItem, int aKin
VECTOR2I ip_first, ip_last; VECTOR2I ip_first, ip_last;
int dist_max = INT_MIN; int dist_max = INT_MIN;
vector<SHAPE_LINE_CHAIN::INTERSECTION> isect_list; std::vector<SHAPE_LINE_CHAIN::INTERSECTION> isect_list;
int clearance = GetClearance( obs.item, &aLine ); int clearance = GetClearance( obs.item, &aLine );
@ -564,7 +562,7 @@ void PNS_NODE::removeSegment( PNS_SEGMENT* aSeg )
void PNS_NODE::removeLine( PNS_LINE* aLine ) void PNS_NODE::removeLine( PNS_LINE* aLine )
{ {
vector<PNS_SEGMENT*>* segRefs = aLine->GetLinkedSegments(); std::vector<PNS_SEGMENT*>* segRefs = aLine->GetLinkedSegments();
if( !segRefs ) if( !segRefs )
return; return;
@ -700,7 +698,7 @@ void PNS_NODE::FindLineEnds( PNS_LINE* aLine, PNS_JOINT& a, PNS_JOINT& b )
} }
int PNS_NODE::FindLinesBetweenJoints( PNS_JOINT& a, PNS_JOINT& b, vector<PNS_LINE*>& aLines ) int PNS_NODE::FindLinesBetweenJoints( PNS_JOINT& a, PNS_JOINT& b, std::vector<PNS_LINE*>& aLines )
{ {
BOOST_FOREACH( PNS_ITEM* item, a.GetLinkList() ) BOOST_FOREACH( PNS_ITEM* item, a.GetLinkList() )
{ {
@ -763,7 +761,7 @@ PNS_JOINT& PNS_NODE::touchJoint( const VECTOR2I& aPos, const PNS_LAYERSET& aLaye
// try to find the joint in this node. // try to find the joint in this node.
JointMap::iterator f = m_joints.find( tag ); JointMap::iterator f = m_joints.find( tag );
pair<JointMap::iterator, JointMap::iterator> range; std::pair<JointMap::iterator, JointMap::iterator> range;
// not found and we are not root? find in the root and copy results here. // not found and we are not root? find in the root and copy results here.
if( f == m_joints.end() && !isRoot() ) if( f == m_joints.end() && !isRoot() )
@ -895,7 +893,7 @@ void PNS_NODE::Dump( bool aLong )
printf( "Line: %s, net %d ", l->GetLine().Format().c_str(), l->GetNet() ); printf( "Line: %s, net %d ", l->GetLine().Format().c_str(), l->GetNet() );
for( vector<PNS_SEGMENT*>::iterator j = seg_refs->begin(); j != seg_refs->end(); ++j ) for( std::vector<PNS_SEGMENT*>::iterator j = seg_refs->begin(); j != seg_refs->end(); ++j )
{ {
printf( "%s ", (*j)->GetSeg().A.Format().c_str() ); printf( "%s ", (*j)->GetSeg().A.Format().c_str() );
@ -932,7 +930,7 @@ void PNS_NODE::GetUpdatedItems( ItemVector& aRemoved, ItemVector& aAdded )
void PNS_NODE::releaseChildren() void PNS_NODE::releaseChildren()
{ {
// copy the kids as the PNS_NODE destructor erases the item from the parent node. // copy the kids as the PNS_NODE destructor erases the item from the parent node.
vector<PNS_NODE*> kids = m_children; std::vector<PNS_NODE*> kids = m_children;
BOOST_FOREACH( PNS_NODE * node, kids ) { BOOST_FOREACH( PNS_NODE * node, kids ) {
node->releaseChildren(); node->releaseChildren();

View File

@ -28,8 +28,6 @@
#include "pns_optimizer.h" #include "pns_optimizer.h"
#include "pns_utils.h" #include "pns_utils.h"
using namespace std;
/** /**
* *
* Cost Estimator Methods * Cost Estimator Methods
@ -620,8 +618,8 @@ int PNS_OPTIMIZER::smartPadsSingle( PNS_LINE* aLine, PNS_ITEM* aPad, bool aEnd,
const int ForbiddenAngles = DIRECTION_45::ANG_ACUTE | DIRECTION_45::ANG_RIGHT | const int ForbiddenAngles = DIRECTION_45::ANG_ACUTE | DIRECTION_45::ANG_RIGHT |
DIRECTION_45::ANG_HALF_FULL | DIRECTION_45::ANG_UNDEFINED; DIRECTION_45::ANG_HALF_FULL | DIRECTION_45::ANG_UNDEFINED;
typedef pair<int, SHAPE_LINE_CHAIN> RtVariant; typedef std::pair<int, SHAPE_LINE_CHAIN> RtVariant;
vector<RtVariant> variants; std::vector<RtVariant> variants;
BreakoutList breakouts = computeBreakouts( aLine->GetWidth(), aPad, true ); BreakoutList breakouts = computeBreakouts( aLine->GetWidth(), aPad, true );
@ -629,7 +627,7 @@ int PNS_OPTIMIZER::smartPadsSingle( PNS_LINE* aLine, PNS_ITEM* aPad, bool aEnd,
// bool startDiagonal = DIRECTION_45( line.CSegment(0) ).IsDiagonal(); // bool startDiagonal = DIRECTION_45( line.CSegment(0) ).IsDiagonal();
int p_end = min( aEndVertex, min( 3, line.PointCount() - 1 ) ); int p_end = std::min( aEndVertex, std::min( 3, line.PointCount() - 1 ) );
for( int p = 1; p <= p_end; p++ ) for( int p = 1; p <= p_end; p++ )
{ {

View File

@ -51,8 +51,6 @@
#include <class_track.h> #include <class_track.h>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
using namespace std;
// an ugly singleton for drawing debug items within the router context. // an ugly singleton for drawing debug items within the router context.
// To be fixed sometime in the future. // To be fixed sometime in the future.
static PNS_ROUTER* theRouter; static PNS_ROUTER* theRouter;
@ -89,7 +87,7 @@ public:
} }
private: private:
vector<int> m_clearanceCache; std::vector<int> m_clearanceCache;
int m_defaultClearance; int m_defaultClearance;
}; };
@ -232,7 +230,7 @@ int PNS_ROUTER::NextCopperLayer( bool aUp )
void PNS_ROUTER::SyncWorld() void PNS_ROUTER::SyncWorld()
{ {
vector<D_PAD*> pads; std::vector<D_PAD*> pads;
if( !m_board ) if( !m_board )
{ {
@ -662,7 +660,7 @@ PNS_NODE* PNS_ROUTER::removeLoops( PNS_NODE* aNode, PNS_SEGMENT* aLatestSeg )
PNS_NODE* cleaned = aNode->Branch(); PNS_NODE* cleaned = aNode->Branch();
PNS_JOINT a, b; PNS_JOINT a, b;
vector<PNS_LINE*> lines; std::vector<PNS_LINE*> lines;
cleaned->FindLineEnds( ourLine, a, b ); cleaned->FindLineEnds( ourLine, a, b );
cleaned->FindLinesBetweenJoints( a, b, lines ); cleaned->FindLinesBetweenJoints( a, b, lines );
@ -699,7 +697,7 @@ bool PNS_ROUTER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
if( aEndItem && m_currentNet >= 0 && m_currentNet == aEndItem->GetNet() ) if( aEndItem && m_currentNet >= 0 && m_currentNet == aEndItem->GetNet() )
real_end = true; real_end = true;
int last = ( real_end || m_placingVia ) ? l.SegmentCount() : max( 1, l.SegmentCount() - 1 ); int last = ( real_end || m_placingVia ) ? l.SegmentCount() : std::max( 1, l.SegmentCount() - 1 );
PNS_NODE* latest = m_placer->GetCurrentNode(); PNS_NODE* latest = m_placer->GetCurrentNode();
@ -771,7 +769,7 @@ void PNS_ROUTER::FlipPosture()
if( m_placer->GetTail().GetCLine().SegmentCount() == 0 ) if( m_placer->GetTail().GetCLine().SegmentCount() == 0 )
{ {
m_start_diagonal = !m_start_diagonal; m_start_diagonal = !m_start_diagonal;
m_placer->SetInitialDirection( m_start_diagonal ? m_placer->SetInitialDirection( m_start_diagonal ?
DIRECTION_45( DIRECTION_45::NE ) : DIRECTION_45( DIRECTION_45::N ) ); DIRECTION_45( DIRECTION_45::NE ) : DIRECTION_45( DIRECTION_45::N ) );
} }
else else

View File

@ -35,8 +35,6 @@
#include <profile.h> #include <profile.h>
using namespace std;
PNS_SHOVE::PNS_SHOVE( PNS_NODE* aWorld ) PNS_SHOVE::PNS_SHOVE( PNS_NODE* aWorld )
{ {
m_root = aWorld; m_root = aWorld;
@ -280,9 +278,9 @@ const PNS_COST_ESTIMATOR PNS_SHOVE::TotalCost() const
PNS_SHOVE::ShoveStatus PNS_SHOVE::ShoveLines( PNS_LINE* aCurrentHead ) PNS_SHOVE::ShoveStatus PNS_SHOVE::ShoveLines( PNS_LINE* aCurrentHead )
{ {
stack <PNS_LINE*> lineStack; std::stack<PNS_LINE*> lineStack;
PNS_NODE* node, * parent; PNS_NODE* node, * parent;
PNS_VIA* headVia = NULL; PNS_VIA* headVia = NULL;
bool fail = false; bool fail = false;
int iter = 0; int iter = 0;

View File

@ -18,8 +18,6 @@
* with this program. If not, see <http://www.gnu.or/licenses/>. * with this program. If not, see <http://www.gnu.or/licenses/>.
*/ */
#include <vector>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
@ -29,8 +27,6 @@
#include "pns_optimizer.h" #include "pns_optimizer.h"
#include "pns_utils.h" #include "pns_utils.h"
#include "pns_router.h" #include "pns_router.h"
using namespace std;
using boost::optional; using boost::optional;
void PNS_WALKAROUND::start( const PNS_LINE& aInitialPath ) void PNS_WALKAROUND::start( const PNS_LINE& aInitialPath )

View File

@ -39,7 +39,6 @@
#include "trace.h" #include "trace.h"
using namespace KIGFX; using namespace KIGFX;
using namespace std;
using boost::optional; using boost::optional;
static TOOL_ACTION ACT_AutoEndRoute( "AutoEndRoute", AS_CONTEXT, 'F' ); static TOOL_ACTION ACT_AutoEndRoute( "AutoEndRoute", AS_CONTEXT, 'F' );

View File

@ -31,7 +31,6 @@
#include <vector> #include <vector>
#include <functional> #include <functional>
using namespace std;
#ifndef _GDIPLUS_H #ifndef _GDIPLUS_H
// I designed this with GDI+ in mind. However, this particular code doesn't // I designed this with GDI+ in mind. However, this particular code doesn't
@ -80,9 +79,9 @@ public:
#endif // _GDIPLUS_H #endif // _GDIPLUS_H
typedef vector<PointF> pointVector; typedef std::vector<PointF> pointVector;
typedef vector<PointF>::iterator pointIterator; typedef std::vector<PointF>::iterator pointIterator;
typedef vector<PointF>::const_iterator cpointIterator; typedef std::vector<PointF>::const_iterator cpointIterator;
class SutherlandHodgman class SutherlandHodgman
{ {
@ -249,10 +248,10 @@ private:
// rectangles, we include the left and top boundaries, but not the right and bottom boundaries. // rectangles, we include the left and top boundaries, but not the right and bottom boundaries.
// In other words: a vertex on the left boundary is considered to be inside, but a vertex // In other words: a vertex on the left boundary is considered to be inside, but a vertex
// on the right boundary is considered to be outside. // on the right boundary is considered to be outside.
typedef BoundaryVert < less<REAL> > BoundaryRight; typedef BoundaryVert<std::less<REAL> > BoundaryRight;
typedef BoundaryHor < greater_equal<REAL> > BoundaryTop; typedef BoundaryHor<std::greater_equal<REAL> > BoundaryTop;
typedef BoundaryVert < greater_equal<REAL> > BoundaryLeft; typedef BoundaryVert<std::greater_equal<REAL> > BoundaryLeft;
typedef BoundaryHor < less<REAL> > BoundaryBottom; typedef BoundaryHor<std::less<REAL> > BoundaryBottom;
// Next typedefs define the four stages. First template parameter is the boundary, // Next typedefs define the four stages. First template parameter is the boundary,
// second template parameter is the next stage. // second template parameter is the next stage.

View File

@ -1,4 +1,4 @@
/* /*
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/ * http://code.google.com/p/poly2tri/
* *
@ -96,14 +96,14 @@ void Triangle::ClearNeighbor(Triangle *triangle )
} }
else if( neighbors_[1] == triangle ) else if( neighbors_[1] == triangle )
{ {
neighbors_[1] = NULL; neighbors_[1] = NULL;
} }
else else
{ {
neighbors_[2] = NULL; neighbors_[2] = NULL;
} }
} }
void Triangle::ClearNeighbors() void Triangle::ClearNeighbors()
{ {
neighbors_[0] = NULL; neighbors_[0] = NULL;
@ -357,10 +357,9 @@ Triangle& Triangle::NeighborAcross(Point& opoint)
void Triangle::DebugPrint() void Triangle::DebugPrint()
{ {
using namespace std; std::cout << points_[0]->x << "," << points_[0]->y << " ";
cout << points_[0]->x << "," << points_[0]->y << " "; std::cout << points_[1]->x << "," << points_[1]->y << " ";
cout << points_[1]->x << "," << points_[1]->y << " "; std::cout << points_[2]->x << "," << points_[2]->y << "\n";
cout << points_[2]->x << "," << points_[2]->y << endl;
} }
} }

View File

@ -63,8 +63,6 @@
#include <cstddef> #include <cstddef>
#include <vector> #include <vector>
using namespace std;
#include <class_title_block.h> #include <class_title_block.h>
#include <class_colors_design_settings.h> #include <class_colors_design_settings.h>
#include <class_marker_base.h> #include <class_marker_base.h>