From: andy Date: Tue, 8 Aug 2006 18:23:20 +0000 (+0000) Subject: Fix a few warnings while I'm in there. Melchior poitned out that my default X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e26481cf0afa3f902c5cc7f58df19f50048530eb;p=flightgear.git Fix a few warnings while I'm in there. Melchior poitned out that my default configure-generated Makefiles don't include -Wall and a few issues had crept into the code. --- diff --git a/src/FDM/YASim/BodyEnvironment.hpp b/src/FDM/YASim/BodyEnvironment.hpp index 69b4a3e4e..536b4ea40 100644 --- a/src/FDM/YASim/BodyEnvironment.hpp +++ b/src/FDM/YASim/BodyEnvironment.hpp @@ -89,6 +89,8 @@ public: // of body state vs. the environment can happen here (crashes, // etc...). virtual void newState(State* state) = 0; + + virtual ~BodyEnvironment() {} // #!$!?! gcc warning... }; }; // namespace yasim diff --git a/src/FDM/YASim/Engine.hpp b/src/FDM/YASim/Engine.hpp index 8be455507..135deab34 100644 --- a/src/FDM/YASim/Engine.hpp +++ b/src/FDM/YASim/Engine.hpp @@ -35,6 +35,7 @@ public: virtual float getTorque() = 0; virtual float getFuelFlow() = 0; + virtual ~Engine() {} protected: float _throttle; bool _starter; // true=engaged, false=disengaged diff --git a/src/FDM/YASim/FGFDM.cpp b/src/FDM/YASim/FGFDM.cpp index 426a35ed4..0284adf25 100644 --- a/src/FDM/YASim/FGFDM.cpp +++ b/src/FDM/YASim/FGFDM.cpp @@ -480,7 +480,7 @@ void FGFDM::setOutputProperties(float dt) int j = 0; float f; char b[256]; - while(j = r->getValueforFGSet(j, b, &f)) + while((j = r->getValueforFGSet(j, b, &f))) if(b[0]) fgSetFloat(b,f); for(j=0; j < r->numRotorparts(); j++) { diff --git a/src/FDM/YASim/Model.cpp b/src/FDM/YASim/Model.cpp index e38de2515..35cf6dea7 100644 --- a/src/FDM/YASim/Model.cpp +++ b/src/FDM/YASim/Model.cpp @@ -477,7 +477,6 @@ void Model::calcForces(State* s) // The arrester hook if(_hook) { - float v[3], rot[3], glvel[3], ground[3]; _hook->calcForce(_ground_cb, &_body, s, lv, lrot); float force[3], contact[3]; _hook->getForce(force, contact); @@ -486,7 +485,6 @@ void Model::calcForces(State* s) // The launchbar/holdback if(_launchbar) { - float v[3], rot[3], glvel[3], ground[3]; _launchbar->calcForce(_ground_cb, &_body, s, lv, lrot); float forcelb[3], contactlb[3], forcehb[3], contacthb[3]; _launchbar->getForce(forcelb, contactlb, forcehb, contacthb); diff --git a/src/FDM/YASim/yasim-test.cpp b/src/FDM/YASim/yasim-test.cpp index 4affd193b..8696ff36b 100644 --- a/src/FDM/YASim/yasim-test.cpp +++ b/src/FDM/YASim/yasim-test.cpp @@ -30,8 +30,8 @@ static const float KTS2MPS = 0.514444444444; // G's). You can use this in gnuplot like so (assuming the output is // in a file named "dat": // -// plot "dat" using 1:2 with lines title 'lift', \ -// "dat" using 1:3 with lines title 'drag', \ +// plot "dat" using 1:2 with lines title 'lift', \ +// "dat" using 1:3 with lines title 'drag', \ // "dat" using 1:4 with lines title 'LD' // void yasim_graph(Airplane* a, float alt, float kts)