From b53badf201a12c6bd4665347f8a70d4d48e13a84 Mon Sep 17 00:00:00 2001 From: fredb Date: Sun, 31 Aug 2008 18:32:43 +0000 Subject: [PATCH] =?UTF-8?q?Stefan=20C.=20M=FCller=20:=20Small=20patch=20fi?= =?UTF-8?q?xing=20bugs=20I've=20encountered=20while=20getting=20the=20curr?= =?UTF-8?q?ent=20CVS=20to=20build=20in=20MSVC.=20*=20std::lower=5Fbound=20?= =?UTF-8?q?was=20used=20with=20the=20key-type=20of=20a=20map,=20but=20lowe?= =?UTF-8?q?r=5Fbound=20expects=20the=20value-type=20of=20the=20collection?= =?UTF-8?q?=20it=20works=20on,=20with=20is=20std::pair.=20MSVC=20seems=20t?= =?UTF-8?q?o=20be=20more=20strict=20about=20this.=20*=20Added=20an=20missi?= =?UTF-8?q?ng=20include=20statement.=20*=20Replaced=20an=20rint()=20call?= =?UTF-8?q?=20with=20floor()=20(MSVC=20does=20not=20offer=20rint).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Airports/simple.cxx | 10 ++++++++++ src/Main/metar_main.cxx | 3 ++- src/Navaids/fixlist.cxx | 10 ++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 7a5871fd7..2ebfb8434 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -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; diff --git a/src/Main/metar_main.cxx b/src/Main/metar_main.cxx index 0857bac5d..d150b6526 100644 --- a/src/Main/metar_main.cxx +++ b/src/Main/metar_main.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -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); } diff --git a/src/Navaids/fixlist.cxx b/src/Navaids/fixlist.cxx index 2749cf22c..a07429f06 100644 --- a/src/Navaids/fixlist.cxx +++ b/src/Navaids/fixlist.cxx @@ -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;