From: James Turner Date: Wed, 27 Jan 2016 14:02:27 +0000 (+0000) Subject: VS2013 compile fixes. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=819833a56030570718b9cc2aa1a52daa34631e18;p=simgear.git VS2013 compile fixes. - mostly about return type conversions. --- diff --git a/simgear/bvh/BVHGroup.hxx b/simgear/bvh/BVHGroup.hxx index d0b58363..c956602b 100644 --- a/simgear/bvh/BVHGroup.hxx +++ b/simgear/bvh/BVHGroup.hxx @@ -43,7 +43,7 @@ public: void removeChild(BVHNode* child); unsigned getNumChildren() const - { return _children.size(); } + { return static_cast(_children.size()); } const BVHNode* getChild(unsigned i) const { if (_children.size() <= i) return 0; return _children[i]; } BVHNode* getChild(unsigned i) diff --git a/simgear/bvh/BVHStaticData.hxx b/simgear/bvh/BVHStaticData.hxx index d90bcb80..d75c729c 100644 --- a/simgear/bvh/BVHStaticData.hxx +++ b/simgear/bvh/BVHStaticData.hxx @@ -31,13 +31,13 @@ public: virtual ~BVHStaticData() {} unsigned addVertex(const SGVec3f& vertex) - { _vertices.push_back(vertex); return _vertices.size() - 1; } + { _vertices.push_back(vertex); return static_cast(_vertices.size() - 1); } const SGVec3f& getVertex(unsigned i) const { return _vertices[i]; } unsigned addMaterial(const BVHMaterial* material) - { _materials.push_back(material); return _materials.size() - 1; } + { _materials.push_back(material); return static_cast(_materials.size() - 1); } const BVHMaterial* getMaterial(unsigned i) const { if (_materials.size() <= i) return 0; return _materials[i]; } diff --git a/simgear/ephemeris/stardata.hxx b/simgear/ephemeris/stardata.hxx index 40513e65..8f3298c2 100644 --- a/simgear/ephemeris/stardata.hxx +++ b/simgear/ephemeris/stardata.hxx @@ -41,7 +41,7 @@ public: bool load( const SGPath& path ); // stars - inline int getNumStars() const { return _stars.size(); } + inline int getNumStars() const { return static_cast(_stars.size()); } inline SGVec3d *getStars() { return &(_stars[0]); } private: diff --git a/simgear/math/SGMisc.hxx b/simgear/math/SGMisc.hxx index abf162d8..c317b431 100644 --- a/simgear/math/SGMisc.hxx +++ b/simgear/math/SGMisc.hxx @@ -154,7 +154,7 @@ public: static bool isNaN(const T& v) { #ifdef HAVE_ISNAN - return isnan(v); + return (isnan(v) != 0); #elif defined HAVE_STD_ISNAN return std::isnan(v); #else