From 32e9505eedffe7f98de028513de8a809a366bd98 Mon Sep 17 00:00:00 2001 From: timoore Date: Mon, 2 Jun 2008 21:09:51 +0000 Subject: [PATCH] Clean up header file use of iostream and "using" declarations Replace include with istream, ostream and/or iosfwd as appropriate. Remove using namespace std and using std::foo from header files. --- src/ATCDCL/ATCVoice.hxx | 11 +-- src/ATCDCL/approach.cxx | 5 ++ src/ATCDCL/approach.hxx | 26 +++---- src/ATCDCL/atis.hxx | 19 ++---- src/ATCDCL/ground.hxx | 50 ++++++-------- src/ATCDCL/tower.hxx | 63 +++++++++-------- src/ATCDCL/transmission.cxx | 3 +- src/ATCDCL/transmission.hxx | 32 ++++----- src/ATCDCL/transmissionlist.cxx | 8 +-- src/Cockpit/panel_io.cxx | 2 +- src/Cockpit/panel_io.hxx | 9 +-- src/FDM/JSBSim/input_output/FGXMLElement.cpp | 6 ++ src/FDM/JSBSim/input_output/FGXMLElement.h | 67 ++++++++----------- src/FDM/JSBSim/input_output/FGXMLFileRead.h | 3 +- src/FDM/JSBSim/input_output/FGfdmSocket.cpp | 5 ++ src/FDM/JSBSim/input_output/FGfdmSocket.h | 13 ---- src/FDM/JSBSim/math/FGColumnVector3.cpp | 6 ++ src/FDM/JSBSim/math/FGColumnVector3.h | 18 +---- src/FDM/JSBSim/math/FGCondition.cpp | 7 ++ src/FDM/JSBSim/math/FGCondition.h | 12 ++-- src/FDM/JSBSim/math/FGFunction.cpp | 4 ++ src/FDM/JSBSim/math/FGFunction.h | 2 +- src/FDM/JSBSim/math/FGMatrix33.cpp | 7 +- src/FDM/JSBSim/math/FGMatrix33.h | 23 ++----- src/FDM/JSBSim/models/FGAerodynamics.h | 10 +-- src/FDM/JSBSim/models/FGGroundReactions.cpp | 5 +- src/FDM/JSBSim/models/FGInput.h | 10 --- src/FDM/JSBSim/models/FGLGear.cpp | 8 ++- src/FDM/JSBSim/models/FGMassBalance.h | 2 +- src/FDM/JSBSim/models/FGModel.h | 15 +---- src/FDM/JSBSim/models/FGOutput.cpp | 2 + src/FDM/JSBSim/models/FGOutput.h | 12 ++-- src/FDM/JSBSim/models/FGPropulsion.cpp | 1 + src/FDM/JSBSim/models/FGPropulsion.h | 14 ++-- .../models/flight_control/FGActuator.cpp | 6 +- .../models/flight_control/FGFCSComponent.h | 14 ++-- src/FDM/JSBSim/models/propulsion/FGEngine.cpp | 2 +- src/FDM/LaRCsim/IO360.hxx | 5 -- src/FDM/UIUCModel/uiuc_aircraft.h | 45 ++++++------- src/FDM/UIUCModel/uiuc_engine.cpp | 2 - src/FDM/UIUCModel/uiuc_menu_functions.h | 7 +- src/FDM/UIUCModel/uiuc_warnings_errors.cpp | 4 +- src/FDM/UIUCModel/uiuc_warnings_errors.h | 5 +- src/FDM/YASim/Rotorpart.hpp | 4 +- src/Main/fg_init.cxx | 2 +- src/Main/logger.hxx | 6 +- src/Navaids/fix.hxx | 13 ++-- src/Navaids/navrecord.hxx | 15 ++--- 48 files changed, 258 insertions(+), 352 deletions(-) diff --git a/src/ATCDCL/ATCVoice.hxx b/src/ATCDCL/ATCVoice.hxx index a5ea59394..0bc501c20 100644 --- a/src/ATCDCL/ATCVoice.hxx +++ b/src/ATCDCL/ATCVoice.hxx @@ -25,10 +25,8 @@ #if defined( SG_HAVE_STD_INCLUDES ) || defined( __BORLANDC__ ) || (__APPLE__) # include -# include #else # include -# include #endif #include @@ -41,18 +39,13 @@ SG_USING_STD(map); SG_USING_STD(list); SG_USING_STD(string); -SG_USING_STD(cout); -SG_USING_STD(ios); -SG_USING_STD(ofstream); -SG_USING_STD(ifstream); - struct WordData { unsigned int offset; // Offset of beginning of word sample into raw sound sample unsigned int length; // Byte length of word sample }; -typedef map < string, WordData > atc_word_map_type; +typedef std::map < std::string, WordData > atc_word_map_type; typedef atc_word_map_type::iterator atc_word_map_iterator; typedef atc_word_map_type::const_iterator atc_word_map_const_iterator; @@ -65,7 +58,7 @@ public: // Load the two voice files - one containing the raw sound data (.wav) and one containing the word positions (.vce). // Return true if successful. - bool LoadVoice(const string& voice); + bool LoadVoice(const std::string& voice); // Given a desired message, return a pointer to the data buffer and write the buffer length into len. // Sets dataOK = true if the returned buffer is valid. diff --git a/src/ATCDCL/approach.cxx b/src/ATCDCL/approach.cxx index 44784abf1..296e3446b 100644 --- a/src/ATCDCL/approach.cxx +++ b/src/ATCDCL/approach.cxx @@ -22,6 +22,8 @@ # include #endif +#include + #include "approach.hxx" #include "transmission.hxx" #include "transmissionlist.hxx" @@ -38,6 +40,9 @@ #include +using std::cout; +using std::endl; + //Constructor FGApproach::FGApproach(){ comm1_node = fgGetNode("/instrumentation/comm[0]/frequencies/selected-mhz", true); diff --git a/src/ATCDCL/approach.hxx b/src/ATCDCL/approach.hxx index 9aec71d01..ad6bea6a2 100644 --- a/src/ATCDCL/approach.hxx +++ b/src/ATCDCL/approach.hxx @@ -34,23 +34,15 @@ #include
#ifdef SG_HAVE_STD_INCLUDES -# include -#include +# include #elif defined( SG_HAVE_NATIVE_SGI_COMPILERS ) # include #elif defined( __BORLANDC__ ) # include #else # include -#include #endif -#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS ) -SG_USING_STD(istream); -#endif - -SG_USING_STD(string); - #include "ATC.hxx" #include "transmission.hxx" @@ -67,7 +59,7 @@ const double lfl = 10.0; // length of final leg struct PlaneApp { // variables for plane if it's on the radar - string ident; // indentification of plane + std::string ident; // indentification of plane double lon; // longitude in degrees double lat; // latitude in degrees double alt; // Altitute above sea level in feet @@ -111,7 +103,7 @@ class FGApproach : public FGATC { int bucket; - string active_runway; + std::string active_runway; double active_rw_hdg; double active_rw_lon; double active_rw_lat; @@ -119,7 +111,7 @@ class FGApproach : public FGATC { int num_planes; // number of planes on the stack PlaneApp planes[max_planes]; // Array of planes - string transmission; + std::string transmission; bool first; SGPropertyNode_ptr comm1_node; @@ -138,7 +130,7 @@ class FGApproach : public FGATC { SGPropertyNode_ptr atcopt9_node; // for failure modeling - string trans_ident; // transmitted ident + std::string trans_ident; // transmitted ident bool approach_failed; // approach failed? public: @@ -153,14 +145,14 @@ public: // Add new plane to stack if not already registered // Input: pid - id of plane (name) // Output: "true" if added; "false" if already existend - void AddPlane(const string& pid); + void AddPlane(const std::string& pid); // Remove plane from stack if out of range int RemovePlane(); inline double get_bucket() const { return bucket; } inline int get_pnum() const { return num_planes; } - inline const string& get_trans_ident() { return trans_ident; } + inline const std::string& get_trans_ident() { return trans_ident; } private: @@ -176,7 +168,7 @@ private: double angle_diff_deg( const double &a1, const double &a2); - void set_message(const string &s); + void set_message(const std::string &s); // ======================================================================== // get point2 given starting point1 and course and distance @@ -225,7 +217,7 @@ private: //Update the transmission string void UpdateTransmission(void); - friend istream& operator>> ( istream&, FGApproach& ); + friend std::istream& operator>> ( std::istream&, FGApproach& ); }; #endif // _FG_APPROACH_HXX diff --git a/src/ATCDCL/atis.hxx b/src/ATCDCL/atis.hxx index 05835d4a7..c4c28e2d4 100644 --- a/src/ATCDCL/atis.hxx +++ b/src/ATCDCL/atis.hxx @@ -33,18 +33,13 @@ #include #ifdef SG_HAVE_STD_INCLUDES -# include -# include +# include #elif defined( __BORLANDC__ ) || (__APPLE__) # include #else # include -# include #endif -SG_USING_STD(istream); -SG_USING_STD(string); - #include "ATC.hxx" //DCL - a complete guess for now. @@ -53,12 +48,12 @@ SG_USING_STD(string); class FGATIS : public FGATC { //atc_type type; - string transmission; // The actual ATIS transmission + std::string transmission; // The actual ATIS transmission // This is not stored in default.atis but is generated // from the prevailing conditions when required. // for failure modeling - string trans_ident; // transmitted ident + std::string trans_ident; // transmitted ident bool atis_failed; // atis failed? // Aircraft position @@ -79,17 +74,17 @@ class FGATIS : public FGATC { void Update(double dt); //inline void set_type(const atc_type tp) {type = tp;} - inline const string& get_trans_ident() { return trans_ident; } - inline void set_refname(const string& r) { refname = r; } + inline const std::string& get_trans_ident() { return trans_ident; } + inline void set_refname(const std::string& r) { refname = r; } private: - string refname; // Holds the refname of a transmission in progress + std::string refname; // Holds the refname of a transmission in progress //Update the transmission string void UpdateTransmission(void); - friend istream& operator>> ( istream&, FGATIS& ); + friend std::istream& operator>> ( std::istream&, FGATIS& ); }; #endif // _FG_ATIS_HXX diff --git a/src/ATCDCL/ground.hxx b/src/ATCDCL/ground.hxx index 43f5c0a31..de8348b87 100644 --- a/src/ATCDCL/ground.hxx +++ b/src/ATCDCL/ground.hxx @@ -33,16 +33,8 @@ #include "ATC.hxx" #include "ATCProjection.hxx" -#include STL_IOSTREAM #include STL_STRING -SG_USING_STD(string); -SG_USING_STD(ios); - -SG_USING_STD(map); -SG_USING_STD(vector); -SG_USING_STD(list); - class FGAIEntity; class FGATCMgr; @@ -86,7 +78,7 @@ struct ground_network_element { struct arc : public ground_network_element { int distance; - string name; + std::string name; arc_type type; bool directed; //false if 2-way, true if 1-way. //This is a can of worms since arcs might be one way in different directions under different circumstances @@ -95,7 +87,7 @@ struct arc : public ground_network_element { // If the arc is directed then flow is normally from n1 to n2. See the above can of worms comment though. }; -typedef vector arc_array_type; // This was and may become again a list instead of vector +typedef std::vector arc_array_type; // This was and may become again a list instead of vector typedef arc_array_type::iterator arc_array_iterator; typedef arc_array_type::const_iterator arc_array_const_iterator; @@ -106,13 +98,13 @@ struct node : public ground_network_element { unsigned int nodeID; //each node in an airport needs a unique ID number - this is ZERO-BASED to match array position Point3D pos; Point3D orthoPos; - string name; + std::string name; node_type type; arc_array_type arcs; double max_turn_radius; }; -typedef vector node_array_type; +typedef std::vector node_array_type; typedef node_array_type::iterator node_array_iterator; typedef node_array_type::const_iterator node_array_const_iterator; @@ -121,18 +113,18 @@ struct Gate : public node { int max_weight; //units?? //airline_code airline; //For the future - we don't have any airline codes ATM int id; // The gate number in the logical scheme of things - string name; // The real-world gate letter/number + std::string name; // The real-world gate letter/number //node* pNode; bool used; double heading; // The direction the parked-up plane should point in degrees }; -typedef vector < Gate* > gate_vec_type; +typedef std::vector < Gate* > gate_vec_type; typedef gate_vec_type::iterator gate_vec_iterator; typedef gate_vec_type::const_iterator gate_vec_const_iterator; // A map of gate vs. the logical (internal FGFS) gate ID -typedef map < int, Gate* > gate_map_type; +typedef std::map < int, Gate* > gate_map_type; typedef gate_map_type::iterator gate_map_iterator; typedef gate_map_type::const_iterator gate_map_const_iterator; @@ -146,7 +138,7 @@ struct Rwy { // This will get us up and running for single runway airports though. }; -typedef vector < Rwy > runway_array_type; +typedef std::vector < Rwy > runway_array_type; typedef runway_array_type::iterator runway_array_iterator; typedef runway_array_type::const_iterator runway_array_const_iterator; @@ -157,7 +149,7 @@ typedef runway_array_type::const_iterator runway_array_const_iterator; // Structures to use the network // A path through the network -typedef vector < ground_network_element* > ground_network_path_type; +typedef std::vector < ground_network_element* > ground_network_path_type; typedef ground_network_path_type::iterator ground_network_path_iterator; typedef ground_network_path_type::const_iterator ground_network_path_const_iterator; @@ -174,7 +166,7 @@ struct a_path { }; // Paths mapped by nodeID reached so-far -typedef map < unsigned int, a_path* > shortest_path_map_type; +typedef std::map < unsigned int, a_path* > shortest_path_map_type; typedef shortest_path_map_type::iterator shortest_path_map_iterator; // Nodes mapped by their ID @@ -201,7 +193,7 @@ struct GroundRec { // Almost certainly need to add more here }; -typedef list < GroundRec* > ground_rec_list; +typedef std::list < GroundRec* > ground_rec_list; typedef ground_rec_list::iterator ground_rec_list_itr; typedef ground_rec_list::const_iterator ground_rec_list_const_itr; @@ -215,7 +207,7 @@ struct GRunwayDetails { Point3D end2ortho; // ortho projection end2 (the take off end in the current hardwired scheme) double hdg; // true runway heading double length; // In *METERS* - string rwyID; + std::string rwyID; }; /////////////////////////////////////////////////////////////////////////////// @@ -227,13 +219,13 @@ class FGGround : public FGATC { public: FGGround(); - FGGround(const string& id); + FGGround(const std::string& id); ~FGGround(); void Init(); void Update(double dt); - inline const string& get_trans_ident() { return trans_ident; } + inline const std::string& get_trans_ident() { return trans_ident; } // Contact ground control on arrival, assumed to request any gate //void NewArrival(plane_rec plane); @@ -258,22 +250,22 @@ public: Gate* GetGateNode(); // Return a pointer to a hold short node - node* GetHoldShortNode(const string& rwyID); + node* GetHoldShortNode(const std::string& rwyID); // Runway stuff - this might change in the future. // Get a list of exits from a given runway // It is up to the calling function to check for non-zero size of returned array before use - node_array_type GetExits(const string& rwyID); + node_array_type GetExits(const std::string& rwyID); // Get a path from one node to another ground_network_path_type GetPath(node* A, node* B); // Get a path from a node to a runway threshold - ground_network_path_type GetPath(node* A, const string& rwyID); + ground_network_path_type GetPath(node* A, const std::string& rwyID); // Get a path from a node to a runway hold short point // Bit of a hack this at the moment! - ground_network_path_type GetPathToHoldShort(node* A, const string& rwyID); + ground_network_path_type GetPathToHoldShort(node* A, const std::string& rwyID); private: FGATCMgr* ATCmgr; @@ -314,7 +306,7 @@ private: SGPropertyNode_ptr wind_speed_knots; //knots // for failure modeling - string trans_ident; // transmitted ident + std::string trans_ident; // transmitted ident bool ground_failed; // ground failed? bool networkLoadOK; // Indicates whether LoadNetwork returned true or false at last attempt @@ -328,7 +320,7 @@ private: // Physical runway details double aptElev; // Airport elevation - string activeRwy; // Active runway number - For now we'll disregard multiple / alternate runway operation. + std::string activeRwy; // Active runway number - For now we'll disregard multiple / alternate runway operation. RunwayDetails rwy; // Assumed to be the active one for now.// Figure out which runways are active. // For now we'll just be simple and do one active runway - eventually this will get much more complex @@ -353,7 +345,7 @@ private: // Return a pointer to the node at a runway threshold // Returns NULL if unsuccessful. - node* GetThresholdNode(const string& rwyID); + node* GetThresholdNode(const std::string& rwyID); // A shortest path algorithm from memory (I can't find the bl&*dy book again!) ground_network_path_type GetShortestPath(node* A, node* B); diff --git a/src/ATCDCL/tower.hxx b/src/ATCDCL/tower.hxx index 0fe4103a7..ad1c2ba17 100644 --- a/src/ATCDCL/tower.hxx +++ b/src/ATCDCL/tower.hxx @@ -26,12 +26,9 @@ #include #include -#include STL_IOSTREAM +#include #include STL_STRING -SG_USING_STD(string); -SG_USING_STD(ios); - #include "ATC.hxx" #include "ATCProjection.hxx" #include "AIPlane.hxx" @@ -117,7 +114,7 @@ public: }; -typedef list < TowerPlaneRec* > tower_plane_rec_list_type; +typedef std::list < TowerPlaneRec* > tower_plane_rec_list_type; typedef tower_plane_rec_list_type::iterator tower_plane_rec_list_iterator; typedef tower_plane_rec_list_type::const_iterator tower_plane_rec_list_const_iterator; @@ -138,21 +135,21 @@ public: // Contact tower for VFR approach // eg "Cessna Charlie Foxtrot Golf Foxtrot Sierra eight miles South of the airport for full stop with Bravo" // This function probably only called via user interaction - AI planes will have an overloaded function taking a planerec. - void VFRArrivalContact(const string& ID, const LandingType& opt = AIP_LT_UNKNOWN); + void VFRArrivalContact(const std::string& ID, const LandingType& opt = AIP_LT_UNKNOWN); // For the AI planes... void VFRArrivalContact(const PlaneRec& plane, FGAIPlane* requestee, const LandingType& lt = AIP_LT_UNKNOWN); - void RequestDepartureClearance(const string& ID); - void RequestTakeOffClearance(const string& ID); - void ReportFinal(const string& ID); - void ReportLongFinal(const string& ID); - void ReportOuterMarker(const string& ID); - void ReportMiddleMarker(const string& ID); - void ReportInnerMarker(const string& ID); - void ReportRunwayVacated(const string& ID); - void ReportReadyForDeparture(const string& ID); - void ReportDownwind(const string& ID); - void ReportGoingAround(const string& ID); + void RequestDepartureClearance(const std::string& ID); + void RequestTakeOffClearance(const std::string& ID); + void ReportFinal(const std::string& ID); + void ReportLongFinal(const std::string& ID); + void ReportOuterMarker(const std::string& ID); + void ReportMiddleMarker(const std::string& ID); + void ReportInnerMarker(const std::string& ID); + void ReportRunwayVacated(const std::string& ID); + void ReportReadyForDeparture(const std::string& ID); + void ReportDownwind(const std::string& ID); + void ReportGoingAround(const std::string& ID); // Contact tower when at a hold short for departure - for now we'll assume plane - maybe vehicles might want to cross runway eventually? void ContactAtHoldShort(const PlaneRec& plane, FGAIPlane* requestee, tower_traffic_type operation); @@ -162,16 +159,16 @@ public: void RegisterAIPlane(const PlaneRec& plane, FGAIPlane* ai, const tower_traffic_type& op, const PatternLeg& lg = LEG_UNKNOWN); // Deregister and remove an AI plane. - void DeregisterAIPlane(const string& id); + void DeregisterAIPlane(const std::string& id); // Public interface to the active runway - this will get more complex // in the future and consider multi-runway use, airplane weight etc. - inline const string& GetActiveRunway() const { return activeRwy; } + inline const std::string& GetActiveRunway() const { return activeRwy; } inline const RunwayDetails& GetActiveRunwayDetails() const { return rwy; } // Get the pattern direction of the active rwy. inline int GetPatternDirection() const { return rwy.patternDirection; } - inline const string& get_trans_ident() const { return trans_ident; } + inline const std::string& get_trans_ident() const { return trans_ident; } inline FGGround* const GetGroundPtr() const { return ground; } @@ -181,9 +178,9 @@ public: bool GetDownwindConstraint(double& dpos); bool GetBaseConstraint(double& bpos); - string GenText(const string& m, int c); - string GetWeather(); - string GetATISID(); + std::string GenText(const std::string& m, int c); + std::string GetWeather(); + std::string GetATISID(); private: FGATCMgr* ATCmgr; @@ -210,10 +207,10 @@ private: void ClearHoldingPlane(TowerPlaneRec* t); // Find a pointer to plane of callsign ID within the internal data structures - TowerPlaneRec* FindPlane(const string& ID); + TowerPlaneRec* FindPlane(const std::string& ID); // Remove and delete all instances of a plane with a given ID - void RemovePlane(const string& ID); + void RemovePlane(const std::string& ID); // Figure out if a given position lies on the active runway // Might have to change when we consider more than one active rwy. @@ -227,10 +224,10 @@ private: // For air traffic this is the middle approximation. void CalcETA(TowerPlaneRec* tpr, bool printout = false); - // Iterate through all the lists and call CalcETA for all the planes. + // Iterate through all the std::lists and call CalcETA for all the planes. void doThresholdETACalc(); - // Order the list of traffic as per expected threshold use and flag any conflicts + // Order the std::list of traffic as per expected threshold use and flag any conflicts bool doThresholdUseOrder(); // Calculate the crow-flys distance of a plane to the threshold in meters @@ -258,7 +255,7 @@ private: SGPropertyNode_ptr wind_speed_knots; //knots double aptElev; // Airport elevation - string activeRwy; // Active runway number - For now we'll disregard multiple / alternate runway operation. + std::string activeRwy; // Active runway number - For now we'll disregard multiple / alternate runway operation. RunwayDetails rwy; // Assumed to be the active one for now. bool rwyOccupied; // Active runway occupied flag. For now we'll disregard land-and-hold-short operations. FGATCAlignedProjection ortho; // Orthogonal mapping of the local area with the active runway threshold at the origin @@ -311,9 +308,9 @@ private: tower_plane_rec_list_iterator vacatedListItr; // Returns true if successful - bool RemoveFromTrafficList(const string& id); - bool RemoveFromAppList(const string& id); - bool RemoveFromRwyList(const string& id); + bool RemoveFromTrafficList(const std::string& id); + bool RemoveFromAppList(const std::string& id); + bool RemoveFromRwyList(const std::string& id); // Return the ETA of plane no. list_pos (1-based) in the traffic list. // i.e. list_pos = 1 implies next to use runway. @@ -340,7 +337,7 @@ private: //FGDeparture* _departure; // The relevant departure control (once we've actually written it!) // for failure modeling - string trans_ident; // transmitted ident + std::string trans_ident; // transmitted ident bool tower_failed; // tower failed? // Pointers to current users position and orientation @@ -359,7 +356,7 @@ private: double nominal_downwind_leg_pos; double nominal_base_leg_pos; - friend istream& operator>> ( istream&, FGTower& ); + friend std::istream& operator>> ( std::istream&, FGTower& ); }; #endif //_FG_TOWER_HXX diff --git a/src/ATCDCL/transmission.cxx b/src/ATCDCL/transmission.cxx index 0a6ea4b76..9f77af939 100644 --- a/src/ATCDCL/transmission.cxx +++ b/src/ATCDCL/transmission.cxx @@ -25,6 +25,7 @@ #include "transmission.hxx" +#include #include @@ -60,7 +61,7 @@ TransPar FGTransmission::Parse() { if ( tkn <= 20 ) { tkn += 1; } else { - cout << "Too many tokens" << endl; + SG_LOG(SG_ATC, SG_WARN,"Too many tokens"); } } } diff --git a/src/ATCDCL/transmission.hxx b/src/ATCDCL/transmission.hxx index c1881b3c6..8318d5a3b 100644 --- a/src/ATCDCL/transmission.hxx +++ b/src/ATCDCL/transmission.hxx @@ -48,12 +48,6 @@ #include "ATC.hxx" -#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS ) -SG_USING_STD(istream); -#endif - -SG_USING_STD(string); - struct TransCode { int c1; int c2; @@ -62,18 +56,18 @@ struct TransCode { // TransPar - a representation of the logic of a parsed speech transmission struct TransPar { - string station; - string callsign; - string airport; - string intention; // landing, crossing - string intid; // (airport) ID for intention + std::string station; + std::string callsign; + std::string airport; + std::string intention; // landing, crossing + std::string intid; // (airport) ID for intention bool request; // is the transmission a request or an answer? int tdir; // turning direction: 1=left, 2=right double heading; int VDir; // vertical direction: 1=descent, 2=maintain, 3=climb double alt; double miles; - string runway; + std::string runway; double freq; double time; }; @@ -84,8 +78,8 @@ class FGTransmission { //int StationType; // Type of ATC station: 1 Approach atc_type StationType; TransCode Code; // DCL - no idea what this is. - string TransText; // The text of the spoken transmission - string MenuText; // An abbreviated version of the text for the menu entry + std::string TransText; // The text of the spoken transmission + std::string MenuText; // An abbreviated version of the text for the menu entry public: @@ -96,21 +90,21 @@ public: inline atc_type get_station() const { return StationType; } inline const TransCode& get_code() { return Code; } - inline const string& get_transtext() { return TransText; } - inline const string& get_menutext() { return MenuText; } + inline const std::string& get_transtext() { return TransText; } + inline const std::string& get_menutext() { return MenuText; } // Return the parsed logic of the transmission TransPar Parse(); private: - friend istream& operator>> ( istream&, FGTransmission& ); + friend std::istream& operator>> ( std::istream&, FGTransmission& ); }; -inline istream& -operator >> ( istream& in, FGTransmission& a ) { +inline std::istream& +operator >> ( std::istream& in, FGTransmission& a ) { char ch; int tmp; diff --git a/src/ATCDCL/transmissionlist.cxx b/src/ATCDCL/transmissionlist.cxx index cb24e50ca..1f55609a3 100644 --- a/src/ATCDCL/transmissionlist.cxx +++ b/src/ATCDCL/transmissionlist.cxx @@ -130,13 +130,13 @@ bool FGTransmissionList::query_station( const atc_type &station, FGTransmission num_trans += 1; } else { - cout << "Transmissionlist error: Too many transmissions" << endl; + SG_LOG(SG_GENERAL, SG_WARN, "Transmissionlist error: Too many transmissions"); } } if ( num_trans != 0 ) return true; else { - cout << "No transmission with station " << station << "found." << endl; + SG_LOG(SG_GENERAL, SG_WARN, "No transmission with station " << station << "found."); string empty; return false; } @@ -240,7 +240,7 @@ string FGTransmissionList::gen_text(const atc_type &station, const TransCode cod else if ( strcmp ( tag, "@RW" ) == 0 ) strcat( &dum[0], tpars.runway.c_str() ); else { - cout << "Tag " << tag << " not found" << endl; + SG_LOG(SG_GENERAL, SG_WARN, "Tag " << tag << " not found"); break; } strcat( &dum[0], &mes[len+3] ); @@ -248,7 +248,7 @@ string FGTransmissionList::gen_text(const atc_type &station, const TransCode cod ++check; if(check > 10) { - SG_LOG(SG_ATC, SG_WARN, "WARNING: Possibly endless loop terminated in FGTransmissionlist::gen_text(...)"); + SG_LOG(SG_GENERAL, SG_WARN, "WARNING: Possibly endless loop terminated in FGTransmissionlist::gen_text(...)"); break; } } diff --git a/src/Cockpit/panel_io.cxx b/src/Cockpit/panel_io.cxx index d017fb93c..9461544de 100644 --- a/src/Cockpit/panel_io.cxx +++ b/src/Cockpit/panel_io.cxx @@ -34,7 +34,7 @@ #include #include -#include STL_IOSTREAM +#include #include STL_FSTREAM #include STL_STRING diff --git a/src/Cockpit/panel_io.hxx b/src/Cockpit/panel_io.hxx index 4db99ea18..3f604828d 100644 --- a/src/Cockpit/panel_io.hxx +++ b/src/Cockpit/panel_io.hxx @@ -31,15 +31,12 @@ #include -#include STL_IOSTREAM +#include #include STL_STRING -SG_USING_STD(istream); -SG_USING_STD(string); - class FGPanel; -extern FGPanel * fgReadPanel (istream &input); -extern FGPanel * fgReadPanel (const string &relative_path); +extern FGPanel * fgReadPanel (std::istream &input); +extern FGPanel * fgReadPanel (const std::string &relative_path); #endif // __PANEL_IO_HXX diff --git a/src/FDM/JSBSim/input_output/FGXMLElement.cpp b/src/FDM/JSBSim/input_output/FGXMLElement.cpp index 741a80609..831256fe1 100755 --- a/src/FDM/JSBSim/input_output/FGXMLElement.cpp +++ b/src/FDM/JSBSim/input_output/FGXMLElement.cpp @@ -53,6 +53,8 @@ INCLUDES #include #include +#include + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -62,6 +64,10 @@ namespace JSBSim { static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_XMLELEMENT; +using std::cerr; +using std::cout; +using std::endl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/input_output/FGXMLElement.h b/src/FDM/JSBSim/input_output/FGXMLElement.h index ce3711aed..55aa6b1f7 100755 --- a/src/FDM/JSBSim/input_output/FGXMLElement.h +++ b/src/FDM/JSBSim/input_output/FGXMLElement.h @@ -39,30 +39,17 @@ INCLUDES # ifdef SG_HAVE_STD_INCLUDES # include # include -# include # include # else # include # include -# include # include # endif #else # include # include -# include # include - using std::string; - using std::map; - using std::vector; - using std::cout; - using std::endl; #endif - using std::string; - using std::map; - using std::vector; - using std::cout; - using std::endl; #include @@ -159,7 +146,7 @@ public: /** Constructor @param nm the name of this element (if given) */ - Element(string nm); + Element(std::string nm); /// Destructor ~Element(void); @@ -167,23 +154,23 @@ public: @param key specifies the attribute key to retrieve the value of. @return the key value (as a string), or the empty string if no such attribute exists. */ - string GetAttributeValue(string key); + std::string GetAttributeValue(std::string key); /** Retrieves an attribute value as a double precision real number. @param key specifies the attribute key to retrieve the value of. @return the key value (as a number), or the HUGE_VAL if no such attribute exists. */ - double GetAttributeValueAsNumber(string key); + double GetAttributeValueAsNumber(std::string key); /** Retrieves the element name. @return the element name, or the empty string if no name has been set.*/ - string GetName(void) {return name;} + std::string GetName(void) {return name;} /** Gets a line of data belonging to an element. @param i the index of the data line to return (0 by default). @return a string representing the data line requested, or the empty string if none exists.*/ - string GetDataLine(unsigned int i=0); + std::string GetDataLine(unsigned int i=0); /// Returns the number of lines of data stored unsigned int GetNumDataLines(void) {return (unsigned int)data_lines.size();} @@ -192,7 +179,7 @@ public: unsigned int GetNumElements(void) {return (unsigned int)children.size();} /// Returns the number of named child elements for this element. - unsigned int GetNumElements(string); + unsigned int GetNumElements(std::string); /** Converts the element data to a number. This function attempts to convert the first (and presumably only) line of @@ -225,12 +212,12 @@ public: Element* GetParent(void) {return parent;} /** Searches for a specified element. - Finds the first element that matches the supplied string, or simply the first - element if no search string is supplied. This function call resets the internal + Finds the first element that matches the supplied std::string, or simply the first + element if no search std::string is supplied. This function call resets the internal element counter to the first element. - @param el the search string (empty string by default). - @return a pointer to the first element that matches the supplied search string. */ - Element* FindElement(string el=""); + @param el the search std::string (empty std::string by default). + @return a pointer to the first element that matches the supplied search std::string. */ + Element* FindElement(std::string el=""); /** Searches for the next element as specified. This function would be called after FindElement() is first called (in order to @@ -241,7 +228,7 @@ public: @param el the name of the next element to find. @return the pointer to the found element, or 0 if no appropriate element us found.*/ - Element* FindNextElement(string el=""); + Element* FindNextElement(std::string el=""); /** Searches for the named element and returns the string data belonging to it. This function allows the data belonging to a named element to be returned @@ -251,7 +238,7 @@ public: default) @return the data value for the named element as a string, or the empty string if the element cannot be found. */ - string FindElementValue(string el=""); + std::string FindElementValue(std::string el=""); /** Searches for the named element and returns the data belonging to it as a number. This function allows the data belonging to a named element to be returned @@ -261,7 +248,7 @@ public: default) @return the data value for the named element as a double, or HUGE_VAL if the data is missing. */ - double FindElementValueAsNumber(string el=""); + double FindElementValueAsNumber(std::string el=""); /** Searches for the named element and converts and returns the data belonging to it. This function allows the data belonging to a named element to be returned @@ -278,7 +265,7 @@ public: to which the value returned will be converted. @return the unit-converted data value for the named element as a double, or HUGE_VAL if the data is missing. */ - double FindElementValueAsNumberConvertTo(string el, string target_units); + double FindElementValueAsNumberConvertTo(std::string el, std::string target_units); /** Searches for the named element and converts and returns the data belonging to it. This function allows the data belonging to a named element to be returned @@ -297,9 +284,9 @@ public: to which the value returned will be converted. @return the unit-converted data value for the named element as a double, or HUGE_VAL if the data is missing. */ - double FindElementValueAsNumberConvertFromTo( string el, - string supplied_units, - string target_units); + double FindElementValueAsNumberConvertFromTo( std::string el, + std::string supplied_units, + std::string target_units); /** Composes a 3-element column vector for the supplied location or orientation. This function processes a LOCATION or ORIENTATION construct, returning a @@ -310,7 +297,7 @@ public: @param target_units the string representing the native units used by JSBSim to which the value returned will be converted. @return a column vector object built from the LOCATION or ORIENT components. */ - FGColumnVector3 FindElementTripletConvertTo( string target_units); + FGColumnVector3 FindElementTripletConvertTo( std::string target_units); /** This function sets the value of the parent class attribute to the supplied Element pointer. @@ -324,11 +311,11 @@ public: /** Stores an attribute belonging to this element. * @param name The string name of the attribute. * @param value The string value of the attribute. */ - void AddAttribute(string name, string value); + void AddAttribute(std::string name, std::string value); /** Stores data belonging to this element. * @param d the data to store. */ - void AddData(string d); + void AddData(std::string d); /** Prints the element. * Prints this element and calls the Print routine for child elements. @@ -336,14 +323,14 @@ public: void Print(unsigned int level=0); private: - string name; - map attributes; - vector data_lines; - vector children; - vector attribute_key; + std::string name; + std::map attributes; + std::vector data_lines; + std::vector children; + std::vector attribute_key; Element *parent; unsigned int element_index; - typedef map > tMapConvert; + typedef std::map > tMapConvert; tMapConvert convert; }; diff --git a/src/FDM/JSBSim/input_output/FGXMLFileRead.h b/src/FDM/JSBSim/input_output/FGXMLFileRead.h index b9e250600..15493c674 100755 --- a/src/FDM/JSBSim/input_output/FGXMLFileRead.h +++ b/src/FDM/JSBSim/input_output/FGXMLFileRead.h @@ -35,6 +35,7 @@ SENTRY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +#include #include /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -58,7 +59,7 @@ protected: Element* document; Element* LoadXMLDocument(string XML_filename) { - ifstream infile; + std::ifstream infile; if ( !XML_filename.empty() ) { if (XML_filename.find(".xml") == string::npos) XML_filename += ".xml"; diff --git a/src/FDM/JSBSim/input_output/FGfdmSocket.cpp b/src/FDM/JSBSim/input_output/FGfdmSocket.cpp index c1a582699..2376f2b80 100644 --- a/src/FDM/JSBSim/input_output/FGfdmSocket.cpp +++ b/src/FDM/JSBSim/input_output/FGfdmSocket.cpp @@ -38,6 +38,7 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include +#include #include "FGfdmSocket.h" @@ -46,6 +47,10 @@ namespace JSBSim { static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_FDMSOCKET; +using std::cerr; +using std::cout; +using std::endl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/input_output/FGfdmSocket.h b/src/FDM/JSBSim/input_output/FGfdmSocket.h index f1d41ef1b..cd88fddbd 100644 --- a/src/FDM/JSBSim/input_output/FGfdmSocket.h +++ b/src/FDM/JSBSim/input_output/FGfdmSocket.h @@ -43,21 +43,8 @@ INCLUDES #ifdef FGFS # include # include STL_STRING -# include STL_IOSTREAM -# include STL_FSTREAM - SG_USING_STD(cout); - SG_USING_STD(endl); #else # include -# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) -# include -# include -# else -# include -# include - using std::cout; - using std::endl; -# endif #endif #include diff --git a/src/FDM/JSBSim/math/FGColumnVector3.cpp b/src/FDM/JSBSim/math/FGColumnVector3.cpp index f34afe592..fc66c27e7 100644 --- a/src/FDM/JSBSim/math/FGColumnVector3.cpp +++ b/src/FDM/JSBSim/math/FGColumnVector3.cpp @@ -39,12 +39,18 @@ INCLUDES #include "FGColumnVector3.h" #include +#include namespace JSBSim { static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_COLUMNVECTOR3; +using std::ostream; +using std::cerr; +using std::cout; +using std::endl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/math/FGColumnVector3.h b/src/FDM/JSBSim/math/FGColumnVector3.h index 85e6bab22..1045436cb 100644 --- a/src/FDM/JSBSim/math/FGColumnVector3.h +++ b/src/FDM/JSBSim/math/FGColumnVector3.h @@ -44,14 +44,8 @@ INCLUDES # include # include # include STL_STRING +# include # include STL_FSTREAM -# include STL_IOSTREAM - SG_USING_STD(string); - SG_USING_STD(ostream); - SG_USING_STD(istream); - SG_USING_STD(cerr); - SG_USING_STD(cout); - SG_USING_STD(endl); #else # include # if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) @@ -66,16 +60,10 @@ INCLUDES # else # include # endif - using std::ostream; - using std::istream; - using std::cerr; - using std::cout; - using std::endl; # if !(defined(_MSC_VER) && _MSC_VER <= 1200) using std::sqrt; # endif # endif - using std::string; #endif #include "FGJSBBase.h" @@ -174,7 +162,7 @@ public: /** Prints the contents of the vector @param delimeter the item separator (tab or comma) @return a string with the delimeter-separated contents of the vector */ - string Dump(string delimeter) const; + std::string Dump(std::string delimeter) const; /** Assignment operator. @param b source vector. @@ -316,7 +304,7 @@ inline FGColumnVector3 operator*(double scalar, const FGColumnVector3& A) { @param os Stream to write to. @param M Matrix to write. Write the matrix to a stream.*/ -ostream& operator<<(ostream& os, const FGColumnVector3& col); +std::ostream& operator<<(std::ostream& os, const FGColumnVector3& col); } // namespace JSBSim diff --git a/src/FDM/JSBSim/math/FGCondition.cpp b/src/FDM/JSBSim/math/FGCondition.cpp index e5cebbcb0..9177f4f02 100644 --- a/src/FDM/JSBSim/math/FGCondition.cpp +++ b/src/FDM/JSBSim/math/FGCondition.cpp @@ -34,6 +34,8 @@ COMMENTS, REFERENCES, and NOTES INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +#include + #include "FGCondition.h" namespace JSBSim { @@ -41,6 +43,11 @@ namespace JSBSim { static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_CONDITION; +using std::cerr; +using std::cout; +using std::endl; +using std::vector; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/math/FGCondition.h b/src/FDM/JSBSim/math/FGCondition.h index c778e0f79..aaee6aacd 100644 --- a/src/FDM/JSBSim/math/FGCondition.h +++ b/src/FDM/JSBSim/math/FGCondition.h @@ -38,6 +38,8 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include +#include + #include #include #include @@ -69,7 +71,7 @@ class FGCondition : public FGJSBBase { public: FGCondition(Element* element, FGPropertyManager* PropertyManager); - FGCondition(string test, FGPropertyManager* PropertyManager); + FGCondition(std::string test, FGPropertyManager* PropertyManager); ~FGCondition(void); bool Evaluate(void); @@ -78,18 +80,18 @@ public: private: enum eComparison {ecUndef=0, eEQ, eNE, eGT, eGE, eLT, eLE}; enum eLogic {elUndef=0, eAND, eOR}; - map mComparison; + std::map mComparison; eLogic Logic; FGPropertyManager *TestParam1, *TestParam2, *PropertyManager; double TestValue; eComparison Comparison; bool isGroup; - string conditional; + std::string conditional; - static string indent; + static std::string indent; - vector conditions; + std::vector conditions; void InitializeConditionals(void); void Debug(int from); diff --git a/src/FDM/JSBSim/math/FGFunction.cpp b/src/FDM/JSBSim/math/FGFunction.cpp index f040e2a65..304575a62 100755 --- a/src/FDM/JSBSim/math/FGFunction.cpp +++ b/src/FDM/JSBSim/math/FGFunction.cpp @@ -29,6 +29,7 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include +#include #include "FGFunction.h" #include "FGTable.h" @@ -40,6 +41,9 @@ namespace JSBSim { static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_FUNCTION; +using std::cerr; +using std::cout; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/math/FGFunction.h b/src/FDM/JSBSim/math/FGFunction.h index 47bc1ccc3..bad10f5f1 100755 --- a/src/FDM/JSBSim/math/FGFunction.h +++ b/src/FDM/JSBSim/math/FGFunction.h @@ -180,7 +180,7 @@ public: void cacheValue(bool shouldCache); private: - vector Parameters; + std::vector Parameters; FGPropertyManager* const PropertyManager; bool cached; string Prefix; diff --git a/src/FDM/JSBSim/math/FGMatrix33.cpp b/src/FDM/JSBSim/math/FGMatrix33.cpp index 9b4ce1231..5b66bc8e1 100644 --- a/src/FDM/JSBSim/math/FGMatrix33.cpp +++ b/src/FDM/JSBSim/math/FGMatrix33.cpp @@ -45,6 +45,9 @@ namespace JSBSim { static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_MATRIX33; +using std::cout; +using std::endl; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -61,7 +64,7 @@ FGMatrix33::FGMatrix33(void) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -ostream& operator<<(ostream& os, const FGMatrix33& M) +std::ostream& operator<<(std::ostream& os, const FGMatrix33& M) { for (unsigned int i=1; i<=M.Rows(); i++) { for (unsigned int j=1; j<=M.Cols(); j++) { @@ -76,7 +79,7 @@ ostream& operator<<(ostream& os, const FGMatrix33& M) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -istream& operator>>(istream& is, FGMatrix33& M) +std::istream& operator>>(std::istream& is, FGMatrix33& M) { for (unsigned int i=1; i<=M.Rows(); i++) { for (unsigned int j=1; j<=M.Cols(); j++) { diff --git a/src/FDM/JSBSim/math/FGMatrix33.h b/src/FDM/JSBSim/math/FGMatrix33.h index 60b1ff885..b540389ea 100644 --- a/src/FDM/JSBSim/math/FGMatrix33.h +++ b/src/FDM/JSBSim/math/FGMatrix33.h @@ -45,14 +45,7 @@ INCLUDES # include # include # include STL_STRING -# include STL_FSTREAM -# include STL_IOSTREAM - SG_USING_STD(string); - SG_USING_STD(ostream); - SG_USING_STD(istream); - SG_USING_STD(cerr); - SG_USING_STD(cout); - SG_USING_STD(endl); +# include #else # include # if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) @@ -61,19 +54,13 @@ INCLUDES # include # else # include -# include +# include # if defined(sgi) && !defined(__GNUC__) # include # else # include # endif - using std::ostream; - using std::istream; - using std::cerr; - using std::cout; - using std::endl; # endif - using std::string; #endif #include "FGColumnVector3.h" @@ -107,7 +94,7 @@ DECLARATION: MatrixException class MatrixException : public FGJSBBase { public: - string Message; + std::string Message; }; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -473,7 +460,7 @@ inline FGMatrix33 operator*(double scalar, const FGMatrix33& A) { Write the matrix to a stream. */ -ostream& operator<<(ostream& os, const FGMatrix33& M); +std::ostream& operator<<(std::ostream& os, const FGMatrix33& M); /** Read matrix from a stream. @@ -482,7 +469,7 @@ ostream& operator<<(ostream& os, const FGMatrix33& M); Read matrix from a stream. */ -istream& operator>>(istream& is, FGMatrix33& M); +std::istream& operator>>(std::istream& is, FGMatrix33& M); } // namespace JSBSim diff --git a/src/FDM/JSBSim/models/FGAerodynamics.h b/src/FDM/JSBSim/models/FGAerodynamics.h index 91c19d122..e25faa761 100644 --- a/src/FDM/JSBSim/models/FGAerodynamics.h +++ b/src/FDM/JSBSim/models/FGAerodynamics.h @@ -165,20 +165,20 @@ public: /** Gets the strings for the current set of coefficients. @param delimeter either a tab or comma string depending on output type @return a string containing the descriptive names for all coefficients */ - string GetCoefficientStrings(string delimeter); + std::string GetCoefficientStrings(std::string delimeter); /** Gets the coefficient values. @param delimeter either a tab or comma string depending on output type @return a string containing the numeric values for the current set of coefficients */ - string GetCoefficientValues(string delimeter); + std::string GetCoefficientValues(std::string delimeter); private: - typedef map AxisIndex; + typedef std::map AxisIndex; AxisIndex AxisIdx; FGFunction* AeroRPShift; - vector variables; - typedef vector CoeffArray; + std::vector variables; + typedef std::vector CoeffArray; CoeffArray* Coeff; FGColumnVector3 vFs; FGColumnVector3 vForces; diff --git a/src/FDM/JSBSim/models/FGGroundReactions.cpp b/src/FDM/JSBSim/models/FGGroundReactions.cpp index c8bf6ab9e..8ba03ddf4 100644 --- a/src/FDM/JSBSim/models/FGGroundReactions.cpp +++ b/src/FDM/JSBSim/models/FGGroundReactions.cpp @@ -46,6 +46,9 @@ namespace JSBSim { static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_GROUNDREACTIONS; +using std::ostringstream; +using std::setprecision; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -139,7 +142,7 @@ bool FGGroundReactions::Load(Element* el) string FGGroundReactions::GetGroundReactionStrings(string delimeter) { - std::ostringstream buf; + ostringstream buf; for (unsigned int i=0;i -# include STL_IOSTREAM -# include STL_FSTREAM -#else -# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) -# include -# include -# else -# include -# include -# endif #endif #include diff --git a/src/FDM/JSBSim/models/FGLGear.cpp b/src/FDM/JSBSim/models/FGLGear.cpp index b25b95a89..bfbe8a7c0 100644 --- a/src/FDM/JSBSim/models/FGLGear.cpp +++ b/src/FDM/JSBSim/models/FGLGear.cpp @@ -38,6 +38,8 @@ HISTORY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +#include + #include "FGLGear.h" namespace JSBSim { @@ -650,11 +652,11 @@ void FGLGear::ComputeVerticalStrutForce(void) } else { dampForce = -compressSpeed * bDampRebound; } - vLocalForce(eZ) = min(springForce + dampForce, (double)0.0); + vLocalForce(eZ) = std::min(springForce + dampForce, (double)0.0); // Remember these values for reporting - MaximumStrutForce = max(MaximumStrutForce, fabs(vLocalForce(eZ))); - MaximumStrutTravel = max(MaximumStrutTravel, fabs(compressLength)); + MaximumStrutForce = std::max(MaximumStrutForce, fabs(vLocalForce(eZ))); + MaximumStrutTravel = std::max(MaximumStrutTravel, fabs(compressLength)); } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/models/FGMassBalance.h b/src/FDM/JSBSim/models/FGMassBalance.h index 13f1aa9b3..10817e9ce 100644 --- a/src/FDM/JSBSim/models/FGMassBalance.h +++ b/src/FDM/JSBSim/models/FGMassBalance.h @@ -154,7 +154,7 @@ private: double Weight; }; - vector PointMasses; + std::vector PointMasses; void Debug(int from); }; diff --git a/src/FDM/JSBSim/models/FGModel.h b/src/FDM/JSBSim/models/FGModel.h index 4d0f8b7f2..8ef7e2774 100644 --- a/src/FDM/JSBSim/models/FGModel.h +++ b/src/FDM/JSBSim/models/FGModel.h @@ -44,17 +44,6 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES -# include -# else -# include -# endif -#else -# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) -# include -# else -# include -# endif #endif #include @@ -65,8 +54,6 @@ DEFINITIONS #define ID_MODEL "$Id$" -using namespace std; - /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -113,7 +100,7 @@ public: virtual bool Load(Element* el) {return true;} FGModel* NextModel; - string Name; + std::string Name; /** Runs the model; called by the Executive @see JSBSim.cpp documentation diff --git a/src/FDM/JSBSim/models/FGOutput.cpp b/src/FDM/JSBSim/models/FGOutput.cpp index 64aaf018f..bc5de4f6b 100644 --- a/src/FDM/JSBSim/models/FGOutput.cpp +++ b/src/FDM/JSBSim/models/FGOutput.cpp @@ -59,6 +59,8 @@ namespace JSBSim { static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_OUTPUT; +using std::setprecision; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/models/FGOutput.h b/src/FDM/JSBSim/models/FGOutput.h index 8d3f00b9e..73bfda491 100644 --- a/src/FDM/JSBSim/models/FGOutput.h +++ b/src/FDM/JSBSim/models/FGOutput.h @@ -42,18 +42,18 @@ INCLUDES #ifdef FGFS # include -# include STL_IOSTREAM # include STL_FSTREAM #else # if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) -# include # include # else -# include # include # endif #endif +#include +#include + #include #include @@ -165,10 +165,10 @@ private: enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type; bool sFirstPass, dFirstPass, enabled; int SubSystems; - string output_file_name, delimeter, Filename, DirectivesFile; - ofstream datafile; + std::string output_file_name, delimeter, Filename, DirectivesFile; + std::ofstream datafile; FGfdmSocket* socket; - vector OutputProperties; + std::vector OutputProperties; void Debug(int from); }; diff --git a/src/FDM/JSBSim/models/FGPropulsion.cpp b/src/FDM/JSBSim/models/FGPropulsion.cpp index a6f45021f..ba486d139 100644 --- a/src/FDM/JSBSim/models/FGPropulsion.cpp +++ b/src/FDM/JSBSim/models/FGPropulsion.cpp @@ -62,6 +62,7 @@ static const char *IdHdr = ID_PROPULSION; extern short debug_lvl; +using std::ifstream; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION diff --git a/src/FDM/JSBSim/models/FGPropulsion.h b/src/FDM/JSBSim/models/FGPropulsion.h index 9884f61c3..19329865a 100644 --- a/src/FDM/JSBSim/models/FGPropulsion.h +++ b/src/FDM/JSBSim/models/FGPropulsion.h @@ -153,8 +153,8 @@ public: be done before calling this (i.e. magnetos, starter engage, etc.) */ bool ICEngineStart(void); - string GetPropulsionStrings(string delimeter); - string GetPropulsionValues(string delimeter); + std::string GetPropulsionStrings(std::string delimeter); + std::string GetPropulsionValues(std::string delimeter); inline FGColumnVector3& GetForces(void) {return vForces; } inline double GetForces(int n) const { return vForces(n);} @@ -169,8 +169,8 @@ public: FGColumnVector3& GetTanksMoment(void); double GetTanksWeight(void); - ifstream* FindEngineFile(string filename); - string FindEngineFullPathname(string engine_filename); + std::ifstream* FindEngineFile(std::string filename); + std::string FindEngineFullPathname(std::string engine_filename); inline int GetActiveEngine(void) const {return ActiveEngine;} inline bool GetFuelFreeze(void) {return fuel_freeze;} double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;} @@ -186,9 +186,9 @@ public: void unbind(); private: - vector Engines; - vector Tanks; - vector ::iterator iTank; + std::vector Engines; + std::vector Tanks; + std::vector ::iterator iTank; unsigned int numSelectedFuelTanks; unsigned int numSelectedOxiTanks; unsigned int numFuelTanks; diff --git a/src/FDM/JSBSim/models/flight_control/FGActuator.cpp b/src/FDM/JSBSim/models/flight_control/FGActuator.cpp index 3a06e89b3..6db41de90 100755 --- a/src/FDM/JSBSim/models/flight_control/FGActuator.cpp +++ b/src/FDM/JSBSim/models/flight_control/FGActuator.cpp @@ -37,6 +37,8 @@ COMMENTS, REFERENCES, and NOTES INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +#include + #include "FGActuator.h" namespace JSBSim { @@ -153,9 +155,9 @@ void FGActuator::Hysteresis(void) double input = Output; if (input > PreviousHystOutput) { - Output = max(PreviousHystOutput, input-0.5*hysteresis_width); + Output = std::max(PreviousHystOutput, input-0.5*hysteresis_width); } else if (input < PreviousHystOutput) { - Output = min(PreviousHystOutput, input+0.5*hysteresis_width); + Output = std::min(PreviousHystOutput, input+0.5*hysteresis_width); } PreviousHystOutput = Output; diff --git a/src/FDM/JSBSim/models/flight_control/FGFCSComponent.h b/src/FDM/JSBSim/models/flight_control/FGFCSComponent.h index 8e0fa14f4..935cb7596 100644 --- a/src/FDM/JSBSim/models/flight_control/FGFCSComponent.h +++ b/src/FDM/JSBSim/models/flight_control/FGFCSComponent.h @@ -53,8 +53,6 @@ DEFINITIONS #define ID_FCSCOMPONENT "$Id$" -using std::string; - /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -103,8 +101,8 @@ public: virtual void SetOutput(void); inline double GetOutput (void) const {return Output;} inline FGPropertyManager* GetOutputNode(void) { return OutputNode; } - inline string GetName(void) const {return Name;} - inline string GetType(void) const { return Type; } + inline std::string GetName(void) const {return Name;} + inline std::string GetType(void) const { return Type; } virtual double GetOutputPct(void) const { return 0; } protected: @@ -114,10 +112,10 @@ protected: FGPropertyManager* OutputNode; FGPropertyManager* ClipMinPropertyNode; FGPropertyManager* ClipMaxPropertyNode; - vector InputNodes; - vector InputSigns; - string Type; - string Name; + std::vector InputNodes; + std::vector InputSigns; + std::string Type; + std::string Name; double Input; double Output; double clipmax, clipmin; diff --git a/src/FDM/JSBSim/models/propulsion/FGEngine.cpp b/src/FDM/JSBSim/models/propulsion/FGEngine.cpp index b40cdb349..436526f70 100644 --- a/src/FDM/JSBSim/models/propulsion/FGEngine.cpp +++ b/src/FDM/JSBSim/models/propulsion/FGEngine.cpp @@ -250,7 +250,7 @@ bool FGEngine::LoadThruster(Element *thruster_element) double P_Factor = 0, Sense = 0.0; string enginePath = FDMExec->GetEnginePath(); string aircraftPath = FDMExec->GetFullAircraftPath(); - ifstream thruster_file; + std::ifstream thruster_file; FGColumnVector3 location, orientation; string separator = "/"; diff --git a/src/FDM/LaRCsim/IO360.hxx b/src/FDM/LaRCsim/IO360.hxx index fe8ae82dd..76d79a56e 100644 --- a/src/FDM/LaRCsim/IO360.hxx +++ b/src/FDM/LaRCsim/IO360.hxx @@ -27,11 +27,6 @@ #include -#include STL_IOSTREAM -#include STL_FSTREAM - -SG_USING_STD(ofstream); - class FGNewEngine { private: diff --git a/src/FDM/UIUCModel/uiuc_aircraft.h b/src/FDM/UIUCModel/uiuc_aircraft.h index 593705588..1ade41da2 100644 --- a/src/FDM/UIUCModel/uiuc_aircraft.h +++ b/src/FDM/UIUCModel/uiuc_aircraft.h @@ -144,17 +144,12 @@ #include #include -#include STL_IOSTREAM +#include #include #include "uiuc_parsefile.h" #include "uiuc_flapdata.h" -SG_USING_STD(map); -SG_USING_STD(iostream); -SG_USING_STD(ofstream); - - typedef stack :: iterator LIST; /* Add more keywords here if required*/ @@ -635,7 +630,7 @@ struct AIRCRAFT #define recordParts aircraft_->recordParts /*= Keywords (token1) ===========================================*/ - map Keyword_map; + std::map Keyword_map; #define Keyword_map aircraft_->Keyword_map double CD, CX, CL, CZ, Cm, CY, Cl, Cn; @@ -670,7 +665,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* init ========== Initial values for equations of motion =======*/ - map init_map; + std::map init_map; #define init_map aircraft_->init_map int recordRate; @@ -777,7 +772,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* geometry ====== Aircraft-specific geometric quantities =======*/ - map geometry_map; + std::map geometry_map; #define geometry_map aircraft_->geometry_map double bw, cbar, Sw, ih, bh, chord_h, Sh; @@ -793,7 +788,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* controlSurface Control surface deflections and properties ===*/ - map controlSurface_map; + std::map controlSurface_map; #define controlSurface_map aircraft_->controlSurface_map double demax, demin; @@ -980,7 +975,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* controlsMixer = Control mixer ================================*/ - map controlsMixer_map; + std::map controlsMixer_map; #define controlsMixer_map aircraft_->controlsMixer_map double nomix; @@ -990,7 +985,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* mass =========== Aircraft-specific mass properties ===========*/ - map mass_map; + std::map mass_map; #define mass_map aircraft_->mass_map double Weight; @@ -1016,7 +1011,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* engine ======== Propulsion data ==============================*/ - map engine_map; + std::map engine_map; #define engine_map aircraft_->engine_map double simpleSingleMaxThrust; @@ -1158,7 +1153,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* CD ============ Aerodynamic x-force quantities (longitudinal) */ - map CD_map; + std::map CD_map; #define CD_map aircraft_->CD_map double CDo, CDK, CLK, CD_a, CD_adot, CD_q, CD_ih, CD_de, CD_dr, CD_da, CD_beta; @@ -1358,7 +1353,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* CL ============ Aerodynamic z-force quantities (longitudinal) */ - map CL_map; + std::map CL_map; #define CL_map aircraft_->CL_map double CLo, CL_a, CL_adot, CL_q, CL_ih, CL_de; @@ -1545,7 +1540,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* Cm ============ Aerodynamic m-moment quantities (longitudinal) */ - map Cm_map; + std::map Cm_map; #define Cm_map aircraft_->Cm_map double Cmo, Cm_a, Cm_a2, Cm_adot, Cm_q; @@ -1709,7 +1704,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* CY ============ Aerodynamic y-force quantities (lateral) =====*/ - map CY_map; + std::map CY_map; #define CY_map aircraft_->CY_map double CYo, CY_beta, CY_p, CY_r, CY_da, CY_dr, CY_dra, CY_bdot; @@ -1884,7 +1879,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* Cl ============ Aerodynamic l-moment quantities (lateral) ====*/ - map Cl_map; + std::map Cl_map; #define Cl_map aircraft_->Cl_map double Clo, Cl_beta, Cl_p, Cl_r, Cl_da, Cl_dr, Cl_daa; @@ -2057,7 +2052,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* Cn ============ Aerodynamic n-moment quantities (lateral) ====*/ - map Cn_map; + std::map Cn_map; #define Cn_map aircraft_->Cn_map double Cno, Cn_beta, Cn_p, Cn_r, Cn_da, Cn_dr, Cn_q, Cn_b3; @@ -2232,7 +2227,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* gear ========== Landing gear model quantities ================*/ - map gear_map; + std::map gear_map; #define gear_map aircraft_->gear_map #define MAX_GEAR 16 @@ -2258,7 +2253,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* ice =========== Ice model quantities ======================== */ - map ice_map; + std::map ice_map; #define ice_map aircraft_->ice_map bool ice_model, ice_on, beta_model; @@ -2793,7 +2788,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* fog =========== Fog field quantities ======================== */ - map fog_map; + std::map fog_map; #define fog_map aircraft_->fog_map bool fog_field; @@ -2821,7 +2816,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* record ======== Record desired quantites to file =============*/ - map record_map; + std::map record_map; #define record_map aircraft_->record_map /***** Angles ******/ @@ -2899,7 +2894,7 @@ struct AIRCRAFT /* Variables (token2) ===========================================*/ /* misc ========== Miscellaneous input commands =================*/ - map misc_map; + std::map misc_map; #define misc_map aircraft_->misc_map double simpleHingeMomentCoef; @@ -3036,7 +3031,7 @@ struct AIRCRAFT #define Cn_iced aircraft_->Cn_iced #define Ch_iced aircraft_->Ch_iced - ofstream fout; + std::ofstream fout; #define fout aircraft_->fout diff --git a/src/FDM/UIUCModel/uiuc_engine.cpp b/src/FDM/UIUCModel/uiuc_engine.cpp index a5af47eff..453b4e37f 100644 --- a/src/FDM/UIUCModel/uiuc_engine.cpp +++ b/src/FDM/UIUCModel/uiuc_engine.cpp @@ -72,8 +72,6 @@ #include "uiuc_engine.h" -SG_USING_STD(cerr); - void uiuc_engine() { stack command_list; diff --git a/src/FDM/UIUCModel/uiuc_menu_functions.h b/src/FDM/UIUCModel/uiuc_menu_functions.h index 048ebf991..1423c0fe4 100644 --- a/src/FDM/UIUCModel/uiuc_menu_functions.h +++ b/src/FDM/UIUCModel/uiuc_menu_functions.h @@ -6,17 +6,12 @@ #include #include -#include STL_IOSTREAM -//#include STL_STRSTREAM -#include - -//SG_USING_STD(istrstream); void d_2_to_3( double array2D[100][100], double array3D[][100][100], int index3D); void d_1_to_2( double array1D[100], double array2D[][100], int index2D); void d_1_to_1( double array1[100], double array2[100] ); void i_1_to_2( int array1D[100], int array2D[][100], int index2D); -bool check_float( const string &token); +bool check_float( const std::string &token); //bool check_float( const string &token); #endif //_MENU_FUNCTIONS_H_ diff --git a/src/FDM/UIUCModel/uiuc_warnings_errors.cpp b/src/FDM/UIUCModel/uiuc_warnings_errors.cpp index a4e3930c8..c16266c14 100644 --- a/src/FDM/UIUCModel/uiuc_warnings_errors.cpp +++ b/src/FDM/UIUCModel/uiuc_warnings_errors.cpp @@ -74,6 +74,8 @@ Prints to screen the follow: **********************************************************************/ +#include + #include "uiuc_warnings_errors.h" SG_USING_STD (cerr); @@ -83,7 +85,7 @@ SG_USING_STD (endl); SG_USING_STD (exit); #endif -void uiuc_warnings_errors(int errorCode, string line) +void uiuc_warnings_errors(int errorCode, std::string line) { switch (errorCode) { diff --git a/src/FDM/UIUCModel/uiuc_warnings_errors.h b/src/FDM/UIUCModel/uiuc_warnings_errors.h index e19d13f95..62640bb47 100644 --- a/src/FDM/UIUCModel/uiuc_warnings_errors.h +++ b/src/FDM/UIUCModel/uiuc_warnings_errors.h @@ -5,10 +5,7 @@ #include #include -#include STL_IOSTREAM -SG_USING_STD(string); - -void uiuc_warnings_errors(int errorCode, string line); +void uiuc_warnings_errors(int errorCode, std::string line); #endif //_WARNINGS_ERRORS_H_ diff --git a/src/FDM/YASim/Rotorpart.hpp b/src/FDM/YASim/Rotorpart.hpp index 7f50349c2..05b945b37 100644 --- a/src/FDM/YASim/Rotorpart.hpp +++ b/src/FDM/YASim/Rotorpart.hpp @@ -1,7 +1,7 @@ #ifndef _ROTORPART_HPP #define _ROTORPART_HPP -#include -#include +#include + namespace yasim { class Rotor; class Rotorpart diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 7cb2c6fc3..0c6c42ca3 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -462,7 +462,7 @@ SGPropertyNode *fgInitLocale(const char *language) { // Initialize the localization routines bool fgDetectLanguage() { - char *language = ::getenv("LANG"); + const char *language = ::getenv("LANG"); if (language == NULL) { SG_LOG(SG_GENERAL, SG_INFO, "Unable to detect the language" ); diff --git a/src/Main/logger.hxx b/src/Main/logger.hxx index d9ffb73c3..184af4425 100644 --- a/src/Main/logger.hxx +++ b/src/Main/logger.hxx @@ -14,7 +14,7 @@ # include #endif -#include +#include #include #include @@ -23,10 +23,6 @@ #include #include -SG_USING_STD(ostream); -SG_USING_STD(vector); - - /** * Log any property values to any number of CSV files. */ diff --git a/src/Navaids/fix.hxx b/src/Navaids/fix.hxx index a5f8f891d..2335be1fb 100644 --- a/src/Navaids/fix.hxx +++ b/src/Navaids/fix.hxx @@ -40,10 +40,7 @@ # include #endif -SG_USING_STD(istream); - #include STL_STRING -SG_USING_STD(string); // SG_USING_STD(cout); // SG_USING_STD(endl); @@ -51,7 +48,7 @@ SG_USING_STD(string); class FGFix { - string ident; + std::string ident; double lon, lat; public: @@ -59,11 +56,11 @@ public: inline FGFix(void); inline ~FGFix(void) {} - inline const string& get_ident() const { return ident; } + inline const std::string& get_ident() const { return ident; } inline double get_lon() const { return lon; } inline double get_lat() const { return lat; } - friend istream& operator>> ( istream&, FGFix& ); + friend std::istream& operator>> ( std::istream&, FGFix& ); }; @@ -76,8 +73,8 @@ FGFix::FGFix() } -inline istream& -operator >> ( istream& in, FGFix& f ) +inline std::istream& +operator >> ( std::istream& in, FGFix& f ) { in >> f.lat; diff --git a/src/Navaids/navrecord.hxx b/src/Navaids/navrecord.hxx index dcf605cee..d5ab6ec0b 100644 --- a/src/Navaids/navrecord.hxx +++ b/src/Navaids/navrecord.hxx @@ -43,9 +43,6 @@ # include #endif -SG_USING_STD(istream); - - #define FG_NAV_DEFAULT_RANGE 50 // nm #define FG_LOC_DEFAULT_RANGE 18 // nm #define FG_DME_DEFAULT_RANGE 50 // nm @@ -105,7 +102,7 @@ public: inline bool get_serviceable() const { return serviceable; } inline const char *get_trans_ident() const { return trans_ident.c_str(); } - friend istream& operator>> ( istream&, FGNavRecord& ); + friend std::istream& operator>> ( std::istream&, FGNavRecord& ); }; @@ -136,8 +133,8 @@ inline fg_nav_types FGNavRecord::get_fg_type() const { } -inline istream& -operator >> ( istream& in, FGNavRecord& n ) +inline std::istream& +operator >> ( std::istream& in, FGNavRecord& n ) { in >> n.type; @@ -209,7 +206,7 @@ public: inline const string& get_channel() const { return channel; } inline int get_freq() const { return freq; } - friend istream& operator>> ( istream&, FGTACANRecord& ); + friend std::istream& operator>> ( std::istream&, FGTACANRecord& ); }; @@ -221,8 +218,8 @@ FGTACANRecord::FGTACANRecord(void) : { } -inline istream& -operator >> ( istream& in, FGTACANRecord& n ) +inline std::istream& +operator >> ( std::istream& in, FGTACANRecord& n ) { in >> n.channel >> n.freq ; //getline( in, n.name );