]> git.mxchange.org Git - flightgear.git/commitdiff
Minor pointer safety and compiler warning issues.
authorThorstenB <brehmt@gmail.com>
Tue, 25 Sep 2012 20:09:26 +0000 (22:09 +0200)
committerThorstenB <brehmt@gmail.com>
Tue, 25 Sep 2012 20:10:06 +0000 (22:10 +0200)
src/Aircraft/controls.cxx
src/Airports/dynamicloader.cxx
src/Airports/gnnode.cxx
src/Scenery/scenery.cxx

index 8ff11133c2dce0c58af67b7c1255489ce3509e91..50134d19616e54d8a29cdf077fcf280531eafde0 100644 (file)
@@ -74,6 +74,8 @@ FGControls::FGControls() :
     mode( 0 ),
     dump( false ),
     outflow_valve( 0.0 ),
     mode( 0 ),
     dump( false ),
     outflow_valve( 0.0 ),
+    landing_lights( false ),
+    turn_off_lights( false ),
     taxi_light( false ),
     logo_lights( false ),
     nav_lights( false ),
     taxi_light( false ),
     logo_lights( false ),
     nav_lights( false ),
@@ -87,6 +89,7 @@ FGControls::FGControls() :
     release_ALL( false ),
     vertical_adjust( 0.0 ),
     fore_aft_adjust( 0.0 ),
     release_ALL( false ),
     vertical_adjust( 0.0 ),
     fore_aft_adjust( 0.0 ),
+    cmd_selector_valve( 0 ),
     off_start_run( 0 ),
     APU_fire_switch( false ),
     autothrottle_arm( false ),
     off_start_run( 0 ),
     APU_fire_switch( false ),
     autothrottle_arm( false ),
@@ -166,6 +169,8 @@ void FGControls::reset_all()
 
 // Destructor
 FGControls::~FGControls() {
 
 // Destructor
 FGControls::~FGControls() {
+    if (globals)
+        globals->set_controls( NULL );
 }
 
 
 }
 
 
@@ -651,6 +656,9 @@ void
 FGControls::update (double dt)
 {
   SG_UNUSED(dt);
 FGControls::update (double dt)
 {
   SG_UNUSED(dt);
+
+  // nothing here, don't call again
+  suspend();
 }
 \f
 ////////////////////////////////////////////////////////////////////////
 }
 \f
 ////////////////////////////////////////////////////////////////////////
index c7b74a58f91d751cafdd758feffd0b9540295ba8..79fa1f36eecc484a2d6f73da29800a61d6f1c370 100644 (file)
@@ -60,7 +60,7 @@ void  FGAirportDynamicsXMLLoader::endXML () {
 void FGAirportDynamicsXMLLoader::startParking(const XMLAttributes &atts)
 {
   string type;
 void FGAirportDynamicsXMLLoader::startParking(const XMLAttributes &atts)
 {
   string type;
-  int index;
+  int index = 0;
   string gateName, gateNumber;
   string lat, lon;
   double heading = 0.0;
   string gateName, gateNumber;
   string lat, lon;
   double heading = 0.0;
@@ -108,10 +108,10 @@ void FGAirportDynamicsXMLLoader::startParking(const XMLAttributes &atts)
 
 void FGAirportDynamicsXMLLoader::startNode(const XMLAttributes &atts)
 {
 
 void FGAirportDynamicsXMLLoader::startNode(const XMLAttributes &atts)
 {
-  int index;
+  int index = 0;
   string lat, lon;
   string lat, lon;
-  bool onRunway;
-  int holdPointType;
+  bool onRunway = false;
+  int holdPointType = 0;
   
   for (int i = 0; i < atts.size() ; i++)
        {
   
   for (int i = 0; i < atts.size() ; i++)
        {
@@ -147,7 +147,7 @@ void FGAirportDynamicsXMLLoader::startNode(const XMLAttributes &atts)
 
 void FGAirportDynamicsXMLLoader::startArc(const XMLAttributes &atts)
 {  
 
 void FGAirportDynamicsXMLLoader::startArc(const XMLAttributes &atts)
 {  
-  int begin, end;
+  int begin = 0, end = 0;
   bool isPushBackRoute = false;
   
   for (int i = 0; i < atts.size() ; i++)
   bool isPushBackRoute = false;
   
   for (int i = 0; i < atts.size() ; i++)
index 41e746305cde34e123f89d50559c41a9e670cf52..85fc93022c680048897bfa136d2158ce8bfa3f95 100644 (file)
@@ -31,8 +31,8 @@ void FGTaxiNode::setElevation(double val)
 
 double FGTaxiNode::getElevationFt(double refelev)
 {
 
 double FGTaxiNode::getElevationFt(double refelev)
 {
-    double elevF = elevation();
 #if 0
 #if 0
+    double elevF = elevation();
     double elevationEnd = 0;
     if ((elevF == 0) || (elevF == refelev)) {
         SGGeod center2 = mPosition;
     double elevationEnd = 0;
     if ((elevF == 0) || (elevF == refelev)) {
         SGGeod center2 = mPosition;
index 4b787ddb3ff45c39d57d529f44e18e0c6fd04112..5ed687e83c3175e9f0acfd70a39931c4b11b6b80 100644 (file)
@@ -36,6 +36,7 @@
 #include <osgViewer/Viewer>
 
 #include <simgear/constants.h>
 #include <osgViewer/Viewer>
 
 #include <simgear/constants.h>
+#include <simgear/sg_inlines.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/scene/tgdb/userdata.hxx>
 #include <simgear/scene/material/matlib.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/scene/tgdb/userdata.hxx>
 #include <simgear/scene/material/matlib.hxx>
@@ -249,7 +250,11 @@ void FGScenery::init() {
 }
 
 
 }
 
 
-void FGScenery::update(double dt) {
+void FGScenery::update(double dt)
+{
+    SG_UNUSED(dt);
+    // nothing here, don't call again
+    suspend();
 }
 
 
 }