Anders Gidenstam wrote:
> On Tue, 25 Aug 2009, Erik Hofman wrote:
> 
>>
>> Tim Moore wrote:
>>> The worst thing about that line is that it is broken :)
>> I can't find anything about it that makes it 'broken', knowing that
>> doubles are 64-bit and floats are 32-bit. It might be a bit better this
>> way though.
> 
> The line:
>    *((float*)&buf[length]) = sg_bswap_32(*(uint32_t*)&val);
> 
> Unless I'm mistaken the line writes a uint_32 (supposedly containing a 
> byte-swapped float) to a float location, triggering a automatic value 
> conversion from uint32 to float. Hmm.. and in addition to that val is a 
> double

Hm, that was only obvious after reading the source. I had another part 
of the code in mind. Good catch indeed.

Erik

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to