Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-09-01 Thread James Turner
On 31 Aug 2008, at 21:57, Tim Moore wrote: > I guess you're not using map::lower_bound because you want to > support an > arbitrary ordering different from the map? What will the lower bound > result mean > in that case? Actually my logic is busted anyway, I was hoping to avoid a linear se

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread Tim Moore
James Turner wrote: > On 31 Aug 2008, at 11:58, Stefan C. Müller wrote: > >> OK, here's the patch. >> But we need a total of 3 overloaded operator(). Not realy nice to >> look at. >> Anyway, I'm happy with both variants. > > As you say, not ideal, but I'm still working on this code, so a little

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread Stefan C. Müller
Frederic Bouvier schrieb: Stefan C. Müller a écrit : * Replaced an rint() call with floor() (MSVC does not offer rint). I am a bit worried that floor and rint are not the same. I don't know if it matters in this context but how about using the code below instead ? // round double to 1

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread Frederic Bouvier
Stefan C. Müller a écrit : > * Replaced an rint() call with floor() (MSVC does not offer rint). I am a bit worried that floor and rint are not the same. I don't know if it matters in this context but how about using the code below instead ? // round double to 10^g double rnd(double r, int g = 0)

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread Frederic Bouvier
Frederic Bouvier a écrit : > Stefan C. Müller a écrit : > >> * Replaced an rint() call with floor() (MSVC does not offer rint). >> > > Are you sure you don't need > #include > ? > because rint is already used in Main/Options.cxx > Forget that. I missed the #ifdef HAVE_RINT around it -

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread Frederic Bouvier
Stefan C. Müller a écrit : > * Replaced an rint() call with floor() (MSVC does not offer rint). Are you sure you don't need #include ? because rint is already used in Main/Options.cxx -Fred -- Frédéric Bouvier http://my.fotolia.com/frfoto/ Photo gallery http://fgsd.sourceforge.net/Flight

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread James Turner
On 31 Aug 2008, at 11:58, Stefan C. Müller wrote: > OK, here's the patch. > But we need a total of 3 overloaded operator(). Not realy nice to > look at. > Anyway, I'm happy with both variants. As you say, not ideal, but I'm still working on this code, so a little bit of uglyness, I can live

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread Stefan C. Müller
James Turner schrieb: Adding the commutative operator is fine with me, seems like the cleanest solution. OK, here's the patch. But we need a total of 3 overloaded operator(). Not realy nice to look at. Anyway, I'm happy with both variants. Stefan Index: Airports/simple.cxx

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread Stefan C. Müller
Frederic Bouvier schrieb: > As Stefan says, the ( debugging ) code expects the predicate is > commutative. Maybe there is a symbol to disable debugging code to be > generated, Ah, yes there is one way, but I forgot to mention. It's prossible to #define _HAS_INTERATOR_DEBUGGING 0 (default for rele

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread James Turner
On 31 Aug 2008, at 08:30, Frederic Bouvier wrote: > As Stefan says, the ( debugging ) code expects the predicate is > commutative. Maybe there is a symbol to disable debugging code to be > generated, or we could provide the class a second operator() : > > > bool operator()(const std::string& aB,

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-31 Thread Frederic Bouvier
James Turner a écrit : > On 30 Aug 2008, at 23:16, Stefan C. Müller wrote: > > >>> As far as I can tell, this is not true. The third parameter type is >>> independant from the type of the container, and should only match >>> the type of the second parameter of the predicate. The current code

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-30 Thread James Turner
On 30 Aug 2008, at 23:16, Stefan C. Müller wrote: >> As far as I can tell, this is not true. The third parameter type is >> independant from the type of the container, and should only match >> the type of the second parameter of the predicate. The current code >> compile under MSVC 7.1 and

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-30 Thread Stefan C. Müller
Frederic Bouvier schrieb: > Hi Stefan, > > - "Stefan C. Müller" a écrit : > >> 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

Re: [Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-30 Thread Frederic Bouvier
Hi Stefan, - "Stefan C. Müller" a écrit : > 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 see

[Flightgear-devel] Patch: Minor bugfixes for MSVC compatibility

2008-08-30 Thread Stefan C. Müller
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 i