]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/xmlauto.cxx
fix a pointer reference.
[flightgear.git] / src / Autopilot / xmlauto.cxx
index 1da3642765a9f61ccfa03122e9f784303fad48f6..6761cddf7d30a88330064d7e088b9447b089a75d 100644 (file)
@@ -152,15 +152,15 @@ double FGXMLAutoInput::get_value()
 }
 
 FGXMLAutoComponent::FGXMLAutoComponent( SGPropertyNode * node ) :
-      debug(false),
-      name(""),
+      _condition( NULL ),
       enable_prop( NULL ),
-      passive_mode( fgGetNode("/autopilot/locks/passive-mode", true) ),
       enable_value( NULL ),
+      passive_mode( fgGetNode("/autopilot/locks/passive-mode", true) ),
       honor_passive( false ),
-      enabled( false ),
-      _condition( NULL ),
-      feedback_if_disabled( false )
+      name(""),
+      feedback_if_disabled( false ),
+      debug(false),
+      enabled( false )
 {
     int i;
     SGPropertyNode *prop; 
@@ -573,7 +573,8 @@ void FGPISimpleController::update( double dt ) {
 
 
 FGPredictor::FGPredictor ( SGPropertyNode *node ):
-    FGXMLAutoComponent( node )
+    FGXMLAutoComponent( node ),
+    average(0.0)
 {
     int i;
     for ( i = 0; i < node->nChildren(); ++i ) {
@@ -618,7 +619,7 @@ void FGPredictor::update( double dt ) {
 
         if ( dt > 0.0 ) {
             double current = (ivalue - last_value)/dt; // calculate current error change (per second)
-            double average = dt < 1.0 ? ((1.0 - dt) * average + current * dt) : current;
+            average = dt < 1.0 ? ((1.0 - dt) * average + current * dt) : current;
 
             // calculate output with filter gain adjustment
             double output = ivalue + 
@@ -794,7 +795,7 @@ void FGXMLAutopilot::init() {
                         " details.");
                 exit(-1);
             }        
-        } catch (const sg_exception& exc) {
+        } catch (const sg_exception&) {
             SG_LOG( SG_ALL, SG_ALERT, "Failed to load autopilot configuration: "
                     << config.str() );
         }