[Bug 3838] Players can't move when connecting to ppc64 server.

bugzilla-daemon at icculus.org bugzilla-daemon at icculus.org
Sun Nov 2 18:53:22 EST 2008


http://bugzilla.icculus.org/show_bug.cgi?id=3838





------- Comment #5 from sparky at pld-linux.org  2008-11-02 18:53 EDT -------
I've got the solution.
Thanks Ludwig ! You probably can't imagine how much help you've been.

Citing your comment from Bug 3805: "Just grep for union". So I did, and I found
this flower:

static ID_INLINE float _vmf(intptr_t x)
{
        union { 
                intptr_t l;
                float f;
        } t;
        t.l = x;
        return t.f;
}

Which is wrong, because union of two different size variables is very hard to
predict. I don't know why it works on x86_64, but there's no chance it's going
to work on ppc64. All the interesting data is in lower bytes of 'l', while the
float starts at the beginning of the union.

Code using int-float union works well on both x86_64 and ppc64, it looks like
this:

static ID_INLINE float _vmf( intptr_t x )
{
        union { 
                int l;
                float f;
        } t;
        t.l = (int) x;
        return t.f;
}

I'll integrate the change into Bug 3805 patch.


-- 
Configure bugmail: http://bugzilla.icculus.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.



More information about the quake3-bugzilla mailing list