]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/dynamicloader.cxx
Alexis Bory:
[flightgear.git] / src / Airports / dynamicloader.cxx
index c7b74a58f91d751cafdd758feffd0b9540295ba8..b79030a22be3d6d3480dccbe4db8e7257e0ea76e 100644 (file)
@@ -60,7 +60,7 @@ void  FGAirportDynamicsXMLLoader::endXML () {
 void FGAirportDynamicsXMLLoader::startParking(const XMLAttributes &atts)
 {
   string type;
-  int index;
+  int index = 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)
 {
-  int index;
+  int index = 0;
   string lat, lon;
-  bool onRunway;
-  int holdPointType;
+  bool onRunway = false;
+  int holdPointType = 0;
   
   for (int i = 0; i < atts.size() ; i++)
        {
@@ -123,7 +123,7 @@ void FGAirportDynamicsXMLLoader::startNode(const XMLAttributes &atts)
          else if (attname == "lon")
            lon = atts.getValue(i);
     else if (attname == "isOnRunway")
-      onRunway = (bool) std::atoi(atts.getValue(i));
+      onRunway = std::atoi(atts.getValue(i)) != 0;
          else if (attname == "holdPointType") {
       string attval = atts.getValue(i);
       if (attval=="none") {
@@ -147,7 +147,7 @@ void FGAirportDynamicsXMLLoader::startNode(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++)
@@ -158,7 +158,7 @@ void FGAirportDynamicsXMLLoader::startArc(const XMLAttributes &atts)
          else if (attname == "end")
            end = std::atoi(atts.getValue(i));
     else if (attname == "isPushBackRoute")
-           isPushBackRoute = (bool) std::atoi(atts.getValue(i));
+           isPushBackRoute = std::atoi(atts.getValue(i)) != 0;
        }
   
   _dynamics->getGroundNetwork()->addSegment(new FGTaxiSegment(begin, end, isPushBackRoute));