diff --git a/contrib/src/ai/aiPathFinder.h b/contrib/src/ai/aiPathFinder.h index 1595cb2777..4b2e2c976a 100644 --- a/contrib/src/ai/aiPathFinder.h +++ b/contrib/src/ai/aiPathFinder.h @@ -18,8 +18,8 @@ #include "cmath.h" #include "lineSegs.h" -typedef vector NodeArray; -typedef vector NavMesh; +typedef std::vector NodeArray; +typedef std::vector NavMesh; Node* find_in_mesh(NavMesh nav_mesh, LVecBase3 pos, int grid_size); @@ -32,8 +32,8 @@ class EXPCL_PANDAAI PathFinder { public: Node *_src_node; Node *_dest_node; - vector _open_list; - vector _closed_list; + std::vector _open_list; + std::vector _closed_list; NavMesh _grid; diff --git a/contrib/src/ai/aiWorld.h b/contrib/src/ai/aiWorld.h index 64cecefc2d..3848e054dc 100644 --- a/contrib/src/ai/aiWorld.h +++ b/contrib/src/ai/aiWorld.h @@ -34,7 +34,7 @@ class EXPCL_PANDAAI AIWorld { AICharPool _ai_char_pool; NodePath _render; public: - vector _obstacles; + std::vector _obstacles; typedef std::vector FlockPool; FlockPool _flock_pool; void remove_ai_char_from_flock(string name); diff --git a/contrib/src/ai/pathFind.cxx b/contrib/src/ai/pathFind.cxx index 39093da197..aca7745229 100644 --- a/contrib/src/ai/pathFind.cxx +++ b/contrib/src/ai/pathFind.cxx @@ -46,7 +46,7 @@ void PathFind::create_nav_mesh(const char* navmesh_filename) { string fields[10]; // Open data file for reading. - ifstream nav_mesh_file (navmesh_filename); + std::ifstream nav_mesh_file (navmesh_filename); if(nav_mesh_file.is_open()) { // Capture the grid size from the file. @@ -56,7 +56,7 @@ void PathFind::create_nav_mesh(const char* navmesh_filename) { // Initialize the stage mesh with NULL nodes. for(int r = 0; r < _grid_size; ++r) { - _nav_mesh.push_back(vector()); + _nav_mesh.push_back(std::vector()); for(int c = 0; c < _grid_size; ++c) { _nav_mesh[r].push_back(NULL); } @@ -111,7 +111,7 @@ void PathFind::create_nav_mesh(const char* navmesh_filename) { * _nav_mesh. */ void PathFind::assign_neighbor_nodes(const char* navmesh_filename){ - ifstream nav_mesh_file (navmesh_filename); + std::ifstream nav_mesh_file (navmesh_filename); // Stage variables. int gd_x, gd_y, gd_xn, gd_yn; diff --git a/contrib/src/ai/pathFind.h b/contrib/src/ai/pathFind.h index eb82f9ff99..ffeb50abf0 100644 --- a/contrib/src/ai/pathFind.h +++ b/contrib/src/ai/pathFind.h @@ -40,9 +40,9 @@ public: LVecBase3 _prev_position; PT(GeomNode) _parent; LineSegs *_pen; - vector _previous_obstacles; + std::vector _previous_obstacles; bool _dynamic_avoid; - vector _dynamic_obstacle; + std::vector _dynamic_obstacle; PathFind(AICharacter *ai_ch); ~PathFind(); diff --git a/contrib/src/rplight/gpuCommandList.h b/contrib/src/rplight/gpuCommandList.h index f2ec280116..1551afe630 100644 --- a/contrib/src/rplight/gpuCommandList.h +++ b/contrib/src/rplight/gpuCommandList.h @@ -48,7 +48,7 @@ PUBLISHED: MAKE_PROPERTY(num_commands, get_num_commands); protected: - queue _commands; + std::queue _commands; }; #endif // GPUCOMMANDLIST_H diff --git a/contrib/src/rplight/pointerSlotStorage.h b/contrib/src/rplight/pointerSlotStorage.h index 2d908c5795..401e133b81 100644 --- a/contrib/src/rplight/pointerSlotStorage.h +++ b/contrib/src/rplight/pointerSlotStorage.h @@ -45,6 +45,7 @@ class PointerSlotStorage {}; using std::tr1::array; #else #include +using std::array; #endif /** diff --git a/contrib/src/rplight/pssmCameraRig.h b/contrib/src/rplight/pssmCameraRig.h index ce0567bbbf..33cefe6dc1 100644 --- a/contrib/src/rplight/pssmCameraRig.h +++ b/contrib/src/rplight/pssmCameraRig.h @@ -96,9 +96,9 @@ protected: inline LPoint3 get_interpolated_point(CoordinateOrigin origin, float depth); LVecBase3 get_snap_offset(const LMatrix4& mat, size_t resolution); - vector _cam_nodes; - vector _cameras; - vector _max_film_sizes; + std::vector _cam_nodes; + std::vector _cameras; + std::vector _max_film_sizes; // Current near and far points // Order: UL, UR, LL, LR (See CoordinateOrigin) diff --git a/direct/src/dcparser/dcbase.h b/direct/src/dcparser/dcbase.h index 6d65f16524..6cf146d848 100644 --- a/direct/src/dcparser/dcbase.h +++ b/direct/src/dcparser/dcbase.h @@ -60,8 +60,6 @@ #include #endif -using namespace std; - #define INLINE inline #define TYPENAME typename @@ -82,7 +80,7 @@ using namespace std; // Panda defines a special Filename class. We'll use an ordinary string // instead. -typedef string Filename; +typedef std::string Filename; // Panda defines WORDS_BIGENDIAN on a bigendian machine; otherwise, the // machine is assumed to be littleendian. Outside of Panda, you're @@ -92,15 +90,15 @@ typedef string Filename; #include #include #include -#define pvector vector -#define pmap map -#define pset set +#define pvector std::vector +#define pmap std::map +#define pset std::set #include -typedef ifstream pifstream; -typedef ofstream pofstream; -typedef fstream pfstream; +typedef std::ifstream pifstream; +typedef std::ofstream pofstream; +typedef std::fstream pfstream; #endif // WITHIN_PANDA diff --git a/direct/src/directdServer/directdClient.cxx b/direct/src/directdServer/directdClient.cxx index 550c3f2862..91059ed384 100644 --- a/direct/src/directdServer/directdClient.cxx +++ b/direct/src/directdServer/directdClient.cxx @@ -24,7 +24,7 @@ DirectDClient::cli_command(const string& cmd) { cerr<<"command "<> code; string host; @@ -49,7 +49,7 @@ DirectDClient::run_client(const string& host, int port) { connect_to(host, port); while (!cin.fail() && _connections.size()!=0) { - cout << "directd send: " << flush; + cout << "directd send: " << std::flush; string d; cin >> d; cli_command(d); diff --git a/direct/src/interval/cMetaInterval.cxx b/direct/src/interval/cMetaInterval.cxx index dd5f1386f2..a4b914c7ed 100644 --- a/direct/src/interval/cMetaInterval.cxx +++ b/direct/src/interval/cMetaInterval.cxx @@ -756,7 +756,7 @@ do_recompute() { // We do a stable_sort() to guarantee ordering of events that have the same // start time. These must be invoked in the order in which they appear. - stable_sort(_events.begin(), _events.end(), IndirectLess()); + std::stable_sort(_events.begin(), _events.end(), IndirectLess()); _duration = int_to_double_time(_end_time); } diff --git a/dtool/src/cppparser/cppBison.cxx.prebuilt b/dtool/src/cppparser/cppBison.cxx.prebuilt index 6ee30a3510..f1985d488e 100644 --- a/dtool/src/cppparser/cppBison.cxx.prebuilt +++ b/dtool/src/cppparser/cppBison.cxx.prebuilt @@ -114,9 +114,9 @@ static int publish_nest_level = 0; static CPPVisibility publish_previous; static YYLTYPE publish_loc; -static vector last_scopes; -static vector last_storage_classes; -static vector last_structs; +static std::vector last_scopes; +static std::vector last_storage_classes; +static std::vector last_structs; int yyparse(); diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 64fc1cf4f1..3750399ccc 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -49,9 +49,9 @@ static int publish_nest_level = 0; static CPPVisibility publish_previous; static YYLTYPE publish_loc; -static vector last_scopes; -static vector last_storage_classes; -static vector last_structs; +static std::vector last_scopes; +static std::vector last_storage_classes; +static std::vector last_structs; int yyparse(); diff --git a/dtool/src/cppparser/cppClosureType.h b/dtool/src/cppparser/cppClosureType.h index 9c3533ad4a..85b392ba85 100644 --- a/dtool/src/cppparser/cppClosureType.h +++ b/dtool/src/cppparser/cppClosureType.h @@ -39,7 +39,7 @@ public: CaptureType _type; CPPExpression *_initializer; }; - typedef vector Captures; + typedef std::vector Captures; Captures _captures; CaptureType _default_capture; diff --git a/dtool/src/cppparser/cppCommentBlock.h b/dtool/src/cppparser/cppCommentBlock.h index d3e8ef0a02..614012ce61 100644 --- a/dtool/src/cppparser/cppCommentBlock.h +++ b/dtool/src/cppparser/cppCommentBlock.h @@ -36,6 +36,6 @@ public: string _comment; }; -typedef list CPPComments; +typedef std::list CPPComments; #endif diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index 899d1f076f..c41441fd75 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -567,12 +567,12 @@ show_line(const YYLTYPE &loc) { } // Seek to the offending line in the file. - ifstream stream; + std::ifstream stream; if (loc.file._filename.open_read(stream)) { int l = 0; string linestr; while (l < loc.first_line) { - getline(stream, linestr); + std::getline(stream, linestr); ++l; } diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index fc47f057d1..8c44ec4429 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -35,8 +35,6 @@ #include #include -using namespace std; - #define INLINE inline #define ALWAYS_INLINE inline #define TYPENAME typename @@ -78,8 +76,7 @@ typedef int ios_seekdir; #include #include - -using namespace std; +#include #define TYPENAME typename @@ -90,10 +87,10 @@ typedef int ios_iostate; // Old iostream libraries used ios::seek_dir instead of ios::seekdir. typedef ios::seek_dir ios_seekdir; #else -typedef ios::openmode ios_openmode; -typedef ios::fmtflags ios_fmtflags; -typedef ios::iostate ios_iostate; -typedef ios::seekdir ios_seekdir; +typedef std::ios::openmode ios_openmode; +typedef std::ios::fmtflags ios_fmtflags; +typedef std::ios::iostate ios_iostate; +typedef std::ios::seekdir ios_seekdir; #endif // Apple has an outdated libstdc++. Not all is lost, though, as we can fill @@ -161,6 +158,36 @@ namespace std { #endif // CPPPARSER +// This was previously `using namespace std`, but we don't want to pull in the +// entire namespace, so we enumerate the things we are using without std:: +// prefix in the Panda headers. It is intended that this list will shrink. +using std::cerr; +using std::cin; +using std::cout; +using std::dec; +using std::endl; +using std::hex; +using std::ios; +using std::iostream; +using std::istream; +using std::istringstream; +using std::max; +using std::min; +using std::move; +using std::ostream; +using std::ostringstream; +using std::pair; +using std::setfill; +using std::setw; +using std::streambuf; +using std::streamoff; +using std::streampos; +using std::streamsize; +using std::string; +using std::stringstream; +using std::swap; +using std::wstring; + // The ReferenceCount class is defined later, within Panda, but we need to // pass around forward references to it here at the very low level. class ReferenceCount; diff --git a/dtool/src/dtoolbase/fakestringstream.h b/dtool/src/dtoolbase/fakestringstream.h index 4ff2a971f0..7132d6280e 100644 --- a/dtool/src/dtoolbase/fakestringstream.h +++ b/dtool/src/dtoolbase/fakestringstream.h @@ -18,8 +18,6 @@ #include #include -using namespace std; - class fake_istream_buffer { public: fake_istream_buffer() { diff --git a/dtool/src/dtoolbase/memoryHook.h b/dtool/src/dtoolbase/memoryHook.h index bb30e7f03d..11d83439d3 100644 --- a/dtool/src/dtoolbase/memoryHook.h +++ b/dtool/src/dtoolbase/memoryHook.h @@ -84,7 +84,7 @@ protected: private: size_t _page_size; - typedef map DeletedChains; + typedef std::map DeletedChains; DeletedChains _deleted_chains; mutable MutexImpl _lock; diff --git a/dtool/src/dtoolbase/neverFreeMemory.h b/dtool/src/dtoolbase/neverFreeMemory.h index d3f0cf51a1..8396313015 100644 --- a/dtool/src/dtoolbase/neverFreeMemory.h +++ b/dtool/src/dtoolbase/neverFreeMemory.h @@ -57,7 +57,7 @@ private: size_t _remaining; }; - typedef set Pages; + typedef std::set Pages; Pages _pages; size_t _total_alloc; diff --git a/dtool/src/dtoolbase/pallocator.h b/dtool/src/dtoolbase/pallocator.h index 8dfbb8178d..9c27191aa0 100644 --- a/dtool/src/dtoolbase/pallocator.h +++ b/dtool/src/dtoolbase/pallocator.h @@ -20,6 +20,8 @@ #include "deletedChain.h" #include "typeHandle.h" +using std::allocator; + /** * This is our own Panda specialization on the default STL allocator. Its * main purpose is to call the hooks for MemoryUsage to properly track STL- @@ -36,8 +38,8 @@ // If we're not trying to make custom allocators (either we don't know what // kind of syntax this STL library wants, or we're compiling with OPTIMIZE 4), // then simply use the standard allocator. -#define pallocator_single allocator -#define pallocator_array allocator +#define pallocator_single std::allocator +#define pallocator_array std::allocator #else diff --git a/dtool/src/dtoolbase/pdeque.h b/dtool/src/dtoolbase/pdeque.h index 96cf319e77..e3bc33d521 100644 --- a/dtool/src/dtoolbase/pdeque.h +++ b/dtool/src/dtoolbase/pdeque.h @@ -22,10 +22,12 @@ #if !defined(USE_STL_ALLOCATOR) || defined(CPPPARSER) // If we're not using custom allocators, just use the standard class // definition. -#define pdeque deque +#define pdeque std::deque #else +using std::deque; + /** * This is our own Panda specialization on the default STL deque. Its main * purpose is to call the hooks for MemoryUsage to properly track STL- diff --git a/dtool/src/dtoolbase/pdtoa.cxx b/dtool/src/dtoolbase/pdtoa.cxx index bc50d6ff92..2b508654ba 100644 --- a/dtool/src/dtoolbase/pdtoa.cxx +++ b/dtool/src/dtoolbase/pdtoa.cxx @@ -397,7 +397,7 @@ void pdtoa(double value, char *buffer) { #ifdef _MSC_VER if (copysign(1.0, value) < 0) { #else - if (signbit(value)) { + if (std::signbit(value)) { #endif *buffer++ = '-'; value = -value; diff --git a/dtool/src/dtoolbase/plist.h b/dtool/src/dtoolbase/plist.h index bbb9e55089..978f91cd49 100644 --- a/dtool/src/dtoolbase/plist.h +++ b/dtool/src/dtoolbase/plist.h @@ -22,10 +22,12 @@ #if !defined(USE_STL_ALLOCATOR) || defined(CPPPARSER) // If we're not using custom allocators, just use the standard class // definition. -#define plist list +#define plist std::list #else +using std::list; + /** * This is our own Panda specialization on the default STL list. Its main * purpose is to call the hooks for MemoryUsage to properly track STL- diff --git a/dtool/src/dtoolbase/pmap.h b/dtool/src/dtoolbase/pmap.h index e115191b45..8ac5be6134 100644 --- a/dtool/src/dtoolbase/pmap.h +++ b/dtool/src/dtoolbase/pmap.h @@ -27,8 +27,8 @@ #if !defined(USE_STL_ALLOCATOR) || defined(CPPPARSER) // If we're not using custom allocators, just use the standard class // definition. -#define pmap map -#define pmultimap multimap +#define pmap std::map +#define pmultimap std::multimap #ifdef HAVE_STL_HASH #define phash_map stdext::hash_map @@ -40,6 +40,9 @@ #else // USE_STL_ALLOCATOR +using std::map; +using std::multimap; + /** * This is our own Panda specialization on the default STL map. Its main * purpose is to call the hooks for MemoryUsage to properly track STL- diff --git a/dtool/src/dtoolbase/pset.h b/dtool/src/dtoolbase/pset.h index b7990ad671..142c5b3149 100644 --- a/dtool/src/dtoolbase/pset.h +++ b/dtool/src/dtoolbase/pset.h @@ -27,19 +27,22 @@ #if !defined(USE_STL_ALLOCATOR) || defined(CPPPARSER) // If we're not using custom allocators, just use the standard class // definition. -#define pset set -#define pmultiset multiset +#define pset std::set +#define pmultiset std::multiset #ifdef HAVE_STL_HASH #define phash_set stdext::hash_set #define phash_multiset stdext::hash_multiset #else // HAVE_STL_HASH -#define phash_set set -#define phash_multiset multiset +#define phash_set std::set +#define phash_multiset std::multiset #endif // HAVE_STL_HASH #else // USE_STL_ALLOCATOR +using std::set; +using std::multiset; + /** * This is our own Panda specialization on the default STL set. Its main * purpose is to call the hooks for MemoryUsage to properly track STL- diff --git a/dtool/src/dtoolbase/pvector.h b/dtool/src/dtoolbase/pvector.h index 8da0e88b85..8baf3c49c1 100644 --- a/dtool/src/dtoolbase/pvector.h +++ b/dtool/src/dtoolbase/pvector.h @@ -28,11 +28,13 @@ #elif defined(CPPPARSER) // Simplified definition to speed up Interrogate parsing. template -class pvector : public vector { +class pvector : public std::vector { }; #else +using std::vector; + /** * This is our own Panda specialization on the default STL vector. Its main * purpose is to call the hooks for MemoryUsage to properly track STL- diff --git a/dtool/src/dtoolbase/stl_compares.h b/dtool/src/dtoolbase/stl_compares.h index 57d989337a..0afffbf9a2 100644 --- a/dtool/src/dtoolbase/stl_compares.h +++ b/dtool/src/dtoolbase/stl_compares.h @@ -24,6 +24,8 @@ #ifdef HAVE_STL_HASH #include // for hash_compare +using std::less; + template > class stl_hash_compare : public stdext::hash_compare { public: @@ -36,6 +38,8 @@ public: #include // for less +using std::less; + // This is declared for the cases in which we don't have STL_HASH available. template > class stl_hash_compare : public Compare { diff --git a/dtool/src/dtoolbase/typeRegistry.h b/dtool/src/dtoolbase/typeRegistry.h index 5c5c09ad4c..2227782862 100644 --- a/dtool/src/dtoolbase/typeRegistry.h +++ b/dtool/src/dtoolbase/typeRegistry.h @@ -100,13 +100,13 @@ private: static INLINE void init_lock(); - typedef vector HandleRegistry; + typedef std::vector HandleRegistry; HandleRegistry _handle_registry; - typedef map NameRegistry; + typedef std::map NameRegistry; NameRegistry _name_registry; - typedef vector RootClasses; + typedef std::vector RootClasses; RootClasses _root_classes; bool _derivations_fresh; diff --git a/dtool/src/dtoolbase/typeRegistryNode.h b/dtool/src/dtoolbase/typeRegistryNode.h index a8df5c339e..c459d64805 100644 --- a/dtool/src/dtoolbase/typeRegistryNode.h +++ b/dtool/src/dtoolbase/typeRegistryNode.h @@ -43,7 +43,7 @@ public: TypeHandle _handle; string _name; TypeHandle &_ref; - typedef vector Classes; + typedef std::vector Classes; Classes _parent_classes; Classes _child_classes; @@ -72,7 +72,7 @@ private: SubtreeMaskType _mask; SubtreeMaskType _bits; }; - typedef vector TopInheritance; + typedef std::vector TopInheritance; void r_build_subtrees(TypeRegistryNode *top, int bit_count, SubtreeMaskType bits); diff --git a/dtool/src/dtoolutil/dSearchPath.cxx b/dtool/src/dtoolutil/dSearchPath.cxx index d0aec4c3ad..f30f2156fc 100644 --- a/dtool/src/dtoolutil/dSearchPath.cxx +++ b/dtool/src/dtoolutil/dSearchPath.cxx @@ -220,8 +220,8 @@ append_path(const string &path, const string &separator) { */ void DSearchPath:: append_path(const DSearchPath &path) { - copy(path._directories.begin(), path._directories.end(), - back_inserter(_directories)); + std::copy(path._directories.begin(), path._directories.end(), + std::back_inserter(_directories)); } /** @@ -232,8 +232,8 @@ void DSearchPath:: prepend_path(const DSearchPath &path) { if (!path._directories.empty()) { Directories new_directories = path._directories; - copy(_directories.begin(), _directories.end(), - back_inserter(new_directories)); + std::copy(_directories.begin(), _directories.end(), + std::back_inserter(new_directories)); _directories.swap(new_directories); } } diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index 2df2647490..036707f47d 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -1855,7 +1855,7 @@ scan_directory(vector_string &contents) const { * or set_binary(). */ bool Filename:: -open_read(ifstream &stream) const { +open_read(std::ifstream &stream) const { assert(!get_pattern()); assert(is_binary_or_text()); @@ -1891,7 +1891,7 @@ open_read(ifstream &stream) const { * if it already exists. Otherwise, the file is kept at its original length. */ bool Filename:: -open_write(ofstream &stream, bool truncate) const { +open_write(std::ofstream &stream, bool truncate) const { assert(!get_pattern()); assert(is_binary_or_text()); @@ -1937,7 +1937,7 @@ open_write(ofstream &stream, bool truncate) const { * or set_binary(). */ bool Filename:: -open_append(ofstream &stream) const { +open_append(std::ofstream &stream) const { assert(!get_pattern()); assert(is_binary_or_text()); @@ -1969,7 +1969,7 @@ open_append(ofstream &stream) const { * one of set_text() or set_binary(). */ bool Filename:: -open_read_write(fstream &stream, bool truncate) const { +open_read_write(std::fstream &stream, bool truncate) const { assert(!get_pattern()); assert(is_binary_or_text()); @@ -2011,7 +2011,7 @@ open_read_write(fstream &stream, bool truncate) const { * open_read() without first calling one of set_text() or set_binary(). */ bool Filename:: -open_read_append(fstream &stream) const { +open_read_append(std::fstream &stream) const { assert(!get_pattern()); assert(is_binary_or_text()); diff --git a/dtool/src/dtoolutil/filename.h b/dtool/src/dtoolutil/filename.h index 07927a846c..01297dfbee 100644 --- a/dtool/src/dtoolutil/filename.h +++ b/dtool/src/dtoolutil/filename.h @@ -203,11 +203,11 @@ PUBLISHED: EXTENSION(PyObject *scan_directory() const); #endif - bool open_read(ifstream &stream) const; - bool open_write(ofstream &stream, bool truncate = true) const; - bool open_append(ofstream &stream) const; - bool open_read_write(fstream &stream, bool truncate = false) const; - bool open_read_append(fstream &stream) const; + bool open_read(std::ifstream &stream) const; + bool open_write(std::ofstream &stream, bool truncate = true) const; + bool open_append(std::ofstream &stream) const; + bool open_read_write(std::fstream &stream, bool truncate = false) const; + bool open_read_append(std::fstream &stream) const; #ifdef USE_PANDAFILESTREAM bool open_read(pifstream &stream) const; diff --git a/dtool/src/interrogate/functionRemap.h b/dtool/src/interrogate/functionRemap.h index b4b8aea6dd..7c12f65c3d 100644 --- a/dtool/src/interrogate/functionRemap.h +++ b/dtool/src/interrogate/functionRemap.h @@ -103,7 +103,7 @@ public: F_explicit_args = 0x8000, }; - typedef vector Parameters; + typedef std::vector Parameters; Parameters _parameters; ParameterRemap *_return_type; diff --git a/dtool/src/interrogate/interfaceMaker.cxx b/dtool/src/interrogate/interfaceMaker.cxx index 218affd565..2b04f8477a 100644 --- a/dtool/src/interrogate/interfaceMaker.cxx +++ b/dtool/src/interrogate/interfaceMaker.cxx @@ -460,7 +460,7 @@ wrap_global_functions() { * added to the end. */ void InterfaceMaker:: -get_function_remaps(vector &remaps) { +get_function_remaps(std::vector &remaps) { FunctionsByIndex::iterator fi; for (fi = _functions.begin(); fi != _functions.end(); ++fi) { Function *func = (*fi).second; diff --git a/dtool/src/interrogate/interfaceMaker.h b/dtool/src/interrogate/interfaceMaker.h index f6b4730609..620f42d275 100644 --- a/dtool/src/interrogate/interfaceMaker.h +++ b/dtool/src/interrogate/interfaceMaker.h @@ -64,7 +64,7 @@ public: virtual bool separate_overloading(); virtual bool wrap_global_functions(); - void get_function_remaps(vector &remaps); + void get_function_remaps(std::vector &remaps); static ostream &indent(ostream &out, int indent_level); @@ -100,14 +100,14 @@ public: string _name; const InterrogateType &_itype; const InterrogateFunction &_ifunc; - typedef vector Remaps; + typedef std::vector Remaps; Remaps _remaps; bool _has_this; int _flags; ArgsType _args_type; }; - typedef map FunctionsByIndex; - typedef vector Functions; + typedef std::map FunctionsByIndex; + typedef std::vector Functions; FunctionsByIndex _functions; class MakeSeq { @@ -119,15 +119,15 @@ public: Function *_length_getter; Function *_element_getter; }; - typedef vector MakeSeqs; + typedef std::vector MakeSeqs; class Property { public: Property(const InterrogateElement &ielement); const InterrogateElement &_ielement; - vector _getter_remaps; - vector _setter_remaps; + std::vector _getter_remaps; + std::vector _setter_remaps; Function *_length_function; Function *_has_function; Function *_clear_function; @@ -136,7 +136,7 @@ public: Function *_getkey_function; bool _has_this; }; - typedef vector Properties; + typedef std::vector Properties; class Object { public: @@ -162,10 +162,10 @@ public: }; int _protocol_types; }; - typedef map Objects; + typedef std::map Objects; Objects _objects; - typedef map WrappersByHash; + typedef std::map WrappersByHash; WrappersByHash _wrappers_by_hash; virtual FunctionRemap * diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 63d579c68f..5c9dc651ad 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -74,7 +74,7 @@ add_source_file(const string &filename) { void InterrogateBuilder:: read_command_file(istream &in) { string line; - getline(in, line); + std::getline(in, line); while (!in.fail() && !in.eof()) { // Strip out the comment. size_t hash = line.find('#'); @@ -110,7 +110,7 @@ read_command_file(istream &in) { do_command(command, params); } - getline(in, line); + std::getline(in, line); } } @@ -323,7 +323,7 @@ build() { */ void InterrogateBuilder:: write_code(ostream &out_code,ostream * out_include, InterrogateModuleDef *def) { - typedef vector InterfaceMakers; + typedef std::vector InterfaceMakers; InterfaceMakers makers; if (build_c_wrappers) { @@ -443,7 +443,7 @@ write_code(ostream &out_code,ostream * out_include, InterrogateModuleDef *def) { } // Now collect all the function wrappers. - vector remaps; + std::vector remaps; for (mi = makers.begin(); mi != makers.end(); ++mi) { (*mi)->get_function_remaps(remaps); } @@ -457,7 +457,7 @@ write_code(ostream &out_code,ostream * out_include, InterrogateModuleDef *def) { int num_wrappers = 0; map wrappers_by_index; - vector::iterator ri; + std::vector::iterator ri; for (ri = remaps.begin(); ri != remaps.end(); ++ri) { FunctionRemap *remap = (*ri); wrappers_by_index[remap->_wrapper_index] = remap; @@ -960,7 +960,7 @@ is_inherited_published(CPPInstance *function, CPPStructType *struct_type) { * purpose of this function. */ void InterrogateBuilder:: -remap_indices(vector &remaps) { +remap_indices(std::vector &remaps) { IndexRemapper index_remap; InterrogateDatabase::get_ptr()->remap_indices(1, index_remap); @@ -976,7 +976,7 @@ remap_indices(vector &remaps) { (*fi).second = index_remap.map_from((*fi).second); } - vector::iterator ri; + std::vector::iterator ri; for (ri = remaps.begin(); ri != remaps.end(); ++ri) { FunctionRemap *remap = (*ri); remap->_wrapper_index = index_remap.map_from(remap->_wrapper_index); diff --git a/dtool/src/interrogate/interrogateBuilder.h b/dtool/src/interrogate/interrogateBuilder.h index 41096a6f6a..68bcb4b131 100644 --- a/dtool/src/interrogate/interrogateBuilder.h +++ b/dtool/src/interrogate/interrogateBuilder.h @@ -68,8 +68,8 @@ public: TypeIndex get_type(CPPType *type, bool global); public: - typedef set Commands; - typedef map CommandParams; + typedef std::set Commands; + typedef std::map CommandParams; void insert_param_list(InterrogateBuilder::Commands &commands, const string ¶ms); @@ -86,7 +86,7 @@ public: bool is_inherited_published(CPPInstance *function, CPPStructType *struct_type); - void remap_indices(vector &remaps); + void remap_indices(std::vector &remaps); void scan_function(CPPFunctionGroup *fgroup); void scan_function(CPPInstance *function); void scan_struct_type(CPPStructType *type); @@ -135,17 +135,17 @@ public: static string trim_blanks(const string &str); - typedef map TypesByName; - typedef map FunctionsByName; - typedef map MakeSeqsByName; - typedef map PropertiesByName; + typedef std::map TypesByName; + typedef std::map FunctionsByName; + typedef std::map MakeSeqsByName; + typedef std::map PropertiesByName; TypesByName _types_by_name; FunctionsByName _functions_by_name; MakeSeqsByName _make_seqs_by_name; PropertiesByName _properties_by_name; - typedef map IncludeFiles; + typedef std::map IncludeFiles; IncludeFiles _include_files; Commands _forcetype; diff --git a/dtool/src/interrogate/interrogate_module.cxx b/dtool/src/interrogate/interrogate_module.cxx index 8c843e9da1..0cb7703fd0 100644 --- a/dtool/src/interrogate/interrogate_module.cxx +++ b/dtool/src/interrogate/interrogate_module.cxx @@ -80,10 +80,10 @@ upcase_string(const string &str) { * Finds a dependency cycle between the given dependency mapping, starting at * the node that is already placed in the given cycle vector. */ -static bool find_dependency_cycle(vector_string &cycle, map > &dependencies) { +static bool find_dependency_cycle(vector_string &cycle, std::map > &dependencies) { assert(!cycle.empty()); - const set &deps = dependencies[cycle.back()]; + const std::set &deps = dependencies[cycle.back()]; for (auto it = deps.begin(); it != deps.end(); ++it) { auto it2 = std::find(cycle.begin(), cycle.end(), *it); if (it2 != cycle.end()) { @@ -156,7 +156,7 @@ int write_python_table_native(ostream &out) { int count = 0; - map > dependencies; + std::map > dependencies; // out << "extern \"C\" {\n"; @@ -182,7 +182,7 @@ int write_python_table_native(ostream &out) { if (interrogate_type_has_module_name(thetype) && module_name == interrogate_type_module_name(thetype)) { if (interrogate_type_has_library_name(thetype)) { string library_name = interrogate_type_library_name(thetype); - set &deps = dependencies[library_name]; + std::set &deps = dependencies[library_name]; // Get the dependencies for this library. int num_derivations = interrogate_type_number_of_derivations(thetype); @@ -219,7 +219,7 @@ int write_python_table_native(ostream &out) { for (auto it = dependencies.begin(); it != dependencies.end(); ++it) { const string &library_name = it->first; - set &deps = dependencies[library_name]; + std::set &deps = dependencies[library_name]; // Remove the dependencies that have already been added from the deps. if (!deps.empty()) { @@ -243,7 +243,7 @@ int write_python_table_native(ostream &out) { cerr << "Circular dependency between libraries detected:\n"; for (auto it = dependencies.begin(); it != dependencies.end(); ++it) { const string &library_name = it->first; - set &deps = dependencies[library_name]; + std::set &deps = dependencies[library_name]; if (deps.empty()) { continue; } diff --git a/dtool/src/interrogate/parse_file.cxx b/dtool/src/interrogate/parse_file.cxx index 6670bcbe44..f20986022a 100644 --- a/dtool/src/interrogate/parse_file.cxx +++ b/dtool/src/interrogate/parse_file.cxx @@ -276,7 +276,7 @@ main(int argc, char **argv) { while (cin) { string str; cout << "Enter an expression or type name:\n"; - getline(cin, str); + std::getline(std::cin, str); if (!str.empty()) { size_t space = str.find(' '); diff --git a/dtool/src/interrogatedb/indexRemapper.cxx b/dtool/src/interrogatedb/indexRemapper.cxx index eee236cf08..7c606bec06 100644 --- a/dtool/src/interrogatedb/indexRemapper.cxx +++ b/dtool/src/interrogatedb/indexRemapper.cxx @@ -59,7 +59,7 @@ in_map(int from) const { */ int IndexRemapper:: map_from(int from) const { - map::const_iterator mi; + std::map::const_iterator mi; mi = _map_int.find(from); if (mi == _map_int.end()) { return from; diff --git a/dtool/src/interrogatedb/indexRemapper.h b/dtool/src/interrogatedb/indexRemapper.h index 9318777c94..c89a7a2988 100644 --- a/dtool/src/interrogatedb/indexRemapper.h +++ b/dtool/src/interrogatedb/indexRemapper.h @@ -38,7 +38,7 @@ public: int map_from(int from) const; private: - map _map_int; + std::map _map_int; }; #endif diff --git a/dtool/src/interrogatedb/interrogateComponent.h b/dtool/src/interrogatedb/interrogateComponent.h index c69dc26886..77b4388d7e 100644 --- a/dtool/src/interrogatedb/interrogateComponent.h +++ b/dtool/src/interrogatedb/interrogateComponent.h @@ -55,7 +55,7 @@ private: InterrogateModuleDef *_def; string _name; - typedef vector Strings; + typedef std::vector Strings; Strings _alt_names; friend class InterrogateBuilder; diff --git a/dtool/src/interrogatedb/interrogateDatabase.h b/dtool/src/interrogatedb/interrogateDatabase.h index 84fc55fbab..182e35798f 100644 --- a/dtool/src/interrogatedb/interrogateDatabase.h +++ b/dtool/src/interrogatedb/interrogateDatabase.h @@ -124,41 +124,41 @@ private: const string &wrapper_hash_name); // This data is loaded from the various database files. - typedef map TypeMap; + typedef std::map TypeMap; TypeMap _type_map; - typedef map FunctionMap; + typedef std::map FunctionMap; FunctionMap _function_map; - typedef map FunctionWrapperMap; + typedef std::map FunctionWrapperMap; FunctionWrapperMap _wrapper_map; - typedef map ManifestMap; + typedef std::map ManifestMap; ManifestMap _manifest_map; - typedef map ElementMap; + typedef std::map ElementMap; ElementMap _element_map; - typedef map MakeSeqMap; + typedef std::map MakeSeqMap; MakeSeqMap _make_seq_map; - typedef vector GlobalTypes; + typedef std::vector GlobalTypes; GlobalTypes _global_types; GlobalTypes _all_types; - typedef vector GlobalFunctions; + typedef std::vector GlobalFunctions; GlobalFunctions _global_functions; GlobalFunctions _all_functions; - typedef vector GlobalManifests; + typedef std::vector GlobalManifests; GlobalManifests _global_manifests; - typedef vector GlobalElements; + typedef std::vector GlobalElements; GlobalElements _global_elements; // This data is compiled in directly to the shared libraries that we link // with. - typedef vector Modules; + typedef std::vector Modules; Modules _modules; - typedef map ModulesByHash; + typedef std::map ModulesByHash; ModulesByHash _modules_by_hash; // This records the set of database files that are still to be loaded. - typedef vector Requests; + typedef std::vector Requests; Requests _requests; bool _error_flag; @@ -174,7 +174,7 @@ private: }; int _lookups_fresh; - typedef map Lookup; + typedef std::map Lookup; Lookup _types_by_name; Lookup _types_by_scoped_name; Lookup _types_by_true_name; diff --git a/dtool/src/interrogatedb/interrogateFunction.h b/dtool/src/interrogatedb/interrogateFunction.h index 312f69a97e..eac57642f8 100644 --- a/dtool/src/interrogatedb/interrogateFunction.h +++ b/dtool/src/interrogatedb/interrogateFunction.h @@ -78,7 +78,7 @@ private: string _prototype; TypeIndex _class; - typedef vector Wrappers; + typedef std::vector Wrappers; Wrappers _c_wrappers; Wrappers _python_wrappers; @@ -92,7 +92,7 @@ public: // This must be a pointer, rather than a concrete map, so we don't risk // trying to create a map in one DLL and access it in another. Silly // Windows. - typedef map Instances; + typedef std::map Instances; Instances *_instances; string _expression; diff --git a/dtool/src/interrogatedb/interrogateFunctionWrapper.h b/dtool/src/interrogatedb/interrogateFunctionWrapper.h index 511e8c6263..a49edb90ad 100644 --- a/dtool/src/interrogatedb/interrogateFunctionWrapper.h +++ b/dtool/src/interrogatedb/interrogateFunctionWrapper.h @@ -90,7 +90,7 @@ public: }; private: - typedef vector Parameters; + typedef std::vector Parameters; Parameters _parameters; friend class InterrogateBuilder; diff --git a/dtool/src/interrogatedb/interrogateType.h b/dtool/src/interrogatedb/interrogateType.h index 176efb4fb9..e852007b6b 100644 --- a/dtool/src/interrogatedb/interrogateType.h +++ b/dtool/src/interrogatedb/interrogateType.h @@ -154,16 +154,16 @@ public: TypeIndex _wrapped_type; int _array_size; - typedef vector Functions; + typedef std::vector Functions; Functions _constructors; FunctionIndex _destructor; - typedef vector Elements; + typedef std::vector Elements; Elements _elements; Functions _methods; Functions _casts; - typedef vector MakeSeqs; + typedef std::vector MakeSeqs; MakeSeqs _make_seqs; enum DerivationFlags { @@ -188,7 +188,7 @@ public: }; private: - typedef vector Derivations; + typedef std::vector Derivations; Derivations _derivations; public: @@ -205,10 +205,10 @@ public: }; private: - typedef vector EnumValues; + typedef std::vector EnumValues; EnumValues _enum_values; - typedef vector Types; + typedef std::vector Types; Types _nested_types; public: diff --git a/dtool/src/interrogatedb/interrogate_datafile.I b/dtool/src/interrogatedb/interrogate_datafile.I index 9111260237..1e9d0f17e2 100644 --- a/dtool/src/interrogatedb/interrogate_datafile.I +++ b/dtool/src/interrogatedb/interrogate_datafile.I @@ -17,9 +17,9 @@ */ template void -idf_output_vector(ostream &out, const vector &vec) { +idf_output_vector(ostream &out, const std::vector &vec) { out << vec.size() << " "; - TYPENAME vector::const_iterator vi; + TYPENAME std::vector::const_iterator vi; for (vi = vec.begin(); vi != vec.end(); ++vi) { out << (*vi) << " "; } @@ -33,7 +33,7 @@ idf_output_vector(ostream &out, const vector &vec) { */ template void -idf_input_vector(istream &in, vector &vec) { +idf_input_vector(istream &in, std::vector &vec) { int length; in >> length; if (in.fail()) { diff --git a/dtool/src/interrogatedb/interrogate_datafile.h b/dtool/src/interrogatedb/interrogate_datafile.h index ecd2acbce0..7442d8ce81 100644 --- a/dtool/src/interrogatedb/interrogate_datafile.h +++ b/dtool/src/interrogatedb/interrogate_datafile.h @@ -27,10 +27,10 @@ void idf_output_string(ostream &out, const char *str, char whitespace = ' '); void idf_input_string(istream &in, const char *&str); template -void idf_output_vector(ostream &out, const vector &vec); +void idf_output_vector(ostream &out, const std::vector &vec); template -void idf_input_vector(istream &in, vector &vec); +void idf_input_vector(istream &in, std::vector &vec); #include "interrogate_datafile.I" diff --git a/dtool/src/interrogatedb/py_panda.I b/dtool/src/interrogatedb/py_panda.I index 1986a128c5..24c038df94 100644 --- a/dtool/src/interrogatedb/py_panda.I +++ b/dtool/src/interrogatedb/py_panda.I @@ -247,7 +247,7 @@ ALWAYS_INLINE PyObject *Dtool_WrapValue(wchar_t value) { return PyUnicode_FromWideChar(&value, 1); } -ALWAYS_INLINE PyObject *Dtool_WrapValue(nullptr_t) { +ALWAYS_INLINE PyObject *Dtool_WrapValue(std::nullptr_t) { Py_INCREF(Py_None); return Py_None; } diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index f4edc8f4ad..f84d5cd3ba 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -393,7 +393,7 @@ ALWAYS_INLINE PyObject *Dtool_WrapValue(const std::string *value); ALWAYS_INLINE PyObject *Dtool_WrapValue(const std::wstring *value); ALWAYS_INLINE PyObject *Dtool_WrapValue(char value); ALWAYS_INLINE PyObject *Dtool_WrapValue(wchar_t value); -ALWAYS_INLINE PyObject *Dtool_WrapValue(nullptr_t); +ALWAYS_INLINE PyObject *Dtool_WrapValue(std::nullptr_t); ALWAYS_INLINE PyObject *Dtool_WrapValue(PyObject *value); ALWAYS_INLINE PyObject *Dtool_WrapValue(const vector_uchar &value); diff --git a/dtool/src/parser-inc/vector b/dtool/src/parser-inc/vector index fb27a78c0d..e83a5ff911 100644 --- a/dtool/src/parser-inc/vector +++ b/dtool/src/parser-inc/vector @@ -22,6 +22,8 @@ #include +inline namespace std { + template class vector { public: @@ -40,4 +42,6 @@ public: typedef size_t size_type; }; +} + #endif diff --git a/dtool/src/prc/configDeclaration.h b/dtool/src/prc/configDeclaration.h index 9a74acd8d2..1e6c50ee12 100644 --- a/dtool/src/prc/configDeclaration.h +++ b/dtool/src/prc/configDeclaration.h @@ -111,7 +111,7 @@ private: short _flags; }; - typedef vector Words; + typedef std::vector Words; Words _words; bool _got_words; diff --git a/dtool/src/prc/configPage.h b/dtool/src/prc/configPage.h index 72659fe096..e6cdb9ed0d 100644 --- a/dtool/src/prc/configPage.h +++ b/dtool/src/prc/configPage.h @@ -92,7 +92,7 @@ private: int _next_decl_seq; int _trust_level; - typedef vector Declarations; + typedef std::vector Declarations; Declarations _declarations; string _signature; diff --git a/dtool/src/prc/configPageManager.h b/dtool/src/prc/configPageManager.h index 1ad8f6c3bd..dd6acc3f99 100644 --- a/dtool/src/prc/configPageManager.h +++ b/dtool/src/prc/configPageManager.h @@ -76,7 +76,7 @@ private: void config_initialized(); - typedef vector Pages; + typedef std::vector Pages; Pages _implicit_pages; Pages _explicit_pages; bool _pages_sorted; @@ -87,7 +87,7 @@ private: DSearchPath _search_path; - typedef vector Globs; + typedef std::vector Globs; Globs _prc_patterns; Globs _prc_encrypted_patterns; Globs _prc_executable_patterns; @@ -105,7 +105,7 @@ private: int _file_flags; Filename _filename; }; - typedef vector ConfigFiles; + typedef std::vector ConfigFiles; static ConfigPageManager *_global_ptr; }; diff --git a/dtool/src/prc/configVariableCore.h b/dtool/src/prc/configVariableCore.h index 19e03436d2..6e8ce7ace9 100644 --- a/dtool/src/prc/configVariableCore.h +++ b/dtool/src/prc/configVariableCore.h @@ -110,7 +110,7 @@ private: ConfigDeclaration *_default_value; ConfigDeclaration *_local_value; - typedef vector Declarations; + typedef std::vector Declarations; Declarations _declarations; Declarations _trusted_declarations; Declarations _untrusted_declarations; diff --git a/dtool/src/prc/configVariableManager.h b/dtool/src/prc/configVariableManager.h index 713e1bc5d2..818c5a8f3d 100644 --- a/dtool/src/prc/configVariableManager.h +++ b/dtool/src/prc/configVariableManager.h @@ -67,13 +67,13 @@ private: // We have to avoid pmap and pvector, due to the very low-level nature of // this stuff. - typedef vector Variables; + typedef std::vector Variables; Variables _variables; - typedef map VariablesByName; + typedef std::map VariablesByName; VariablesByName _variables_by_name; - typedef map VariableTemplates; + typedef std::map VariableTemplates; VariableTemplates _variable_templates; static ConfigVariableManager *_global_ptr; diff --git a/dtool/src/prc/notify.cxx b/dtool/src/prc/notify.cxx index f74f55e596..dc48aace3c 100644 --- a/dtool/src/prc/notify.cxx +++ b/dtool/src/prc/notify.cxx @@ -36,9 +36,9 @@ Notify *Notify::_global_ptr = (Notify *)NULL; */ Notify:: Notify() { - _ostream_ptr = &cerr; + _ostream_ptr = &std::cerr; _owns_ostream_ptr = false; - _null_ostream_ptr = new fstream; + _null_ostream_ptr = new std::fstream; _assert_handler = (AssertHandler *)NULL; _assert_failed = false; diff --git a/dtool/src/prc/notifyCategory.h b/dtool/src/prc/notifyCategory.h index ee25b56268..5ef3712208 100644 --- a/dtool/src/prc/notifyCategory.h +++ b/dtool/src/prc/notifyCategory.h @@ -88,7 +88,7 @@ private: string _basename; NotifyCategory *_parent; ConfigVariableEnum _severity; - typedef vector Children; + typedef std::vector Children; Children _children; static long _server_delta; // not a time_t because server delta may be signed. diff --git a/dtool/src/prc/pnotify.h b/dtool/src/prc/pnotify.h index 27a346d0d9..90cdb24a5d 100644 --- a/dtool/src/prc/pnotify.h +++ b/dtool/src/prc/pnotify.h @@ -85,7 +85,7 @@ private: // This shouldn't be a pmap, since it might be invoked before we initialize // the global malloc pointers. - typedef map Categories; + typedef std::map Categories; Categories _categories; static Notify *_global_ptr; diff --git a/dtool/src/prc/prcKeyRegistry.h b/dtool/src/prc/prcKeyRegistry.h index 0a21d182ad..c05e69a445 100644 --- a/dtool/src/prc/prcKeyRegistry.h +++ b/dtool/src/prc/prcKeyRegistry.h @@ -63,7 +63,7 @@ private: time_t _generated_time; }; - typedef vector Keys; + typedef std::vector Keys; Keys _keys; static PrcKeyRegistry *_global_ptr; diff --git a/panda/src/chan/partGroup.cxx b/panda/src/chan/partGroup.cxx index 20fe582ae9..e1503e93b3 100644 --- a/panda/src/chan/partGroup.cxx +++ b/panda/src/chan/partGroup.cxx @@ -163,7 +163,7 @@ public: */ void PartGroup:: sort_descendants() { - stable_sort(_children.begin(), _children.end(), PartGroupAlphabeticalOrder()); + std::stable_sort(_children.begin(), _children.end(), PartGroupAlphabeticalOrder()); Children::iterator ci; for (ci = _children.begin(); ci != _children.end(); ++ci) { diff --git a/panda/src/collide/collisionTraverser.cxx b/panda/src/collide/collisionTraverser.cxx index 74973d6764..27ec4a99c1 100644 --- a/panda/src/collide/collisionTraverser.cxx +++ b/panda/src/collide/collisionTraverser.cxx @@ -495,7 +495,7 @@ prepare_colliders_single(CollisionTraverser::LevelStatesSingle &level_states, for (i = 0; i < num_colliders; ++i) { indirect[i] = i; } - sort(indirect, indirect + num_colliders, SortByColliderSort(*this)); + std::sort(indirect, indirect + num_colliders, SortByColliderSort(*this)); int num_remaining_colliders = num_colliders; for (i = 0; i < num_colliders; ++i) { @@ -706,7 +706,7 @@ prepare_colliders_double(CollisionTraverser::LevelStatesDouble &level_states, for (i = 0; i < num_colliders; ++i) { indirect[i] = i; } - sort(indirect, indirect + num_colliders, SortByColliderSort(*this)); + std::sort(indirect, indirect + num_colliders, SortByColliderSort(*this)); int num_remaining_colliders = num_colliders; for (i = 0; i < num_colliders; ++i) { @@ -917,7 +917,7 @@ prepare_colliders_quad(CollisionTraverser::LevelStatesQuad &level_states, for (i = 0; i < num_colliders; ++i) { indirect[i] = i; } - sort(indirect, indirect + num_colliders, SortByColliderSort(*this)); + std::sort(indirect, indirect + num_colliders, SortByColliderSort(*this)); int num_remaining_colliders = num_colliders; for (i = 0; i < num_colliders; ++i) { diff --git a/panda/src/cull/cullBinFixed.cxx b/panda/src/cull/cullBinFixed.cxx index 212bc4f320..e3e5637ad9 100644 --- a/panda/src/cull/cullBinFixed.cxx +++ b/panda/src/cull/cullBinFixed.cxx @@ -61,7 +61,7 @@ add_object(CullableObject *object, Thread *current_thread) { void CullBinFixed:: finish_cull(SceneSetup *, Thread *current_thread) { PStatTimer timer(_cull_this_pcollector, current_thread); - stable_sort(_objects.begin(), _objects.end()); + std::stable_sort(_objects.begin(), _objects.end()); } /** diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index cb2f69ff6c..0583602189 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -1540,7 +1540,9 @@ do_determine_display_regions(GraphicsOutput::CData *cdata) { } } - stable_sort(cdata->_active_display_regions.begin(), cdata->_active_display_regions.end(), IndirectLess()); + std::stable_sort(cdata->_active_display_regions.begin(), + cdata->_active_display_regions.end(), + IndirectLess()); } /** diff --git a/panda/src/display/graphicsWindow_ext.cxx b/panda/src/display/graphicsWindow_ext.cxx index 06260b4c83..ac06b3565a 100644 --- a/panda/src/display/graphicsWindow_ext.cxx +++ b/panda/src/display/graphicsWindow_ext.cxx @@ -30,7 +30,7 @@ add_python_event_handler(PyObject* handler, PyObject* name){ */ void Extension:: remove_python_event_handler(PyObject* name){ - list toRemove; + std::list toRemove; GraphicsWindow::PythonWinProcClasses::iterator iter; for (iter = _this->_python_window_proc_classes.begin(); iter != _this->_python_window_proc_classes.end(); ++iter) { PythonGraphicsWindowProc* pgwp = (PythonGraphicsWindowProc*)*iter; @@ -43,7 +43,7 @@ remove_python_event_handler(PyObject* name){ } #endif } - list::iterator iter2; + std::list::iterator iter2; for (iter2 = toRemove.begin(); iter2 != toRemove.end(); ++iter2) { PythonGraphicsWindowProc* pgwp = *iter2; _this->remove_window_proc(pgwp); diff --git a/panda/src/display/subprocessWindowBuffer.cxx b/panda/src/display/subprocessWindowBuffer.cxx index 36eec2def3..daae50b523 100644 --- a/panda/src/display/subprocessWindowBuffer.cxx +++ b/panda/src/display/subprocessWindowBuffer.cxx @@ -18,7 +18,6 @@ #include #include -using namespace std; const char SubprocessWindowBuffer:: _magic_number[SubprocessWindowBuffer::magic_number_length] = "pNdaSWB"; diff --git a/panda/src/display/subprocessWindowBuffer.h b/panda/src/display/subprocessWindowBuffer.h index 2fecbcadbc..e0d52a7f4a 100644 --- a/panda/src/display/subprocessWindowBuffer.h +++ b/panda/src/display/subprocessWindowBuffer.h @@ -17,7 +17,6 @@ #include // perror #include #include -using namespace std; /** * This is a special class that is designed to faciliate SubprocessWindow. diff --git a/panda/src/downloader/httpChannel.cxx b/panda/src/downloader/httpChannel.cxx index 93e04f1432..30d1b3c7bf 100644 --- a/panda/src/downloader/httpChannel.cxx +++ b/panda/src/downloader/httpChannel.cxx @@ -1637,7 +1637,7 @@ run_ssl_handshake() { if (downloader_cat.is_spam()) { downloader_cat.spam() << _NOTIFY_HTTP_CHANNEL_ID - << "Received certificate from server:\n" << flush; + << "Received certificate from server:\n" << std::flush; X509_print_fp(stderr, cert); fflush(stderr); } @@ -2144,14 +2144,14 @@ run_reading_body() { } string line; - getline(*_body_stream, line); + std::getline(*_body_stream, line); while (!_body_stream->fail() && !_body_stream->eof()) { if (downloader_cat.is_spam()) { downloader_cat.spam() << _NOTIFY_HTTP_CHANNEL_ID << "skip: " << line << "\n"; } - getline(*_body_stream, line); + std::getline(*_body_stream, line); } if (!_body_stream->is_closed()) { diff --git a/panda/src/downloadertools/multify.cxx b/panda/src/downloadertools/multify.cxx index 8f3df9ce14..b26de65ab1 100644 --- a/panda/src/downloadertools/multify.cxx +++ b/panda/src/downloadertools/multify.cxx @@ -245,7 +245,7 @@ const string & get_password() { if (!got_password) { cerr << "Enter password: "; - getline(cin, password); + std::getline(std::cin, password); got_password = true; } @@ -650,7 +650,7 @@ list_files(const vector_string ¶ms) { int i; if (verbose) { - cout << num_subfiles << " subfiles:\n" << flush; + cout << num_subfiles << " subfiles:\n" << std::flush; for (i = 0; i < num_subfiles; i++) { string subfile_name = multifile->get_subfile_name(i); if (is_named(subfile_name, params)) { diff --git a/panda/src/downloadertools/pdecrypt.cxx b/panda/src/downloadertools/pdecrypt.cxx index 73a242fda1..9ce3445bf0 100644 --- a/panda/src/downloadertools/pdecrypt.cxx +++ b/panda/src/downloadertools/pdecrypt.cxx @@ -122,7 +122,7 @@ main(int argc, char **argv) { // Prompt for password. if (!got_password) { cerr << "Enter password: "; - getline(cin, password); + std::getline(std::cin, password); got_password = true; } diff --git a/panda/src/downloadertools/pencrypt.cxx b/panda/src/downloadertools/pencrypt.cxx index 5f8774c4d9..3d61651348 100644 --- a/panda/src/downloadertools/pencrypt.cxx +++ b/panda/src/downloadertools/pencrypt.cxx @@ -181,7 +181,7 @@ main(int argc, char **argv) { // Prompt for password. if (!got_password) { cerr << "Enter password: "; - getline(cin, password); + std::getline(std::cin, password); got_password = true; } diff --git a/panda/src/egg/eggData.cxx b/panda/src/egg/eggData.cxx index 69eb4eb6e6..b91f660b68 100644 --- a/panda/src/egg/eggData.cxx +++ b/panda/src/egg/eggData.cxx @@ -276,7 +276,7 @@ write(ostream &out, int indent_level) const { PT(EggCoordinateSystem) ecs = new EggCoordinateSystem(_coordsys); ecs->write(out, indent_level); EggGroupNode::write(out, indent_level); - out << flush; + out << std::flush; } diff --git a/panda/src/egg/eggPrimitive.I b/panda/src/egg/eggPrimitive.I index 8ae8a1eecf..a52449443d 100644 --- a/panda/src/egg/eggPrimitive.I +++ b/panda/src/egg/eggPrimitive.I @@ -136,7 +136,7 @@ has_texture() const { INLINE bool EggPrimitive:: has_texture(EggTexture *texture) const { PT_EggTexture t = texture; - return (::find(_textures.begin(), _textures.end(), t) != _textures.end()); + return (std::find(_textures.begin(), _textures.end(), t) != _textures.end()); } /** diff --git a/panda/src/egg/eggPrimitive.cxx b/panda/src/egg/eggPrimitive.cxx index e3eb0b16d7..90cd4942ca 100644 --- a/panda/src/egg/eggPrimitive.cxx +++ b/panda/src/egg/eggPrimitive.cxx @@ -644,7 +644,7 @@ erase(iterator first, iterator last) { EggPrimitive::iterator EggPrimitive:: find(EggVertex *vertex) { PT_EggVertex vpt = vertex; - return ::find(begin(), end(), vpt); + return std::find(begin(), end(), vpt); } @@ -670,7 +670,7 @@ add_vertex(EggVertex *vertex) { EggVertex *EggPrimitive:: remove_vertex(EggVertex *vertex) { PT_EggVertex vpt = vertex; - iterator i = ::find(begin(), end(), vpt); + iterator i = std::find(begin(), end(), vpt); if (i == end()) { return PT_EggVertex(); } else { diff --git a/panda/src/egg/eggUtilities.I b/panda/src/egg/eggUtilities.I index 04430db8f5..4ad2d6b1c7 100644 --- a/panda/src/egg/eggUtilities.I +++ b/panda/src/egg/eggUtilities.I @@ -57,7 +57,7 @@ split_vertex(EggVertex *vert, const FunctionObject &sequence) { typedef pvector Prims; Prims prims; prims.reserve(vert->pref_size()); - copy(vert->pref_begin(), vert->pref_end(), back_inserter(prims)); + std::copy(vert->pref_begin(), vert->pref_end(), std::back_inserter(prims)); // Now walk through the list of primitives that reference this vertex. Prims::const_iterator pri; diff --git a/panda/src/egg/eggVertexPool.cxx b/panda/src/egg/eggVertexPool.cxx index f1783d8158..e35cee0079 100644 --- a/panda/src/egg/eggVertexPool.cxx +++ b/panda/src/egg/eggVertexPool.cxx @@ -675,7 +675,7 @@ transform(const LMatrix4d &mat) { typedef pvector Verts; Verts verts; verts.reserve(size()); - copy(begin(), end(), back_inserter(verts)); + std::copy(begin(), end(), std::back_inserter(verts)); Verts::const_iterator vi; for (vi = verts.begin(); vi != verts.end(); ++vi) { @@ -742,7 +742,7 @@ sort_by_external_index() { sorted_vertices.push_back(*i); } - ::sort(sorted_vertices.begin(), sorted_vertices.end(), SortByExternalIndex()); + std::sort(sorted_vertices.begin(), sorted_vertices.end(), SortByExternalIndex()); // Now reassign the indices, and copy them into a new index map. IndexVertices new_index_vertices; diff --git a/panda/src/egg/lexer.cxx.prebuilt b/panda/src/egg/lexer.cxx.prebuilt index 6f6e8bd56a..ef8160d2c2 100644 --- a/panda/src/egg/lexer.cxx.prebuilt +++ b/panda/src/egg/lexer.cxx.prebuilt @@ -1062,11 +1062,11 @@ eggyyerror(const string &msg) { } out << " at line " << line_number << ", column " << col_number << ":\n" - << setiosflags(Notify::get_literal_flag()) + << std::setiosflags(Notify::get_literal_flag()) << current_line << "\n"; indent(out, col_number-1) << "^\n" << msg << "\n\n" - << resetiosflags(Notify::get_literal_flag()) << flush; + << std::resetiosflags(Notify::get_literal_flag()) << std::flush; } error_count++; } @@ -1088,11 +1088,11 @@ eggyywarning(const string &msg) { } out << " at line " << line_number << ", column " << col_number << ":\n" - << setiosflags(Notify::get_literal_flag()) + << std::setiosflags(Notify::get_literal_flag()) << current_line << "\n"; indent(out, col_number-1) << "^\n" << msg << "\n\n" - << resetiosflags(Notify::get_literal_flag()) << flush; + << std::resetiosflags(Notify::get_literal_flag()) << std::flush; } warning_count++; } @@ -1215,7 +1215,7 @@ eat_c_comment() { ostringstream errmsg; errmsg << "This comment contains a nested /* symbol at line " << line << ", column " << col-1 << "--possibly unclosed?" - << ends; + << std::ends; eggyywarning(errmsg); } last_c = c; diff --git a/panda/src/egg/lexer.lxx b/panda/src/egg/lexer.lxx index 1ce4a0006e..c1294a8ec7 100644 --- a/panda/src/egg/lexer.lxx +++ b/panda/src/egg/lexer.lxx @@ -117,11 +117,11 @@ eggyyerror(const string &msg) { } out << " at line " << line_number << ", column " << col_number << ":\n" - << setiosflags(Notify::get_literal_flag()) + << std::setiosflags(Notify::get_literal_flag()) << current_line << "\n"; indent(out, col_number-1) << "^\n" << msg << "\n\n" - << resetiosflags(Notify::get_literal_flag()) << flush; + << std::resetiosflags(Notify::get_literal_flag()) << std::flush; } error_count++; } @@ -143,11 +143,11 @@ eggyywarning(const string &msg) { } out << " at line " << line_number << ", column " << col_number << ":\n" - << setiosflags(Notify::get_literal_flag()) + << std::setiosflags(Notify::get_literal_flag()) << current_line << "\n"; indent(out, col_number-1) << "^\n" << msg << "\n\n" - << resetiosflags(Notify::get_literal_flag()) << flush; + << std::resetiosflags(Notify::get_literal_flag()) << std::flush; } warning_count++; } @@ -270,7 +270,7 @@ eat_c_comment() { ostringstream errmsg; errmsg << "This comment contains a nested /* symbol at line " << line << ", column " << col-1 << "--possibly unclosed?" - << ends; + << std::ends; eggyywarning(errmsg); } last_c = c; diff --git a/panda/src/egg/parser.cxx.prebuilt b/panda/src/egg/parser.cxx.prebuilt index 7791e8de4a..b25f0abf32 100644 --- a/panda/src/egg/parser.cxx.prebuilt +++ b/panda/src/egg/parser.cxx.prebuilt @@ -3137,14 +3137,14 @@ yyreduce: if (vertex_index < 0) { ostringstream errmsg; errmsg << "Ignoring invalid vertex index " << vertex_index - << " in vertex pool " << pool->get_name() << ends; + << " in vertex pool " << pool->get_name() << std::ends; eggyywarning(errmsg); vertex_index = -1; } else if (pool->has_vertex(vertex_index)) { ostringstream errmsg; errmsg << "Ignoring duplicate vertex index " << vertex_index - << " in vertex pool " << pool->get_name() << ends; + << " in vertex pool " << pool->get_name() << std::ends; eggyywarning(errmsg); vertex_index = -1; } @@ -4055,7 +4055,7 @@ yyreduce: if (vertex == NULL) { ostringstream errmsg; errmsg << "No vertex " << index << " in pool " << pool->get_name() - << ends; + << std::ends; eggyyerror(errmsg); } else { group->ref_vertex(vertex, membership); @@ -4659,7 +4659,7 @@ yyreduce: if (vertex == NULL) { ostringstream errmsg; errmsg << "No vertex " << index << " in pool " << pool->get_name() - << ends; + << std::ends; eggyyerror(errmsg); } else { prim->add_vertex(vertex); diff --git a/panda/src/egg/parser.yxx b/panda/src/egg/parser.yxx index 02e83f18ec..ab864d92d6 100644 --- a/panda/src/egg/parser.yxx +++ b/panda/src/egg/parser.yxx @@ -971,14 +971,14 @@ vertex: if (vertex_index < 0) { ostringstream errmsg; errmsg << "Ignoring invalid vertex index " << vertex_index - << " in vertex pool " << pool->get_name() << ends; + << " in vertex pool " << pool->get_name() << std::ends; eggyywarning(errmsg); vertex_index = -1; } else if (pool->has_vertex(vertex_index)) { ostringstream errmsg; errmsg << "Ignoring duplicate vertex index " << vertex_index - << " in vertex pool " << pool->get_name() << ends; + << " in vertex pool " << pool->get_name() << std::ends; eggyywarning(errmsg); vertex_index = -1; } @@ -1797,7 +1797,7 @@ group_vertex_ref: if (vertex == NULL) { ostringstream errmsg; errmsg << "No vertex " << index << " in pool " << pool->get_name() - << ends; + << std::ends; eggyyerror(errmsg); } else { group->ref_vertex(vertex, membership); @@ -2477,7 +2477,7 @@ primitive_vertex_ref: if (vertex == NULL) { ostringstream errmsg; errmsg << "No vertex " << index << " in pool " << pool->get_name() - << ends; + << std::ends; eggyyerror(errmsg); } else { prim->add_vertex(vertex); diff --git a/panda/src/event/asyncFuture.I b/panda/src/event/asyncFuture.I index 44fb0a8247..960ce56b49 100644 --- a/panda/src/event/asyncFuture.I +++ b/panda/src/event/asyncFuture.I @@ -89,7 +89,7 @@ get_result(TypedObject *&ptr, ReferenceCount *&ref_ptr) const { * Sets this future's result. Can only be called if done() returns false. */ INLINE void AsyncFuture:: -set_result(nullptr_t) { +set_result(std::nullptr_t) { set_result(nullptr, nullptr); } diff --git a/panda/src/event/asyncFuture.h b/panda/src/event/asyncFuture.h index 18d5b773f1..5349ced637 100644 --- a/panda/src/event/asyncFuture.h +++ b/panda/src/event/asyncFuture.h @@ -83,7 +83,7 @@ PUBLISHED: BLOCKING void wait(); BLOCKING void wait(double timeout); - INLINE void set_result(nullptr_t); + INLINE void set_result(std::nullptr_t); INLINE void set_result(TypedObject *result); INLINE void set_result(TypedReferenceCount *result); INLINE void set_result(TypedWritableReferenceCount *result); diff --git a/panda/src/event/eventParameter.h b/panda/src/event/eventParameter.h index 24ea3ec1e2..8519c3c4d6 100644 --- a/panda/src/event/eventParameter.h +++ b/panda/src/event/eventParameter.h @@ -35,7 +35,7 @@ class EXPCL_PANDA_EVENT EventParameter { PUBLISHED: INLINE EventParameter() = default; - INLINE EventParameter(nullptr_t) {}; + INLINE EventParameter(std::nullptr_t) {}; INLINE EventParameter(const TypedWritableReferenceCount *ptr); INLINE EventParameter(const TypedReferenceCount *ptr); INLINE EventParameter(int value); diff --git a/panda/src/express/hashVal.cxx b/panda/src/express/hashVal.cxx index aa08714668..02065e1a5b 100644 --- a/panda/src/express/hashVal.cxx +++ b/panda/src/express/hashVal.cxx @@ -39,7 +39,7 @@ output_hex(ostream &out) const { */ void HashVal:: input_hex(istream &in) { - in >> ws; + in >> std::ws; char buffer[32]; size_t i = 0; int ch = in.get(); diff --git a/panda/src/express/make_ca_bundle.cxx b/panda/src/express/make_ca_bundle.cxx index 0794312de1..bc57eb97d8 100644 --- a/panda/src/express/make_ca_bundle.cxx +++ b/panda/src/express/make_ca_bundle.cxx @@ -70,7 +70,7 @@ main(int argc, char *argv[]) { // Now write the data to the .c file, in a compilable form, similar to // bin2c. - ofstream out; + std::ofstream out; Filename target = Filename::text_filename(string(target_filename)); if (!target.open_write(out)) { cerr << "Couldn't open " << target_filename << " for writing.\n"; diff --git a/panda/src/express/memoryUsage.h b/panda/src/express/memoryUsage.h index 9742348cac..cd72581704 100644 --- a/panda/src/express/memoryUsage.h +++ b/panda/src/express/memoryUsage.h @@ -156,12 +156,12 @@ private: * one pointer or the other. We don't store an entry for an object's * TypedObject pointer. */ - typedef map Table; + typedef std::map Table; Table _table; // This table indexes the individual MemoryInfo objects, for unique // iteration. - typedef set InfoSet; + typedef std::set InfoSet; InfoSet _info_set; bool _info_set_dirty; diff --git a/panda/src/express/multifile.cxx b/panda/src/express/multifile.cxx index 0bedba8909..2ae60892d4 100644 --- a/panda/src/express/multifile.cxx +++ b/panda/src/express/multifile.cxx @@ -1296,7 +1296,7 @@ repack() { } _removed_subfiles.clear(); _new_subfiles.clear(); - copy(_subfiles.begin(), _subfiles.end(), back_inserter(_new_subfiles)); + std::copy(_subfiles.begin(), _subfiles.end(), std::back_inserter(_new_subfiles)); _next_index = 0; _last_index = 0; _last_data_byte = 0; diff --git a/panda/src/express/ordered_vector.I b/panda/src/express/ordered_vector.I index 287998b85c..4f0d5082f0 100644 --- a/panda/src/express/ordered_vector.I +++ b/panda/src/express/ordered_vector.I @@ -601,7 +601,7 @@ template INLINE void ordered_vector:: sort_nonunique() { TAU_PROFILE("ordered_vector::sort_nonunique()", " ", TAU_USER); - stable_sort(begin(), end(), _compare); + std::stable_sort(begin(), end(), _compare); } /** diff --git a/panda/src/express/profileTimer.cxx b/panda/src/express/profileTimer.cxx index 41d1ac8f89..ef571fc929 100644 --- a/panda/src/express/profileTimer.cxx +++ b/panda/src/express/profileTimer.cxx @@ -13,8 +13,6 @@ #include "pmap.h" -using namespace std; - // See ProfileTimer.h for documentation. @@ -120,13 +118,13 @@ consolidateTo(ostream &out) const { { pmap::const_iterator i=entries.begin(); for (;i!=entries.end(); ++i) { - out << " " << setw(50) << i->first << ": " - << setiosflags(ios::fixed) << setprecision(6) << setw(10) << i->second << "\n"; + out << " " << std::setw(50) << i->first << ": " + << std::setiosflags(std::ios::fixed) << std::setprecision(6) << std::setw(10) << i->second << "\n"; total+=i->second; } } out << "\n [Total Time: " - << setiosflags(ios::fixed) << setprecision(6) << total + << std::setiosflags(std::ios::fixed) << std::setprecision(6) << total << " seconds]\n" << "-------------------------------------------------------------------\n"; out << endl; @@ -150,12 +148,12 @@ printTo(ostream &out) const { int i; for (i=0; i<_entryCount; ++i) { TimerEntry& te=_entries[i]; - out << " " << setw(50) << te._tag << ": " - << setiosflags(ios::fixed) << setprecision(6) << setw(10) << te._time << "\n"; + out << " " << std::setw(50) << te._tag << ": " + << std::setiosflags(std::ios::fixed) << std::setprecision(6) << std::setw(10) << te._time << "\n"; total+=te._time; } out << "\n [Total Time: " - << setiosflags(ios::fixed) << setprecision(6) << total + << std::setiosflags(std::ios::fixed) << std::setprecision(6) << total << " seconds]\n" << "-------------------------------------------------------------------\n"; out << endl; diff --git a/panda/src/express/virtualFile.cxx b/panda/src/express/virtualFile.cxx index 1d12b7f250..eb010f2806 100644 --- a/panda/src/express/virtualFile.cxx +++ b/panda/src/express/virtualFile.cxx @@ -108,8 +108,8 @@ scan_directory() const { // Copy the set of nested mount points to a sorted list so we can search it // quickly. ov_set mount_points; - copy(mount_points_flat.begin(), mount_points_flat.end(), - back_inserter(mount_points)); + std::copy(mount_points_flat.begin(), mount_points_flat.end(), + std::back_inserter(mount_points)); mount_points.sort(); diff --git a/panda/src/express/virtualFileMountSystem.cxx b/panda/src/express/virtualFileMountSystem.cxx index ce201712b2..ef9c4dcaf5 100644 --- a/panda/src/express/virtualFileMountSystem.cxx +++ b/panda/src/express/virtualFileMountSystem.cxx @@ -49,7 +49,7 @@ bool VirtualFileMountSystem:: create_file(const Filename &file) { Filename pathname(_physical_filename, file); pathname.set_binary(); - ofstream stream; + std::ofstream stream; return pathname.open_write(stream, false); } diff --git a/panda/src/express/weakReferenceList.cxx b/panda/src/express/weakReferenceList.cxx index f9e92d6009..0534556d7a 100644 --- a/panda/src/express/weakReferenceList.cxx +++ b/panda/src/express/weakReferenceList.cxx @@ -47,7 +47,7 @@ add_callback(WeakPointerCallback *callback, void *data) { // have been deleted in the meantime. bool deleted = was_deleted(); if (!deleted) { - _callbacks.insert(make_pair(callback, data)); + _callbacks.insert(std::make_pair(callback, data)); } _lock.unlock(); diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 27fabc899e..6c756631e2 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -2801,7 +2801,7 @@ glsl_report_shader_errors(GLuint shader, Shader::ShaderType type, bool fatal) { // instead of source indices. istringstream log(info_log); string line; - while (getline(log, line)) { + while (std::getline(log, line)) { int fileno, lineno, colno; int prefixlen = 0; diff --git a/panda/src/gobj/geomTriangles.cxx b/panda/src/gobj/geomTriangles.cxx index a6e3b9480f..fa24ce761a 100644 --- a/panda/src/gobj/geomTriangles.cxx +++ b/panda/src/gobj/geomTriangles.cxx @@ -73,6 +73,8 @@ get_primitive_type() const { */ CPT(GeomPrimitive) GeomTriangles:: make_adjacency() const { + using std::make_pair; + Thread *current_thread = Thread::get_current_thread(); PT(GeomTrianglesAdjacency) adj = new GeomTrianglesAdjacency(get_usage_hint()); diff --git a/panda/src/gobj/geomTristrips.cxx b/panda/src/gobj/geomTristrips.cxx index ae7bf0bc25..01f97e8bee 100644 --- a/panda/src/gobj/geomTristrips.cxx +++ b/panda/src/gobj/geomTristrips.cxx @@ -87,6 +87,8 @@ get_geom_rendering() const { */ CPT(GeomPrimitive) GeomTristrips:: make_adjacency() const { + using std::make_pair; + Thread *current_thread = Thread::get_current_thread(); PT(GeomTristripsAdjacency) adj = new GeomTristripsAdjacency(get_usage_hint()); CPTA_int ends = get_ends(); diff --git a/panda/src/gobj/internalName_ext.cxx b/panda/src/gobj/internalName_ext.cxx index b98bcd9c12..0c157f2541 100644 --- a/panda/src/gobj/internalName_ext.cxx +++ b/panda/src/gobj/internalName_ext.cxx @@ -73,7 +73,7 @@ make(PyStringObject *str) { Py_INCREF(str); iname->ref(); - InternalName::_py_intern_table.insert(make_pair((PyObject *)str, iname.p())); + InternalName::_py_intern_table.insert(std::make_pair((PyObject *)str, iname.p())); return iname.p(); } diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 94c90c644d..834757a4d1 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -2575,7 +2575,7 @@ r_preprocess_source(ostream &out, const Filename &fn, int ext_google_line = 0; bool had_include = false; int lineno = 0; - while (getline(*source, line)) { + while (std::getline(*source, line)) { ++lineno; if (line.empty()) { @@ -2589,7 +2589,7 @@ r_preprocess_source(ostream &out, const Filename &fn, line.resize(line.size() - 1); string line2; - if (getline(*source, line2)) { + if (std::getline(*source, line2)) { line += line2; out.put('\n'); ++lineno; @@ -2618,7 +2618,7 @@ r_preprocess_source(ostream &out, const Filename &fn, size_t block_end = line2.find("*/"); while (block_end == string::npos) { // Didn't find it - look in the next line. - if (getline(*source, line2)) { + if (std::getline(*source, line2)) { out.put('\n'); ++lineno; block_end = line2.find("*/"); diff --git a/panda/src/net/datagram_ui.cxx b/panda/src/net/datagram_ui.cxx index fb5fc1a958..fa9879bf86 100644 --- a/panda/src/net/datagram_ui.cxx +++ b/panda/src/net/datagram_ui.cxx @@ -31,8 +31,8 @@ operator >> (istream &in, NetDatagram &datagram) { datagram.clear(); // First, read a line of text. - string line; - getline(in, line); + std::string line; + std::getline(in, line); // Now parse the text. size_t p = 0; @@ -74,7 +74,7 @@ operator >> (istream &in, NetDatagram &datagram) { while (p < line.length() && line[p] != '"') { p++; } - string str = line.substr(start, p - start); + std::string str = line.substr(start, p - start); datagram.add_int8(DE_string); datagram.add_string(str); p++; @@ -85,7 +85,7 @@ operator >> (istream &in, NetDatagram &datagram) { while (p < line.length() && !isspace(line[p])) { p++; } - string str = line.substr(start, p - start); + std::string str = line.substr(start, p - start); datagram.add_int8(DE_string); datagram.add_string(str); } diff --git a/panda/src/net/test_raw_server.cxx b/panda/src/net/test_raw_server.cxx index 7811fdd446..aeec9b0aee 100644 --- a/panda/src/net/test_raw_server.cxx +++ b/panda/src/net/test_raw_server.cxx @@ -84,7 +84,7 @@ main(int argc, char *argv[]) { if (reader.get_data(datagram)) { string data = datagram.get_message(); nout.write(data.data(), data.length()); - nout << flush; + nout << std::flush; Clients::iterator ci; for (ci = clients.begin(); ci != clients.end(); ++ci) { diff --git a/panda/src/pgraph/clipPlaneAttrib.cxx b/panda/src/pgraph/clipPlaneAttrib.cxx index 726b5472b7..0e37f618a5 100644 --- a/panda/src/pgraph/clipPlaneAttrib.cxx +++ b/panda/src/pgraph/clipPlaneAttrib.cxx @@ -505,8 +505,8 @@ compose_off(const RenderAttrib *other) const { // Create a new ClipPlaneAttrib that will hold the result. ClipPlaneAttrib *new_attrib = new ClipPlaneAttrib; - back_insert_iterator result = - back_inserter(new_attrib->_on_planes); + std::back_insert_iterator result = + std::back_inserter(new_attrib->_on_planes); while (ai != _off_planes.end() && bi != ta->_off_planes.end()) { @@ -717,8 +717,8 @@ compose_impl(const RenderAttrib *other) const { // Create a new ClipPlaneAttrib that will hold the result. ClipPlaneAttrib *new_attrib = new ClipPlaneAttrib; - back_insert_iterator result = - back_inserter(new_attrib->_on_planes); + std::back_insert_iterator result = + std::back_inserter(new_attrib->_on_planes); while (ai != _on_planes.end() && bi != ta->_on_planes.end() && diff --git a/panda/src/pgraph/cullableObject.cxx b/panda/src/pgraph/cullableObject.cxx index 8c8b24f1c0..31ebfb2484 100644 --- a/panda/src/pgraph/cullableObject.cxx +++ b/panda/src/pgraph/cullableObject.cxx @@ -545,7 +545,7 @@ munge_points_to_quads(const CullTraverser *traverser, bool force) { // Now sort the points in order from back-to-front so they will render // properly with transparency, at least with each other. - sort(vertices, vertices_end, SortPoints(points)); + std::sort(vertices, vertices_end, SortPoints(points)); // Go through the points, now in sorted order, and generate a pair of // triangles for each one. We generate indexed triangles instead of diff --git a/panda/src/pgraph/lightAttrib.cxx b/panda/src/pgraph/lightAttrib.cxx index 40014c53ee..fea2094a23 100644 --- a/panda/src/pgraph/lightAttrib.cxx +++ b/panda/src/pgraph/lightAttrib.cxx @@ -734,8 +734,8 @@ compose_impl(const RenderAttrib *other) const { // Create a new LightAttrib that will hold the result. LightAttrib *new_attrib = new LightAttrib; - back_insert_iterator result = - back_inserter(new_attrib->_on_lights); + std::back_insert_iterator result = + std::back_inserter(new_attrib->_on_lights); while (ai != _on_lights.end() && bi != ta->_on_lights.end() && diff --git a/panda/src/pgraph/renderAttrib.h b/panda/src/pgraph/renderAttrib.h index b506d64841..514a90b7d4 100644 --- a/panda/src/pgraph/renderAttrib.h +++ b/panda/src/pgraph/renderAttrib.h @@ -185,7 +185,7 @@ public: private: // This mutex protects _attribs. static LightReMutex *_attribs_lock; - typedef SimpleHashMap > Attribs; + typedef SimpleHashMap > Attribs; static Attribs *_attribs; int _saved_entry; diff --git a/panda/src/pgraph/renderAttribRegistry.cxx b/panda/src/pgraph/renderAttribRegistry.cxx index 4c27e4c0a7..ba3cc9a3b6 100644 --- a/panda/src/pgraph/renderAttribRegistry.cxx +++ b/panda/src/pgraph/renderAttribRegistry.cxx @@ -105,7 +105,7 @@ register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib) { _registry.push_back(RegistryNode(type_handle, sort, default_attrib)); _sorted_slots.push_back(slot); - ::sort(_sorted_slots.begin(), _sorted_slots.end(), SortSlots(this)); + std::sort(_sorted_slots.begin(), _sorted_slots.end(), SortSlots(this)); return slot; } @@ -123,7 +123,7 @@ set_slot_sort(int slot, int sort) { for (int i = 1; i < (int)_registry.size(); ++i) { _sorted_slots.push_back(i); } - ::sort(_sorted_slots.begin(), _sorted_slots.end(), SortSlots(this)); + std::sort(_sorted_slots.begin(), _sorted_slots.end(), SortSlots(this)); } /** diff --git a/panda/src/pgraph/renderEffects.cxx b/panda/src/pgraph/renderEffects.cxx index aaa81773ce..139eb9e00f 100644 --- a/panda/src/pgraph/renderEffects.cxx +++ b/panda/src/pgraph/renderEffects.cxx @@ -123,8 +123,8 @@ xform(const LMatrix4 &mat) const { } RenderEffects *new_state = new RenderEffects; - back_insert_iterator result = - back_inserter(new_state->_effects); + std::back_insert_iterator result = + std::back_inserter(new_state->_effects); Effects::const_iterator ai; for (ai = _effects.begin(); ai != _effects.end(); ++ai) { @@ -251,8 +251,8 @@ make(const RenderEffect *effect1, CPT(RenderEffects) RenderEffects:: add_effect(const RenderEffect *effect) const { RenderEffects *new_state = new RenderEffects; - back_insert_iterator result = - back_inserter(new_state->_effects); + std::back_insert_iterator result = + std::back_inserter(new_state->_effects); Effect new_effect(effect); Effects::const_iterator ai = _effects.begin(); @@ -288,8 +288,8 @@ add_effect(const RenderEffect *effect) const { CPT(RenderEffects) RenderEffects:: remove_effect(TypeHandle type) const { RenderEffects *new_state = new RenderEffects; - back_insert_iterator result = - back_inserter(new_state->_effects); + std::back_insert_iterator result = + std::back_inserter(new_state->_effects); Effects::const_iterator ai = _effects.begin(); diff --git a/panda/src/pgraph/renderState.h b/panda/src/pgraph/renderState.h index 433582fd2c..053f8cc365 100644 --- a/panda/src/pgraph/renderState.h +++ b/panda/src/pgraph/renderState.h @@ -227,7 +227,7 @@ private: // cache, which is encoded in _composition_cache and // _invert_composition_cache. static LightReMutex *_states_lock; - typedef SimpleHashMap > States; + typedef SimpleHashMap > States; static States *_states; static const RenderState *_empty_state; diff --git a/panda/src/pgraph/textureStageCollection.cxx b/panda/src/pgraph/textureStageCollection.cxx index 4f707efe63..42d6320b33 100644 --- a/panda/src/pgraph/textureStageCollection.cxx +++ b/panda/src/pgraph/textureStageCollection.cxx @@ -231,8 +231,8 @@ size() const { */ void TextureStageCollection:: sort() { - ::sort(_texture_stages.begin(), _texture_stages.end(), - CompareTextureStageSort()); + std::sort(_texture_stages.begin(), _texture_stages.end(), + CompareTextureStageSort()); } /** diff --git a/panda/src/pgraph/transformState.h b/panda/src/pgraph/transformState.h index 5edd8985d6..e204402489 100644 --- a/panda/src/pgraph/transformState.h +++ b/panda/src/pgraph/transformState.h @@ -252,7 +252,7 @@ private: // cache, which is encoded in _composition_cache and // _invert_composition_cache. static LightReMutex *_states_lock; - typedef SimpleHashMap > States; + typedef SimpleHashMap > States; static States *_states; static CPT(TransformState) _identity_state; static CPT(TransformState) _invalid_state; diff --git a/panda/src/pipeline/test_diners.cxx b/panda/src/pipeline/test_diners.cxx index 0a8f01e484..27976e3ea5 100644 --- a/panda/src/pipeline/test_diners.cxx +++ b/panda/src/pipeline/test_diners.cxx @@ -42,7 +42,7 @@ static double random_f(double max) return max * (double)i / (double)RAND_MAX; } -#define PRINTMSG(x) { MutexHolder l(Mutex::_notify_mutex); x << flush; } +#define PRINTMSG(x) { MutexHolder l(Mutex::_notify_mutex); x << std::flush; } // n philosophers sharing n chopsticks. Philosophers are poor folk and can't // afford luxuries like 2 chopsticks per person. diff --git a/panda/src/pipeline/test_threaddata.cxx b/panda/src/pipeline/test_threaddata.cxx index ebf6698216..2a397ac5c5 100644 --- a/panda/src/pipeline/test_threaddata.cxx +++ b/panda/src/pipeline/test_threaddata.cxx @@ -48,7 +48,7 @@ thread_main() { MutexHolder holder(cout_mutex); cout << "Running thread " << get_name() << " with parameter " << _parameter - << ", i = " << i << "\n" << flush; + << ", i = " << i << "\n" << std::flush; Thread *thread = get_current_thread(); nassertv(thread == this); } diff --git a/panda/src/pnmimage/pnmImage.cxx b/panda/src/pnmimage/pnmImage.cxx index d4fed72b3c..6f9daaf000 100644 --- a/panda/src/pnmimage/pnmImage.cxx +++ b/panda/src/pnmimage/pnmImage.cxx @@ -1918,7 +1918,7 @@ make_histogram(PNMImage::Histogram &histogram) { pixels.push_back(PixelSpecCount((*hi).first, (*hi).second)); } } - ::sort(pixels.begin(), pixels.end()); + std::sort(pixels.begin(), pixels.end()); histogram.swap(pixels, hist_map); } diff --git a/panda/src/pstatclient/pStatFrameData.cxx b/panda/src/pstatclient/pStatFrameData.cxx index f15f6bc61e..9c58f8d29d 100644 --- a/panda/src/pstatclient/pStatFrameData.cxx +++ b/panda/src/pstatclient/pStatFrameData.cxx @@ -25,7 +25,7 @@ */ void PStatFrameData:: sort_time() { - stable_sort(_time_data.begin(), _time_data.end()); + std::stable_sort(_time_data.begin(), _time_data.end()); } /** diff --git a/panda/src/putil/datagramInputFile.I b/panda/src/putil/datagramInputFile.I index c956fef4ac..152aa3505e 100644 --- a/panda/src/putil/datagramInputFile.I +++ b/panda/src/putil/datagramInputFile.I @@ -45,7 +45,7 @@ open(const Filename &filename) { */ INLINE istream &DatagramInputFile:: get_stream() { - static ifstream null_stream; + static std::ifstream null_stream; nassertr(_in != NULL, null_stream); return *_in; } diff --git a/panda/src/putil/datagramOutputFile.I b/panda/src/putil/datagramOutputFile.I index b3dbe95c9c..54167ae967 100644 --- a/panda/src/putil/datagramOutputFile.I +++ b/panda/src/putil/datagramOutputFile.I @@ -44,7 +44,7 @@ open(const Filename &filename) { */ INLINE ostream &DatagramOutputFile:: get_stream() { - static ofstream null_stream; + static std::ofstream null_stream; nassertr(_out != NULL, null_stream); return *_out; } diff --git a/panda/src/putil/simpleHashMap.h b/panda/src/putil/simpleHashMap.h index 6d08de5554..cd759f6cbd 100644 --- a/panda/src/putil/simpleHashMap.h +++ b/panda/src/putil/simpleHashMap.h @@ -52,16 +52,16 @@ private: * values. This allows effectively using SimpleHashMap as a set. */ template -class SimpleKeyValuePair { +class SimpleKeyValuePair { public: - INLINE SimpleKeyValuePair(const Key &key, nullptr_t data) : + INLINE SimpleKeyValuePair(const Key &key, std::nullptr_t data) : _key(key) {} Key _key; - ALWAYS_INLINE constexpr static nullptr_t get_data() { return nullptr; } - ALWAYS_INLINE constexpr static nullptr_t modify_data() { return nullptr; } - ALWAYS_INLINE static void set_data(nullptr_t) {} + ALWAYS_INLINE constexpr static std::nullptr_t get_data() { return nullptr; } + ALWAYS_INLINE constexpr static std::nullptr_t modify_data() { return nullptr; } + ALWAYS_INLINE static void set_data(std::nullptr_t) {} }; /** diff --git a/panda/src/speedtree/speedTreeNode.cxx b/panda/src/speedtree/speedTreeNode.cxx index c455e848f5..f3b9eb469d 100644 --- a/panda/src/speedtree/speedTreeNode.cxx +++ b/panda/src/speedtree/speedTreeNode.cxx @@ -505,7 +505,7 @@ add_from_stf(istream &in, const Filename &pathname, } // Consume any whitespace at the end of the file. - in >> ws; + in >> std::ws; if (!in.eof()) { // If we didn't read all the way to end-of-file, there was an error. diff --git a/panda/src/speedtree/stBasicTerrain.cxx b/panda/src/speedtree/stBasicTerrain.cxx index 5ee746dcbf..9b84e86ee8 100644 --- a/panda/src/speedtree/stBasicTerrain.cxx +++ b/panda/src/speedtree/stBasicTerrain.cxx @@ -191,7 +191,7 @@ setup_terrain(istream &in, const Filename &pathname) { } // Consume any whitespace at the end of the file. - in >> ws; + in >> std::ws; if (!in.eof()) { // If we didn't read all the way to end-of-file, there was an error. diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index 767dd9a4eb..d215d0e1aa 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -2825,7 +2825,7 @@ static HCURSOR get_cursor(const Filename &filename); const WinGraphicsWindow::WindowClass &WinGraphicsWindow:: register_window_class(const WindowProperties &props) { WindowClass wcreg(props); - wostringstream wclass_name; + std::wostringstream wclass_name; wclass_name << L"WinGraphicsWindow" << _window_class_index; wcreg._name = wclass_name.str(); diff --git a/pandatool/src/bam/ptsToBam.cxx b/pandatool/src/bam/ptsToBam.cxx index 4db96663ca..941b291105 100644 --- a/pandatool/src/bam/ptsToBam.cxx +++ b/pandatool/src/bam/ptsToBam.cxx @@ -77,7 +77,7 @@ run() { _decimated_point_number = 0.0; _num_vdatas = 0; string line; - while (getline(pts, line)) { + while (std::getline(pts, line)) { process_line(line); } close_vertex_data(); @@ -132,7 +132,7 @@ process_line(const string &line) { _line_number++; if (_line_number % 1000000 == 0) { - cerr << "." << flush; + std::cerr << "." << std::flush; } if (line.empty() || !isdigit(line[0])) { diff --git a/pandatool/src/cvscopy/cvsCopy.cxx b/pandatool/src/cvscopy/cvsCopy.cxx index 1b8b43449a..fdb1d6b85e 100644 --- a/pandatool/src/cvscopy/cvsCopy.cxx +++ b/pandatool/src/cvscopy/cvsCopy.cxx @@ -264,7 +264,7 @@ verify_binary_file(Filename source, Filename dest) { source.set_binary(); dest.set_binary(); - ifstream s, d; + std::ifstream s, d; if (!source.open_read(s)) { return false; } @@ -313,8 +313,8 @@ copy_binary_file(Filename source, Filename dest) { source.set_binary(); dest.set_binary(); - ifstream in; - ofstream out; + std::ifstream in; + std::ofstream out; if (!source.open_read(in)) { nout << "Cannot read " << source << "\n"; return false; @@ -475,11 +475,11 @@ scan_for_root(const string &dirname) { */ string CVSCopy:: prompt(const string &message) { - nout << flush; + nout << std::flush; while (true) { - cerr << message << flush; - string response; - getline(cin, response); + std::cerr << message << std::flush; + std::string response; + std::getline(std::cin, response); // Remove leading and trailing whitespace. size_t p = 0; diff --git a/pandatool/src/cvscopy/cvsSourceTree.cxx b/pandatool/src/cvscopy/cvsSourceTree.cxx index 5fea69e430..333c4991ad 100644 --- a/pandatool/src/cvscopy/cvsSourceTree.cxx +++ b/pandatool/src/cvscopy/cvsSourceTree.cxx @@ -438,11 +438,11 @@ ask_any(const string &basename, */ string CVSSourceTree:: prompt(const string &message) { - nout << flush; + nout << std::flush; while (true) { - cerr << message << flush; - string response; - getline(cin, response); + cerr << message << std::flush; + std::string response; + std::getline(std::cin, response); // Remove leading and trailing whitespace. size_t p = 0; diff --git a/pandatool/src/dxf/dxfFile.cxx b/pandatool/src/dxf/dxfFile.cxx index b716ea11ba..35772c625f 100644 --- a/pandatool/src/dxf/dxfFile.cxx +++ b/pandatool/src/dxf/dxfFile.cxx @@ -552,7 +552,7 @@ get_group() { in.get(); } - getline(in, _string); + std::getline(in, _string); _string = trim_right(_string); if (!in) { diff --git a/pandatool/src/egg-palettize/eggPalettize.cxx b/pandatool/src/egg-palettize/eggPalettize.cxx index 200b62e798..d01087a9ac 100644 --- a/pandatool/src/egg-palettize/eggPalettize.cxx +++ b/pandatool/src/egg-palettize/eggPalettize.cxx @@ -701,7 +701,7 @@ run() { } else { _txa_filename.set_text(); - ifstream txa_file; + std::ifstream txa_file; if (!_txa_filename.open_read(txa_file)) { nout << "Unable to open " << _txa_filename << "\n"; exit(1); diff --git a/pandatool/src/egg-qtess/qtessInputFile.cxx b/pandatool/src/egg-qtess/qtessInputFile.cxx index 647f0b8471..850ad638f9 100644 --- a/pandatool/src/egg-qtess/qtessInputFile.cxx +++ b/pandatool/src/egg-qtess/qtessInputFile.cxx @@ -30,7 +30,7 @@ read(const Filename &filename) { _filename = Filename::text_filename(filename); _entries.clear(); - ifstream input; + std::ifstream input; if (!_filename.open_read(input)) { qtess_cat.error() << "Unable to open input file " << _filename << "\n"; @@ -41,7 +41,7 @@ read(const Filename &filename) { int line_number = 0; string line; - while (getline(input, line)) { + while (std::getline(input, line)) { line_number++; // Eliminate comments. We have to scan the line repeatedly until we find diff --git a/pandatool/src/eggbase/eggMultiFilter.cxx b/pandatool/src/eggbase/eggMultiFilter.cxx index 8b8fd61a15..1191d55dea 100644 --- a/pandatool/src/eggbase/eggMultiFilter.cxx +++ b/pandatool/src/eggbase/eggMultiFilter.cxx @@ -76,14 +76,14 @@ handle_args(ProgramBase::Args &args) { nout << "Populating args from input file: " << _input_filename << "\n"; // Makes sure the file is set is_text _filename = Filename::text_filename(_input_filename); - ifstream input; + std::ifstream input; if (!_filename.open_read(input)) { nout << "Error opening file: " << _input_filename << "\n"; return false; } string line; // File should be a space-delimited list of egg files - while (getline(input, line, ' ')) { + while (std::getline(input, line, ' ')) { args.push_back(line); } } diff --git a/pandatool/src/eggbase/eggWriter.h b/pandatool/src/eggbase/eggWriter.h index 9ef09fffe6..9037fe7e54 100644 --- a/pandatool/src/eggbase/eggWriter.h +++ b/pandatool/src/eggbase/eggWriter.h @@ -39,7 +39,7 @@ protected: virtual bool post_command_line(); private: - ofstream _output_stream; + std::ofstream _output_stream; }; #endif diff --git a/pandatool/src/flt/fltHeader.cxx b/pandatool/src/flt/fltHeader.cxx index 062afe15fa..3b689fb0fe 100644 --- a/pandatool/src/flt/fltHeader.cxx +++ b/pandatool/src/flt/fltHeader.cxx @@ -237,7 +237,7 @@ FltError FltHeader:: write_flt(Filename filename) { filename.set_binary(); - ofstream out; + std::ofstream out; if (!filename.open_write(out)) { assert(!flt_error_abort); return FE_could_not_open; diff --git a/pandatool/src/flt/fltTexture.cxx b/pandatool/src/flt/fltTexture.cxx index c3c61cf130..ee56205c6f 100644 --- a/pandatool/src/flt/fltTexture.cxx +++ b/pandatool/src/flt/fltTexture.cxx @@ -136,7 +136,7 @@ FltError FltTexture:: read_attr_data() { Filename attr_filename = get_attr_filename(); - ifstream attr; + std::ifstream attr; if (!attr_filename.open_read(attr)) { return FE_could_not_open; } @@ -184,7 +184,7 @@ write_attr_data(Filename attr_filename) const { } attr_filename.set_binary(); - ofstream attr; + std::ofstream attr; if (!attr_filename.open_write(attr)) { return FE_could_not_open; } diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index d661af583b..ed2a22552b 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/pandatool/src/mayaegg/mayaToEggConverter.cxx @@ -675,7 +675,7 @@ convert_char_chan(double start_frame, double end_frame, double frame_inc, } else { // We have to write to cerr instead of mayaegg_cat to allow flushing // without writing a newline. - cerr << "." << flush; + std::cerr << "." << std::flush; } MGlobal::viewFrame(frame); diff --git a/pandatool/src/mayaprogs/blend_test.cxx b/pandatool/src/mayaprogs/blend_test.cxx index cf7e880731..5cbd6d413e 100644 --- a/pandatool/src/mayaprogs/blend_test.cxx +++ b/pandatool/src/mayaprogs/blend_test.cxx @@ -177,7 +177,7 @@ output_vertices(const char *filename, MFnMesh &mesh) { exit(1); } - ofstream file(filename, ios::out | ios::trunc); + std::ofstream file(filename, ios::out | ios::trunc); if (!file) { cerr << "Couldn't open " << filename << " for output.\n"; exit(1); diff --git a/pandatool/src/mayaprogs/normal_test.cxx b/pandatool/src/mayaprogs/normal_test.cxx index e1015f2759..ca1b4638eb 100644 --- a/pandatool/src/mayaprogs/normal_test.cxx +++ b/pandatool/src/mayaprogs/normal_test.cxx @@ -179,7 +179,7 @@ output_vertices(const char *filename, MFnMesh &mesh) { exit(1); } - ofstream file(filename, ios::out | ios::trunc); + std::ofstream file(filename, std::ios::out | std::ios::trunc); if (!file) { cerr << "Couldn't open " << filename << " for output.\n"; exit(1); diff --git a/pandatool/src/miscprogs/binToC.cxx b/pandatool/src/miscprogs/binToC.cxx index 8d1ee2dec8..ba41010a60 100644 --- a/pandatool/src/miscprogs/binToC.cxx +++ b/pandatool/src/miscprogs/binToC.cxx @@ -66,13 +66,13 @@ BinToC() : */ void BinToC:: run() { - ifstream in; + std::ifstream in; if (!_input_filename.open_read(in)) { nout << "Unable to read " << _input_filename << ".\n"; exit(1); } - ostream &out = get_output(); + std::ostream &out = get_output(); string static_keyword; if (_static_table) { static_keyword = "static "; diff --git a/pandatool/src/palettizer/textureImage.cxx b/pandatool/src/palettizer/textureImage.cxx index 54e213ed24..fca1307928 100644 --- a/pandatool/src/palettizer/textureImage.cxx +++ b/pandatool/src/palettizer/textureImage.cxx @@ -90,7 +90,7 @@ assign_groups() { if (_explicitly_assigned_groups.empty()) { // If we have no explicit group assignments, we must consider all the egg // files. - copy(_egg_files.begin(), _egg_files.end(), back_inserter(needed_eggs)); + std::copy(_egg_files.begin(), _egg_files.end(), std::back_inserter(needed_eggs)); } else { // Otherwise, we only need to consider the egg files that don't have any diff --git a/pandatool/src/progbase/programBase.cxx b/pandatool/src/progbase/programBase.cxx index 86a2c17c48..c5440d08f2 100644 --- a/pandatool/src/progbase/programBase.cxx +++ b/pandatool/src/progbase/programBase.cxx @@ -57,7 +57,7 @@ operator () (const Option *a, const Option *b) const { // properly flushed before we exit, if someone calls exit(). It's probably // not necessary, but why not be phobic about it? static void flush_nout() { - nout << flush; + nout << std::flush; } static ConfigVariableInt default_terminal_width diff --git a/pandatool/src/progbase/withOutputFile.h b/pandatool/src/progbase/withOutputFile.h index d77627ffa7..7c4c0f2af7 100644 --- a/pandatool/src/progbase/withOutputFile.h +++ b/pandatool/src/progbase/withOutputFile.h @@ -52,8 +52,8 @@ protected: Filename _output_filename; private: - ofstream _output_stream; - ostream *_output_ptr; + std::ofstream _output_stream; + std::ostream *_output_ptr; bool _owns_output_ptr; }; diff --git a/pandatool/src/softegg/soft2Egg.c b/pandatool/src/softegg/soft2Egg.c index aaad102fb4..9e744b8655 100644 --- a/pandatool/src/softegg/soft2Egg.c +++ b/pandatool/src/softegg/soft2Egg.c @@ -192,10 +192,9 @@ class soft2egg : public EggBase bool has_morph; bool make_pose; - ofstream eggFile; - ofstream animFile; - ofstream texFile; - + std::ofstream eggFile; + std::ofstream animFile; + std::ofstream texFile; }; diff --git a/pandatool/src/softegg/softToEggConverter.cxx b/pandatool/src/softegg/softToEggConverter.cxx index 64d5da3aed..41cd0b66b9 100644 --- a/pandatool/src/softegg/softToEggConverter.cxx +++ b/pandatool/src/softegg/softToEggConverter.cxx @@ -775,7 +775,7 @@ convert_char_chan() { // if (softegg_cat.is_debug()) { softegg_cat.debug(false) softegg_cat.info() << "frame " << time << "\n"; // } else { We have to write to cerr instead of softegg_cat to allow - // flushing without writing a newline. cerr << "." << flush; } + // flushing without writing a newline. std::cerr << "." << std::flush; } // MGlobal::viewFrame(frame); for (i = 0; i < num_nodes; i++) { diff --git a/pandatool/src/softprogs/softCVS.cxx b/pandatool/src/softprogs/softCVS.cxx index 22329eb8c5..a49e8ccde4 100644 --- a/pandatool/src/softprogs/softCVS.cxx +++ b/pandatool/src/softprogs/softCVS.cxx @@ -282,7 +282,7 @@ get_scenes() { Filename file(sf.get_dirname(), sf.get_filename()); file.set_text(); - ifstream in; + std::ifstream in; if (!file.open_read(in)) { nout << "Unable to read " << file << "\n"; } else { @@ -436,7 +436,7 @@ scan_cvs(const string &dirname, pset &cvs_elements) { return false; } - ifstream in; + std::ifstream in; cvs_entries.set_text(); if (!cvs_entries.open_read(in)) { nout << "Unable to read CVS directory.\n"; @@ -444,7 +444,7 @@ scan_cvs(const string &dirname, pset &cvs_elements) { } string line; - getline(in, line); + std::getline(in, line); while (!in.fail() && !in.eof()) { if (!line.empty() && line[0] == '/') { size_t slash = line.find('/', 1); @@ -461,7 +461,7 @@ scan_cvs(const string &dirname, pset &cvs_elements) { } } - getline(in, line); + std::getline(in, line); } return true; diff --git a/pandatool/src/text-stats/textStats.cxx b/pandatool/src/text-stats/textStats.cxx index cc1e2392c1..c5e3c5a11c 100644 --- a/pandatool/src/text-stats/textStats.cxx +++ b/pandatool/src/text-stats/textStats.cxx @@ -87,7 +87,7 @@ run() { nout << "Listening for connections.\n"; if (_got_outputFileName) { - _outFile = new ofstream(_outputFileName.c_str(), ios::out); + _outFile = new std::ofstream(_outputFileName.c_str(), std::ios::out); } else { _outFile = &(nout); } diff --git a/pandatool/src/vrml/vrmlParser.cxx.prebuilt b/pandatool/src/vrml/vrmlParser.cxx.prebuilt index fb95f8075f..6eaddbf170 100644 --- a/pandatool/src/vrml/vrmlParser.cxx.prebuilt +++ b/pandatool/src/vrml/vrmlParser.cxx.prebuilt @@ -106,7 +106,7 @@ // Currently-being-define proto. Prototypes may be nested, so a stack // is needed: -stack< VrmlNodeType*, plist > currentProtoStack; +std::stack > currentProtoStack; // This is used to keep track of which field in which type of node is being // parsed. Field are nested (nodes are contained inside MFNode/SFNode fields) @@ -117,12 +117,12 @@ typedef struct { const VrmlNodeType::NameTypeRec *typeRec; } FieldRec; -stack< FieldRec*, plist > currentField; +std::stack > currentField; // Similarly for the node entries (which contain the actual values for // the fields as they are encountered): -stack< VrmlNode*, plist > currentNode; +std::stack > currentNode; // This is used when the parser knows what kind of token it expects // to get next-- used when parsing field values (whose types are declared diff --git a/pandatool/src/vrml/vrmlParser.yxx b/pandatool/src/vrml/vrmlParser.yxx index 3404f8c3f8..f3984b47fc 100644 --- a/pandatool/src/vrml/vrmlParser.yxx +++ b/pandatool/src/vrml/vrmlParser.yxx @@ -49,7 +49,7 @@ // Currently-being-define proto. Prototypes may be nested, so a stack // is needed: -stack< VrmlNodeType*, plist > currentProtoStack; +std::stack > currentProtoStack; // This is used to keep track of which field in which type of node is being // parsed. Field are nested (nodes are contained inside MFNode/SFNode fields) @@ -60,12 +60,12 @@ typedef struct { const VrmlNodeType::NameTypeRec *typeRec; } FieldRec; -stack< FieldRec*, plist > currentField; +std::stack > currentField; // Similarly for the node entries (which contain the actual values for // the fields as they are encountered): -stack< VrmlNode*, plist > currentNode; +std::stack > currentNode; // This is used when the parser knows what kind of token it expects // to get next-- used when parsing field values (whose types are declared diff --git a/pandatool/src/xfile/xFile.cxx b/pandatool/src/xfile/xFile.cxx index 26791ed403..049fe26780 100644 --- a/pandatool/src/xfile/xFile.cxx +++ b/pandatool/src/xfile/xFile.cxx @@ -123,7 +123,7 @@ read(istream &in, const string &filename) { */ bool XFile:: write(Filename filename) const { - ofstream out; + std::ofstream out; // We actually open the file to write in binary mode, to avoid the MS-DOS // newline characters (since Windows seems to do this too).