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).
{
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;
#include <sstream>
#include <iostream>
#include <string.h>
+#include <time.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/environment/metar.hxx>
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);
}
{
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;