[Verse-dev] Network packing of real64s (doubles)

Emil Brink verse-dev@blender.org
Fri, 19 Mar 2004 18:05:06 +0100 (MET)


On Fri, 19 Mar 2004, Eskil Steenberg wrote:

> Hi
>
> >Heh. I don't think you should be so quick to blame Intel, here. I
> >quote the code, once again:
> >
> >
> Obviously it is my fault, i just assumed that on a 32 bit architecture
> they only swapped the 32 bits. If they swap any thing larger they may as
> well store the entire memory space backwards.....
>
> What is your favorite fix may I ask?

I'm not sure, or there would be a fix already. I would like it if we
did not use any "long long"s, since they're not always supported. The
only fix I can think of then is to use a loop over the bytes of the
double, starting either from the beginning (on big-endian machines)
or from the end (on little-endian machines).

Obviously, doing it that way requires knowing the endianness, and at
the moment I'm not 100% certain there is a standard way of checking
that at compile-time (checking at run-time is not an option for this
code, in my opinion). There is <endian.h>, but I don't know if it's
standard.

You know, these are the exact kinds of problems that people use
autoconf to solve. :)

I'm outa here, so no more input from me no this issue today.

Say hi to San Jose for me, Eskil! :)

Regards,

/Emil