Hi Dirk,

Dirk Reiners wrote:
>> attached patch fixes <subject> but this looks so strange, I suspect it
>> might be on purpose (in that case a comment in the code seems
>> appropriate ;) )
>>
>> Could somebody shed some light on the issue, please ?
> 
> given that 32 bit are 32 bit, no matter what they represent, there is not 
> really 
> a need to have a separate Real32 HostToNet.

well, yes and no.

float f = 10.2345f;
int i = reinterpret_cast<int>(f);

does not work - that cast is not allowed.

int i = static_cast<int>(f);
int i = (int) f;

both truncate to the integral part of f, i.e. i is 10 (btw. this is
probably what happens in the code mentioned above, seems wrong to me ;) ).

int i = *reinterpret_cast<int*>(&f);

is a violation of aliasing rules, I think.
That's why there are different version for integer and fp types even if
they have the same size.
Anyway, I now think this is just a typo, so unless somebody starts
jelling I'll apply the patch on Monday.

        Thanks,
                Carsten

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to