]> git.mxchange.org Git - flightgear.git/commitdiff
Stefan C. Müller :
authorfredb <fredb>
Sun, 31 Aug 2008 18:32:43 +0000 (18:32 +0000)
committerfredb <fredb>
Sun, 31 Aug 2008 18:32:43 +0000 (18:32 +0000)
Small patch fixing bugs I've encountered while getting the current CVS to build in MSVC.
* std::lower_bound was used with the key-type of a map, but lower_bound expects the value-type of the collection it works on, with is std::pair. MSVC seems to be more strict about this.
* Added an missing include statement.
* Replaced an rint() call with floor() (MSVC does not offer rint).

src/Airports/simple.cxx
src/Main/metar_main.cxx
src/Navaids/fixlist.cxx

index 7a5871fd76d6fae445182c14a8b7883abfdd9614..2ebfb8434579cd7f00f0838d4786ea4f7c958119 100644 (file)
@@ -335,6 +335,16 @@ public:
   {
     return mOrdering->compare(aA.first,aB);
   }
+
+  bool operator()(const std::string& aA, const airport_map::value_type& aB) const
+  {
+    return mOrdering->compare(aA, aB.first);
+  }
+
+  bool operator()(const airport_map::value_type& aA, const airport_map::value_type& aB) const
+  {
+    return mOrdering->compare(aA.first, aB.first);
+  }
   
 private:
   FGIdentOrdering* mOrdering;
index 0857bac5dc6bacf8cf62f63b35467924be704677..d150b65267097f027dce01302e0db4d10a01f766 100644 (file)
@@ -24,6 +24,7 @@
 #include <sstream>
 #include <iostream>
 #include <string.h>
+#include <time.h>
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/environment/metar.hxx>
@@ -76,7 +77,7 @@ const char *azimuthName(double d)
 double rnd(double r, int g = 0)
 {
        double f = pow(10.0, g);
-       return f * rint(r / f);
+       return f * floor(r / f + 0.5);
 }
 
 
index 2749cf22c6fad62362b590a03a85712212f466b3..a07429f061b40115d702be1678305ec91d431071 100644 (file)
@@ -145,6 +145,16 @@ public:
   {
     return mOrdering->compare(aA.first,aB);
   }
+
+  bool operator()(const std::string& aA, const fix_map_type::value_type& aB) const
+  {
+    return mOrdering->compare(aA, aB.first);
+  }
+
+  bool operator()(const fix_map_type::value_type& aA, const fix_map_type::value_type& aB) const
+  {
+    return mOrdering->compare(aA.first, aB.first);
+  }
   
 private:
   FGIdentOrdering* mOrdering;