]> git.mxchange.org Git - flightgear.git/commitdiff
compilation fixes for gcc -Wall -Werror
authorTim Moore <timoore@redhat.com>
Mon, 24 Aug 2009 15:13:31 +0000 (17:13 +0200)
committerTim Moore <timoore@redhat.com>
Mon, 24 Aug 2009 15:13:31 +0000 (17:13 +0200)
Most are cosmetic, but the changes in the FGATCInstruction constructor
fix unitialized members.

src/AIModel/AIFlightPlanCreate.cxx
src/AIModel/AIFlightPlanCreatePushBack.cxx
src/ATC/trafficcontrol.cxx
src/Traffic/TrafficMgr.cxx

index 560d69db4b437391fb179a111de0efcc0264e497..64df906f5fb51400a9848fd04f6da461a09d8b98 100644 (file)
@@ -529,10 +529,10 @@ void FGAIFlightPlan::createParking(FGAIAircraft *ac, FGAirport *apt, double radi
 {
   waypoint* wpt;
   double aptElev = apt->getElevation();
-  double lat, lat2;
-  double lon, lon2;
-  double az2;
-  double heading;
+  double lat = 0.0, lat2 = 0.0;
+  double lon = 0.0, lon2 = 0.0;
+  double az2 = 0.0;
+  double heading = 0.0;
 
   double vTaxi        = ac->getPerformance()->vTaxi();
   double vTaxiReduced = vTaxi * (2.0/3.0);
index 76458f211e12a982b378fa71187ae376ad55ae0d..d97e30da22eea2b37eef3bc372cc1a72a0386c46 100644 (file)
@@ -246,9 +246,9 @@ void FGAIFlightPlan::createPushBackFallBack(FGAIAircraft *ac, bool firstFlight,
   double heading;
   double lat;
   double lon;
-  double lat2;
-  double lon2;
-  double az2;
+  double lat2 = 0.0;
+  double lon2 = 0.0;
+  double az2 = 0.0;
 
   double vTaxi = ac->getPerformance()->vTaxi();
   double vTaxiBackward = vTaxi * (-2.0/3.0);
index 3ddfbc4ed3262f13b03c82d4f0bdc11cb62371e4..57f718812ce242bbf680a8eb9371ffd278e3b3fa 100644 (file)
@@ -248,7 +248,7 @@ bool FGTrafficRecord::isOpposing (FGGroundNetwork *net, FGTrafficRecord &other,
       
        for (intVecIterator i = intentions.begin(); i != intentions.end(); i++)
        {
-         if (opp = net->findSegment(other.currentPos)->opposite())
+         if ((opp = net->findSegment(other.currentPos)->opposite()))
            {
              if ((*i) > 0)
                if (opp->getIndex() == net->findSegment(*i)->getIndex())
@@ -267,7 +267,7 @@ bool FGTrafficRecord::isOpposing (FGGroundNetwork *net, FGTrafficRecord &other,
                {  
                  // cerr << "Current segment 1 " << (*i) << endl;
                  if ((*i) > 0) {
-                   if (opp = net->findSegment(*i)->opposite())
+                   if ((opp = net->findSegment(*i)->opposite()))
                      {
                        if (opp->getIndex() == 
                            net->findSegment(*j)->getIndex())
@@ -318,9 +318,9 @@ FGATCInstruction::FGATCInstruction()
   changeAltitude = false;
   resolveCircularWait = false;
 
-  double speed   = 0;
-  double heading = 0;
-  double alt     = 0;
+  speed   = 0;
+  heading = 0;
+  alt     = 0;
 }
 
 bool FGATCInstruction::hasInstruction()
index 5abcc755c6e63f8af6b3ca36dbfc0f783275e54a..050f0846dde6b2b57e0dcb14751f5aec9c6fe18f 100644 (file)
@@ -128,8 +128,7 @@ void FGTrafficManager::init()
       }
       ulCloseDir(d);
     }
-    time_t now = time(NULL) + fgGetLong("/sim/time/warp");
-
+    
     currAircraft = scheduledAircraft.begin();
     currAircraftClosest = scheduledAircraft.begin();
 }