From a8d7645004b03884229914a546e3e945df6ba809 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 4 Mar 2014 16:05:36 +0000 Subject: [PATCH] Code cleanups. (no functionality change) --- simgear/scene/sky/cloud.cxx | 14 +------------- simgear/scene/sky/cloud.hxx | 9 ++++----- simgear/scene/sky/cloudfield.cxx | 12 ------------ simgear/scene/sky/sky.cxx | 2 +- simgear/scene/sky/sky.hxx | 2 +- 5 files changed, 7 insertions(+), 32 deletions(-) diff --git a/simgear/scene/sky/cloud.cxx b/simgear/scene/sky/cloud.cxx index cdd851b4..e3522dda 100644 --- a/simgear/scene/sky/cloud.cxx +++ b/simgear/scene/sky/cloud.cxx @@ -60,18 +60,6 @@ using namespace simgear; using namespace osg; -#if defined(__MINGW32__) -#define isnan(x) _isnan(x) -#endif - -// #if defined (__FreeBSD__) -// # if __FreeBSD_version < 500000 -// extern "C" { -// inline int isnan(double r) { return !(r <= 0 || r >= 0); } -// } -// # endif -// #endif - static osg::ref_ptr layer_states[SGCloudLayer::SG_MAX_CLOUD_COVERAGES]; static osg::ref_ptr layer_states2[SGCloudLayer::SG_MAX_CLOUD_COVERAGES]; static osg::ref_ptr cubeMap; @@ -735,7 +723,7 @@ bool SGCloudLayer::reposition( const SGVec3f& p, const SGVec3f& up, double lon, // this happens, lets just use the last known good course. // This is a hack, and it would probably be better to make // calc_gc_course_dist() more robust. - if ( isnan(course) ) { + if ( isNaN(course) ) { course = last_course; } else { last_course = course; diff --git a/simgear/scene/sky/cloud.hxx b/simgear/scene/sky/cloud.hxx index 95f6dbbe..c79481af 100644 --- a/simgear/scene/sky/cloud.hxx +++ b/simgear/scene/sky/cloud.hxx @@ -33,7 +33,6 @@ #include #include -using std::string; #include #include @@ -74,7 +73,7 @@ public: * Constructor * @param tex_path the path to the set of cloud textures */ - SGCloudLayer( const string &tex_path ); + SGCloudLayer( const std::string &tex_path ); /** * Destructor @@ -141,16 +140,16 @@ public: void setCoverage (Coverage coverage); /** get coverage as string */ - const string & getCoverageString() const; + const std::string & getCoverageString() const; /** get coverage as string */ - static const string & getCoverageString( Coverage coverage ); + static const std::string & getCoverageString( Coverage coverage ); /** get coverage type from string */ static Coverage getCoverageType( const std::string & coverage ); /** set coverage as string */ - void setCoverageString( const string & coverage ); + void setCoverageString( const std::string & coverage ); /** * set the cloud movement direction diff --git a/simgear/scene/sky/cloudfield.cxx b/simgear/scene/sky/cloudfield.cxx index 45ae15f8..13ee3030 100644 --- a/simgear/scene/sky/cloudfield.cxx +++ b/simgear/scene/sky/cloudfield.cxx @@ -51,18 +51,6 @@ using std::vector; #include "newcloud.hxx" #include "cloudfield.hxx" -#if defined(__MINGW32__) -#define isnan(x) _isnan(x) -#endif - -#if defined (__FreeBSD__) -# if __FreeBSD_version < 500000 - extern "C" { - inline int isnan(double r) { return !(r <= 0 || r >= 0); } - } -# endif -#endif - using namespace simgear; float SGCloudField::fieldSize = 50000.0f; diff --git a/simgear/scene/sky/sky.cxx b/simgear/scene/sky/sky.cxx index e5535059..71160207 100644 --- a/simgear/scene/sky/sky.cxx +++ b/simgear/scene/sky/sky.cxx @@ -293,7 +293,7 @@ void SGSky::set_3dCloudUseImpostors(bool imp) SGCloudField::setUseImpostors(imp); } -void SGSky::texture_path( const string& path ) { +void SGSky::texture_path( const std::string& path ) { tex_path = SGPath( path ); } diff --git a/simgear/scene/sky/sky.hxx b/simgear/scene/sky/sky.hxx index 09d9b4ca..6b99d4ac 100644 --- a/simgear/scene/sky/sky.hxx +++ b/simgear/scene/sky/sky.hxx @@ -352,7 +352,7 @@ public: * Specify the texture path (optional, defaults to current directory) * @param path base path to texture locations */ - void texture_path( const string& path ); + void texture_path( const std::string& path ); /** * Get the current sun color