0x00000000007e1c50 in GPS::updateTTWNode (this=0xce164c0,
c...@0x7fff664fdee0, distance_m=12822604.584446406,
no...@0x7fff664fddd0) at src/Instrumentation/gps.cxx:483
483         unsigned int TTW_seconds = (int) (TTW + 0.5);
(gdb) p TTW
$10 = 62278235905.950584

Not sure what it is calculating anyway.  This happened with the
hurricane just at startup.
And all the "while" loops look silly too. Not to mention that it
should probably display times up to 99:59:59 so the check at the top
is wrong.

-- 
Csaba/Jester
Index: src/Instrumentation/gps.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/gps.cxx,v
retrieving revision 1.29
diff -u -r1.29 gps.cxx
--- src/Instrumentation/gps.cxx	9 Dec 2008 08:10:33 -0000	1.29
+++ src/Instrumentation/gps.cxx	2 Jan 2009 17:29:12 -0000
@@ -480,8 +480,8 @@
         TTW = (distance_m * SG_METER_TO_NM) / (ctx.speed_kt / 3600);
     }
    
-    unsigned int TTW_seconds = (int) (TTW + 0.5);
-    if (TTW_seconds < 356400) { // That's 99 hours
+    if (TTW < 356399.5) { // That's 99 hours minus rounding
+      unsigned int TTW_seconds = (unsigned int) (TTW + 0.5);
       unsigned int TTW_minutes = 0;
       unsigned int TTW_hours   = 0;
       char TTW_str[9];
------------------------------------------------------------------------------
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to