From b1b6d2f6e273cca1fcabcd5c230629356f52d6cb Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 27 Jun 2013 09:37:06 +0100 Subject: [PATCH] Namespace fixes for std::string --- src/Autopilot/pisimplecontroller.cxx | 2 +- src/Autopilot/predictor.cxx | 2 +- src/Cockpit/groundradar.cxx | 2 +- src/Cockpit/panel.cxx | 14 +++++++------- src/Input/FGMouseInput.cxx | 2 +- src/Instrumentation/airspeed_indicator.cxx | 2 +- src/Instrumentation/altimeter.hxx | 2 +- src/Instrumentation/instrument_mgr.cxx | 4 ++-- src/Instrumentation/mk_viii.hxx | 2 +- src/Instrumentation/newnavradio.cxx | 13 ++++++++----- src/Instrumentation/tcas.hxx | 14 +++++++------- src/Main/globals.cxx | 6 +++--- src/Main/main.cxx | 2 +- src/Model/acmodel.cxx | 2 +- src/Model/panelnode.cxx | 2 +- src/Viewer/renderingpipeline.cxx | 4 ++-- src/Viewer/splash.cxx | 4 ++-- 17 files changed, 41 insertions(+), 38 deletions(-) diff --git a/src/Autopilot/pisimplecontroller.cxx b/src/Autopilot/pisimplecontroller.cxx index c33260698..643471d75 100644 --- a/src/Autopilot/pisimplecontroller.cxx +++ b/src/Autopilot/pisimplecontroller.cxx @@ -34,7 +34,7 @@ PISimpleController::PISimpleController() : { } -bool PISimpleController::configure( const string& nodeName, SGPropertyNode_ptr configNode) +bool PISimpleController::configure( const std::string& nodeName, SGPropertyNode_ptr configNode) { if( AnalogComponent::configure( nodeName, configNode ) ) return true; diff --git a/src/Autopilot/predictor.cxx b/src/Autopilot/predictor.cxx index d5c854a72..9e7c8030e 100644 --- a/src/Autopilot/predictor.cxx +++ b/src/Autopilot/predictor.cxx @@ -34,7 +34,7 @@ Predictor::Predictor () : { } -bool Predictor::configure(const string& nodeName, SGPropertyNode_ptr configNode) +bool Predictor::configure(const std::string& nodeName, SGPropertyNode_ptr configNode) { SG_LOG( SG_AUTOPILOT, SG_BULK, "Predictor::configure(" << nodeName << ")" << endl ); diff --git a/src/Cockpit/groundradar.cxx b/src/Cockpit/groundradar.cxx index 702ba6d5a..a142f4c22 100644 --- a/src/Cockpit/groundradar.cxx +++ b/src/Cockpit/groundradar.cxx @@ -221,7 +221,7 @@ void GroundRadar::updateTexture() osg::ref_ptr taxi_vertices = new osg::Vec3Array; osg::ref_ptr pvt_vertices = new osg::Vec3Array; - const string airport_name = _airport_node->getStringValue(); + const std::string airport_name = _airport_node->getStringValue(); const FGAirport* airport = fgFindAirportID(airport_name); if (airport == 0) diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index 3fbc1994b..db09777ed 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -98,10 +98,10 @@ get_aspect_adjust (int xsize, int ysize) // Implementation of FGTextureManager. //////////////////////////////////////////////////////////////////////// -map > FGTextureManager::_textureMap; +map > FGTextureManager::_textureMap; osg::Texture2D* -FGTextureManager::createTexture (const string &relativePath, bool staticTexture) +FGTextureManager::createTexture (const std::string &relativePath, bool staticTexture) { osg::Texture2D* texture = _textureMap[relativePath].get(); if (texture == 0) { @@ -118,7 +118,7 @@ FGTextureManager::createTexture (const string &relativePath, bool staticTexture) } -void FGTextureManager::addTexture(const string &relativePath, +void FGTextureManager::addTexture(const std::string &relativePath, osg::Texture2D* texture) { _textureMap[relativePath] = texture; @@ -136,7 +136,7 @@ FGCroppedTexture::FGCroppedTexture () } -FGCroppedTexture::FGCroppedTexture (const string &path, +FGCroppedTexture::FGCroppedTexture (const std::string &path, float minX, float minY, float maxX, float maxY) : _path(path), _texture(0), @@ -1135,7 +1135,7 @@ FGTextLayer::setPointSize (float size) } void -FGTextLayer::setFontName(const string &name) +FGTextLayer::setFontName(const std::string &name) { _font_name = name + ".txf"; FGFontCache *fc = globals->get_fontcache(); @@ -1170,7 +1170,7 @@ FGTextLayer::recalc_value () const // Implementation of FGTextLayer::Chunk. //////////////////////////////////////////////////////////////////////// -FGTextLayer::Chunk::Chunk (const string &text, const string &fmt) +FGTextLayer::Chunk::Chunk (const std::string &text, const std::string &fmt) : _type(FGTextLayer::TEXT), _fmt(fmt) { _text = text; @@ -1179,7 +1179,7 @@ FGTextLayer::Chunk::Chunk (const string &text, const string &fmt) } FGTextLayer::Chunk::Chunk (ChunkType type, const SGPropertyNode * node, - const string &fmt, float mult, float offs, + const std::string &fmt, float mult, float offs, bool truncation) : _type(type), _fmt(fmt), _mult(mult), _offs(offs), _trunc(truncation) { diff --git a/src/Input/FGMouseInput.cxx b/src/Input/FGMouseInput.cxx index 6ac4c0e98..0ea62d011 100644 --- a/src/Input/FGMouseInput.cxx +++ b/src/Input/FGMouseInput.cxx @@ -373,7 +373,7 @@ FGMouseInput::~FGMouseInput() void FGMouseInput::init() { SG_LOG(SG_INPUT, SG_DEBUG, "Initializing mouse bindings"); - string module = ""; + std::string module = ""; SGPropertyNode * mouse_nodes = fgGetNode("/input/mice"); if (mouse_nodes == 0) { diff --git a/src/Instrumentation/airspeed_indicator.cxx b/src/Instrumentation/airspeed_indicator.cxx index 3c339451c..2879f73b7 100644 --- a/src/Instrumentation/airspeed_indicator.cxx +++ b/src/Instrumentation/airspeed_indicator.cxx @@ -45,7 +45,7 @@ AirspeedIndicator::~AirspeedIndicator () void AirspeedIndicator::init () { - string branch; + std::string branch; branch = "/instrumentation/" + _name; SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); diff --git a/src/Instrumentation/altimeter.hxx b/src/Instrumentation/altimeter.hxx index 38c6ba63f..45c3a4e61 100644 --- a/src/Instrumentation/altimeter.hxx +++ b/src/Instrumentation/altimeter.hxx @@ -50,7 +50,7 @@ private: std::string _name; int _num; SGPropertyNode_ptr _rootNode; - string _static_pressure; + std::string _static_pressure; double _tau; double _quantum; double _kollsman; diff --git a/src/Instrumentation/instrument_mgr.cxx b/src/Instrumentation/instrument_mgr.cxx index 80724e3a6..dbf557eb6 100644 --- a/src/Instrumentation/instrument_mgr.cxx +++ b/src/Instrumentation/instrument_mgr.cxx @@ -110,7 +110,7 @@ bool FGInstrumentMgr::build (SGPropertyNode* config_props) { for ( int i = 0; i < config_props->nChildren(); ++i ) { SGPropertyNode *node = config_props->getChild(i); - string name = node->getName(); + std::string name = node->getName(); std::ostringstream subsystemname; subsystemname << "instrument-" << i << '-' @@ -118,7 +118,7 @@ bool FGInstrumentMgr::build (SGPropertyNode* config_props) int index = node->getIntValue("number", 0); if (index > 0) subsystemname << '['<< index << ']'; - string id = subsystemname.str(); + std::string id = subsystemname.str(); if ( name == "adf" ) { set_subsystem( id, new ADF( node ), 0.15 ); diff --git a/src/Instrumentation/mk_viii.hxx b/src/Instrumentation/mk_viii.hxx index 62649eff7..6529fba7b 100644 --- a/src/Instrumentation/mk_viii.hxx +++ b/src/Instrumentation/mk_viii.hxx @@ -1329,7 +1329,7 @@ private: // MK_VIII (continued) ////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// - string name; + std::string name; int num; PowerHandler power_handler; diff --git a/src/Instrumentation/newnavradio.cxx b/src/Instrumentation/newnavradio.cxx index bc54961d9..7d4b60f29 100644 --- a/src/Instrumentation/newnavradio.cxx +++ b/src/Instrumentation/newnavradio.cxx @@ -174,7 +174,7 @@ protected: PropertyObject _trackDistance_m; PropertyObject _slantDistance_m; PropertyObject _heightAboveStation_ft; - PropertyObject _ident; + PropertyObject _ident; PropertyObject _inRange; PropertyObject _range_nm; }; @@ -378,7 +378,9 @@ double VOR::ServiceVolume::adjustRange( double height_ft, double nominalRange_nm } VOR::VOR( SGPropertyNode_ptr rootNode) : - NavRadioComponentWithIdent("vor", rootNode, new VORAudioIdent(getIdentString(string("vor"), rootNode->getIndex()))), + NavRadioComponentWithIdent("vor", rootNode, + new VORAudioIdent(getIdentString(std::string("vor"), + rootNode->getIndex()))), _totalTime(0.0), _radial( rootNode->getNode(_name,true)->getNode("radial",true) ), _radialInbound( rootNode->getNode(_name,true)->getNode("radial-inbound",true) ) @@ -523,7 +525,8 @@ double LOC::ServiceVolume::adjustRange( double azimuthAngle_deg, double elevatio } LOC::LOC( SGPropertyNode_ptr rootNode) : - NavRadioComponentWithIdent("loc", rootNode, new LOCAudioIdent(getIdentString(string("loc"), rootNode->getIndex()))), + NavRadioComponentWithIdent("loc", rootNode, new LOCAudioIdent(getIdentString(std::string("loc"), + rootNode->getIndex()))), _serviceVolume(), _localizerOffset_norm( rootNode->getNode(_name,true)->getNode("offset-norm",true) ), _localizerWidth_deg( rootNode->getNode(_name,true)->getNode("width-deg",true) ) @@ -882,7 +885,7 @@ NavRadioImpl::NavRadioImpl( SGPropertyNode_ptr node ) : _legacy( this ), _name(node->getStringValue("name", "nav")), _num(node->getIntValue("number", 0)), - _rootNode(fgGetNode( string("/instrumentation/") + _name, _num, true)), + _rootNode(fgGetNode( std::string("/instrumentation/") + _name, _num, true)), _useFrequencyFormatter( _rootNode->getNode("frequencies/selected-mhz",true), _rootNode->getNode("frequencies/selected-mhz-fmt",true), 0.05 ), _stbyFrequencyFormatter( _rootNode->getNode("frequencies/standby-mhz",true), _rootNode->getNode("frequencies/standby-mhz-fmt",true), 0.05 ), _navIndicator(_rootNode), @@ -968,7 +971,7 @@ void NavRadioImpl::Legacy::update( double dt ) _navRadioImpl->_components[VOR_COMPONENT]->valid() || _navRadioImpl->_components[LOC_COMPONENT]->valid() ); - string ident = _navRadioImpl->_components[VOR_COMPONENT]->getIdent(); + std::string ident = _navRadioImpl->_components[VOR_COMPONENT]->getIdent(); if( ident.empty() ) ident = _navRadioImpl->_components[LOC_COMPONENT]->getIdent(); diff --git a/src/Instrumentation/tcas.hxx b/src/Instrumentation/tcas.hxx index 9f9f0964e..89d929114 100644 --- a/src/Instrumentation/tcas.hxx +++ b/src/Instrumentation/tcas.hxx @@ -114,7 +114,7 @@ class TCAS : public SGSubsystem typedef struct { - string callsign; + std::string callsign; bool verticalTA; bool verticalRA; bool horizontalTA; @@ -134,7 +134,7 @@ class TCAS : public SGSubsystem double RAtimestamp; } TrackerTarget; - typedef map TrackerTargets; + typedef map TrackerTargets; typedef struct { @@ -264,12 +264,12 @@ class TCAS : public SGSubsystem void update (void); - void add (const string callsign, int detectedLevel); + void add (const std::string callsign, int detectedLevel); bool active (void) { return haveTargets;} bool newTraffic (void) { return newTargets;} - bool isTracked (string callsign) { if (!haveTargets) return false;else return _isTracked(callsign);} - bool _isTracked (string callsign); - int getThreatLevel (string callsign); + bool isTracked (std::string callsign) { if (!haveTargets) return false;else return _isTracked(callsign);} + bool _isTracked (std::string callsign); + int getThreatLevel (std::string callsign); private: TCAS* tcas; @@ -358,7 +358,7 @@ class TCAS : public SGSubsystem }; private: - string name; + std::string name; int num; double nextUpdateTime; int selfTestStep; diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 8e5547d10..45d70af52 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -220,7 +220,7 @@ FGGlobals::~FGGlobals() } // set the fg_root path -void FGGlobals::set_fg_root (const string &root) { +void FGGlobals::set_fg_root (const std::string &root) { SGPath tmp(root); fg_root = tmp.realpath(); @@ -247,12 +247,12 @@ void FGGlobals::set_fg_root (const string &root) { } // set the fg_home path -void FGGlobals::set_fg_home (const string &home) { +void FGGlobals::set_fg_home (const std::string &home) { SGPath tmp(home); fg_home = tmp.realpath(); } -void FGGlobals::append_fg_scenery (const string &paths) +void FGGlobals::append_fg_scenery (const std::string &paths) { // fg_scenery.clear(); SGPropertyNode* sim = fgGetNode("/sim", true); diff --git a/src/Main/main.cxx b/src/Main/main.cxx index ebb72641a..ea94dd4cd 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -301,7 +301,7 @@ int fgMainInit( int argc, char **argv ) { // now home is initialised, we can log to a file inside it logToFile(); - string version; + std::string version; #ifdef FLIGHTGEAR_VERSION version = FLIGHTGEAR_VERSION; #else diff --git a/src/Model/acmodel.cxx b/src/Model/acmodel.cxx index c25802f4f..73701f622 100644 --- a/src/Model/acmodel.cxx +++ b/src/Model/acmodel.cxx @@ -65,7 +65,7 @@ FGAircraftModel::init () osg::Node *model = NULL; _aircraft = new SGModelPlacement; - string path = fgGetString("/sim/model/path", "Models/Geometry/glider.ac"); + std::string path = fgGetString("/sim/model/path", "Models/Geometry/glider.ac"); SGPath resolvedPath = globals->resolve_aircraft_path(path); if (resolvedPath.isNull()) diff --git a/src/Model/panelnode.cxx b/src/Model/panelnode.cxx index 4d9a2faf1..9e6c81cde 100644 --- a/src/Model/panelnode.cxx +++ b/src/Model/panelnode.cxx @@ -179,7 +179,7 @@ void FGPanelNode::lazyLoad() _panel = fgReadPanel(_panelPath); if (!_panel) { SG_LOG(SG_COCKPIT, SG_WARN, "failed to read panel from:" << _panelPath); - _panelPath = string(); // don't keep trying to read + _panelPath = std::string(); // don't keep trying to read return; } diff --git a/src/Viewer/renderingpipeline.cxx b/src/Viewer/renderingpipeline.cxx index ab4f9640a..1c0cb345d 100644 --- a/src/Viewer/renderingpipeline.cxx +++ b/src/Viewer/renderingpipeline.cxx @@ -132,8 +132,8 @@ void findAttrOrHex(const simgear::effect::EffectPropertyMap& pMap, try { result = boost::lexical_cast(val); } catch (boost::bad_lexical_cast &) { - throw simgear::effect::BuilderException(string("findAttrOrHex: could not find attribute ") - + string(val)); + throw simgear::effect::BuilderException(std::string("findAttrOrHex: could not find attribute ") + + std::string(val)); } } } diff --git a/src/Viewer/splash.cxx b/src/Viewer/splash.cxx index 5615efc16..fb7995518 100644 --- a/src/Viewer/splash.cxx +++ b/src/Viewer/splash.cxx @@ -388,7 +388,7 @@ void fgSplashInit () { void fgSplashProgress( const char *identifier ) { const char* spinChars = "-\\|/"; static int spin_count = 0; - string spin_status = string(""); + std::string spin_status = std::string(""); if (identifier[0] != 0) spin_status += spinChars[spin_count++ % 4]; @@ -398,7 +398,7 @@ void fgSplashProgress( const char *identifier ) { const char* text = ""; if (identifier[0] != 0) { - string id = string("splash/") + identifier; + std::string id = std::string("splash/") + identifier; text = globals->get_locale()->getLocalizedString(id.c_str(), "sys", ""); } -- 2.39.5