]> git.mxchange.org Git - simgear.git/blobdiff - simgear/metar/MetarStation.cpp
Tidy up the autoconf/automake configuration a bit.
[simgear.git] / simgear / metar / MetarStation.cpp
index 935c8a8ae1383ef2aa2ffbe25424ff15757673af..9000ae5ce9e347cece8cff1624a65e017c93c3ba 100644 (file)
@@ -8,12 +8,10 @@
 #include "MetarStation.h"
 #include <algorithm>
 
-#include <simgear/misc/fgpath.hxx>
-
-#if !defined (FG_HAVE_NATIVE_SGI_COMPILERS)
-FG_USING_STD(ostream);
-FG_USING_STD(cout);
-FG_USING_STD(endl);
+#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
+SG_USING_STD(ostream);
+SG_USING_STD(cout);
+SG_USING_STD(endl);
 #endif
 
 
@@ -48,7 +46,7 @@ double CMetarStation::decodeDMS( char *b )
                // Direction (E W N S)
                if ( *b == 'W' || *b == 'S' ) r = -r;
        }
-       return r * DEG_TO_RAD;
+       return r * SGD_DEGREES_TO_RADIANS;
 }
 
 // Constructor
@@ -82,14 +80,14 @@ CMetarStation::CMetarStation(
        s = t; t = strchr( s, ';' ); *t = 0; t++;
        double ulongitude = decodeDMS( s );
        s = t; t = strchr( s, ';' ); *t = 0; t++;
-       double altitude = atoi( s ) * FEET_TO_METER;
-       m_altitude = altitude;
+       double altitude = atoi( s ) * SG_FEET_TO_METER;
+       m_altitude = (int)altitude;
        s = t; t = strchr( s, ';' ); *t = 0; t++;
-       double ualtitude = atoi( s ) * FEET_TO_METER;
-       Point3D p( longitude, latitude, altitude+EQUATORIAL_RADIUS_M );
+       double ualtitude = atoi( s ) * SG_FEET_TO_METER;
+       Point3D p( longitude, latitude, altitude+SG_EQUATORIAL_RADIUS_M );
        m_locationPolar = p;
        m_locationCart = sgPolarToCart3d( p );
-       Point3D up( ulongitude, ulatitude, ualtitude+EQUATORIAL_RADIUS_M );
+       Point3D up( ulongitude, ulatitude, ualtitude+SG_EQUATORIAL_RADIUS_M );
        m_upperLocationPolar = up;
        m_upperLocationCart = sgPolarToCart3d( up );
        s = t;
@@ -175,7 +173,7 @@ CMetarStation * CMetarStationDB::find( Point3D locationCart )
 {
     std::map<std::string,CMetarStation*>::iterator itr;
     double bestDist = 99999999;
-    CMetarStation * bestStation;
+    CMetarStation *bestStation = NULL;
     Point3D curLocation = locationCart;
     itr = METAR_Stations.begin(); 
     while(itr != METAR_Stations.end())