X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fbucket%2Fnewbucket.hxx;h=d3e8783af3372c34830ed901c6ce17129a739fe8;hb=872db67f21e9f89bc4282e571d448a704f01d8e5;hp=ccb5a8f9f48330590d469ac40b35a560685f502f;hpb=e700fc6f34f151a5f3f5c51ffca164d5199c7fa5;p=simgear.git diff --git a/simgear/bucket/newbucket.hxx b/simgear/bucket/newbucket.hxx index ccb5a8f9..d3e8783a 100644 --- a/simgear/bucket/newbucket.hxx +++ b/simgear/bucket/newbucket.hxx @@ -33,29 +33,10 @@ #include #include -#ifdef SG_HAVE_STD_INCLUDES -# include -# include // sprintf() -#else -# include -# include // sprintf() -#endif - -#include STL_IOSTREAM - -// I don't understand ... or should be included -// already depending on how you defined SG_HAVE_STD_INCLUDES, but I -// can go ahead and add this -- CLO -#ifdef __MWERKS__ -SG_USING_STD(sprintf); -SG_USING_STD(fabs); -#endif - -#include STL_STRING - -SG_USING_STD(string); -SG_USING_STD(ostream); - +#include +#include // sprintf() +#include +#include /** * standard size of a bucket in degrees (1/8 of a degree) @@ -114,7 +95,6 @@ static double sg_bucket_span( double l ) { class SGBucket { private: - double cx, cy; // centerpoint (lon, lat) in degrees of bucket short lon; // longitude index (-180 to 179) short lat; // latitude index (-90 to 89) char x; // x subdivision (0 to 7) @@ -210,18 +190,19 @@ public: * string form. * @return tile index in string form */ - inline string gen_index_str() const { + inline std::string gen_index_str() const { char tmp[20]; - sprintf(tmp, "%ld", - (((long)lon + 180) << 14) + ((lat + 90) << 6) + (y << 3) + x); - return (string)tmp; + std::sprintf(tmp, "%ld", + (((long)lon + 180) << 14) + ((lat + 90) << 6) + + (y << 3) + x); + return (std::string)tmp; } /** * Build the base path name for this bucket. * @return base path in string form */ - string gen_base_path() const; + std::string gen_base_path() const; /** * @return the center lon of a tile. @@ -306,10 +287,15 @@ public: // friends - friend ostream& operator<< ( ostream&, const SGBucket& ); + friend std::ostream& operator<< ( std::ostream&, const SGBucket& ); friend bool operator== ( const SGBucket&, const SGBucket& ); }; +inline bool operator!= (const SGBucket& lhs, const SGBucket& rhs) + { + return !(lhs == rhs); + } + /** * \relates SGBucket @@ -340,8 +326,8 @@ void sgBucketDiff( const SGBucket& b1, const SGBucket& b2, int *dx, int *dy ); * @param out output stream * @param b bucket */ -inline ostream& -operator<< ( ostream& out, const SGBucket& b ) +inline std::ostream& +operator<< ( std::ostream& out, const SGBucket& b ) { return out << b.lon << ":" << b.x << ", " << b.lat << ":" << b.y; }