[Kstars-devel] [kstars] kstars/skyobjects: Initialize Rearth in KSPlanetBase to NaN

Akarsh Simha akarsh.simha at kdemail.net
Sun Apr 13 23:05:03 UTC 2014


Git commit 2d6bbdb153d7148f5cc800f1053cc1d9c18064f2 by Akarsh Simha.
Committed on 13/04/2014 at 22:57.
Pushed by asimha into branch 'master'.

Initialize Rearth in KSPlanetBase to NaN

The member Rearth describes the distance to earth from the
planet. This was initialized to zero. It is much cleaner to initialize
it to NaN.

This may introduce a number of crashes, especially in debug mode, but
it will help expose computation bugs that would otherwise be hard to
find.

CCMAIL: kstars-devel at kde.org

M  +2    -1    kstars/skyobjects/ksplanetbase.cpp

http://commits.kde.org/kstars/2d6bbdb153d7148f5cc800f1053cc1d9c18064f2

diff --git a/kstars/skyobjects/ksplanetbase.cpp b/kstars/skyobjects/ksplanetbase.cpp
index 169ab3f..0a252e3 100644
--- a/kstars/skyobjects/ksplanetbase.cpp
+++ b/kstars/skyobjects/ksplanetbase.cpp
@@ -23,6 +23,7 @@
 #include <QPoint>
 #include <QMatrix>
 
+#include "nan.h"
 #include "kstarsdata.h"
 #include "ksutils.h"
 #include "ksnumbers.h"
@@ -56,7 +57,7 @@ const SkyObject::UID KSPlanetBase::UID_SOL_COMET    = 2;
 
 KSPlanetBase::KSPlanetBase( const QString &s, const QString &image_file, const QColor &c, double pSize ) :
     TrailObject( 2, 0.0, 0.0, 0.0, s ),
-    Rearth(0.0)
+    Rearth( NaN::d )
 {
     init( s, image_file, c, pSize );
 }



More information about the Kstars-devel mailing list