From: ehofman Date: Mon, 23 Feb 2004 09:48:10 +0000 (+0000) Subject: Frederic Bouvier: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=86e94fd08e30834abf819eed66debb6e6f185040;p=flightgear.git Frederic Bouvier: The last change from Curt to Airports/simple.[ch]xx made GUI/AirportList.cxx not compilable because of the loss of a '*' in getAirport. Also : fabs is not defined under MSVC unless is included. --- diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 04a528f95..e27946169 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -27,6 +27,8 @@ # include #endif +#include + #include #include @@ -52,7 +54,10 @@ operator >> ( istream& in, FGAirport& a ) in.getline( name, 256 ); a.name = name; - a.has_metar = true; // assume true + // a.has_metar = true; // assume true + // only airports with four-letter codes can have metar stations + a.has_metar = (isalpha(a.id[0]) && isalpha(a.id[1]) && isalpha(a.id[2]) + && isalpha(a.id[3]) && !a.id[4]); return in; } @@ -121,9 +126,9 @@ FGAirportList::size () const return airports_array.size(); } -const FGAirport FGAirportList::getAirport( int index ) const +const FGAirport *FGAirportList::getAirport( int index ) const { - return *airports_array[index]; + return airports_array[index]; } diff --git a/src/Airports/simple.hxx b/src/Airports/simple.hxx index 2d25e16d5..7d3372ecb 100644 --- a/src/Airports/simple.hxx +++ b/src/Airports/simple.hxx @@ -102,7 +102,7 @@ public: /** * Return a specific airport, by position. */ - const FGAirport getAirport( int index ) const; + const FGAirport *getAirport( int index ) const; /**