From b1b4b7ecf48c4420d4445979c36cbf3f80be616a Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 17 Oct 2011 17:41:59 +0100 Subject: [PATCH] Fix (nearly) all the std:: namespace violations in headers, in preparation for fixing SGsmplstat.hxx to *not* do a 'using namespace std'. --- src/AIModel/AIBase.hxx | 2 +- src/ATC/atcdialog.hxx | 4 +- src/ATCDCL/ATCDialogOld.cxx | 2 + src/ATCDCL/atis.cxx | 2 + src/Airports/simple.cxx | 7 +- src/Autopilot/analogcomponent.cxx | 4 +- src/Autopilot/autopilot.cxx | 9 ++- src/Autopilot/autopilotgroup.cxx | 5 +- src/Autopilot/component.cxx | 4 +- src/Autopilot/digitalcomponent.cxx | 1 + src/Autopilot/digitalfilter.cxx | 5 ++ src/Autopilot/flipflop.cxx | 5 ++ src/Autopilot/pidcontroller.cxx | 3 + src/Autopilot/pisimplecontroller.cxx | 3 + src/Autopilot/predictor.cxx | 3 + src/Cockpit/panel.cxx | 2 + src/Environment/fgclouds.cxx | 2 +- src/Environment/presets.cxx | 1 + src/Environment/realwx_ctrl.cxx | 2 +- src/Environment/ridge_lift.cxx | 6 +- src/Environment/terrainsampler.cxx | 5 ++ src/FDM/YASim/Hitch.cpp | 3 + src/FDM/YASim/Rotor.cpp | 7 +- src/GUI/menubar.cxx | 5 +- src/GUI/menubar.hxx | 13 ++-- src/GUI/new_gui.cxx | 4 +- src/GUI/new_gui.hxx | 11 +-- src/GUI/property_list.cxx | 4 +- src/Input/FGCommonInput.cxx | 1 + src/Input/FGEventInput.cxx | 2 + src/Input/FGEventInput.hxx | 31 +++++---- src/Input/FGJoystickInput.cxx | 2 +- src/Input/FGMacOSXEventInput.cxx | 9 ++- src/Input/FGMacOSXEventInput.hxx | 22 +++--- src/Input/FGMouseInput.cxx | 2 + src/Instrumentation/HUD/HUD.cxx | 2 + src/Instrumentation/KLN89/kln89.cxx | 1 + src/Instrumentation/KLN89/kln89.hxx | 12 ++-- src/Instrumentation/KLN89/kln89_page.cxx | 2 + src/Instrumentation/KLN89/kln89_page.hxx | 18 ++--- src/Instrumentation/KLN89/kln89_page_alt.cxx | 2 + src/Instrumentation/KLN89/kln89_page_apt.hxx | 12 ++-- src/Instrumentation/KLN89/kln89_page_cal.cxx | 2 + src/Instrumentation/KLN89/kln89_page_dir.cxx | 2 + src/Instrumentation/KLN89/kln89_page_dir.hxx | 2 +- src/Instrumentation/KLN89/kln89_page_fpl.hxx | 8 +-- src/Instrumentation/KLN89/kln89_page_int.cxx | 2 + src/Instrumentation/KLN89/kln89_page_int.hxx | 8 +-- src/Instrumentation/KLN89/kln89_page_nav.cxx | 2 + src/Instrumentation/KLN89/kln89_page_nav.hxx | 2 +- src/Instrumentation/KLN89/kln89_page_ndb.cxx | 2 + src/Instrumentation/KLN89/kln89_page_ndb.hxx | 8 +-- src/Instrumentation/KLN89/kln89_page_oth.cxx | 2 + src/Instrumentation/KLN89/kln89_page_vor.cxx | 2 + src/Instrumentation/KLN89/kln89_page_vor.hxx | 8 +-- src/Instrumentation/NavDisplay.hxx | 4 +- src/Instrumentation/adf.hxx | 2 +- src/Instrumentation/airspeed_indicator.hxx | 2 +- src/Instrumentation/altimeter.hxx | 2 +- src/Instrumentation/attitude_indicator.cxx | 1 + src/Instrumentation/attitude_indicator.hxx | 4 +- src/Instrumentation/clock.cxx | 2 +- src/Instrumentation/clock.hxx | 2 +- src/Instrumentation/dclgps.hxx | 68 +++++++++---------- src/Instrumentation/dme.hxx | 2 +- src/Instrumentation/gsdi.cxx | 2 +- src/Instrumentation/gsdi.hxx | 2 +- src/Instrumentation/heading_indicator.cxx | 6 +- src/Instrumentation/heading_indicator.hxx | 4 +- src/Instrumentation/heading_indicator_dg.cxx | 10 +-- src/Instrumentation/heading_indicator_dg.hxx | 2 +- src/Instrumentation/heading_indicator_fg.cxx | 1 + src/Instrumentation/heading_indicator_fg.hxx | 2 +- .../inst_vertical_speed_indicator.hxx | 2 +- src/Instrumentation/kr_87.hxx | 6 +- src/Instrumentation/mag_compass.cxx | 2 +- src/Instrumentation/mag_compass.hxx | 2 +- src/Instrumentation/mrg.cxx | 2 + src/Instrumentation/mrg.hxx | 2 +- src/Instrumentation/navradio.hxx | 2 +- src/Instrumentation/newnavradio.cxx | 4 +- src/Instrumentation/slip_skid_ball.cxx | 1 + src/Instrumentation/slip_skid_ball.hxx | 2 +- src/Instrumentation/tacan.cxx | 2 +- src/Instrumentation/tacan.hxx | 14 ++-- src/Instrumentation/transponder.cxx | 2 + src/Instrumentation/transponder.hxx | 4 +- src/Instrumentation/turn_indicator.cxx | 1 + src/Instrumentation/turn_indicator.hxx | 2 +- .../vertical_speed_indicator.cxx | 1 + .../vertical_speed_indicator.hxx | 4 +- src/Instrumentation/wxradar.cxx | 2 + src/Instrumentation/wxradar.hxx | 4 +- src/Main/fg_props.hxx | 2 +- src/Main/logger.cxx | 4 +- src/Main/main.cxx | 2 +- src/Main/splash.cxx | 4 +- src/Main/util.cxx | 15 ++-- src/Main/viewmgr.cxx | 2 +- src/Main/viewmgr.hxx | 4 +- src/Navaids/navdb.cxx | 1 + src/Network/ATC-Inputs.cxx | 2 +- src/Network/ATC-Main.cxx | 4 +- src/Scenery/tilemgr.cxx | 2 +- src/Scenery/tilemgr.hxx | 2 +- src/Sound/voice.cxx | 3 +- src/Sound/voice.hxx | 13 ++-- src/Systems/pitot.hxx | 2 +- src/Systems/static.cxx | 6 +- src/Systems/static.hxx | 2 +- src/Systems/vacuum.cxx | 2 +- src/Systems/vacuum.hxx | 4 +- src/Time/TimeManager.cxx | 2 + utils/fgpanel/FGPanelProtocol.hxx | 2 +- 114 files changed, 320 insertions(+), 231 deletions(-) diff --git a/src/AIModel/AIBase.hxx b/src/AIModel/AIBase.hxx index ed20dd869..fb845bd41 100644 --- a/src/AIModel/AIBase.hxx +++ b/src/AIModel/AIBase.hxx @@ -134,7 +134,7 @@ public: string _path; string _callsign; string _submodel; - string _name; + std::string _name; string _parent; SGGeod userpos; diff --git a/src/ATC/atcdialog.hxx b/src/ATC/atcdialog.hxx index 2e1c4ada6..3125fd3e4 100644 --- a/src/ATC/atcdialog.hxx +++ b/src/ATC/atcdialog.hxx @@ -40,8 +40,8 @@ #include // mkDialog #include -typedef vector StringVec; -typedef vector:: iterator StringVecIterator; +typedef std::vector StringVec; +typedef StringVec::iterator StringVecIterator; class FGATCDialogNew { diff --git a/src/ATCDCL/ATCDialogOld.cxx b/src/ATCDCL/ATCDialogOld.cxx index 9f1a53077..bb3cc1650 100644 --- a/src/ATCDCL/ATCDialogOld.cxx +++ b/src/ATCDCL/ATCDialogOld.cxx @@ -41,6 +41,8 @@ #include using std::ostringstream; +using std::cerr; +using std::endl; FGATCDialog *current_atcdialog; diff --git a/src/ATCDCL/atis.cxx b/src/ATCDCL/atis.cxx index 460cc31a8..dad36fb0a 100644 --- a/src/ATCDCL/atis.cxx +++ b/src/ATCDCL/atis.cxx @@ -59,6 +59,8 @@ #include "ATCutils.hxx" #include "ATCmgr.hxx" +using std::string; +using std::map; using std::cout; using std::cout; using boost::ref; diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 92b79005a..d9ac0e676 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -51,6 +51,8 @@ #include using std::vector; +using std::pair; + using namespace flightgear; // magic import of a helper which uses FGPositioned internals @@ -76,7 +78,6 @@ FGAirport::FGAirport(const string &id, const SGGeod& location, const SGGeod& tow FGAirport::~FGAirport() { - cerr << "Deleting Airport" << endl; delete _dynamics; } @@ -552,7 +553,7 @@ FGAirport::selectSID(const SGGeod& aDest, FGRunway* aRwy) << (aRwy ? aRwy->ident() : "no runway preference")); } - return make_pair(sid, enroute); + return std::make_pair(sid, enroute); } pair @@ -584,7 +585,7 @@ FGAirport::selectSTAR(const SGGeod& aOrigin, FGRunway* aRwy) } } // of STAR iteration - return make_pair(star, enroute); + return std::make_pair(star, enroute); } diff --git a/src/Autopilot/analogcomponent.cxx b/src/Autopilot/analogcomponent.cxx index d32717d22..752c3eced 100644 --- a/src/Autopilot/analogcomponent.cxx +++ b/src/Autopilot/analogcomponent.cxx @@ -51,7 +51,7 @@ double AnalogComponent::clamp( double value ) const bool AnalogComponent::configure( const std::string & nodeName, SGPropertyNode_ptr configNode ) { - SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ")" << endl ); + SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ")" ); if( Component::configure( nodeName, configNode ) ) return true; @@ -108,6 +108,6 @@ bool AnalogComponent::configure( const std::string & nodeName, SGPropertyNode_pt return true; } - SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ") [unhandled]" << endl ); + SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ") [unhandled]" ); return false; } diff --git a/src/Autopilot/autopilot.cxx b/src/Autopilot/autopilot.cxx index e8bb91b02..b68ea958e 100644 --- a/src/Autopilot/autopilot.cxx +++ b/src/Autopilot/autopilot.cxx @@ -36,6 +36,9 @@ #include "Main/fg_props.hxx" +using std::map; +using std::string; + using namespace FGXMLAutopilot; Autopilot::Autopilot( SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode ) : @@ -58,13 +61,13 @@ Autopilot::Autopilot( SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode SGPropertyNode_ptr node = configNode->getChild(i); string childName = node->getName(); if( componentForge.count(childName) == 0 ) { - SG_LOG( SG_AUTOPILOT, SG_BULK, "unhandled element <" << childName << ">" << endl ); + SG_LOG( SG_AUTOPILOT, SG_BULK, "unhandled element <" << childName << ">" << std::endl ); continue; } Component * component = (*componentForge[childName])(node); if( component->get_name().length() == 0 ) { - ostringstream buf; + std::ostringstream buf; buf << "unnamed_component_" << i; component->set_name( buf.str() ); } @@ -96,7 +99,7 @@ void Autopilot::add_component( Component * component ) // check for duplicate name std::string name = component->get_name(); for( unsigned i = 0; get_subsystem( name.c_str() ) != NULL; i++ ) { - ostringstream buf; + std::ostringstream buf; buf << component->get_name() << "_" << i; name = buf.str(); } diff --git a/src/Autopilot/autopilotgroup.cxx b/src/Autopilot/autopilotgroup.cxx index e58cd8fd7..10c55514f 100644 --- a/src/Autopilot/autopilotgroup.cxx +++ b/src/Autopilot/autopilotgroup.cxx @@ -36,7 +36,8 @@ #include #include
- +using std::vector; +using std::string; using simgear::PropertyList; class FGXMLAutopilotGroupImplementation : public FGXMLAutopilotGroup @@ -111,7 +112,7 @@ void FGXMLAutopilotGroupImplementation::initFrom( SGPropertyNode_ptr rootNode, c // check for duplicate names string name = apName; for( unsigned i = 0; get_subsystem( apName.c_str() ) != NULL; i++ ) { - ostringstream buf; + std::ostringstream buf; buf << name << "_" << i; apName = buf.str(); } diff --git a/src/Autopilot/component.cxx b/src/Autopilot/component.cxx index 63ee6262a..1da236cc9 100644 --- a/src/Autopilot/component.cxx +++ b/src/Autopilot/component.cxx @@ -58,7 +58,7 @@ bool Component::configure( SGPropertyNode_ptr configNode ) bool Component::configure( const std::string & nodeName, SGPropertyNode_ptr configNode ) { - SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ")" << endl ); + SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ")" << std::endl ); if ( nodeName == "name" ) { _name = configNode->getStringValue(); @@ -97,7 +97,7 @@ bool Component::configure( const std::string & nodeName, SGPropertyNode_ptr conf return true; } // enable - SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ") [unhandled]" << endl ); + SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ") [unhandled]" << std::endl ); return false; } diff --git a/src/Autopilot/digitalcomponent.cxx b/src/Autopilot/digitalcomponent.cxx index 8fed619fb..5e3e9fb22 100644 --- a/src/Autopilot/digitalcomponent.cxx +++ b/src/Autopilot/digitalcomponent.cxx @@ -24,6 +24,7 @@ #include "digitalcomponent.hxx" #include
+using std::string; using namespace FGXMLAutopilot; DigitalComponent::DigitalComponent() : diff --git a/src/Autopilot/digitalfilter.cxx b/src/Autopilot/digitalfilter.cxx index 268679743..6f83b01e1 100644 --- a/src/Autopilot/digitalfilter.cxx +++ b/src/Autopilot/digitalfilter.cxx @@ -25,6 +25,11 @@ #include "functor.hxx" #include +using std::map; +using std::string; +using std::endl; +using std::cout; + namespace FGXMLAutopilot { /* --------------------------------------------------------------------------------- */ diff --git a/src/Autopilot/flipflop.cxx b/src/Autopilot/flipflop.cxx index 076b2db48..8046ce5dc 100644 --- a/src/Autopilot/flipflop.cxx +++ b/src/Autopilot/flipflop.cxx @@ -24,6 +24,11 @@ #include "inputvalue.hxx" #include
+using std::map; +using std::string; +using std::endl; +using std::cout; + namespace FGXMLAutopilot { /** diff --git a/src/Autopilot/pidcontroller.cxx b/src/Autopilot/pidcontroller.cxx index 1ad027460..c3631a22d 100644 --- a/src/Autopilot/pidcontroller.cxx +++ b/src/Autopilot/pidcontroller.cxx @@ -25,6 +25,9 @@ using namespace FGXMLAutopilot; +using std::endl; +using std::cout; + PIDController::PIDController(): AnalogComponent(), alpha( 0.1 ), diff --git a/src/Autopilot/pisimplecontroller.cxx b/src/Autopilot/pisimplecontroller.cxx index b19633adf..c33260698 100644 --- a/src/Autopilot/pisimplecontroller.cxx +++ b/src/Autopilot/pisimplecontroller.cxx @@ -25,6 +25,9 @@ using namespace FGXMLAutopilot; +using std::endl; +using std::cout; + PISimpleController::PISimpleController() : AnalogComponent(), _int_sum( 0.0 ) diff --git a/src/Autopilot/predictor.cxx b/src/Autopilot/predictor.cxx index e1a9f6dc8..d5c854a72 100644 --- a/src/Autopilot/predictor.cxx +++ b/src/Autopilot/predictor.cxx @@ -25,6 +25,9 @@ using namespace FGXMLAutopilot; +using std::endl; +using std::cout; + Predictor::Predictor () : AnalogComponent(), _average(0.0) diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index 7c7dd810c..916771726 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -71,6 +71,8 @@ // my hardware/driver requires many more. #define POFF_UNITS 8 +using std::map; + //////////////////////////////////////////////////////////////////////// // Local functions. //////////////////////////////////////////////////////////////////////// diff --git a/src/Environment/fgclouds.cxx b/src/Environment/fgclouds.cxx index 6cc4d49ef..e7273a714 100644 --- a/src/Environment/fgclouds.cxx +++ b/src/Environment/fgclouds.cxx @@ -135,7 +135,7 @@ double FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_ double c = abox->getDoubleValue("count", 5); int count = (int) (c + (sg_random() - 0.5) * c); - extent = max(w*w, extent); + extent = std::max(w*w, extent); for (int j = 0; j < count; j++) { diff --git a/src/Environment/presets.cxx b/src/Environment/presets.cxx index 55da64630..5e31e63cf 100644 --- a/src/Environment/presets.cxx +++ b/src/Environment/presets.cxx @@ -24,6 +24,7 @@ #endif #include "presets.hxx" +#include #include #include
diff --git a/src/Environment/realwx_ctrl.cxx b/src/Environment/realwx_ctrl.cxx index a481268ea..5592a386e 100644 --- a/src/Environment/realwx_ctrl.cxx +++ b/src/Environment/realwx_ctrl.cxx @@ -330,7 +330,7 @@ void NoaaMetarRealWxController::requestMetar( MetarDataHandler * metarDataHandle string reply; if( name == "X-TIME" ) { - ostringstream buf; + std::ostringstream buf; buf << globals->get_time_params()->get_cur_time(); reply = buf.str(); } diff --git a/src/Environment/ridge_lift.cxx b/src/Environment/ridge_lift.cxx index 3b675a93f..cac1388aa 100644 --- a/src/Environment/ridge_lift.cxx +++ b/src/Environment/ridge_lift.cxx @@ -187,8 +187,8 @@ void FGRidgeLift::update(double dt) { //boundaries double boundary2_m = 130.0; // in the lift if (lift_factor < 0.0) { // in the sink - double highest_probe_temp= max ( probe_elev_m[1], probe_elev_m[2] ); - double highest_probe_downwind_m= max ( highest_probe_temp, probe_elev_m[3] ); + double highest_probe_temp= std::max ( probe_elev_m[1], probe_elev_m[2] ); + double highest_probe_downwind_m= std::max ( highest_probe_temp, probe_elev_m[3] ); boundary2_m = highest_probe_downwind_m - probe_elev_m[0]; } @@ -199,7 +199,7 @@ void FGRidgeLift::update(double dt) { agl_factor = 1.0; } else { agl_factor = exp(-(2 + probe_elev_m[0] / 2000) * - (user_altitude_agl_m - boundary2_m) / max(probe_elev_m[0],200.0)); + (user_altitude_agl_m - boundary2_m) / std::max(probe_elev_m[0],200.0)); } double ground_wind_speed_mps = _surface_wind_speed_node->getDoubleValue() * SG_NM_TO_METER / 3600; diff --git a/src/Environment/terrainsampler.cxx b/src/Environment/terrainsampler.cxx index d3a0e7138..c2f928350 100644 --- a/src/Environment/terrainsampler.cxx +++ b/src/Environment/terrainsampler.cxx @@ -30,7 +30,12 @@ #include #include "terrainsampler.hxx" + using simgear::PropertyList; +using std::deque; +using std::vector; +using std::ostringstream; +using std::string; #include diff --git a/src/FDM/YASim/Hitch.cpp b/src/FDM/YASim/Hitch.cpp index df8b1f7cc..5681625b8 100644 --- a/src/FDM/YASim/Hitch.cpp +++ b/src/FDM/YASim/Hitch.cpp @@ -7,6 +7,9 @@ #include "Hitch.hpp" + +using std::vector; + namespace yasim { Hitch::Hitch(const char *name) { diff --git a/src/FDM/YASim/Rotor.cpp b/src/FDM/YASim/Rotor.cpp index 2a93a4457..797bf21ab 100644 --- a/src/FDM/YASim/Rotor.cpp +++ b/src/FDM/YASim/Rotor.cpp @@ -11,8 +11,6 @@ #include #include -using std::setprecision; - #ifdef TEST_DEBUG #include #endif @@ -20,7 +18,8 @@ using std::setprecision; #include #include - +using std::setprecision; +using std::endl; namespace yasim { @@ -732,7 +731,7 @@ void Rotor::setParameter(const char *parametername, float value) p(rotor_correction_factor,1) SG_LOG(SG_INPUT, SG_ALERT, "internal error in parameter set up for rotor: '" << - parametername <<"'" << endl); + parametername <<"'" << std::endl); #undef p } diff --git a/src/GUI/menubar.cxx b/src/GUI/menubar.cxx index 40f803c23..b21b9ce64 100644 --- a/src/GUI/menubar.cxx +++ b/src/GUI/menubar.cxx @@ -14,8 +14,9 @@ #include "new_gui.hxx" #include "menubar.hxx" - - +using std::vector; +using std::string; +using std::map; //////////////////////////////////////////////////////////////////////// // FIXME!! // diff --git a/src/GUI/menubar.hxx b/src/GUI/menubar.hxx index eab4b7ff8..79e0af814 100644 --- a/src/GUI/menubar.hxx +++ b/src/GUI/menubar.hxx @@ -7,17 +7,12 @@ # error This library requires C++ #endif -#include // for SG_USING_STD #include
#include #include -using std::map; - #include -using std::vector; - class puMenuBar; class puObject; @@ -124,7 +119,7 @@ private: puMenuBar * _menuBar; // A map of bindings for the menubar. - map > _bindings; + std::map > _bindings; // These are hoops that we have to jump through because PUI doesn't // do memory management for lists. We have to allocate the arrays, @@ -132,11 +127,11 @@ private: // freed. char ** make_char_array (int size); puCallback * make_callback_array (int size); - vector _char_arrays; - vector _callback_arrays; + std::vector _char_arrays; + std::vector _callback_arrays; // A map for {menu node path}->puObject translation. - map _objects; + std::map _objects; }; #endif // __MENUBAR_HXX diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index b8834fdca..220d4c3fc 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -32,9 +32,9 @@ extern puFont FONT_HELVETICA_14; extern puFont FONT_SANS_12B; +using std::map; +using std::string; - - //////////////////////////////////////////////////////////////////////// // Implementation of NewGUI. //////////////////////////////////////////////////////////////////////// diff --git a/src/GUI/new_gui.hxx b/src/GUI/new_gui.hxx index 0797d53a6..53590173e 100644 --- a/src/GUI/new_gui.hxx +++ b/src/GUI/new_gui.hxx @@ -212,9 +212,10 @@ private: }; puFont *_font; - map _colors; - typedef map::iterator _itt_t; - typedef map::const_iterator _citt_t; + typedef std::map ColourDict; + ColourDict _colors; + typedef ColourDict::iterator _itt_t; + typedef ColourDict::const_iterator _citt_t; void clear_colors(); @@ -311,8 +312,8 @@ private: // Path to the font directory SGPath _path; - typedef map TexFontMap; - typedef map PuFontMap; + typedef std::map TexFontMap; + typedef std::map PuFontMap; TexFontMap _texFonts; PuFontMap _puFonts; diff --git a/src/GUI/property_list.cxx b/src/GUI/property_list.cxx index 7940ca28f..6ceba838c 100644 --- a/src/GUI/property_list.cxx +++ b/src/GUI/property_list.cxx @@ -31,8 +31,10 @@ #include #include #include + using std::string; using std::cout; +using std::endl; typedef string stdString; // puObject has a "string" member @@ -95,7 +97,7 @@ static void dumpProperties(const SGPropertyNode *node) case props::VEC3D: case props::VEC4D: { - streamsize precision = cout.precision(15); + std::streamsize precision = cout.precision(15); c->printOn(cout); cout.precision(precision); } diff --git a/src/Input/FGCommonInput.cxx b/src/Input/FGCommonInput.cxx index 3e9d92aa9..f62b5ebc7 100644 --- a/src/Input/FGCommonInput.cxx +++ b/src/Input/FGCommonInput.cxx @@ -33,6 +33,7 @@ #include using simgear::PropertyList; +using std::string; void FGCommonInput::read_bindings (const SGPropertyNode * node, binding_list_t * binding_list, int modifiers, const string & module ) { diff --git a/src/Input/FGEventInput.cxx b/src/Input/FGEventInput.cxx index 7e8c98944..a90d20c88 100644 --- a/src/Input/FGEventInput.cxx +++ b/src/Input/FGEventInput.cxx @@ -32,6 +32,8 @@ #include using simgear::PropertyList; +using std::cout; +using std::endl; FGEventSetting::FGEventSetting( SGPropertyNode_ptr base ) : value(0.0) diff --git a/src/Input/FGEventInput.hxx b/src/Input/FGEventInput.hxx index 7188c8381..23b4dd4d1 100644 --- a/src/Input/FGEventInput.hxx +++ b/src/Input/FGEventInput.hxx @@ -24,6 +24,9 @@ #define __FGEVENTINPUT_HXX #include "FGCommonInput.hxx" + +#include + #include "FGButton.hxx" #include "FGDeviceConfigurationMap.hxx" #include @@ -57,7 +60,7 @@ protected: }; typedef SGSharedPtr FGEventSetting_ptr; -typedef vector setting_list_t; +typedef std::vector setting_list_t; /* * A wrapper class for a configured event. @@ -99,12 +102,12 @@ public: /* * access for the name property */ - string GetName() const { return name; } + std::string GetName() const { return name; } /* * access for the description property */ - string GetDescription() const { return desc; } + std::string GetDescription() const { return desc; } virtual void update( double dt ); @@ -113,10 +116,10 @@ public: protected: virtual void fire( SGBinding * binding, FGEventData & eventData ); /* A more or less meaningfull description of the event */ - string desc; + std::string desc; /* One of the predefined names of the event */ - string name; + std::string name; /* A list of SGBinding objects */ binding_list_t bindings[KEYMOD_MAX]; @@ -184,7 +187,7 @@ typedef class SGSharedPtr FGInputEvent_ptr; class FGInputDevice : public SGReferenced { public: FGInputDevice() : debugEvents(false), grab(false) {} - FGInputDevice( string aName ) : name(aName) {} + FGInputDevice( std::string aName ) : name(aName) {} virtual ~FGInputDevice(); @@ -193,15 +196,15 @@ public: virtual void Send( const char * eventName, double value ) = 0; - inline void Send( const string & eventName, double value ) { + inline void Send( const std::string & eventName, double value ) { Send( eventName.c_str(), value ); } virtual const char * TranslateEventName( FGEventData & eventData ) = 0; - void SetName( string name ); - string & GetName() { return name; } + void SetName( std::string name ); + std::string & GetName() { return name; } void HandleEvent( FGEventData & eventData ); @@ -218,14 +221,14 @@ public: bool GetGrab() const { return grab; } - const string & GetNasalModule() const { return nasalModule; } + const std::string & GetNasalModule() const { return nasalModule; } private: // A map of events, this device handles - map handledEvents; + std::map handledEvents; // the device has a name to be recognized - string name; + std::string name; // print out events comming in from the device // if true @@ -236,7 +239,7 @@ private: bool grab; SGPropertyNode_ptr deviceNode; - string nasalModule; + std::string nasalModule; }; typedef SGSharedPtr FGInputDevice_ptr; @@ -261,7 +264,7 @@ protected: unsigned AddDevice( FGInputDevice * inputDevice ); void RemoveDevice( unsigned index ); - map input_devices; + std::map input_devices; FGDeviceConfigurationMap configMap; SGPropertyNode_ptr nasalClose; diff --git a/src/Input/FGJoystickInput.cxx b/src/Input/FGJoystickInput.cxx index 516679f25..58a491c78 100644 --- a/src/Input/FGJoystickInput.cxx +++ b/src/Input/FGJoystickInput.cxx @@ -193,7 +193,7 @@ void FGJoystickInput::postinit() // // Initialize nasal groups. // - ostringstream str; + std::ostringstream str; str << "__js" << i; string module = str.str(); nasalsys->createModule(module.c_str(), module.c_str(), "", 0); diff --git a/src/Input/FGMacOSXEventInput.cxx b/src/Input/FGMacOSXEventInput.cxx index 6c6d27fb5..28c3094cc 100644 --- a/src/Input/FGMacOSXEventInput.cxx +++ b/src/Input/FGMacOSXEventInput.cxx @@ -22,6 +22,9 @@ #include "FGMacOSXEventInput.hxx" +using std::stringstream; +using std::map; +using std::string; #define GetHIDElementLongValue(element, key) ({ \ long value = 0; \ @@ -612,7 +615,7 @@ void FGMacOSXInputDevice::Open() { if (ret != kIOReturnSuccess) { SG_LOG(SG_INPUT, SG_ALERT, "Error creating a plugin for HID : " << GetName()); - throw exception(); + throw std::exception(); return; } @@ -626,14 +629,14 @@ void FGMacOSXInputDevice::Open() { (*plugin)->Release(plugin); // don't leak a ref if (devInterface == NULL) { return; - throw exception(); + throw std::exception(); } // store the interface in this instance ret = (*devInterface)->open(devInterface, 0); if (ret != kIOReturnSuccess) { SG_LOG(SG_INPUT, SG_ALERT, "Error opening device interface: " << GetName()); - throw exception(); + throw std::exception(); return; } CFDictionaryRef props = getProperties(); diff --git a/src/Input/FGMacOSXEventInput.hxx b/src/Input/FGMacOSXEventInput.hxx index a730c3015..07e16ae13 100644 --- a/src/Input/FGMacOSXEventInput.hxx +++ b/src/Input/FGMacOSXEventInput.hxx @@ -68,9 +68,9 @@ typedef enum { class HIDElement; struct FGMacOSXEventData : public FGEventData { - FGMacOSXEventData(string name, double value, double dt, int modifiers) : + FGMacOSXEventData(std::string name, double value, double dt, int modifiers) : FGEventData(value, dt, modifiers), name(name) {} - string name; + std::string name; }; // @@ -92,7 +92,7 @@ public: HIDElement(CFDictionaryRef element, long page, long usage); virtual ~HIDElement() {} bool isUpdated(); - string getName() { return name; } + std::string getName() { return name; } virtual void generateEvent(FGMacOSXInputDevice *device, double dt, int modifiers); virtual long read(IOHIDDeviceInterface **interface); virtual void write(IOHIDDeviceInterface **interface, double value) { @@ -106,7 +106,7 @@ protected: float value; float lastValue; - string name; + std::string name; }; class AxisElement : public HIDElement { @@ -182,7 +182,7 @@ public: private: io_object_t device; IOHIDDeviceInterface **devInterface; - map elements; // maps eventName and its relevant element for Send() + std::map elements; // maps eventName and its relevant element for Send() }; // @@ -225,22 +225,22 @@ private: io_iterator_t removedIterator; // maps FG device property ID (i.e. /input/events/device[ID]) with io_object for detaching devices - map deviceIndices; + std::map deviceIndices; }; // // For obtaining event name and type from both HID element page and usage // -class HIDTypeByID : public map*> { +class HIDTypeByID : public std::map*> { public: HIDTypeByID(struct HIDTypes *table) { for( int i = 0; table[i].key!= -1; i++ ) - (*this)[table[i].key] = new pair(table[i].type, table[i].eventName); + (*this)[table[i].key] = new std::pair(table[i].type, table[i].eventName); } ~HIDTypeByID() { - map*>::iterator it; + std::map*>::iterator it; for (it = this->begin(); it != this->end(); it++) { delete (*it).second; } @@ -249,7 +249,7 @@ public: // key = (HID_element_page) << 16 | HID_element_usage) const char *getName(long key) { - pair *usageType = (*this)[key]; + std::pair *usageType = (*this)[key]; if (usageType == NULL) { return ""; } else { @@ -258,7 +258,7 @@ public: } const HIDUsageType getType(long key) { - pair *usageType = (*this)[key]; + std::pair *usageType = (*this)[key]; if (usageType == NULL) { return kHIDUsageNotSupported; } else { diff --git a/src/Input/FGMouseInput.cxx b/src/Input/FGMouseInput.cxx index 276fc0ed5..5d9a6884b 100644 --- a/src/Input/FGMouseInput.cxx +++ b/src/Input/FGMouseInput.cxx @@ -25,6 +25,8 @@ #include "FGMouseInput.hxx" #include "Main/globals.hxx" +using std::ios_base; + void ActivePickCallbacks::init( int b, const osgGA::GUIEventAdapter* ea ) { // Get the list of hit callbacks. Take the first callback that diff --git a/src/Instrumentation/HUD/HUD.cxx b/src/Instrumentation/HUD/HUD.cxx index d886bc76e..2f130ae96 100644 --- a/src/Instrumentation/HUD/HUD.cxx +++ b/src/Instrumentation/HUD/HUD.cxx @@ -40,6 +40,8 @@ #include "HUD.hxx" +using std::endl; +using std::ifstream; static float clamp(float f) { diff --git a/src/Instrumentation/KLN89/kln89.cxx b/src/Instrumentation/KLN89/kln89.cxx index 8b7f53779..c2212a99f 100644 --- a/src/Instrumentation/KLN89/kln89.cxx +++ b/src/Instrumentation/KLN89/kln89.cxx @@ -52,6 +52,7 @@ #include using std::cout; +using std::string; // Command callbacks for FlightGear diff --git a/src/Instrumentation/KLN89/kln89.hxx b/src/Instrumentation/KLN89/kln89.hxx index b84d6efdc..c9ee874d5 100644 --- a/src/Instrumentation/KLN89/kln89.hxx +++ b/src/Instrumentation/KLN89/kln89.hxx @@ -68,10 +68,10 @@ const char* KLN89TimeCodes[20] = { "UTC", "GST", "GDT", "ATS", "ATD", "EST", "ED */ // Used for storing airport town and county mapped by ID, since currently FG does not store this -typedef map airport_id_str_map_type; +typedef std::map airport_id_str_map_type; typedef airport_id_str_map_type::iterator airport_id_str_map_iterator; -typedef vector kln89_page_list_type; +typedef std::vector kln89_page_list_type; typedef kln89_page_list_type::iterator kln89_page_list_itr; class KLN89 : public DCLGPS { @@ -150,14 +150,14 @@ private: void ToggleOBSMode(); // Initiate Direct To operation to the supplied ID. - void DtoInitiate(const string& id); + void DtoInitiate(const std::string& id); //----------------------- Drawing functions which take CHARACTER units ------------------------- // Render string s in display field field at position x, y // WHERE POSITION IS IN CHARACTER UNITS! // zero y at bottom? // invert: -1 => no inversion, 0 -> n => 1 char - s[invert] gets inverted, 99 => entire string gets inverted - void DrawText(const string& s, int field, int px, int py, bool bold = false, int invert = -1); + void DrawText(const std::string& s, int field, int px, int py, bool bold = false, int invert = -1); void DrawLatitude(double d, int field, int px, int py); void DrawLongitude(double d, int field, int px, int py); @@ -307,7 +307,7 @@ private: // Draw an airport or waypoint label on the moving map // Specify position by the map pixel co-ordinate of the left or right, bottom, of the *visible* portion of the label. // The black background quad will automatically overlap this by 1 pixel. - void DrawLabel(const string& s, int x1, int y1, bool right_align = false); + void DrawLabel(const std::string& s, int x1, int y1, bool right_align = false); int GetLabelQuadrant(double h); int GetLabelQuadrant(double h1, double h2); @@ -316,7 +316,7 @@ private: void DrawLine(int x1, int y1, int x2, int y2); // Draw normal sized text on the moving map - void DrawMapText(const string& s, int x, int y, bool draw_background = false); + void DrawMapText(const std::string& s, int x, int y, bool draw_background = false); void DrawMapUpArrow(int x, int y); diff --git a/src/Instrumentation/KLN89/kln89_page.cxx b/src/Instrumentation/KLN89/kln89_page.cxx index a53f3065b..03a22ee88 100644 --- a/src/Instrumentation/KLN89/kln89_page.cxx +++ b/src/Instrumentation/KLN89/kln89_page.cxx @@ -24,6 +24,8 @@ #include "kln89_page.hxx" #include
+using std::string; + KLN89Page::KLN89Page(KLN89* parent) { _kln89 = parent; _entInvert = false; diff --git a/src/Instrumentation/KLN89/kln89_page.hxx b/src/Instrumentation/KLN89/kln89_page.hxx index 7c2e1802e..d785a7d9a 100644 --- a/src/Instrumentation/KLN89/kln89_page.hxx +++ b/src/Instrumentation/KLN89/kln89_page.hxx @@ -65,21 +65,21 @@ public: inline void SetEntInvert(bool b) { _entInvert = b; } // Get / Set a waypoint id, NOT the page name! - virtual void SetId(const string& s); - virtual const string& GetId(); + virtual void SetId(const std::string& s); + virtual const std::string& GetId(); inline int GetSubPage() { return(_subPage); } void SetSubPage(int n); inline int GetNSubPages() { return(_nSubPages); } - inline const string& GetName() { return(_name); } + inline const std::string& GetName() { return(_name); } protected: KLN89* _kln89; - string _name; // eg. "APT", "NAV" etc + std::string _name; // eg. "APT", "NAV" etc int _nSubPages; // _subpage is zero based int _subPage; // The subpage gets remembered when other pages are displayed @@ -97,18 +97,18 @@ protected: // Invert ID and display ENT in field 1 bool _entInvert; - string _id; // The ID of the waypoint that the page is displaying. + std::string _id; // The ID of the waypoint that the page is displaying. // Doesn't make sense for all pages, but does for all the data pages. - void ShowScratchpadMessage(const string& line1, const string& line2); + void ShowScratchpadMessage(const std::string& line1, const std::string& line2); bool _scratchpadMsg; // Set true when there is a scratchpad message to display double _scratchpadTimer; // Used for displaying the scratchpad messages for the right amount of time. - string _scratchpadLine1; - string _scratchpadLine2; + std::string _scratchpadLine1; + std::string _scratchpadLine2; // TODO - remove this function from this class and use a built in method instead. - string GPSitoa(int n); + std::string GPSitoa(int n); }; #endif // _KLN89_PAGE_HXX diff --git a/src/Instrumentation/KLN89/kln89_page_alt.cxx b/src/Instrumentation/KLN89/kln89_page_alt.cxx index c60e0c027..685febcdb 100644 --- a/src/Instrumentation/KLN89/kln89_page_alt.cxx +++ b/src/Instrumentation/KLN89/kln89_page_alt.cxx @@ -25,6 +25,8 @@ #include "kln89_page_alt.hxx" +using std::string; + KLN89AltPage::KLN89AltPage(KLN89* parent) : KLN89Page(parent) { _nSubPages = 2; diff --git a/src/Instrumentation/KLN89/kln89_page_apt.hxx b/src/Instrumentation/KLN89/kln89_page_apt.hxx index b091193ba..b1e9d4d84 100644 --- a/src/Instrumentation/KLN89/kln89_page_apt.hxx +++ b/src/Instrumentation/KLN89/kln89_page_apt.hxx @@ -29,7 +29,7 @@ class FGRunway; struct AptFreq { - string service; + std::string service; unsigned short int freq; }; @@ -49,15 +49,15 @@ public: void Knob2Left1(); void Knob2Right1(); - void SetId(const string& s); + void SetId(const std::string& s); private: // Update the cached airport details - void UpdateAirport(const string& id); + void UpdateAirport(const std::string& id); - string _apt_id; - string _last_apt_id; - string _save_apt_id; + std::string _apt_id; + std::string _last_apt_id; + std::string _save_apt_id; const FGAirport* ap; vector _aptRwys; diff --git a/src/Instrumentation/KLN89/kln89_page_cal.cxx b/src/Instrumentation/KLN89/kln89_page_cal.cxx index 4354ba1ea..5aac2b5e5 100644 --- a/src/Instrumentation/KLN89/kln89_page_cal.cxx +++ b/src/Instrumentation/KLN89/kln89_page_cal.cxx @@ -28,6 +28,8 @@ #include
#include "kln89_page_cal.hxx" +using std::string; + KLN89CalPage::KLN89CalPage(KLN89* parent) : KLN89Page(parent) { _nSubPages = 8; diff --git a/src/Instrumentation/KLN89/kln89_page_dir.cxx b/src/Instrumentation/KLN89/kln89_page_dir.cxx index 9b04ffb9b..db139f519 100644 --- a/src/Instrumentation/KLN89/kln89_page_dir.cxx +++ b/src/Instrumentation/KLN89/kln89_page_dir.cxx @@ -28,6 +28,8 @@ #include "kln89_page_dir.hxx" #include
+using std::string; + KLN89DirPage::KLN89DirPage(KLN89* parent) : KLN89Page(parent) { _nSubPages = 1; diff --git a/src/Instrumentation/KLN89/kln89_page_dir.hxx b/src/Instrumentation/KLN89/kln89_page_dir.hxx index 2f23d6276..e4918c83f 100644 --- a/src/Instrumentation/KLN89/kln89_page_dir.hxx +++ b/src/Instrumentation/KLN89/kln89_page_dir.hxx @@ -34,7 +34,7 @@ public: void Update(double dt); - void SetId(const string& s); + void SetId(const std::string& s); void CrsrPressed(); void ClrPressed(); diff --git a/src/Instrumentation/KLN89/kln89_page_fpl.hxx b/src/Instrumentation/KLN89/kln89_page_fpl.hxx index 770c7ab37..e79097343 100644 --- a/src/Instrumentation/KLN89/kln89_page_fpl.hxx +++ b/src/Instrumentation/KLN89/kln89_page_fpl.hxx @@ -48,7 +48,7 @@ public: // Override the base class GetId function to return the waypoint ID under the cursor // on FPL0 page, if there is one and the cursor is on. // Otherwise return an empty string. - inline const string& GetId() { return(_fp0SelWpId); } + inline const std::string& GetId() { return(_fp0SelWpId); } private: int _fpMode; // 0 = Dis, 1 = Dtk @@ -56,7 +56,7 @@ private: bool _bEntWp; // set true when a waypoint is being entered bool _bEntExp; // Set true when ent is expected to set the currently entered waypoint as entered. - string _entWpStr; // The currently entered wp ID (need not be valid) + std::string _entWpStr; // The currently entered wp ID (need not be valid) GPSWaypoint* _entWp; // Waypoint being currently entered // The position of the cursor in a waypoint being entered @@ -83,9 +83,9 @@ private: void Calc(); // The ID of the waypoint under the cursor in fpl0, if those conditions exist! - string _fp0SelWpId; + std::string _fp0SelWpId; - vector _params; + std::vector _params; }; #endif // _KLN89_PAGE_FPL_HXX diff --git a/src/Instrumentation/KLN89/kln89_page_int.cxx b/src/Instrumentation/KLN89/kln89_page_int.cxx index 4d5ff6923..ac3ac25b9 100644 --- a/src/Instrumentation/KLN89/kln89_page_int.cxx +++ b/src/Instrumentation/KLN89/kln89_page_int.cxx @@ -29,6 +29,8 @@ #include #include +using std::string; + KLN89IntPage::KLN89IntPage(KLN89* parent) : KLN89Page(parent) { _nSubPages = 2; diff --git a/src/Instrumentation/KLN89/kln89_page_int.hxx b/src/Instrumentation/KLN89/kln89_page_int.hxx index 8923db886..76ff0ee31 100644 --- a/src/Instrumentation/KLN89/kln89_page_int.hxx +++ b/src/Instrumentation/KLN89/kln89_page_int.hxx @@ -42,12 +42,12 @@ public: void Knob2Left1(); void Knob2Right1(); - void SetId(const string& s); + void SetId(const std::string& s); private: - string _int_id; - string _last_int_id; - string _save_int_id; + std::string _int_id; + std::string _last_int_id; + std::string _save_int_id; const FGFix* _fp; FGNavRecord* _nearestVor; FGNavRecord* _refNav; // Will usually be the same as _nearestVor, and gets reset to _nearestVor when page looses focus. diff --git a/src/Instrumentation/KLN89/kln89_page_nav.cxx b/src/Instrumentation/KLN89/kln89_page_nav.cxx index f376c9384..6997a5cf1 100644 --- a/src/Instrumentation/KLN89/kln89_page_nav.cxx +++ b/src/Instrumentation/KLN89/kln89_page_nav.cxx @@ -28,6 +28,8 @@ #include "kln89_page_nav.hxx" #include
+using std::string; + KLN89NavPage::KLN89NavPage(KLN89* parent) : KLN89Page(parent) { _nSubPages = 4; diff --git a/src/Instrumentation/KLN89/kln89_page_nav.hxx b/src/Instrumentation/KLN89/kln89_page_nav.hxx index 53ec9e5ee..aff3747d8 100644 --- a/src/Instrumentation/KLN89/kln89_page_nav.hxx +++ b/src/Instrumentation/KLN89/kln89_page_nav.hxx @@ -42,7 +42,7 @@ public: void LooseFocus(); // Returns the id string of the selected waypoint on NAV4 if valid, else returns an empty string. - string GetNav4WpId(); + std::string GetNav4WpId(); private: int _posFormat; // 0 => lat,lon; 1 => ref to wp. diff --git a/src/Instrumentation/KLN89/kln89_page_ndb.cxx b/src/Instrumentation/KLN89/kln89_page_ndb.cxx index c6ba4bb0e..c621bba51 100644 --- a/src/Instrumentation/KLN89/kln89_page_ndb.cxx +++ b/src/Instrumentation/KLN89/kln89_page_ndb.cxx @@ -28,6 +28,8 @@ #include "kln89_page_ndb.hxx" #include +using std::string; + KLN89NDBPage::KLN89NDBPage(KLN89* parent) : KLN89Page(parent) { _nSubPages = 2; diff --git a/src/Instrumentation/KLN89/kln89_page_ndb.hxx b/src/Instrumentation/KLN89/kln89_page_ndb.hxx index 191a8d1af..a4a5bb652 100644 --- a/src/Instrumentation/KLN89/kln89_page_ndb.hxx +++ b/src/Instrumentation/KLN89/kln89_page_ndb.hxx @@ -40,12 +40,12 @@ public: void Knob2Left1(); void Knob2Right1(); - void SetId(const string& s); + void SetId(const std::string& s); private: - string _ndb_id; - string _last_ndb_id; - string _save_ndb_id; + std::string _ndb_id; + std::string _last_ndb_id; + std::string _save_ndb_id; FGNavRecord* np; }; diff --git a/src/Instrumentation/KLN89/kln89_page_oth.cxx b/src/Instrumentation/KLN89/kln89_page_oth.cxx index 3caa76ce3..2ab41a1d0 100644 --- a/src/Instrumentation/KLN89/kln89_page_oth.cxx +++ b/src/Instrumentation/KLN89/kln89_page_oth.cxx @@ -27,6 +27,8 @@ #include "kln89_page_oth.hxx" +using std::string; + KLN89OthPage::KLN89OthPage(KLN89* parent) : KLN89Page(parent) { _nSubPages = 12; diff --git a/src/Instrumentation/KLN89/kln89_page_vor.cxx b/src/Instrumentation/KLN89/kln89_page_vor.cxx index cbc70e669..0c6239c99 100644 --- a/src/Instrumentation/KLN89/kln89_page_vor.cxx +++ b/src/Instrumentation/KLN89/kln89_page_vor.cxx @@ -28,6 +28,8 @@ #include "kln89_page_vor.hxx" #include +using std::string; + KLN89VorPage::KLN89VorPage(KLN89* parent) : KLN89Page(parent) { _nSubPages = 2; diff --git a/src/Instrumentation/KLN89/kln89_page_vor.hxx b/src/Instrumentation/KLN89/kln89_page_vor.hxx index f07fd8232..4ce12be29 100644 --- a/src/Instrumentation/KLN89/kln89_page_vor.hxx +++ b/src/Instrumentation/KLN89/kln89_page_vor.hxx @@ -40,12 +40,12 @@ public: void Knob2Left1(); void Knob2Right1(); - void SetId(const string& s); + void SetId(const std::string& s); private: - string _vor_id; - string _last_vor_id; - string _save_vor_id; + std::string _vor_id; + std::string _last_vor_id; + std::string _save_vor_id; FGNavRecord* np; }; diff --git a/src/Instrumentation/NavDisplay.hxx b/src/Instrumentation/NavDisplay.hxx index 1c8a73885..7f4b0f283 100644 --- a/src/Instrumentation/NavDisplay.hxx +++ b/src/Instrumentation/NavDisplay.hxx @@ -62,7 +62,7 @@ public: virtual void update(double dt); protected: - string _name; + std::string _name; int _num; double _time; double _updateInterval; @@ -110,7 +110,7 @@ private: void updateFont(); - string _texture_path; + std::string _texture_path; float _scale; // factor to convert nm to display units diff --git a/src/Instrumentation/adf.hxx b/src/Instrumentation/adf.hxx index 5b1b1667d..c8f36e4ff 100644 --- a/src/Instrumentation/adf.hxx +++ b/src/Instrumentation/adf.hxx @@ -63,7 +63,7 @@ private: void search (double frequency, double longitude_rad, double latitude_rad, double altitude_m); - string _name; + std::string _name; unsigned int _num; SGPropertyNode_ptr _longitude_node; diff --git a/src/Instrumentation/airspeed_indicator.hxx b/src/Instrumentation/airspeed_indicator.hxx index 41e544c66..26dd15a52 100644 --- a/src/Instrumentation/airspeed_indicator.hxx +++ b/src/Instrumentation/airspeed_indicator.hxx @@ -45,7 +45,7 @@ public: private: void computeMach(double ias); - string _name; + std::string _name; unsigned int _num; string _total_pressure; string _static_pressure; diff --git a/src/Instrumentation/altimeter.hxx b/src/Instrumentation/altimeter.hxx index e5baae64c..a2ad87969 100644 --- a/src/Instrumentation/altimeter.hxx +++ b/src/Instrumentation/altimeter.hxx @@ -39,7 +39,7 @@ public: private: - string _name; + std::string _name; int _num; string _static_pressure; double _tau; diff --git a/src/Instrumentation/attitude_indicator.cxx b/src/Instrumentation/attitude_indicator.cxx index 54e7f24fc..ca93cd15a 100644 --- a/src/Instrumentation/attitude_indicator.cxx +++ b/src/Instrumentation/attitude_indicator.cxx @@ -18,6 +18,7 @@ #include
#include
+using std::string; AttitudeIndicator::AttitudeIndicator ( SGPropertyNode *node ) : diff --git a/src/Instrumentation/attitude_indicator.hxx b/src/Instrumentation/attitude_indicator.hxx index fe278ddc0..4bdc48b90 100644 --- a/src/Instrumentation/attitude_indicator.hxx +++ b/src/Instrumentation/attitude_indicator.hxx @@ -51,9 +51,9 @@ public: private: - string _name; + std::string _name; int _num; - string _suction; + std::string _suction; Gyro _gyro; diff --git a/src/Instrumentation/clock.cxx b/src/Instrumentation/clock.cxx index 5d581e6f4..86343cb47 100644 --- a/src/Instrumentation/clock.cxx +++ b/src/Instrumentation/clock.cxx @@ -37,7 +37,7 @@ Clock::~Clock () void Clock::init () { - string branch; + std::string branch; branch = "/instrumentation/" + _name; SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); diff --git a/src/Instrumentation/clock.hxx b/src/Instrumentation/clock.hxx index 307fe469e..f4fcba846 100644 --- a/src/Instrumentation/clock.hxx +++ b/src/Instrumentation/clock.hxx @@ -35,7 +35,7 @@ public: virtual void update(double dt); private: - string _name; + std::string _name; unsigned int _num; bool _is_serviceable; diff --git a/src/Instrumentation/dclgps.hxx b/src/Instrumentation/dclgps.hxx index e2b2ee269..be3469aaf 100644 --- a/src/Instrumentation/dclgps.hxx +++ b/src/Instrumentation/dclgps.hxx @@ -68,7 +68,7 @@ enum GPSAppWpType { GPS_APP_NONE // Not part of the approach sequence - the default. }; -ostream& operator << (ostream& os, GPSAppWpType type); +std::ostream& operator << (std::ostream& os, GPSAppWpType type); struct GPSWaypoint { GPSWaypoint(); @@ -78,23 +78,23 @@ struct GPSWaypoint { static GPSWaypoint* createFromPositioned(const FGPositioned* aFix); ~GPSWaypoint(); - string GetAprId(); // Returns the id with i, f, m or h added if appropriate. (Initial approach fix, final approach fix, etc) - string id; + std::string GetAprId(); // Returns the id with i, f, m or h added if appropriate. (Initial approach fix, final approach fix, etc) + std::string id; float lat; // Radians float lon; // Radians GPSWpType type; GPSAppWpType appType; // only used for waypoints that are part of an approach sequence }; -typedef vector < GPSWaypoint* > gps_waypoint_array; +typedef std::vector < GPSWaypoint* > gps_waypoint_array; typedef gps_waypoint_array::iterator gps_waypoint_array_iterator; -typedef map < string, gps_waypoint_array > gps_waypoint_map; +typedef std::map < std::string, gps_waypoint_array > gps_waypoint_map; typedef gps_waypoint_map::iterator gps_waypoint_map_iterator; typedef gps_waypoint_map::const_iterator gps_waypoint_map_const_iterator; class GPSFlightPlan { public: - vector waypoints; + std::vector waypoints; inline bool IsEmpty() { return(waypoints.size() == 0); } }; @@ -106,10 +106,10 @@ public: virtual ~FGIAP() = 0; //protected: - string _aptIdent; // The ident of the airport this approach is for - string _ident; // The approach ident. - string _name; // The full approach name. - string _rwyStr; // The string used to specify the rwy - eg "B" in this instance. + std::string _aptIdent; // The ident of the airport this approach is for + std::string _ident; // The approach ident. + std::string _name; // The full approach name. + std::string _rwyStr; // The string used to specify the rwy - eg "B" in this instance. bool _precision; // True for precision approach, false for non-precision. }; @@ -120,14 +120,14 @@ public: ~FGNPIAP(); //private: public: - vector _approachRoutes; // The approach route(s) from the IAF(s) to the IF. + std::vector _approachRoutes; // The approach route(s) from the IAF(s) to the IF. // NOTE: It is an assumption in the code that uses this that there is a unique IAF per approach route. - vector _IAP; // The compulsory waypoints of the approach procedure (may duplicate one of the above). + std::vector _IAP; // The compulsory waypoints of the approach procedure (may duplicate one of the above). // _IAP includes the FAF and MAF, and the missed approach waypoints. }; -typedef vector < FGIAP* > iap_list_type; -typedef map < string, iap_list_type > iap_map_type; +typedef std::vector < FGIAP* > iap_list_type; +typedef std::map < std::string, iap_list_type > iap_map_type; typedef iap_map_type::iterator iap_map_iterator; // A class to encapsulate hr:min representation of time. @@ -157,7 +157,7 @@ public: ClockTime t2(diff / 60, diff % 60); return(t2); } - friend ostream& operator<< (ostream& out, const ClockTime& t); + friend std::ostream& operator<< (std::ostream& out, const ClockTime& t); private: int _hr; @@ -181,12 +181,12 @@ public: virtual void update(double dt); // Expand a SIAP ident to the full procedure name. - string ExpandSIAPIdent(const string& ident); + std::string ExpandSIAPIdent(const std::string& ident); // Render string s in display field field at position x, y // WHERE POSITION IS IN CHARACTER UNITS! // zero y at bottom? - virtual void DrawText(const string& s, int field, int px, int py, bool bold = false); + virtual void DrawText(const std::string& s, int field, int px, int py, bool bold = false); // Render a char at a given position as above virtual void DrawChar(char c, int field, int px, int py, bool bold = false); @@ -214,7 +214,7 @@ public: // Returns -1 if no active waypoint. int GetActiveWaypointIndex(); // Ditto for an arbitrary waypoint id - int GetWaypointIndex(const string& id); + int GetWaypointIndex(const std::string& id); // Returns meters float GetDistToActiveWaypoint(); @@ -232,7 +232,7 @@ public: // returns -1 if groundspeed is less than 30kts. // If the waypoint is an unreached part of the active flight plan the time will be via each leg. // otherwise it will be a direct-to time. - double GetTimeToWaypoint(const string& id); + double GetTimeToWaypoint(const std::string& id); // Return true if waypoint alerting is occuring inline bool GetWaypointAlert() const { return(_waypointAlert); } @@ -253,7 +253,7 @@ public: inline bool GetToFlag() const { return(_headingBugTo); } // Initiate Direct To operation to the supplied ID. - virtual void DtoInitiate(const string& id); + virtual void DtoInitiate(const std::string& id); // Cancel Direct To operation void DtoCancel(); @@ -286,7 +286,7 @@ protected: // CDI full-scale deflection, specified either as an index into a vector of values (standard values) or as a double precision float (intermediate values). // This will influence how an externally driven CDI will display as well as the NAV1 page. // Hence the variables are located here, not in the nav page class. - vector _cdiScales; + std::vector _cdiScales; unsigned int _currentCdiScaleIndex; bool _cdiScaleTransition; // Set true when the floating CDI value is used during transitions double _currentCdiScale; // The floating value to use. @@ -305,13 +305,13 @@ protected: void LoadApproachData(); // Find first of any type of waypoint by id. (TODO - Possibly we should return multiple waypoints here). - GPSWaypoint* FindFirstById(const string& id) const; - GPSWaypoint* FindFirstByExactId(const string& id) const; + GPSWaypoint* FindFirstById(const std::string& id) const; + GPSWaypoint* FindFirstByExactId(const std::string& id) const; - FGNavRecord* FindFirstVorById(const string& id, bool &multi, bool exact = false); - FGNavRecord* FindFirstNDBById(const string& id, bool &multi, bool exact = false); - const FGAirport* FindFirstAptById(const string& id, bool &multi, bool exact = false); - const FGFix* FindFirstIntById(const string& id, bool &multi, bool exact = false); + FGNavRecord* FindFirstVorById(const std::string& id, bool &multi, bool exact = false); + FGNavRecord* FindFirstNDBById(const std::string& id, bool &multi, bool exact = false); + const FGAirport* FindFirstAptById(const std::string& id, bool &multi, bool exact = false); + const FGFix* FindFirstIntById(const std::string& id, bool &multi, bool exact = false); // Find the closest VOR to a position in RADIANS. FGNavRecord* FindClosestVor(double lat_rad, double lon_rad); @@ -388,7 +388,7 @@ protected: // Flightplans // GPS can have up to _maxFlightPlans flightplans stored, PLUS an active FP which may or my not be one of the stored ones. // This is from KLN89, but is probably not far off the mark for most if not all GPS. - vector _flightPlans; + std::vector _flightPlans; unsigned int _maxFlightPlans; GPSFlightPlan* _activeFP; @@ -414,7 +414,7 @@ protected: bool _headingBugTo; // Set true when the heading bug is TO, false when FROM. bool _waypointAlert; // Set true when waypoint alerting is happening. (This is a variable NOT a user-setting). bool _departed; // Set when groundspeed first exceeds 30kts. - string _departureTimeString; // Ditto. + std::string _departureTimeString; // Ditto. double _elapsedTime; // Elapsed time in seconds since departure ClockTime _powerOnTime; // Time (hr:min) of unit power-up. bool _powerOnTimerSet; // Indicates that we have set the above following power-up. @@ -437,9 +437,9 @@ protected: // Magvar stuff. Might get some of this stuff (such as time) from FG in future. SGTime* _time; - list _messageStack; + std::list _messageStack; - virtual void CreateFlightPlan(GPSFlightPlan* fp, vector ids, vector wps); + virtual void CreateFlightPlan(GPSFlightPlan* fp, std::vector ids, std::vector wps); // Orientate the GPS unit to a flightplan - ie. figure out from current position // and possibly orientation which leg of the FP we are on. @@ -460,10 +460,10 @@ protected: // the scale change, but it's in the manual... bool _approachActive; // Set true when in approach-active mode GPSFlightPlan* _approachFP; // Current approach - not necessarily loaded. - string _approachID; // ID of the airport we have an approach loaded for - bit of a hack that can hopefully be removed in future. + std::string _approachID; // ID of the airport we have an approach loaded for - bit of a hack that can hopefully be removed in future. // More hackery since we aren't actually storing an approach class... Doh! - string _approachAbbrev; - string _approachRwyStr; + std::string _approachAbbrev; + std::string _approachRwyStr; }; #endif // _DCLGPS_HXX diff --git a/src/Instrumentation/dme.hxx b/src/Instrumentation/dme.hxx index 6ec6edc63..084fd8207 100644 --- a/src/Instrumentation/dme.hxx +++ b/src/Instrumentation/dme.hxx @@ -61,7 +61,7 @@ private: FGNavRecord * _navrecord; - string _name; + std::string _name; int _num; class AudioIdent * _audioIdent; diff --git a/src/Instrumentation/gsdi.cxx b/src/Instrumentation/gsdi.cxx index acf11412d..7a5e45481 100644 --- a/src/Instrumentation/gsdi.cxx +++ b/src/Instrumentation/gsdi.cxx @@ -49,7 +49,7 @@ GSDI::~GSDI() void GSDI::init() { - string branch; + std::string branch; branch = "/instrumentation/" + _name; SGPropertyNode *n = fgGetNode(branch.c_str(), _num, true); _serviceableN = n->getNode("serviceable", true); diff --git a/src/Instrumentation/gsdi.hxx b/src/Instrumentation/gsdi.hxx index 2fc8e2966..0d8ef2e36 100644 --- a/src/Instrumentation/gsdi.hxx +++ b/src/Instrumentation/gsdi.hxx @@ -51,7 +51,7 @@ public: virtual void update(double dt); private: - string _name; + std::string _name; unsigned int _num; SGPropertyNode_ptr _serviceableN; diff --git a/src/Instrumentation/heading_indicator.cxx b/src/Instrumentation/heading_indicator.cxx index 53046480a..f7899b7bc 100644 --- a/src/Instrumentation/heading_indicator.cxx +++ b/src/Instrumentation/heading_indicator.cxx @@ -29,7 +29,7 @@ HeadingIndicator::~HeadingIndicator () void HeadingIndicator::init () { - string branch; + std::string branch; branch = "/instrumentation/" + _name; SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); @@ -47,7 +47,7 @@ void HeadingIndicator::bind () { std::ostringstream temp; - string branch; + std::string branch; temp << _num; branch = "/instrumentation/" + _name + "[" + temp.str() + "]"; @@ -61,7 +61,7 @@ void HeadingIndicator::unbind () { std::ostringstream temp; - string branch; + std::string branch; temp << _num; branch = "/instrumentation/" + _name + "[" + temp.str() + "]"; diff --git a/src/Instrumentation/heading_indicator.hxx b/src/Instrumentation/heading_indicator.hxx index f3d6f5f15..ecd06fb18 100644 --- a/src/Instrumentation/heading_indicator.hxx +++ b/src/Instrumentation/heading_indicator.hxx @@ -51,9 +51,9 @@ private: Gyro _gyro; double _last_heading_deg; - string _name; + std::string _name; int _num; - string _suction; + std::string _suction; SGPropertyNode_ptr _offset_node; SGPropertyNode_ptr _heading_in_node; diff --git a/src/Instrumentation/heading_indicator_dg.cxx b/src/Instrumentation/heading_indicator_dg.cxx index 0c4864912..d44e0b036 100644 --- a/src/Instrumentation/heading_indicator_dg.cxx +++ b/src/Instrumentation/heading_indicator_dg.cxx @@ -25,8 +25,8 @@ HeadingIndicatorDG::HeadingIndicatorDG ( SGPropertyNode *node ) : int i; for ( i = 0; i < node->nChildren(); ++i ) { SGPropertyNode *child = node->getChild(i); - string cname = child->getName(); - string cval = child->getStringValue(); + std::string cname = child->getName(); + std::string cval = child->getStringValue(); if ( cname == "name" ) { name = cval; } else if ( cname == "number" ) { @@ -51,7 +51,7 @@ HeadingIndicatorDG::~HeadingIndicatorDG () void HeadingIndicatorDG::init () { - string branch; + std::string branch; branch = "/instrumentation/" + name; _heading_in_node = fgGetNode("/orientation/heading-deg", true); @@ -81,7 +81,7 @@ void HeadingIndicatorDG::bind () { std::ostringstream temp; - string branch; + std::string branch; temp << num; branch = "/instrumentation/" + name + "[" + temp.str() + "]"; @@ -95,7 +95,7 @@ void HeadingIndicatorDG::unbind () { std::ostringstream temp; - string branch; + std::string branch; temp << num; branch = "/instrumentation/" + name + "[" + temp.str() + "]"; diff --git a/src/Instrumentation/heading_indicator_dg.hxx b/src/Instrumentation/heading_indicator_dg.hxx index d016ca45b..f5035b159 100644 --- a/src/Instrumentation/heading_indicator_dg.hxx +++ b/src/Instrumentation/heading_indicator_dg.hxx @@ -49,7 +49,7 @@ private: Gyro _gyro; double _last_heading_deg; - string name; + std::string name; int num; //string vacuum_system; diff --git a/src/Instrumentation/heading_indicator_fg.cxx b/src/Instrumentation/heading_indicator_fg.cxx index 960bd98ab..ba70da198 100644 --- a/src/Instrumentation/heading_indicator_fg.cxx +++ b/src/Instrumentation/heading_indicator_fg.cxx @@ -14,6 +14,7 @@ #include
#include
+using std::string; HeadingIndicatorFG::HeadingIndicatorFG ( SGPropertyNode *node ) : diff --git a/src/Instrumentation/heading_indicator_fg.hxx b/src/Instrumentation/heading_indicator_fg.hxx index bb4282491..cb31470d9 100644 --- a/src/Instrumentation/heading_indicator_fg.hxx +++ b/src/Instrumentation/heading_indicator_fg.hxx @@ -51,7 +51,7 @@ private: Gyro _gyro; double _last_heading_deg; - string name; + std::string name; int num; SGPropertyNode_ptr _offset_node; diff --git a/src/Instrumentation/inst_vertical_speed_indicator.hxx b/src/Instrumentation/inst_vertical_speed_indicator.hxx index fd588f359..18e818604 100644 --- a/src/Instrumentation/inst_vertical_speed_indicator.hxx +++ b/src/Instrumentation/inst_vertical_speed_indicator.hxx @@ -62,7 +62,7 @@ public: private: - string _name; + std::string _name; int _num; double _internal_pressure_inhg; diff --git a/src/Instrumentation/kr_87.hxx b/src/Instrumentation/kr_87.hxx index 83b8f6bcf..5f32b1f5a 100644 --- a/src/Instrumentation/kr_87.hxx +++ b/src/Instrumentation/kr_87.hxx @@ -43,8 +43,8 @@ class FGKR_87 : public SGSubsystem bool need_update; // internal values - string ident; - string trans_ident; + std::string ident; + std::string trans_ident; bool valid; bool inrange; double stn_lon; @@ -115,7 +115,7 @@ public: void search (); // internal values - inline const string& get_ident() const { return ident; } + inline const std::string& get_ident() const { return ident; } inline bool get_valid() const { return valid; } inline bool get_inrange() const { return inrange; } inline double get_stn_lon() const { return stn_lon; } diff --git a/src/Instrumentation/mag_compass.cxx b/src/Instrumentation/mag_compass.cxx index 1f57f0791..1477228e9 100644 --- a/src/Instrumentation/mag_compass.cxx +++ b/src/Instrumentation/mag_compass.cxx @@ -32,7 +32,7 @@ MagCompass::~MagCompass () void MagCompass::init () { - string branch; + std::string branch; branch = "/instrumentation/" + _name; SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); diff --git a/src/Instrumentation/mag_compass.hxx b/src/Instrumentation/mag_compass.hxx index 919f26bc9..474babdaf 100644 --- a/src/Instrumentation/mag_compass.hxx +++ b/src/Instrumentation/mag_compass.hxx @@ -51,7 +51,7 @@ private: double _error_deg; double _rate_degps; - string _name; + std::string _name; int _num; SGPropertyNode_ptr _serviceable_node; diff --git a/src/Instrumentation/mrg.cxx b/src/Instrumentation/mrg.cxx index 365447b45..8146cd1f9 100644 --- a/src/Instrumentation/mrg.cxx +++ b/src/Instrumentation/mrg.cxx @@ -22,6 +22,8 @@ const double MasterReferenceGyro::gravity = -32.1740485564; +using std::string; + MasterReferenceGyro::MasterReferenceGyro ( SGPropertyNode *node ) : _name(node->getStringValue("name", "master-reference-gyro")), _num(node->getIntValue("number", 0)) diff --git a/src/Instrumentation/mrg.hxx b/src/Instrumentation/mrg.hxx index b925353a5..25be4d8e6 100644 --- a/src/Instrumentation/mrg.hxx +++ b/src/Instrumentation/mrg.hxx @@ -51,7 +51,7 @@ private: static const double gravity; //conversion factor - string _name; + std::string _name; int _num; double _last_roll; diff --git a/src/Instrumentation/navradio.hxx b/src/Instrumentation/navradio.hxx index 518772845..54c2e531e 100644 --- a/src/Instrumentation/navradio.hxx +++ b/src/Instrumentation/navradio.hxx @@ -137,7 +137,7 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener double xrate_ms; double _localizerWidth; // cached localizer width in degrees - string _name; + std::string _name; int _num; // internal periodic station search timer diff --git a/src/Instrumentation/newnavradio.cxx b/src/Instrumentation/newnavradio.cxx index 9468e3f4d..202fd2472 100755 --- a/src/Instrumentation/newnavradio.cxx +++ b/src/Instrumentation/newnavradio.cxx @@ -808,7 +808,7 @@ public: void valueChanged (SGPropertyNode * prop) { // format as fixed decimal "nnn.nn" - ostringstream buf; + std::ostringstream buf; buf << std::fixed << std::setw(5) << std::setfill('0') @@ -922,7 +922,7 @@ void NavRadioImpl::update( double dt ) try { position = globals->get_aircraft_position(); } - catch( exception & ) { + catch( std::exception & ) { return; } diff --git a/src/Instrumentation/slip_skid_ball.cxx b/src/Instrumentation/slip_skid_ball.cxx index 4925e1fa9..2ee3bb12c 100644 --- a/src/Instrumentation/slip_skid_ball.cxx +++ b/src/Instrumentation/slip_skid_ball.cxx @@ -7,6 +7,7 @@ #include
#include
+using std::string; SlipSkidBall::SlipSkidBall ( SGPropertyNode *node) : diff --git a/src/Instrumentation/slip_skid_ball.hxx b/src/Instrumentation/slip_skid_ball.hxx index 3a95b115a..1dc1c8916 100644 --- a/src/Instrumentation/slip_skid_ball.hxx +++ b/src/Instrumentation/slip_skid_ball.hxx @@ -43,7 +43,7 @@ private: double _last_pos; - string _name; + std::string _name; int _num; SGPropertyNode_ptr _serviceable_node; diff --git a/src/Instrumentation/tacan.cxx b/src/Instrumentation/tacan.cxx index b17c8bb34..21fc2f493 100644 --- a/src/Instrumentation/tacan.cxx +++ b/src/Instrumentation/tacan.cxx @@ -18,7 +18,7 @@ #include "tacan.hxx" using std::vector; - +using std::string; /** * Adjust the range. diff --git a/src/Instrumentation/tacan.hxx b/src/Instrumentation/tacan.hxx index 7c8873aed..083efa665 100644 --- a/src/Instrumentation/tacan.hxx +++ b/src/Instrumentation/tacan.hxx @@ -46,10 +46,10 @@ private: void search (double frequency, double longitude_rad, double latitude_rad, double altitude_m); - double searchChannel (const string& channel); + double searchChannel (const std::string& channel); void valueChanged (SGPropertyNode *); - string _name; + std::string _name; unsigned int _num; SGPropertyNode_ptr _longitude_node; @@ -85,7 +85,7 @@ private: SGPropertyNode_ptr _mp_callsign_node; // FIXME bool _new_frequency; - string _channel; + std::string _channel; double _last_distance_nm; double _frequency_mhz; double _time_before_search_sec; @@ -98,16 +98,16 @@ private: double _transmitter_range_nm; double _transmitter_bearing_deg; double _transmitter_bias; - string _transmitter_name; - string _transmitter_ident; + std::string _transmitter_name; + std::string _transmitter_ident; double _mobile_lat, _mobile_lon; double _mobile_elevation_ft; double _mobile_range_nm; double _mobile_bearing_deg; double _mobile_bias; - string _mobile_name; - string _mobile_ident; + std::string _mobile_name; + std::string _mobile_ident; int _listener_active; }; diff --git a/src/Instrumentation/transponder.cxx b/src/Instrumentation/transponder.cxx index 9fa5f13a3..01b34b662 100644 --- a/src/Instrumentation/transponder.cxx +++ b/src/Instrumentation/transponder.cxx @@ -24,6 +24,8 @@ #include "transponder.hxx" +using std::string; + Transponder::Transponder(SGPropertyNode *node) : _name(node->getStringValue("name", "transponder")), diff --git a/src/Instrumentation/transponder.hxx b/src/Instrumentation/transponder.hxx index f0a58efd2..d41514e08 100644 --- a/src/Instrumentation/transponder.hxx +++ b/src/Instrumentation/transponder.hxx @@ -50,9 +50,9 @@ private: SGPropertyNode_ptr flightLevelNode; // Internal - string _name; + std::string _name; int _num; - string _mode_c_altitude; + std::string _mode_c_altitude; }; #endif // TRANSPONDER_HXX diff --git a/src/Instrumentation/turn_indicator.cxx b/src/Instrumentation/turn_indicator.cxx index 973b4054a..25df4de4e 100644 --- a/src/Instrumentation/turn_indicator.cxx +++ b/src/Instrumentation/turn_indicator.cxx @@ -12,6 +12,7 @@ #include
#include
+using std::string; // Use a bigger number to be more responsive, or a smaller number // to be more sluggish. diff --git a/src/Instrumentation/turn_indicator.hxx b/src/Instrumentation/turn_indicator.hxx index b96873081..04a8e6fcb 100644 --- a/src/Instrumentation/turn_indicator.hxx +++ b/src/Instrumentation/turn_indicator.hxx @@ -53,7 +53,7 @@ private: Gyro _gyro; double _last_rate; - string _name; + std::string _name; int _num; SGPropertyNode_ptr _roll_rate_node; diff --git a/src/Instrumentation/vertical_speed_indicator.cxx b/src/Instrumentation/vertical_speed_indicator.cxx index e062db010..1ad62253b 100644 --- a/src/Instrumentation/vertical_speed_indicator.cxx +++ b/src/Instrumentation/vertical_speed_indicator.cxx @@ -9,6 +9,7 @@ #include
#include
+using std::string; VerticalSpeedIndicator::VerticalSpeedIndicator ( SGPropertyNode *node ) : _internal_pressure_inhg(29.92), diff --git a/src/Instrumentation/vertical_speed_indicator.hxx b/src/Instrumentation/vertical_speed_indicator.hxx index d40aa5693..56b4f0e18 100644 --- a/src/Instrumentation/vertical_speed_indicator.hxx +++ b/src/Instrumentation/vertical_speed_indicator.hxx @@ -42,9 +42,9 @@ private: double _internal_pressure_inhg; - string _name; + std::string _name; int _num; - string _static_pressure; + std::string _static_pressure; SGPropertyNode_ptr _serviceable_node; SGPropertyNode_ptr _pressure_node; diff --git a/src/Instrumentation/wxradar.cxx b/src/Instrumentation/wxradar.cxx index acbd1b6cf..d167f78d5 100644 --- a/src/Instrumentation/wxradar.cxx +++ b/src/Instrumentation/wxradar.cxx @@ -45,12 +45,14 @@ #include #include + using std::stringstream; using std::endl; using std::setprecision; using std::fixed; using std::setw; using std::setfill; +using std::string; #include
#include
diff --git a/src/Instrumentation/wxradar.hxx b/src/Instrumentation/wxradar.hxx index 2b696430a..639302bdc 100644 --- a/src/Instrumentation/wxradar.hxx +++ b/src/Instrumentation/wxradar.hxx @@ -51,7 +51,7 @@ public: virtual void valueChanged(SGPropertyNode *); protected: - string _name; + std::string _name; int _num; double _time; double _interval; @@ -90,7 +90,7 @@ protected: SGPropertyNode *getInstrumentNode(const char *name, DefaultType value); private: - string _texture_path; + std::string _texture_path; typedef enum { ARC, MAP, PLAN, ROSE, BSCAN} DisplayMode; DisplayMode _display_mode; diff --git a/src/Main/fg_props.hxx b/src/Main/fg_props.hxx index 8f2e95f0f..d4d7ef1c8 100644 --- a/src/Main/fg_props.hxx +++ b/src/Main/fg_props.hxx @@ -420,7 +420,7 @@ extern const char * fgGetString (const char * name, * @return The property's value as a string, or the default value provided. */ inline const char * fgGetString (const std::string & name, - const std::string & defaultValue = string("")) + const std::string & defaultValue = std::string("")) { return fgGetString( name.c_str(), defaultValue.c_str() ); } diff --git a/src/Main/logger.cxx b/src/Main/logger.cxx index c49904fa9..31f0a59c7 100644 --- a/src/Main/logger.cxx +++ b/src/Main/logger.cxx @@ -38,7 +38,7 @@ FGLogger::init () if (logging == 0) return; - vector children = logging->getChildren("log"); + std::vector children = logging->getChildren("log"); for (unsigned int i = 0; i < children.size(); i++) { SGPropertyNode * child = children[i]; @@ -64,7 +64,7 @@ FGLogger::init () log.interval_ms = child->getLongValue("interval-ms"); log.last_time_ms = globals->get_sim_time_sec() * 1000; log.delimiter = delimiter.c_str()[0]; - log.output = new ofstream(filename.c_str()); + log.output = new std::ofstream(filename.c_str()); if (!log.output) { SG_LOG(SG_GENERAL, SG_ALERT, "Cannot write log to " << filename); continue; diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 1db151ad9..75b0c4481 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -587,7 +587,7 @@ int fgMainInit( int argc, char **argv ) { #endif SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: Version " << version ); - SG_LOG( SG_GENERAL, SG_INFO, "Built with " << SG_COMPILER_STR << endl ); + SG_LOG( SG_GENERAL, SG_INFO, "Built with " << SG_COMPILER_STR << std::endl ); // Allocate global data structures. This needs to happen before // we parse command line options diff --git a/src/Main/splash.cxx b/src/Main/splash.cxx index a21064cab..5708c72e1 100644 --- a/src/Main/splash.cxx +++ b/src/Main/splash.cxx @@ -146,8 +146,8 @@ public: char *genNameString() { - string website = "http://www.flightgear.org"; - string programName = "FlightGear"; + std::string website = "http://www.flightgear.org"; + std::string programName = "FlightGear"; char *name = new char[26]; name[20] = 114; name[8] = 119; diff --git a/src/Main/util.cxx b/src/Main/util.cxx index 2cd15b5b0..9b5b3da8b 100644 --- a/src/Main/util.cxx +++ b/src/Main/util.cxx @@ -17,10 +17,10 @@ // // $Id$ -#ifdef HAVE_CONFIG_H -# include -#endif - +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include @@ -28,7 +28,6 @@ #include #include -using std::vector; #include #include @@ -43,6 +42,8 @@ using std::vector; #include "osgDB/Registry" #endif +using std::vector; + // Originally written by Alex Perry. double fgGetLowPass (double current, double target, double timeratio) @@ -71,10 +72,10 @@ fgGetLowPass (double current, double target, double timeratio) } -string +std::string fgUnescape (const char *s) { - string r; + std::string r; while (*s) { if (*s != '\\') { r += *s++; diff --git a/src/Main/viewmgr.cxx b/src/Main/viewmgr.cxx index ea9fcd7a6..bced660b5 100644 --- a/src/Main/viewmgr.cxx +++ b/src/Main/viewmgr.cxx @@ -288,7 +288,7 @@ FGViewMgr::unbind () fgUntie("/sim/current-view/viewer-y-m"); fgUntie("/sim/current-view/viewer-z-m"); - list::const_iterator it; + std::list::const_iterator it; for (it = tied_props.begin(); it != tied_props.end(); it++){ fgUntie(*it); } diff --git a/src/Main/viewmgr.hxx b/src/Main/viewmgr.hxx index 6461af11a..4906f87f6 100644 --- a/src/Main/viewmgr.hxx +++ b/src/Main/viewmgr.hxx @@ -76,7 +76,7 @@ public: private: void do_bind(); - list tied_props; + std::list tied_props; double axis_long; double axis_lat; @@ -140,7 +140,7 @@ private: bool inited; SGPropertyNode_ptr view_number; - vector config_list; + std::vector config_list; typedef std::vector viewer_list; viewer_list views; SGVec3d abs_viewer_position; diff --git a/src/Navaids/navdb.cxx b/src/Navaids/navdb.cxx index b1a813d61..36ccf9cdf 100644 --- a/src/Navaids/navdb.cxx +++ b/src/Navaids/navdb.cxx @@ -47,6 +47,7 @@ #include
using std::string; +using std::vector; typedef std::map AirportPropertyMap; diff --git a/src/Network/ATC-Inputs.cxx b/src/Network/ATC-Inputs.cxx index 2cd849b43..f73ca6a3f 100644 --- a/src/Network/ATC-Inputs.cxx +++ b/src/Network/ATC-Inputs.cxx @@ -49,7 +49,7 @@ #include "ATC-Inputs.hxx" using std::string; - +using std::vector; // Constructor: The _board parameter specifies which board to diff --git a/src/Network/ATC-Main.cxx b/src/Network/ATC-Main.cxx index bdaf70936..546f03ebe 100644 --- a/src/Network/ATC-Main.cxx +++ b/src/Network/ATC-Main.cxx @@ -54,7 +54,9 @@ #include "ATC-Main.hxx" using std::string; - +using std::cout; +using std::endl; +using std::vector; // Lock the ATC hardware static int fgATCMainLock( int fd ) { diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 190e952da..5d7821307 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -209,7 +209,7 @@ void FGTileMgr::schedule_needed(const SGBucket& curr_bucket, double vis) // cout << "tile width = " << tile_width << " tile_height = " // << tile_height << endl; - double tileRangeM = min(vis,_maxTileRangeM->getDoubleValue()); + double tileRangeM = std::min(vis,_maxTileRangeM->getDoubleValue()); xrange = (int)(tileRangeM / tile_width) + 1; yrange = (int)(tileRangeM / tile_height) + 1; if ( xrange < 1 ) { xrange = 1; } diff --git a/src/Scenery/tilemgr.hxx b/src/Scenery/tilemgr.hxx index 2c6648182..87d1f1347 100644 --- a/src/Scenery/tilemgr.hxx +++ b/src/Scenery/tilemgr.hxx @@ -117,7 +117,7 @@ public: bool schedule_scenery(const SGGeod& position, double range_m, double duration=0.0); // Load a model for a tile - osg::Node* loadTileModel(const string& modelPath, bool cacheModel); + osg::Node* loadTileModel(const std::string& modelPath, bool cacheModel); // Returns true if tiles around current view position have been loaded bool isSceneryLoaded(); diff --git a/src/Sound/voice.cxx b/src/Sound/voice.cxx index df85e1a98..bcdecf8cf 100644 --- a/src/Sound/voice.cxx +++ b/src/Sound/voice.cxx @@ -28,6 +28,7 @@ #define VOICE "/sim/sound/voices" +using std::string; /// MANAGER /// @@ -67,7 +68,7 @@ void FGVoiceMgr::init() try { for (unsigned int i = 0; i < voices.size(); i++) _voices.push_back(new FGVoice(this, voices[i])); - } catch (const string& s) { + } catch (const std::string& s) { SG_LOG(SG_SOUND, SG_ALERT, "VOICE: " << s); } diff --git a/src/Sound/voice.hxx b/src/Sound/voice.hxx index 39dae579a..4bde11d1e 100644 --- a/src/Sound/voice.hxx +++ b/src/Sound/voice.hxx @@ -44,7 +44,6 @@ # include #else # include - using std::queue; #endif // ENABLE_THREADS using std::vector; @@ -66,12 +65,12 @@ private: FGVoiceThread *_thread; #endif - string _host; - string _port; + std::string _host; + std::string _port; bool _enabled; SGPropertyNode_ptr _pausedNode; bool _paused; - vector _voices; + std::vector _voices; }; @@ -102,7 +101,7 @@ public: void setVolume(double); void setPitch(double); void setSpeed(double); - void pushMessage(string); + void pushMessage(std::string); private: class FGVoiceListener; @@ -117,9 +116,9 @@ private: FGVoiceMgr *_mgr; #if defined(ENABLE_THREADS) - SGLockedQueue _msg; + SGLockedQueue _msg; #else - queue _msg; + std::queue _msg; #endif }; diff --git a/src/Systems/pitot.hxx b/src/Systems/pitot.hxx index 9d97dee40..1549c9eda 100644 --- a/src/Systems/pitot.hxx +++ b/src/Systems/pitot.hxx @@ -52,7 +52,7 @@ public: private: - string _name; + std::string _name; int _num; SGPropertyNode_ptr _serviceable_node; SGPropertyNode_ptr _pressure_node; diff --git a/src/Systems/static.cxx b/src/Systems/static.cxx index d3cbbbf36..b9b649e1e 100644 --- a/src/Systems/static.cxx +++ b/src/Systems/static.cxx @@ -4,6 +4,9 @@ // This file is in the Public Domain and comes with no warranty. #include "static.hxx" + +#include + #include
#include
@@ -24,8 +27,7 @@ StaticSystem::~StaticSystem () void StaticSystem::init () { - string branch; - branch = "/systems/" + _name; + std::string branch = "/systems/" + _name; SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); _serviceable_node = node->getChild("serviceable", 0, true); diff --git a/src/Systems/static.hxx b/src/Systems/static.hxx index d62ff7f33..b4853d1ea 100644 --- a/src/Systems/static.hxx +++ b/src/Systems/static.hxx @@ -46,7 +46,7 @@ public: private: - string _name; + std::string _name; int _num; double _tau; SGPropertyNode_ptr _serviceable_node; diff --git a/src/Systems/vacuum.cxx b/src/Systems/vacuum.cxx index a776d9a49..b7f91e0ec 100644 --- a/src/Systems/vacuum.cxx +++ b/src/Systems/vacuum.cxx @@ -35,7 +35,7 @@ void VacuumSystem::init() { unsigned int i; - string branch; + std::string branch; branch = "/systems/" + _name; SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); diff --git a/src/Systems/vacuum.hxx b/src/Systems/vacuum.hxx index fd6913596..3b4713269 100644 --- a/src/Systems/vacuum.hxx +++ b/src/Systems/vacuum.hxx @@ -49,12 +49,12 @@ public: private: - string _name; + std::string _name; int _num; string_list _rpms; double _scale; SGPropertyNode_ptr _serviceable_node; - vector _rpm_nodes; + std::vector _rpm_nodes; SGPropertyNode_ptr _pressure_node; SGPropertyNode_ptr _suction_node; diff --git a/src/Time/TimeManager.cxx b/src/Time/TimeManager.cxx index 856ee7599..52b385e37 100644 --- a/src/Time/TimeManager.cxx +++ b/src/Time/TimeManager.cxx @@ -41,6 +41,8 @@ #include
#include