From eab9a65ebc6fbf5cc09fe03333a24fb2974ba8bd Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Sun, 17 Jul 2011 19:31:28 +0200 Subject: [PATCH] Fix some gcc warnings --- src/Instrumentation/navradio.cxx | 3 ++- src/Main/bootstrap.cxx | 6 +----- src/Navaids/awynet.cxx | 2 +- src/Traffic/Schedule.cxx | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Instrumentation/navradio.cxx b/src/Instrumentation/navradio.cxx index bde228991..780094c42 100644 --- a/src/Instrumentation/navradio.cxx +++ b/src/Instrumentation/navradio.cxx @@ -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 ); diff --git a/src/Main/bootstrap.cxx b/src/Main/bootstrap.cxx index fb95b8f19..a4ba24bd0 100644 --- a/src/Main/bootstrap.cxx +++ b/src/Main/bootstrap.cxx @@ -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() { } diff --git a/src/Navaids/awynet.cxx b/src/Navaids/awynet.cxx index 4432c8d71..0869fc2f7 100644 --- a/src/Navaids/awynet.cxx +++ b/src/Navaids/awynet.cxx @@ -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; diff --git a/src/Traffic/Schedule.cxx b/src/Traffic/Schedule.cxx index cb7fafb3d..20d30609c 100644 --- a/src/Traffic/Schedule.cxx +++ b/src/Traffic/Schedule.cxx @@ -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 }