]> git.mxchange.org Git - flightgear.git/commitdiff
Fix some places relying on public 'using std::string' in SimGear
authorJames Turner <zakalawe@mac.com>
Tue, 21 Aug 2012 16:07:47 +0000 (17:07 +0100)
committerJames Turner <zakalawe@mac.com>
Tue, 21 Aug 2012 16:07:47 +0000 (17:07 +0100)
(Otherwise my next SimGear commit will break them)

12 files changed:
src/ATC/atcdialog.cxx
src/Aircraft/flightrecorder.cxx
src/Aircraft/flightrecorder.hxx
src/Autopilot/component.cxx
src/Autopilot/route_mgr.cxx
src/GUI/gui.h
src/GUI/gui_funcs.cxx
src/Instrumentation/HUD/HUD.cxx
src/Instrumentation/HUD/HUD_ladder.cxx
src/Instrumentation/KLN89/kln89_page_apt.cxx
src/Main/bootstrap.cxx
src/Main/main.hxx

index 51e319d5d6676a9a2ccdc864c05b51007ac3ab0e..f2e851e2691c15a1f3499626bfee127e51a7913f 100644 (file)
@@ -44,6 +44,7 @@
 #include <Airports/simple.hxx>
 #include <ATC/CommStation.hxx>
 
+using std::string;
 
 static SGPropertyNode *getNamedNode(SGPropertyNode *prop, const char *name)
 {
index 73b4f9bff5e98bc879c771e7af9f518ef544b5de..a2188540b9fd75b8790d2ddfd816e5163ba56ce6 100644 (file)
@@ -38,6 +38,7 @@
 #include "flightrecorder.hxx"
 
 using namespace FlightRecorder;
+using std::string;
 
 FGFlightRecorder::FGFlightRecorder(const char* pConfigName) :
     m_RecorderNode(fgGetNode("/sim/flight-recorder", true)),
index 2bf23908826a05ea319066c82242542c0902e0b6..7650db458fe4d3d21c8a9f78dcfa472448723869 100644 (file)
@@ -68,7 +68,7 @@ private:
                         SGPropertyNode_ptr BaseNode);
     void processSignalList(const char* pSignalType, FlightRecorder::TSignalList& SignalList,
                            SGPropertyNode_ptr SignalListNode,
-                           string PropPrefix="", int Count = 1);
+                           std::string PropPrefix="", int Count = 1);
     bool haveProperty(FlightRecorder::TSignalList& Capture,SGPropertyNode* pProperty);
     bool haveProperty(SGPropertyNode* pProperty);
 
@@ -83,7 +83,7 @@ private:
     FlightRecorder::TSignalList m_CaptureBool;
 
     int m_TotalRecordSize;
-    string m_ConfigName;
+    std::string m_ConfigName;
 };
 
 #endif /* FLIGHTRECORDER_HXX_ */
index 1da236cc9c3f29f0613dac1b111f5c6285a05fbf..f1c2894123ba25e34d3bf44cc7b6d5e6bf5aaafd 100644 (file)
@@ -46,7 +46,7 @@ bool Component::configure( SGPropertyNode_ptr configNode )
     SGPropertyNode_ptr prop;
 
     SGPropertyNode_ptr child = configNode->getChild(i);
-    string cname(child->getName());
+    std::string cname(child->getName());
 
     if( configure( cname, child ) )
       continue;
@@ -87,7 +87,7 @@ bool Component::configure( const std::string & nodeName, SGPropertyNode_ptr conf
 
     if ( (prop = configNode->getChild( "value" )) != NULL ) {
       delete _enable_value;
-      _enable_value = new string(prop->getStringValue());
+      _enable_value = new std::string(prop->getStringValue());
     }
 
     if ( (prop = configNode->getChild( "honor-passive" )) != NULL ) {
index 3be33129f5dd30e705b31a8870dab4da16385c42..e685b88884d72d9fb03688a1dce80fcda38323bf 100644 (file)
@@ -56,6 +56,7 @@
 #define RM "/autopilot/route-manager/"
 
 using namespace flightgear;
+using std::string;
 
 static bool commandLoadFlightPlan(const SGPropertyNode* arg)
 {
index f25d0c9613866faf3d7efc905959882755c65d4a..cc523f756ac910dda27c93b5fbf1cb432c1620a8 100644 (file)
@@ -42,7 +42,7 @@ class GraphicsContext;
 // gui.cxx
 extern void guiStartInit(osg::GraphicsContext*);
 extern bool guiFinishInit();
-extern bool openBrowser(string address);
+extern bool openBrowser(const std::string& address);
 extern void mkDialog(const char *txt);
 extern void guiErrorMessage(const char *txt);
 extern void guiErrorMessage(const char *txt, const sg_throwable &throwable);
index e8941e3d53fbef4b772a0d105e0e1e00cca792c4..82a48177235219eac056305a50e8321e183f8c8e 100644 (file)
@@ -165,10 +165,11 @@ void helpCb()
     openBrowser( "Docs/index.html" );
 }
 
-bool openBrowser(string address)
+bool openBrowser(const std::string& aAddress)
 {
     bool ok = true;
-
+    string address(aAddress);
+    
     // do not resolve addresses with given protocol, i.e. "http://...", "ftp://..."
     if (address.find("://")==string::npos)
     {
index 22476c92254564375a2a8e51ce233cf801b9f324..2b5d75aae7f2cb67000cb3f33028a3778ade19a7 100644 (file)
@@ -45,6 +45,7 @@
 
 using std::endl;
 using std::ifstream;
+using std::string;
 
 static float clamp(float f)
 {
index 37a9f292cafaa3c132b4327ea71b33613ef8d926..0b7784a27f91642728e1ce1b7f20066d7860db84 100644 (file)
@@ -28,6 +28,8 @@
 #include <Viewer/viewer.hxx>
 #include "HUD.hxx"
 
+using std::string;
+
 // FIXME
 static float get__heading() { return fgGetFloat("/orientation/heading-deg") * M_PI / 180.0; }
 static float get__throttleval() { return fgGetFloat("/controls/engines/engine/throttle"); }
index 95b34cfe6eee977337058fb0882af3ac73f4d8ca..ae25ca723c9298987d07c3f8592014101279d3eb 100644 (file)
@@ -35,6 +35,8 @@
 #include <Airports/runways.hxx>
 #include <Airports/simple.hxx>
 
+using std::string;
+
 KLN89AptPage::KLN89AptPage(KLN89* parent) 
 : KLN89Page(parent) {
        _nSubPages = 8;
index f2c3514a01fcb3fb862e9491e32ec045cc748c5e..44b547da52445d52c8ef0a4786ba4d5dd36ea779 100644 (file)
@@ -64,8 +64,8 @@ using std::endl;
 
 #include "fg_os.hxx"
 
-string homedir;
-string hostname;
+std::string homedir;
+std::string hostname;
 
 // forward declaration.
 void fgExitCleanup();
@@ -259,7 +259,7 @@ int main ( int argc, char **argv ) {
         if (std::strlen(t.getOrigin()) != 0)
             cerr << " (received from " << t.getOrigin() << ')' << endl;
 
-    } catch (const string &s) {
+    } catch (const std::string &s) {
         cerr << "Fatal error: " << s << endl;
 
     } catch (const char *s) {
@@ -274,8 +274,8 @@ int main ( int argc, char **argv ) {
     return 0;
 }
 
-// do some clean up on exit.  Specifically we want to call alutExit()
-// which happens in the sound manager destructor.
+// do some clean up on exit.  Specifically we want to delete the sound-manager,
+// so OpenAL device and context are released cleanly
 void fgExitCleanup() {
 
     if (_bootstrap_OSInit != 0)
index b6c2d3442a34c896a672148f52ae0066b1868d89..8ddea1a9ebf59c157a6c2b735a67ae1e01d5c9b2 100644 (file)
@@ -9,7 +9,7 @@ int fgMainInit( int argc, char **argv );
 
 extern int idle_state;
 
-extern string homedir;
-extern string hostname;
+extern std::string homedir;
+extern std::string hostname;
 
 #endif