]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/awynet.cxx
Fix some leaks on reset
[flightgear.git] / src / Navaids / awynet.cxx
old mode 100755 (executable)
new mode 100644 (file)
index ab8ec11..e147661
@@ -15,7 +15,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
@@ -37,7 +37,7 @@
 #include "awynet.hxx"
 
 using std::sort;
-
+using std::string;
 using std::cerr;
 using std::endl;
 
@@ -163,10 +163,10 @@ void FGAirwayNetwork::addAirway(const FGAirway &seg)
 //}
 
 /*
-  void FGAirwayNetwork::addNodes(FGParkingVec *parkings)
+  void FGAirwayNetwork::addNodes(FGParkingList *parkings)
   {
   FGTaxiNode n;
-  FGParkingVecIterator i = parkings->begin();
+  FGParkingList::iterator i = parkings->begin();
   while (i != parkings->end())
   {
   n.setIndex(i->getIndex());
@@ -207,7 +207,7 @@ void FGAirwayNetwork::load(const SGPath& path)
 
   sg_gzifstream in( path.str() );
   if ( !in.is_open() ) {
-    SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+    SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
     exit(-1);
   }
   // toss the first two lines of the file
@@ -317,7 +317,7 @@ void FGAirwayNetwork::load(const SGPath& path)
 int FGAirwayNetwork::findNearestNode(const SGGeod& aPos)
 {
   double minDist = HUGE_VAL;
-  int index;
+  int index = -1;
   SGVec3d cart = SGVec3d::fromGeod(aPos);
   
   //cerr << "Lat " << lat << " lon " << lon << endl;
@@ -354,7 +354,7 @@ FGAirRoute FGAirwayNetwork::findShortestRoute(int start, int end)
   foundRoute = false;
   totalDistance = 0;
   FGNode *firstNode = findNode(start);
-  FGNode *lastNode  = findNode(end);
+  //FGNode *lastNode  = findNode(end);
   //prevNode = prevPrevNode = -1;
   //prevNode = start;
   routes.clear();
@@ -364,7 +364,7 @@ FGAirRoute FGAirwayNetwork::findShortestRoute(int start, int end)
 
   if (!foundRoute)
     {
-      SG_LOG( SG_GENERAL, SG_INFO, "Failed to find route from waypoint " << start << " to " << end );
+      SG_LOG( SG_NAVAID, SG_INFO, "Failed to find route from waypoint " << start << " to " << end );
       cerr << "Failed to find route from waypoint " << start << " to " << end << endl;
       //exit(1);
     }
@@ -458,7 +458,7 @@ void FGAirwayNetwork::trace(FGNode *currNode, int end, int depth, double distanc
     }
   else
     {
-      //SG_LOG( SG_GENERAL, SG_DEBUG, "4" );
+      //SG_LOG( SG_NAVAID, SG_DEBUG, "4" );
       //cerr << "4" << endl;
     }
   traceStack.pop_back();