]> git.mxchange.org Git - flightgear.git/commitdiff
Fix some gcc warnings
authorTorsten Dreyer <Torsten@t3r.de>
Sun, 17 Jul 2011 17:31:28 +0000 (19:31 +0200)
committerTorsten Dreyer <Torsten@t3r.de>
Sun, 17 Jul 2011 17:31:28 +0000 (19:31 +0200)
src/Instrumentation/navradio.cxx
src/Main/bootstrap.cxx
src/Navaids/awynet.cxx
src/Traffic/Schedule.cxx

index bde228991c0786444485f03347c6aa228c3d32e4..780094c42a8eca78df33681a69a2f38329159dbb 100644 (file)
@@ -897,7 +897,8 @@ void FGNavRadio::updateAudio()
   }
   
   last_time = now;
-  play_count = ++play_count % NUM_IDENT_SLOTS;
+  play_count++;
+  play_count %= NUM_IDENT_SLOTS;
     
   // Previous ident is out of time;  if still playing, cut it off:
   _sgr->stop( nav_fx_name );
index fb95b8f194a0acfb03a386e45b247ec3131f39a2..a4ba24bd00d47d33384b16d9d007a153d822a81f 100644 (file)
@@ -71,10 +71,10 @@ bool free_hostname = false;
 void fgExitCleanup();
 
 static bool fpeAbort = false;
-static void handleFPE(int);
 static void initFPE();
 
 #if defined(HAVE_FEENABLEEXCEPT)
+static void handleFPE(int);
 static void
 initFPE ()
 {
@@ -115,10 +115,6 @@ handleFPE (int num)
   SG_LOG(SG_GENERAL, SG_ALERT, "Floating point interrupt (SIGFPE)");
 }
 #else
-static void handleFPE(int)
-{
-}
-
 static void initFPE()
 {
 }
index 4432c8d717e288e0b28dd1f920f8769e8cefd705..0869fc2f745a5d1b752a281bec0b4357fba2643b 100644 (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;
index cb7fafb3d73918cd6cae455d220bd2600c786fe0..20d30609cf9e1b57a0f4c735e278ca24f56dc45c 100644 (file)
@@ -221,7 +221,7 @@ bool FGAISchedule::update(time_t now, const SGVec3d& userCart)
     // Check if this aircraft has been released. 
     FGTrafficManager *tmgr = (FGTrafficManager *) globals->get_subsystem("Traffic Manager");
     if (tmgr->isReleased(AIManagerRef)) {
-      AIManagerRef = NULL;
+      AIManagerRef = 0;
     } else {
       return true; // in visual range, let the AIManager handle it
     }