]> git.mxchange.org Git - flightgear.git/commitdiff
Fixed several compiler warnings
authorThorstenB <brehmt@gmail.com>
Wed, 2 Feb 2011 21:05:54 +0000 (22:05 +0100)
committerThorstenB <brehmt@gmail.com>
Wed, 2 Feb 2011 21:05:54 +0000 (22:05 +0100)
uninitialized or unused variables, init sequence, ...

src/AIModel/AIBase.cxx
src/AIModel/AIWingman.cxx
src/FDM/YASim/Gear.cpp
src/FDM/YASim/Rotorpart.cpp
src/Instrumentation/dclgps.cxx
src/Instrumentation/heading_indicator_dg.cxx
src/Instrumentation/rnav_waypt_controller.cxx
src/Time/sunsolver.cxx

index 1e3b775d4f54ee17b94d5918df8c541c1b834d87..33cb073cbd5a3b30c5480fe7d88f8dd5c9e4265c 100644 (file)
@@ -59,8 +59,8 @@ FGAIBase::FGAIBase(object_type ot) :
     props( NULL ),
     model_removed( fgGetNode("/ai/models/model-removed", true) ),
     manager( NULL ),
-    fp( NULL ),
     _installed(false),
+    fp( NULL ),
     _impact_lat(0),
     _impact_lon(0),
     _impact_elev(0),
index cef9ad737f5f749f5b707365036a64bdbcc407da..be053c447884bee615c9ebe5e5ceb8de0512f4ec 100644 (file)
@@ -375,7 +375,7 @@ void FGAIWingman::Break(double dt) {
 void FGAIWingman::Join(double dt) {
 
     double range, bearing, az2;
-    double parent_hdg, parent_spd, parent_ht= 0;
+    double parent_hdg, parent_spd = 0;
     double p_hdg, p_pch, p_rll = 0;
 
     setTgtOffsets(dt, 25);
@@ -425,7 +425,7 @@ void FGAIWingman::Join(double dt) {
     double rel_brg   = calcRelBearingDeg(bearing, hdg);
     double recip_brg = calcRecipBearingDeg(bearing);
     double angle = calcAngle(distance,_offsetpos, pos);
-    double approx_angle = atan2(daltM, range);
+    //double approx_angle = atan2(daltM, range);
     double frm_spd = 50; // formation speed
     double join_rnge = 1000.0;
     double recip_parent_hdg = calcRecipBearingDeg(parent_hdg);
index 886a1a98953f49404f3d96c74de208c6b9b7ae0a..ce2517c7356194d0432aa8400b1c44fcd736f531 100644 (file)
@@ -332,8 +332,10 @@ void Gear::calcForce(RigidBody* body, State *s, float* v, float* rot)
     float b = ground[3] - Math::dot3(tmp, ground)+BumpAltitude;
 
     // Calculate the point of ground _contact.
-    _frac = a/(a-b);
-    if(b < 0) _frac = 1;
+    if(b < 0)
+        _frac = 1;
+    else
+        _frac = a/(a-b);
     for(i=0; i<3; i++)
        _contact[i] = _pos[i] + _frac*_cmpr[i];
 
index 77520dee98d95aabe1cf4a9efa710271f806bbb5..bd54f41227590436931b53b0df3e13c256481ed8 100644 (file)
@@ -99,7 +99,7 @@ void Rotorpart::inititeration(float dt,float *rot)
     float b;
     b=_rotor->getBalance();
     float s =Math::sin(_phi+_direction);
-    float c =Math::cos(_phi+_direction);
+    //float c =Math::cos(_phi+_direction);
     if (s>0)
         _balance=(b>0)?(1.-s*(1.-b)):(1.-s)*(1.+b);
     else
@@ -548,7 +548,7 @@ void Rotorpart::calcForce(float* v, float rho,  float* out, float* torque,
 
     float dirblade[3];
     Math::cross3(_normal,_directionofcentripetalforce,dirblade);
-    float vblade=Math::abs(Math::dot3(dirblade,v));
+    //float vblade=Math::abs(Math::dot3(dirblade,v));
 
     alpha=_alphaalt+(alpha-_alphaalt)*factor;
     _alpha=alpha;
index 58e87dc20324004c885b72af8712dcb735fdfa64..ec78643aa98aaea512d8d008321097e6bc1740ab 100644 (file)
@@ -654,7 +654,7 @@ string DCLGPS::ExpandSIAPIdent(const string& ident) {
        Col 107-111     MSA center fix.  We can ignore this.
 */
 void DCLGPS::LoadApproachData() {
-       FGNPIAP* iap;
+       FGNPIAP* iap = NULL;
        GPSWaypoint* wp;
        GPSFlightPlan* fp;
        const GPSWaypoint* cwp;
index 9bcd19b672cde496b729f9d48aa587c48c1ec405..bb9c1620e4f3e11d2f64f79633ed0a189f39b56b 100644 (file)
@@ -125,7 +125,6 @@ HeadingIndicatorDG::update (double dt)
     double yaw_rate = _yaw_rate_node->getDoubleValue();
     double error = _error_node->getDoubleValue();
     double g = _g_node->getDoubleValue();
-    int sign = 0;
 
     if ( fabs ( yaw_rate ) > 5 ) {
         error += 0.033 * -yaw_rate * dt ;
index 278484d0a99e87fddd0092b0aad4269e5ef7f05e..e728b88d2014889d76ea82cf725a6521b6b52877 100644 (file)
@@ -342,6 +342,9 @@ public:
     case RESTRICT_NONE:
       assert(false);
       break;
+    case SPEED_RESTRICT_MACH:
+      assert(false);
+      break;
     }
   }
   
index b903f5e568f73244fe868cf83c7dd78f9378bf50..b45e0bf2ca52785010ae468605dfe72de73a1e39 100644 (file)
@@ -53,13 +53,12 @@ void fgSunPositionGST(double gst, double *lon, double *lat) {
     /* double *lat;            (return) latitude        */
     /* double *lon;            (return) longitude       */
 
-    double alpha, delta;
     double tmp;
 
     SGPropertyNode* sun = fgGetNode("/ephemeris/sun");
     assert(sun);
     double xs = sun->getDoubleValue("xs");
-    double ys = sun->getDoubleValue("ys");
+    //double ys = sun->getDoubleValue("ys");
     double ye = sun->getDoubleValue("ye");
     double ze = sun->getDoubleValue("ze");
     double ra = atan2(ye, xs);