]> git.mxchange.org Git - flightgear.git/commitdiff
Mac OS X fixes and MSVC warning fixes from Jonathan Polley.
authordavid <david>
Fri, 10 May 2002 23:35:06 +0000 (23:35 +0000)
committerdavid <david>
Fri, 10 May 2002 23:35:06 +0000 (23:35 +0000)
39 files changed:
src/ATC/ATCmgr.cxx
src/ATC/approach.hxx
src/ATC/atis.hxx
src/Airports/runways.cxx
src/Airports/simple.cxx
src/Cockpit/hud_card.cxx
src/Cockpit/hud_ladr.cxx
src/FDM/ExternalNet.cxx
src/FDM/IO360.cxx
src/FDM/JSBSim/FGFCS.cpp
src/FDM/JSBSim/FGGroundReactions.cpp
src/FDM/JSBSim/FGJSBBase.cpp
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGfdmSocket.cpp
src/FDM/YASim/Airplane.cpp
src/FDM/YASim/Atmosphere.cpp
src/FDM/YASim/BodyEnvironment.hpp
src/FDM/YASim/ControlMap.cpp
src/FDM/YASim/Gear.cpp
src/FDM/YASim/Glue.cpp
src/FDM/YASim/Jet.cpp
src/FDM/YASim/Math.cpp
src/FDM/YASim/Model.cpp
src/FDM/YASim/PistonEngine.cpp
src/FDM/YASim/PropEngine.cpp
src/FDM/YASim/Propeller.cpp
src/FDM/YASim/Surface.cpp
src/FDM/YASim/Thruster.cpp
src/FDM/YASim/Wing.cpp
src/GUI/mouse.cxx
src/Input/input.cxx
src/Main/fg_commands.cxx
src/Main/fg_init.cxx
src/Main/viewer.cxx
src/Main/viewmgr.cxx
src/Model/model.cxx
src/Objects/dir_lights.cxx
src/Scenery/hitlist.cxx
src/Scenery/tileentry.cxx

index 4cf79d3372d0da502ba0838568c8f5af481a47df..5a7e1b8ea4b0938f14eeb55acbb1af1b4ec5f552 100644 (file)
@@ -198,6 +198,8 @@ FGATC* FGATCMgr::GetATCPointer(string icao, atc_type type) {
     }
 
     cout << "ERROR IN FGATCMgr - reached end of GetATCPointer\n";
+
+    return NULL;
 }
 
 
index 9b46ff8a7883ba23fd96b2957929b5f4c452badb..5c437baf50b5ed3e2ea57c2a687a727409f22f1f 100644 (file)
@@ -38,7 +38,7 @@
 #include <iomanip>
 #elif defined( SG_HAVE_NATIVE_SGI_COMPILERS )
 #  include <iostream.h>
-#elif defined( __BORLANDC__ )
+#elif defined( __BORLANDC__ ) || (__APPLE__)
 #  include <iostream>
 #else
 #  include <istream.h>
index 642d91599586e1798bd9cd8d1d6a221c82bf120b..6d663a0eeab171623cde4f9af88f780e6b40695a 100644 (file)
@@ -36,7 +36,7 @@
 #include <iomanip>
 #elif defined( SG_HAVE_NATIVE_SGI_COMPILERS )
 #  include <iostream.h>
-#elif defined( __BORLANDC__ )
+#elif defined( __BORLANDC__ ) || (__APPLE__)
 #  include <iostream>
 #else
 #  include <istream.h>
index 23c7d68dddecfd6fc9562d982f6c5c5ea0fa881d..3d16a3dd9388965712a0e08d4e66b434e0f5b5d7 100644 (file)
@@ -56,7 +56,7 @@ SG_USING_NAMESPACE(std);
 #  include <istream>
 #elif defined( SG_HAVE_NATIVE_SGI_COMPILERS )
 #  include <iostream.h>
-#elif defined( __BORLANDC__ )
+#elif defined( __BORLANDC__ ) || defined (__APPLE__)
 #  include <iostream>
 #else
 #  include <istream.h>
index 395fbcdb13c8e3be38f2b61ac8c010a7cb335153..4d74af4b4099926cab89d36b2f19c5a99bc45148 100644 (file)
@@ -53,7 +53,7 @@ SG_USING_NAMESPACE(std);
 #  include <istream>
 #elif defined( SG_HAVE_NATIVE_SGI_COMPILERS )
 #  include <iostream.h>
-#elif defined( __BORLANDC__ )
+#elif defined( __BORLANDC__ ) || defined (__APPLE__)
 #  include <iostream>
 #else
 #  include <istream.h>
index 255341f1223bbf78aa35147152a3ae35338b527a..35aeca1eff80b391722dcc782efa74cde9b82f67 100644 (file)
@@ -194,7 +194,6 @@ draw( void ) //  (HUD_scale * pscale )
     if(type=="gauge") {
         float x,y;
         float i;
-        int  decimal, sign;
         y=(float)(scrn_rect.top);
         x=(float)(scrn_rect.left);
         glEnable(GL_POINT_SMOOTH);
@@ -381,7 +380,7 @@ draw( void ) //  (HUD_scale * pscale )
                             //type-fixed & zoom=1, behaviour to be defined
                             // Code for Moving Type Pointer included by suma.
                             float ycentre, ypoint,xpoint;
-                            int range,wth;
+                            int range;
                                                        
                             if(cur_value > maxValue)
                                 cur_value = maxValue;
index 2ce6b2423b922ff8e36aea7312f79407ed8f9dd5..edc4043c2355142d12c2fdf593fb4f75b1b3f7fc 100644 (file)
@@ -813,8 +813,7 @@ drawNadir(float xfirst, float xlast, float yvalue)
 
 
                float r = 7.5;
-               float ang,temp;
-               float x1,y1,x2,y2,xcent,ycent;
+               float x1,y1,x2,y2;
 
        
         // to draw a circle
index 01d565e79abfbdc5fd893f26e8020d0bc72708d4..62c23edc440945b3abcaaf8c03493f12fd2ae67d 100644 (file)
@@ -74,14 +74,14 @@ static void global2raw( FGRawCtrls *raw ) {
     raw->rudder = node->getDoubleValue( "rudder" );
     raw->flaps = node->getDoubleValue( "flaps" );
     for ( i = 0; i < FGRawCtrls::FG_MAX_ENGINES; ++i ) {
-       raw->throttle[i] = node->getDoubleValue( "throttle", i );
-       raw->mixture[i] = node->getDoubleValue( "mixture", i );
-       raw->prop_advance[i] = node->getDoubleValue( "propeller-pitch", i );
-       raw->magnetos[i] = node->getIntValue( "magnetos", i );
-       raw->starter[i] = node->getBoolValue( "starter", i );
+       raw->throttle[i] = node->getDoubleValue( "throttle", 0.0 );
+       raw->mixture[i] = node->getDoubleValue( "mixture", 0.0 );
+       raw->prop_advance[i] = node->getDoubleValue( "propeller-pitch", 0.0 );
+       raw->magnetos[i] = node->getIntValue( "magnetos", 0 );
+       raw->starter[i] = node->getBoolValue( "starter", false );
     }
     for ( i = 0; i < FGRawCtrls::FG_MAX_WHEELS; ++i ) {
-       raw->brake[i] = node->getDoubleValue( "brakes", i );
+       raw->brake[i] = node->getDoubleValue( "brakes", 0.0 );
     }
     raw->hground = fgGetDouble( "/environment/ground-elevation-m" );
     raw->magvar = fgGetDouble("/environment/magnetic-variation-deg");
@@ -149,9 +149,8 @@ static void net2global( FGNetFDM *net ) {
     }
 
     net->num_wheels = htonl(net->num_wheels);
-    for ( i = 0; i < net->num_wheels; ++i ) {
-       net->wow[i] = htonl(net->wow[i]);
-    }
+
+    // I don't need to convert the Wow flags, since they are one byte in size
 
     net->cur_time = ntohl(net->cur_time);
     net->warp = ntohl(net->warp);
index aa8098aaece236bd68295b1eef6d66c912ae5bde..c75b9b3f2fea84f37ca9d4ac62a46a1444b9474d 100644 (file)
@@ -637,10 +637,8 @@ float FGNewEngine::Calc_Oil_Press (float Oil_Temp, float Engine_RPM)
 void FGNewEngine::Do_Prop_Calcs()
 {
     float Gear_Ratio = 1.0;
-    float blade_length;        // meters
     float forward_velocity;             // m/s
     float prop_power_consumed_SI;       // Watts
-    float prop_power_consumed_HP;       // HP
     double J;                          // advance ratio - dimensionless
     double Cp_20;                   // coefficient of power for 20 degree blade angle
     double Cp_25;                   // coefficient of power for 25 degree blade angle
index 9b5e5a6d57d7656323c2333a7481848bfcc16569..57e73bf8c0aa7411a16eb6ac214f9361351e4518 100644 (file)
@@ -60,6 +60,10 @@ INCLUDES
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FCS;
 
+#if defined(WIN32) && !defined(__CYGWIN__)
+#define snprintf _snprintf
+#endif
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index ee31e6fb32b52b2377438837acf9ec77f817c834..c95b42edb80c9c1cc06b1bcb67ee19d17e75e8d6 100644 (file)
@@ -41,6 +41,15 @@ INCLUDES
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_GROUNDREACTIONS;
 
+#if defined (__APPLE__)
+/* Not all systems have the gcvt function */
+inline char* gcvt (double value, int ndigits, char *buf) {
+    /* note that this is not exactly what gcvt is supposed to do! */
+    snprintf (buf, ndigits+1, "%f", value);
+    return buf;
+}
+#endif
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index acbe1716748e17fcb2fc25fd77cfb5763802586a..bc38f011f116e45f5794c68346e91e7bc8d87eae 100644 (file)
@@ -124,7 +124,7 @@ FGJSBBase::Message* FGJSBBase::PutMessage(string text, int iVal)
   msg->messageId = messageId++;
   msg->subsystem = "FDM";
   msg->type = Message::eInteger;
-  msg->bVal = iVal;
+  msg->bVal = (iVal != 0);
   Messages.push(msg);
   return msg;
 }
@@ -138,7 +138,7 @@ FGJSBBase::Message* FGJSBBase::PutMessage(string text, double dVal)
   msg->messageId = messageId++;
   msg->subsystem = "FDM";
   msg->type = Message::eDouble;
-  msg->bVal = dVal;
+  msg->bVal = (dVal != 0.0);
   Messages.push(msg);
   return msg;
 }
index 4a97bdd94d15a48d9349d4d7c88db9b9429e9a85..439f9701fe747a420c4ad8a9cfa8145476ce99c5 100644 (file)
@@ -59,6 +59,18 @@ INCLUDES
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_PROPULSION;
 
+extern short debug_lvl;
+
+#if defined (__APPLE__)
+/* Not all systems have the gcvt function */
+inline char* gcvt (double value, int ndigits, char *buf) {
+    /* note that this is not exactly what gcvt is supposed to do! */
+    snprintf (buf, ndigits+1, "%f", value);
+    return buf;
+}
+#endif
+
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 190d175980149823b7c79eb3df2c8f17228db87f..9d86bbab5b96f9b81201e3c618adb71b71139689 100644 (file)
@@ -53,7 +53,7 @@ FGfdmSocket::FGfdmSocket(string address, int port)
 
 #if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
     WSADATA wsaData;
-    int PASCAL FAR wsaReturnCode;
+    int wsaReturnCode;
     wsaReturnCode = WSAStartup(MAKEWORD(1,1), &wsaData);
     if (wsaReturnCode == 0) cout << "Winsock DLL loaded ..." << endl;
     else cout << "Winsock DLL not initialized ..." << endl;
index 3e5b689f03c3572a0a32f5413dd94db0877483e7..d92d4f9623d5a6bd9a9c527b1beeee42bc2d0899 100644 (file)
@@ -76,7 +76,7 @@ void Airplane::getPilotAccel(float* out)
 
     // Gravity
     Glue::geodUp(s->pos, out);
-    Math::mul3(-9.8, out, out);
+    Math::mul3(-9.8f, out, out);
 
     // The regular acceleration
     float tmp[3];
@@ -399,7 +399,7 @@ float Airplane::compileFuselage(Fuselage* f)
     float segWgt = len*wid/segs;
     int j;
     for(j=0; j<segs; j++) {
-        float frac = (j+0.5) / segs;
+        float frac = (j+0.5f) / segs;
 
         float scale = 1;
         if(frac < f->mid)
@@ -473,13 +473,13 @@ void Airplane::compileContactPoints()
 {
     // Figure it will compress by 20cm
     float comp[3];
-    float DIST = 0.2;
+    float DIST = 0.2f;
     comp[0] = 0; comp[1] = 0; comp[2] = DIST;
 
     // Give it a spring constant such that at full compression it will
     // hold up 10 times the planes mass.  That's about right.  Yeah.
     float mass = _model.getBody()->getTotalMass();
-    float spring = (1/DIST) * 9.8 * 10 * mass;
+    float spring = (1/DIST) * 9.8f * 10.0f * mass;
     float damp = 2 * Math::sqrt(spring * mass);
 
     int i;
@@ -495,8 +495,8 @@ void Airplane::compileContactPoints()
         g->setBrake(1);
 
         // I made these up
-        g->setStaticFriction(0.6);
-        g->setDynamicFriction(0.5);
+        g->setStaticFriction(0.6f);
+        g->setDynamicFriction(0.5f);
 
         _model.addGear(g);
     }
@@ -552,8 +552,8 @@ void Airplane::compile()
         t->handle = body->addMass(0, t->pos);
         totalFuel += t->cap;
     }
-    _cruiseWeight = _emptyWeight + totalFuel*0.5;
-    _approachWeight = _emptyWeight + totalFuel*0.2;
+    _cruiseWeight = _emptyWeight + totalFuel*0.5f;
+    _approachWeight = _emptyWeight + totalFuel*0.2f;
 
     body->recalc();
 
@@ -570,7 +570,7 @@ void Airplane::compile()
     // Ground effect
     float gepos[3];
     float gespan = _wing->getGroundEffect(gepos);
-    _model.setGroundEffect(gepos, gespan, .3);
+    _model.setGroundEffect(gepos, gespan, 0.3f);
 
     solveGear();
     solve();
@@ -597,7 +597,7 @@ void Airplane::solveGear()
         Gear* g = gr->gear;
         g->getPosition(pos);
        Math::sub3(cg, pos, pos);
-        gr->wgt = 1/(0.5+Math::sqrt(pos[0]*pos[0] + pos[1]*pos[1]));
+        gr->wgt = 1.0f/(0.5f+Math::sqrt(pos[0]*pos[0] + pos[1]*pos[1]));
         total += gr->wgt;
     }
 
@@ -608,12 +608,12 @@ void Airplane::solveGear()
     // The force at max compression should be sufficient to stop a
     // plane moving downwards at 3x the approach descent rate.  Assume
     // a 3 degree approach.
-    float descentRate = 3*_approachSpeed/19.1;
+    float descentRate = 3.0f*_approachSpeed/19.1f;
 
     // Spread the kinetic energy according to the gear weights.  This
     // will results in an equal compression fraction (not distance) of
     // each gear.
-    float energy = 0.5*_approachWeight*descentRate*descentRate;
+    float energy = 0.5f*_approachWeight*descentRate*descentRate;
 
     for(i=0; i<_gears.size(); i++) {
         GearRec* gr = (GearRec*)_gears.get(i);
@@ -631,8 +631,8 @@ void Airplane::solveGear()
         gr->gear->setDamping(2*Math::sqrt(k*_approachWeight*gr->wgt));
 
         // These are pretty generic
-        gr->gear->setStaticFriction(0.8);
-        gr->gear->setDynamicFriction(0.7);
+        gr->gear->setStaticFriction(0.8f);
+        gr->gear->setDynamicFriction(0.7f);
     }
 }
 
@@ -712,7 +712,7 @@ void Airplane::runApproach()
     Math::vmul33(_approachState.orient, wind, wind);
     
     // Approach is by convention at 20% tank capacity
-    setFuelFraction(0.2);
+    setFuelFraction(0.2f);
 
     // Run the thrusters until they get to a stable setting.  FIXME:
     // this is lots of wasted work.
@@ -777,7 +777,7 @@ float Airplane::normFactor(float f)
 
 void Airplane::solve()
 {
-    static const float ARCMIN = 0.0002909;
+    static const float ARCMIN = 0.0002909f;
 
     float tmp[3];
     _solutionIterations = 0;
@@ -824,7 +824,7 @@ void Airplane::solve()
        float pitch1 = tmp[1];
 
        // Now calculate:
-       float awgt = 9.8 * _approachWeight;
+       float awgt = 9.8f * _approachWeight;
 
        float dragFactor = thrust / (thrust-xforce);
        float liftFactor = awgt / (awgt+alift);
@@ -852,11 +852,11 @@ void Airplane::solve()
        }
 
        // OK, now we can adjust the minor variables
-       _cruiseAoA += 0.5*aoaDelta;
-       _tailIncidence += 0.5*tailDelta;
+       _cruiseAoA += 0.5f*aoaDelta;
+       _tailIncidence += 0.5f*tailDelta;
        
-       _cruiseAoA = clamp(_cruiseAoA, -.174, .174);
-       _tailIncidence = clamp(_tailIncidence, -.174, .174);
+       _cruiseAoA = clamp(_cruiseAoA, -0.174f, 0.174f);
+       _tailIncidence = clamp(_tailIncidence, -0.174f, 0.174f);
 
         if(dragFactor < 1.00001 && liftFactor < 1.00001 &&
            aoaDelta < .000017   && tailDelta < .000017)
index 0ace3869fa2a3d59ae7776787187a0b879a5de29..18b54dd2431a0df84398175ffea428e29fcbc453 100644 (file)
@@ -8,35 +8,35 @@ namespace yasim {
 // R=287.  I chose to correct the temperature to 288.20, since 79F is
 // pretty hot for a "standard" atmosphere.
 //                             meters   kelvin      Pa   kg/m^3
-float Atmosphere::data[][4] = {{ 0,     288.20, 101325, 1.22500 },
-                              { 900,   282.31,  90971, 1.12260 },
-                              { 1800,  276.46,  81494, 1.02690 },
-                              { 2700,  270.62,  72835, 0.93765 },
-                              { 3600,  264.77,  64939, 0.85445 },
-                              { 4500,  258.93,  57752, 0.77704 },
-                              { 5400,  253.09,  51226, 0.70513 },
-                              { 6300,  247.25,  45311, 0.63845 },
-                              { 7200,  241.41,  39963, 0.57671 },
-                              { 8100,  235.58,  35140, 0.51967 },
-                              { 9000,  229.74,  30800, 0.46706 },
-                              { 9900,  223.91,  26906, 0.41864 },
-                              { 10800, 218.08,  23422, 0.37417 },
-                              { 11700, 216.66,  20335, 0.32699 },
-                              { 12600, 216.66,  17654, 0.28388 },
-                              { 13500, 216.66,  15327, 0.24646 },
-                              { 14400, 216.66,  13308, 0.21399 },
-                              { 15300, 216.66,  11555, 0.18580 },
-                              { 16200, 216.66,  10033, 0.16133 },
-                              { 17100, 216.66,   8712, 0.14009 },
-                              { 18000, 216.66,   7565, 0.12165 },
-                              { 18900, 216.66,   6570, 0.10564 }};
+float Atmosphere::data[][4] = {{ 0.0f,     288.20f, 101325.0f, 1.22500f },
+                              {   900.0f, 282.31f,  90971.0f, 1.12260f },
+                              {  1800.0f, 276.46f,  81494.0f, 1.02690f },
+                              {  2700.0f, 270.62f,  72835.0f, 0.93765f },
+                              {  3600.0f, 264.77f,  64939.0f, 0.85445f },
+                              {  4500.0f, 258.93f,  57752.0f, 0.77704f },
+                              {  5400.0f, 253.09f,  51226.0f, 0.70513f },
+                              {  6300.0f, 247.25f,  45311.0f, 0.63845f },
+                              {  7200.0f, 241.41f,  39963.0f, 0.57671f },
+                              {  8100.0f, 235.58f,  35140.0f, 0.51967f },
+                              {  9000.0f, 229.74f,  30800.0f, 0.46706f },
+                              {  9900.0f, 223.91f,  26906.0f, 0.41864f },
+                              { 10800.0f, 218.08f,  23422.0f, 0.37417f },
+                              { 11700.0f, 216.66f,  20335.0f, 0.32699f },
+                              { 12600.0f, 216.66f,  17654.0f, 0.28388f },
+                              { 13500.0f, 216.66f,  15327.0f, 0.24646f },
+                              { 14400.0f, 216.66f,  13308.0f, 0.21399f },
+                              { 15300.0f, 216.66f,  11555.0f, 0.18580f },
+                              { 16200.0f, 216.66f,  10033.0f, 0.16133f },
+                              { 17100.0f, 216.66f,   8712.0f, 0.14009f },
+                              { 18000.0f, 216.66f,   7565.0f, 0.12165f },
+                              { 18900.0f, 216.66f,   6570.0f, 0.10564f }};
 
 // Universal gas constant for air, in SI units.  P = R * rho * T.
 // P in pascals (N/m^2), rho is kg/m^3, T in kelvin.
-const float R = 287.1;
+const float R = 287.1f;
 
 // Specific heat ratio for air, at "low" temperatures.  
-const float GAMMA = 1.4;
+const float GAMMA = 1.4f;
 
 float Atmosphere::getStdTemperature(float alt)
 {
@@ -78,8 +78,8 @@ float Atmosphere::calcVCAS(float spd, float pressure, float temp)
         // (1+(mach^2)/5)^(gamma/(gamma-1))
         cp = Math::pow(1+0.2*m2, 3.5);
     } else {
-        float tmp0 = ((144/25.) * m2) / (28/5.*m2 - 4/5.);
-        float tmp1 = ((14/5.) * m2 - (2/5.)) * (5/12.);
+        float tmp0 = ((144.0f/25.0f) * m2) / (28.0f/5.0f*m2 - 4.0f/5.0f);
+        float tmp1 = ((14.0f/5.0f) * m2 - (2.0f/5.0f)) * (5.0f/12.0f);
         cp = Math::pow(tmp0, 3.5) * tmp1;
     }
 
index 8029555d8ff6989b9c62eaf2410a5dfe8557ff65..ca82584315f4784e5325c45c8ffc3e1ee24199ec 100644 (file)
@@ -26,7 +26,7 @@ struct State {
             pos[i] = v[i] = rot[i] = acc[i] = racc[i] = 0;
             int j;
             for(j=0; j<3; j++)
-                orient[3*i+j] = i==j ? 1 : 0;
+                orient[3*i+j] = i==j ? 1.0f : 0.0f;
         }
     }
 };
index 9bc74b5ecf48ed9bc73b202255ddae9557380280..628c059a6cf5954d917d0ddb62d29349de8c11b1 100644 (file)
@@ -118,6 +118,7 @@ int ControlMap::getOutputHandle(void* obj, int type)
        if(o->object == obj && o->type == type)
            return i;
     }
+    return 0;
 }
 
 void ControlMap::setTransitionTime(int handle, float time)
@@ -183,7 +184,7 @@ void ControlMap::applyControls(float dt)
        switch(o->type) {
        case THROTTLE: ((Thruster*)obj)->setThrottle(lval);        break;
        case MIXTURE:  ((Thruster*)obj)->setMixture(lval);         break;
-       case STARTER:  ((Thruster*)obj)->setStarter((bool)lval);   break;
+       case STARTER:  ((Thruster*)obj)->setStarter(lval != 0.0);  break;
        case MAGNETOS: ((PropEngine*)obj)->setMagnetos((int)lval); break;
        case ADVANCE:  ((PropEngine*)obj)->setAdvance(lval);       break;
        case REHEAT:   ((Jet*)obj)->setReheat(lval);               break;
index e50c4d000ece75384fadcb2675ea57b1e4fc155f..51492dcfac9d98dcd6b7cfc473323e7fc521020e 100644 (file)
@@ -11,8 +11,8 @@ Gear::Gear()
        _pos[i] = _cmpr[i] = 0;
     _spring = 1;
     _damp = 0;
-    _sfric = 0.8;
-    _dfric = 0.7;
+    _sfric = 0.8f;
+    _dfric = 0.7f;
     _brake = 0;
     _rot = 0;
     _extension = 1;
@@ -253,8 +253,8 @@ void Gear::calcForce(RigidBody* body, float* v, float* rot, float* ground)
 float Gear::calcFriction(float wgt, float v)
 {
     // How slow is stopped?  10 cm/second?
-    const float STOP = 0.1;
-    const float iSTOP = 1/STOP;
+    const float STOP = 0.1f;
+    const float iSTOP = 1.0f/STOP;
     v = Math::abs(v);
     if(v < STOP) return v*iSTOP * wgt * _sfric;
     else         return wgt * _dfric;
index ac68e8e81883f7428ef96f4ffef692316a153be6..3715bf6a3dc606a6245708e7d0132e5e8ce79d1e 100644 (file)
@@ -124,10 +124,10 @@ void Glue::xyz2nedMat(double lat, double lon, float* out)
     // Shorthand for our output vectors:
     float *north = out, *east = out+3, *down = out+6;
 
-    float slat = Math::sin(lat);
-    float clat = Math::cos(lat);
-    float slon = Math::sin(lon);
-    float clon = Math::cos(lon);
+    float slat = (float) Math::sin(lat);
+    float clat = (float)Math::cos(lat);
+    float slon = (float)Math::sin(lon);
+    float clon = (float)Math::cos(lon);
 
     north[0] = -clon * slat;
     north[1] = -slon * slat;
@@ -157,7 +157,7 @@ void Glue::euler2orient(float roll, float pitch, float hdg, float* out)
     int i, j;
     for(i=0; i<3; i++)
         for(j=0; j<3; j++)
-            out[3*i+j] = (i==j) ? 1 : 0;
+            out[3*i+j] = (i==j) ? 1.0f : 0.0f;
 
     // Negate Y and Z
     out[4] = out[8] = -1;
@@ -233,10 +233,10 @@ void Glue::geodUp(double* pos, float* out)
     double lat, lon, alt;
     xyz2geod(pos, &lat, &lon, &alt);
        
-    float slat = Math::sin(lat);
-    float clat = Math::cos(lat);
-    float slon = Math::sin(lon);
-    float clon = Math::cos(lon);
+    float slat = (float)Math::sin(lat);
+    float clat = (float)Math::cos(lat);
+    float slon = (float)Math::sin(lon);
+    float clon = (float)Math::cos(lon);
     out[0] = clon * clat;
     out[1] = slon * clat;
     out[2] = slat;    
index 599a25e63bbb31150ead363d31935bbff74a49ea..e3448a91966a63915558b9e0707a6f0a3e2b71fd 100644 (file)
@@ -16,7 +16,7 @@ Jet::Jet()
     // tsfc.
     _vMax = 800;
     _epr0 = 3.0;
-    _tsfc = 0.8;
+    _tsfc = 0.8f;
     _egt0 = 1050;
     _n1Min = 55;
     _n1Max = 102;
@@ -85,7 +85,7 @@ void Jet::setSpooling(float time)
     // 2.3 = -ln(0.1), i.e. x=2.3 is the 90% point we're defining
     // The extra fudge factor is there because the N1 speed (which
     // determines thrust) lags the N2 speed.
-    _decay = 1.5 * 2.3 / time;
+    _decay = 1.5f * 2.3f / time;
 }
 
 void Jet::setVectorAngle(float angle)
@@ -173,16 +173,16 @@ void Jet::integrate(float dt)
     // The actual thrust produced is keyed to the N1 speed.  Add the
     // afterburners in at the end.
     float betaN1 =  (_epr0-1) * (_n1 - _n1Min) / (_n1Max - _n1Min);
-    _thrust *= betaN1/(betaTarget+.00001); // blowup protection
+    _thrust *= betaN1/(betaTarget+0.00001f); // blowup protection
     _thrust *= 1 + _reheat*(_abFactor-1);
 
     // Finally, calculate the output variables.   Use a 80/20 mix of
     // the N2/N1 speeds as the key.
-    float beta = 0.8*betaN2 + 0.2*betaN1;
+    float beta = 0.8f*betaN2 + 0.2f*betaN1;
     _epr = beta + 1;
-    float ff0 = _maxThrust*_tsfc*(1/(3600*9.8)); // takeoff fuel flow, kg/s
+    float ff0 = _maxThrust*_tsfc*(1/(3600.0f*9.8f)); // takeoff fuel flow, kg/s
     _fuelFlow = ff0 * beta*ibeta0;
-    _fuelFlow *= 1 + (3.5 * _reheat * _abFactor); // Afterburners take
+    _fuelFlow *= 1 + (3.5f * _reheat * _abFactor); // Afterburners take
                                                  // 3.5 times as much
                                                  // fuel per thrust unit
     _egt = T0 + beta*ibeta0 * (_egt0 - T0);
index b5d2c4e65afb7be7ee7484369aeadbd686d17b59..4662d70b2329e8ce31ddb7f5052636ecbb0d423d 100644 (file)
@@ -12,37 +12,37 @@ float Math::clamp(float val, float min, float max)
 
 float Math::abs(float f)
 {
-    return ::fabs(f);
+    return (float)::fabs(f);
 }
 
 float Math::sqrt(float f)
 {
-    return ::sqrt(f);
+    return (float)::sqrt(f);
 }
 
 float Math::ceil(float f)
 {
-    return ::ceil(f);
+    return (float)::ceil(f);
 }
 
 float Math::cos(float f)
 {
-    return ::cos(f);
+    return (float)::cos(f);
 }
 
 float Math::sin(float f)
 {
-    return ::sin(f);
+    return (float)::sin(f);
 }
 
 float Math::tan(float f)
 {
-    return ::tan(f);
+    return (float)::tan(f);
 }
 
 float Math::atan2(float y, float x)
 {
-    return ::atan2(y, x);
+    return (float)::atan2(y, x);
 }
 
 double Math::abs(double f)
@@ -57,7 +57,7 @@ double Math::sqrt(double f)
 
 float Math::pow(double base, double exp)
 {
-    return ::pow(base, exp);
+    return (float)::pow(base, exp);
 }
 
 double Math::ceil(double f)
index d2c1436ab7cc2ee90b390a1c342bf7fe71ba489c..44ff1bdfc7076c372fc550c3f3ad2cedda2fd38a 100644 (file)
@@ -46,7 +46,7 @@ Model::Model()
     _integrator.setEnvironment(this);
 
     // Default value of 30 Hz
-    _integrator.setInterval(1.0/30.0);
+    _integrator.setInterval(1.0f/30.0f);
 
     _agl = 0;
     _crashed = false;
@@ -224,7 +224,7 @@ void Model::calcForces(State* s)
     // Gravity, convert to a force, then to local coordinates
     float grav[3];
     Glue::geodUp(s->pos, grav);
-    Math::mul3(-9.8 * _body.getTotalMass(), grav, grav);
+    Math::mul3(-9.8f * _body.getTotalMass(), grav, grav);
     Math::vmul33(s->orient, grav, grav);
     _body.addForce(grav);
 
index 9725f1f44b9388daeecb88964f516b3ba920b3a8..b32dae60cea86fb4e6e993bc4ffdfafe608ae963 100644 (file)
@@ -3,9 +3,9 @@
 #include "PistonEngine.hpp"
 namespace yasim {
 
-const static float HP2W = 745.7;
-const static float CIN2CM = 1.6387064e-5;
-const static float RPM2RADPS = 0.1047198;
+const static float HP2W = 745.7f;
+const static float CIN2CM = 1.6387064e-5f;
+const static float RPM2RADPS = 0.1047198f;
 
 PistonEngine::PistonEngine(float power, float speed)
 {
@@ -15,7 +15,7 @@ PistonEngine::PistonEngine(float power, float speed)
 
     // Presume a BSFC (in lb/hour per HP) of 0.45.  In SI that becomes
     // (2.2 lb/kg, 745.7 W/hp, 3600 sec/hour) 7.62e-08 kg/Ws.
-    _f0 = power * 7.62e-08;
+    _f0 = power * 7.62e-08f;
 
     _power0 = power;
     _omega0 = speed;
@@ -26,8 +26,8 @@ PistonEngine::PistonEngine(float power, float speed)
     // Further presume that takeoff is (duh) full throttle and
     // peak-power, that means that by our efficiency function, we are
     // at 11/8 of "ideal" fuel flow.
-    float realFlow = _f0 * (11.0/8.0);
-    _mixCoeff = realFlow * 1.1 / _omega0;
+    float realFlow = _f0 * (11.0f/8.0f);
+    _mixCoeff = realFlow * 1.1f / _omega0;
 
     _turbo = 1;
     _maxMP = 1e6; // No waste gate on non-turbo engines.
@@ -49,7 +49,7 @@ void PistonEngine::setTurboParams(float turbo, float maxMP)
     float P = P0 * (1 + _boost * (_turbo - 1));
     if(P > _maxMP) P = _maxMP;
     float T = Atmosphere::getStdTemperature(0) * Math::pow(P/P0, 2./7.);
-    _rho0 = P / (287.1 * T);
+    _rho0 = P / (287.1f * T);
 }
 
 void PistonEngine::setDisplacement(float d)
@@ -143,7 +143,7 @@ void PistonEngine::calc(float pressure, float temp, float speed)
     // thrust at that setting, so hold onto the "output" value
     // separately.  Ick.
     _mp = pressure * (1 + _boost*(_turbo-1)); // turbocharger
-    float mp = _mp * (0.1 + 0.9 * _throttle); // throttle
+    float mp = _mp * (0.1f + 0.9f * _throttle); // throttle
     _mp *= _throttle;
     if(mp > _maxMP) mp = _maxMP;              // wastegate
 
@@ -151,7 +151,7 @@ void PistonEngine::calc(float pressure, float temp, float speed)
     // pressure change can be assumed to be adiabatic.  Calculate a
     // temperature change, and use that to get the density.
     float T = temp * Math::pow(mp/pressure, 2.0/7.0);
-    float rho = mp / (287.1 * T);
+    float rho = mp / (287.1f * T);
 
     // The actual fuel flow is determined only by engine RPM and the
     // mixture setting.  Not all of this will burn with the same
@@ -174,13 +174,13 @@ void PistonEngine::calc(float pressure, float temp, float speed)
     else if(r < .625)      burned = _fuelFlow;
     else if(r > 1.375)     burned = burnable;
     else
-        burned = _fuelFlow + (burnable-_fuelFlow)*(r-.625)*(4.0/3.0);
+        burned = _fuelFlow + (burnable-_fuelFlow)*(r-0.625f)*(4.0f/3.0f);
 
     // Correct for engine control state
     if(!_running)
        burned = 0;
     if(_magnetos < 3)
-       burned *= 0.9;
+       burned *= 0.9f;
 
     // And finally the power is just the reference power scaled by the
     // amount of fuel burned, and torque is that divided by RPM.
@@ -190,7 +190,7 @@ void PistonEngine::calc(float pressure, float temp, float speed)
     // Figure that the starter motor produces 20% of the engine's
     // cruise torque.
     if(_cranking && !_running)
-       _torque += 0.20 * _power0/_omega0;
+       _torque += 0.20f * _power0/_omega0;
 
     // Also, add a negative torque of 10% of cruise, to represent
     // internal friction.  Propeller aerodynamic friction is too low
@@ -198,7 +198,7 @@ void PistonEngine::calc(float pressure, float temp, float speed)
     // away as we approach cruise RPMs, though, to prevent interaction
     // with the power computations.  Ugly.
     if(speed > 0 && speed < _omega0)
-       _torque -= 0.05 * (_power0/_omega0) * (1 - speed/_omega0);
+       _torque -= 0.05f * (_power0/_omega0) * (1 - speed/_omega0);
 
     // Now EGT.  This one gets a little goofy.  We can calculate the
     // work done by an isentropically expanding exhaust gas as the
@@ -217,10 +217,10 @@ void PistonEngine::calc(float pressure, float temp, float speed)
     // account for non-thermodynamic losses like internal friction;
     // 10% should do it.
 
-    float massFlow = _fuelFlow + (rho * 0.5 * _displacement * speed);
+    float massFlow = _fuelFlow + (rho * 0.5f * _displacement * speed);
     float specHeat = 1300;
-    float corr = 1.0/(Math::pow(_compression, 0.4) - 1);
-    _egt = corr * (power * 1.1) / (massFlow * specHeat);
+    float corr = 1.0f/(Math::pow(_compression, 0.4f) - 1.0f);
+    _egt = corr * (power * 1.1f) / (massFlow * specHeat);
     if(_egt < temp) _egt = temp;
 }
 
index 32812f5f6c51966a2850a559bf12b502a97e8a56..219734760a999a7b818d927b1d932abadf24eeb8 100644 (file)
@@ -7,7 +7,7 @@ namespace yasim {
 PropEngine::PropEngine(Propeller* prop, PistonEngine* eng, float moment)
 {
     // Start off at 500rpm, because the start code doesn't exist yet
-    _omega = 52.3;
+    _omega = 52.3f;
     _dir[0] = 1; _dir[1] = 0; _dir[2] = 0;
 
     _variable = false;
@@ -107,15 +107,15 @@ void PropEngine::stabilize()
            break;
 
        if(tdiff > 0) {
-           if(!goingUp) step *= 0.5;
+           if(!goingUp) step *= 0.5f;
            goingUp = true;
            if(!_variable)  _omega += step;
-           else            _prop->modPitch(1+(step*0.005));
+           else            _prop->modPitch(1+(step*0.005f));
        } else {
-           if(goingUp) step *= 0.5;
+           if(goingUp) step *= 0.5f;
            goingUp = false;
            if(!_variable)  _omega -= step;
-           else            _prop->modPitch(1-(step*0.005));
+           else            _prop->modPitch(1-(step*0.005f));
        }
     }
 
@@ -125,7 +125,7 @@ void PropEngine::stabilize()
 
 void PropEngine::init()
 {
-    _omega = 0.01;
+    _omega = 0.01f;
     _eng->setStarter(false);
     _eng->setMagnetos(0);
 }
@@ -177,12 +177,12 @@ void PropEngine::integrate(float dt)
        float ratio2 = (_omega*_omega)/(targetOmega*targetOmega);
        float targetTorque = engTorque * ratio2;
 
-       float mod = propTorque < targetTorque ? 1.04 : (1/1.04);
+       float mod = propTorque < targetTorque ? 1.04f : (1.0f/1.04f);
 
        // Convert to an acceleration here, so that big propellers
        // don't seek faster than small ones.
        float diff = Math::abs((propTorque - targetTorque) / _moment);
-       if(diff < 10) mod = 1 + (mod-1)*(0.1*diff);
+       if(diff < 10) mod = 1 + (mod-1)*(0.1f*diff);
 
        _prop->modPitch(mod);
     }
index 64cbb531d104caf165f9dacd1ad9fd951d254cae..ee5a9e0ee36dc243f9d42433c833a230b4c874d6 100644 (file)
@@ -10,10 +10,10 @@ Propeller::Propeller(float radius, float v, float omega,
 {
     // Initialize numeric constants:
     _lambdaPeak = Math::pow(5.0, -1.0/4.0);
-    _beta = 1.0/(Math::pow(5.0, -1.0/4.0) - Math::pow(5.0, -5.0/4.0));
+    _beta = 1.0f/(Math::pow(5.0f, -1.0f/4.0f) - Math::pow(5.0f, -5.0f/4.0f));
 
     _r = radius;
-    _etaC = 0.85; // make this settable?
+    _etaC = 0.85f; // make this settable?
 
     _j0 = v/(omega*_lambdaPeak);
     _baseJ0 = _j0;
@@ -32,14 +32,14 @@ void Propeller::setTakeoff(float omega0, float power0)
     float gamma = _etaC * _beta / _j0;
     float torque = power0 / omega0;
     float density = Atmosphere::getStdDensity(0);
-    _tc0 = (torque * gamma) / (0.5 * density * V2 * _f0);
+    _tc0 = (torque * gamma) / (0.5f * density * V2 * _f0);
 }
     
 void Propeller::modPitch(float mod)
 {
     _j0 *= mod;
-    if(_j0 < 0.25*_baseJ0) _j0 = 0.25*_baseJ0;
-    if(_j0 > 4*_baseJ0)    _j0 = 4*_baseJ0;
+    if(_j0 < 0.25f*_baseJ0) _j0 = 0.25f*_baseJ0;
+    if(_j0 > 4*_baseJ0)     _j0 = 4*_baseJ0;
 }
 
 
@@ -58,7 +58,7 @@ void Propeller::calc(float density, float v, float omega,
 
     float torque = 0;
     if(lambda > 1) {
-       lambda = 1.0/lambda;
+       lambda = 1.0f/lambda;
        torque = (density*V2*_f0*_j0)/(4*_etaC*_beta*(1-_lambdaPeak));
     }
 
@@ -66,7 +66,7 @@ void Propeller::calc(float density, float v, float omega,
     // fix (note: the discontinuity is at EXACTLY one, this is about
     // the only time in history you'll see me use == on a floating
     // point number!)
-    if(lambda == 1) lambda = 0.9999;
+    if(lambda == 1.0) lambda = 0.9999f;
 
     // Calculate lambda^4
     float l4 = lambda*lambda; l4 = l4*l4;
@@ -79,7 +79,7 @@ void Propeller::calc(float density, float v, float omega,
     float tc = (1 - lambda) / (1 - _lambdaPeak);
     if(_matchTakeoff && tc > _tc0) tc = _tc0;
 
-    float thrust = 0.5 * density * V2 * _f0 * tc;
+    float thrust = 0.5f * density * V2 * _f0 * tc;
 
     if(torque > 0) {
        torque -= thrust/gamma;
index 536caf680d611eddbb8e71a063171a4feb9a2a45..2b92a26a59a3ff0ccf9df3c2323cd494b88e68a7 100644 (file)
@@ -174,7 +174,7 @@ void Surface::calcForce(float* v, float rho, float* out, float* torque)
     // edge.  Convert to local (i.e. airplane) coordiantes and store
     // into "torque".
     torque[0] = 0;
-    torque[1] = 0.1667 * _chord * (flapLift - (_cz*_cz0 + stallLift));
+    torque[1] = 0.1667f * _chord * (flapLift - (_cz*_cz0 + stallLift));
     torque[2] = 0;
     Math::tmul33(_orient, torque, torque);
 
@@ -190,7 +190,7 @@ void Surface::calcForce(float* v, float rho, float* out, float* torque)
     Math::tmul33(_orient, out, out);
 
     // Add in the units to make a real force:
-    float scale = 0.5*rho*vel*vel*_c0;
+    float scale = 0.5f*rho*vel*vel*_c0;
     Math::mul3(scale, out, out);
     Math::mul3(scale, torque, torque);
 }
@@ -221,7 +221,7 @@ float Surface::stallFunc(float* v)
        return 1;
 
     // (note mask: we want to use the "positive" stall angle here)
-    float scale = 0.5*_peaks[fwdBak]/_stalls[i&2];
+    float scale = 0.5f*_peaks[fwdBak]/_stalls[i&2];
 
     // Before the stall
     if(alpha <= stallAlpha)
index bd3aa46b4688628f863afd73a10503f583589ca2..782ff669e957c348f6478645396749ad5926f0c7 100644 (file)
@@ -65,7 +65,7 @@ void Thruster::setAir(float pressure, float temp)
 {
     _pressure = pressure;
     _temp = temp;
-    _rho = _pressure / (287.1 * _temp);
+    _rho = _pressure / (287.1f * _temp);
 }
 
 }; // namespace yasim
index bd8ecb9793991d3da58e665cd414422052fe0f8f..4513a0f1e7e2df01eb1efaaeb1f08ccfa758cf25 100644 (file)
@@ -264,7 +264,7 @@ void Wing::compile()
 
     // Calculate a "nominal" segment length equal to an average chord,
     // normalized to lie within 0-1 over the length of the wing.
-    float segLen = _chord * (0.5*(_taper+1)) / _length;
+    float segLen = _chord * (0.5f*(_taper+1)) / _length;
 
     // Generating a unit vector pointing out the left wing.
     float left[3];
@@ -327,7 +327,7 @@ void Wing::compile()
 
         int j;
         for(j=0; j<nSegs; j++) {
-            float frac = start + (j+0.5) * (end-start)/nSegs;
+            float frac = start + (j+0.5f) * (end-start)/nSegs;
             float pos[3];
             interp(root, tip, frac, pos);
 
@@ -405,8 +405,8 @@ Surface* Wing::newSurface(float* pos, float* orient, float chord,
     // The negative AoA stall is the same if we're using an uncambered
     // airfoil, otherwise a "little badder".
     if(_camber > 0) {
-        s->setStall(1, stallAoA * 0.8);
-        s->setStallWidth(1, _stallWidth * 0.5);
+        s->setStall(1, stallAoA * 0.8f);
+        s->setStallWidth(1, _stallWidth * 0.5f);
     } else {
         s->setStall(1, stallAoA);
         s->setStall(1, _stallWidth);
@@ -417,7 +417,7 @@ Surface* Wing::newSurface(float* pos, float* orient, float chord,
     s->setStallPeak(1, 1);
     int i;
     for(i=2; i<4; i++) {
-        s->setStall(i, 0.2267);
+        s->setStall(i, 0.2267f);
         s->setStallWidth(i, 1);
     }
     
index 2a19c4e1ac74f54d513739dd0d26f482c9f244ee..71bb00e19bcef5905753ddf63c2d6a18dc07ba7d 100644 (file)
@@ -518,9 +518,6 @@ void guiMouseFunc(int button, int updown, int x, int y)
     static float _quat[4];
     static double _view_offset;
     
-    // general purpose variables
-    double offset;
-            
     glutModifiers = glutGetModifiers();
     glut_active_shift = glutModifiers & GLUT_ACTIVE_SHIFT;
     glut_active_ctrl  = glutModifiers & GLUT_ACTIVE_CTRL; 
index be9c1255d2f5ad14d2801bef765c979b2296e042..41edac95a8e8cdb515e2b6ea86960678781dcfc7 100644 (file)
@@ -381,7 +381,7 @@ FGInput::doMouseClick (int b, int updown, int x, int y)
     return;
   }
 
-  _update_button(m.modes[m.current_mode].buttons[b], modifiers, updown, x, y);
+  _update_button(m.modes[m.current_mode].buttons[b], modifiers, 0 != updown, x, y);
 }
 
 void
index 09e0d029d2f9c6e414f8bd47470965f019af649b..b0f216ecab233f9574d65fb161293dd1528e486f 100644 (file)
@@ -425,7 +425,7 @@ do_property_adjust (const SGPropertyNode * arg, SGCommandState ** state)
     if (hasStep)
       value = step->getBoolValue();
     else
-      value = amount;
+      value = (0.0 != amount);
     if (value)
       return prop->setBoolValue(!prop->getBoolValue());
     else
index 4b9b479db321f9df9f95309a90a306dce428af20..229fe271895bd7783cd5b6d139febc582aaac27f 100644 (file)
@@ -265,8 +265,8 @@ bool fgInitConfig ( int argc, char **argv ) {
     config.append( "system.fgfsrc" );
     fgParseOptions(config.str());
 
-    char name[256];
 #if defined( unix ) || defined( __CYGWIN__ )
+    char name[256];
     // Check for $fg_root/system.fgfsrc.hostname
     gethostname( name, 256 );
     config.concat( "." );
index 6e23eeafa734a7ee41d704e917c6ffda6d80a0f4..f9e62dbcf763c6c8d57a70fa1062ef7469375514 100644 (file)
@@ -484,7 +484,7 @@ FGViewer::recalcOurOwnLocation (double lon_deg, double lat_deg, double alt_ft,
 void
 FGViewer::recalc ()
 {
-  sgVec3 minus_z, right, forward, tilt;
+  sgVec3 right, forward;
   sgMat4 tmpROT;  // temp rotation work matrices
   sgVec3 eye_pos, at_pos;
   sgVec3 position_offset; // eye position offsets (xyz)
@@ -696,6 +696,7 @@ FGViewer::get_h_fov()
     default:
        assert(false);
     }
+    return 0.0;
 }
 
 double
@@ -717,6 +718,7 @@ FGViewer::get_v_fov()
     default:
        assert(false);
     }
+    return 0.0;
 }
 
 void
index 9caf8b843bcaac4ff6a08c83949a1ee9ccea153a..ded790ebad14acc27fab8195c7ac1de33728a3f5 100644 (file)
@@ -257,7 +257,6 @@ FGViewMgr::update (int dt)
                                // Update the current view
   do_axes();
   view->update(dt);
-  double tmp;
 }
 
 void
index a713ab8346a2f12eeb55efec4382c01d593cba34..08738012846d94de4bfb247159129b1f5b25373e 100644 (file)
@@ -270,7 +270,7 @@ FG3DModel::update (int dt)
 bool
 FG3DModel::getVisible () const
 {
-  return _selector->getSelect();
+  return (_selector->getSelect() != 0);
 }
 
 void
index 458347a523d2485e9c55d726d158102aa18a0f8f..2b1cffa5d8d1295dfb0934b878db228bbebc6f42 100644 (file)
@@ -26,4 +26,5 @@
 
 // Generate a directional light
 ssgLeaf *gen_directional_light( sgVec3 pt, sgVec3 dir ) {
+return NULL;
 }
index 538a63b1272f392b831bba67d3c95019e95adb8f..3736908d8e5563d82b1480ea6b7ef4b585a4d1a6 100644 (file)
@@ -291,7 +291,7 @@ int FGHitList::IntersectLeaf( ssgLeaf *leaf, sgdMat4 m,
         sgdVec4 plane;
         sgdMakePlane( plane, tri[0], tri[1], tri[2] );
 
-        sgdVec3 point, test;
+        sgdVec3 point;
 
         // find point of intersection of line from point org
         // in direction dir with triangle's plane
@@ -535,7 +535,6 @@ bool fgCurrentElev( sgdVec3 abs_view_pos, sgdVec3 scenery_center,
         *terrain_elev = result;
         *radius = geoc.radius();
         sgVec3 tmp;
-        sgMat4 TMP;
         sgSetVec3(tmp, hit_list->get_normal(this_hit));
         // cout << "cur_normal: " << tmp[0] << " " << tmp[1] << " "  << tmp[2] << endl;
         sgdSetVec3( normal, tmp );
@@ -600,7 +599,6 @@ bool fgCurrentElev( sgdVec3 abs_view_pos, sgdVec3 scenery_center,
         *terrain_elev = result;
         *radius = geoc.radius();
         sgVec3 tmp;
-        sgMat4 TMP;
         sgSetVec3(tmp, hit_list->get_normal(this_hit));
         // cout << "cur_normal: " << tmp[0] << " " << tmp[1] << " "  << tmp[2] << endl;
         sgdSetVec3( normal, tmp );
index 5fe3c680bb82cef3c74bb66a91bcaad252001ce8..9994737656e3423c2be67928208375f13e04b068 100644 (file)
@@ -353,9 +353,9 @@ ssgBranch* FGTileEntry::gen_runway_lights( ssgVertexArray *points,ssgVertexArray
 {
 
     //************** HARD CODED RUNWAY LIGHT TEXTURES BEGIN ************************    
-    GLuint texEdge, texTaxi, texCenter, texTouchdown;
-    GLuint texThreshold, texCrossbar, texUndershoot, texApproach;
-    GLuint texRabbit, texVasi, texWhite, texRed, texGreen, texYellow;
+    GLuint texEdge, texTaxi, texTouchdown;
+    GLuint texThreshold;
+    GLuint texVasi, texWhite, texRed, texGreen, texYellow;
 
     //VASI lights
     setColor(0.0,0.0,1.0,360.0, 0, 0, 0, 0);
@@ -1052,7 +1052,7 @@ bool FGTileEntry::obj_load( const std::string& path,
        // updated, but hopefully we can can the ascii format soon.
        ssgBranch *tmp = fgAsciiObjLoad( path, this, ground_lights, is_base );
        if ( tmp ) {
-           return tmp;
+           return (NULL != tmp);
        } else {
            // default to an ocean tile
            if ( fgGenTile( path, tile_bucket, &c, &br, geometry ) ) {
@@ -1065,7 +1065,7 @@ bool FGTileEntry::obj_load( const std::string& path,
        }
     }
 
-    return geometry;
+    return (NULL != geometry);
 }