]> git.mxchange.org Git - simgear.git/commitdiff
VS2013 compile fixes.
authorJames Turner <zakalawe@mac.com>
Wed, 27 Jan 2016 14:02:27 +0000 (14:02 +0000)
committerJames Turner <zakalawe@mac.com>
Wed, 27 Jan 2016 14:02:27 +0000 (14:02 +0000)
- mostly about return type conversions.

simgear/bvh/BVHGroup.hxx
simgear/bvh/BVHStaticData.hxx
simgear/ephemeris/stardata.hxx
simgear/math/SGMisc.hxx

index d0b583639bfb32593cd04d413d02039027504de4..c956602bbfd8beae08041a71f1138548551469bb 100644 (file)
@@ -43,7 +43,7 @@ public:
     void removeChild(BVHNode* child);
     
     unsigned getNumChildren() const
-    { return _children.size(); }
+    { return static_cast<unsigned>(_children.size()); }
     const BVHNode* getChild(unsigned i) const
     { if (_children.size() <= i) return 0; return _children[i]; }
     BVHNode* getChild(unsigned i)
index d90bcb80702534e5a2382811b2f2cd7a7094ba58..d75c729c7b0d6d569ed59c2bad2186c6e3269658 100644 (file)
@@ -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<unsigned>(_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<unsigned>(_materials.size() - 1); }
     const BVHMaterial* getMaterial(unsigned i) const
     { if (_materials.size() <= i) return 0; return _materials[i]; }
 
index 40513e65d4472816926fcb821ffd8146be9ae741..8f3298c28576598d18d724c8712e9af32778b447 100644 (file)
@@ -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<int>(_stars.size()); }
     inline SGVec3d *getStars() { return &(_stars[0]); }
 
 private:
index abf162d819e5ab285c397a2d8330077ec4097802..c317b431007180f0e71e9f54895a0f2d496cf002 100644 (file)
@@ -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