mirror of
https://github.com/brl/mutter.git
synced 2025-02-12 19:34:10 +00:00
fixed endianness issue in fast fp conversions
This commit is contained in:
parent
2c97bdf456
commit
5b92cc21cb
@ -1,3 +1,9 @@
|
|||||||
|
2007-07-25 Tomas Frydrych <tf@openedhand.com>
|
||||||
|
|
||||||
|
* clutter/clutter-fixed.c:
|
||||||
|
|
||||||
|
Fixed endianness issue in fast fp conversions.
|
||||||
|
|
||||||
2007-07-25 Tomas Frydrych <tf@openedhand.com>
|
2007-07-25 Tomas Frydrych <tf@openedhand.com>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
@ -837,10 +837,12 @@ clutter_powx (guint x, ClutterFixed y)
|
|||||||
const double _magic = 68719476736.0*1.5;
|
const double _magic = 68719476736.0*1.5;
|
||||||
|
|
||||||
/* Where in the 64 bits of double is the mantisa */
|
/* Where in the 64 bits of double is the mantisa */
|
||||||
#ifdef LITTLE_ENDIAN
|
#if (__FLOAT_WORD_ORDER == 1234)
|
||||||
#define _CFX_MAN 0
|
#define _CFX_MAN 0
|
||||||
#else
|
#elif (__FLOAT_WORD_ORDER == 4321)
|
||||||
#define _CFX_MAN 1
|
#define _CFX_MAN 1
|
||||||
|
#else
|
||||||
|
#define CFX_NO_FAST_CONVERSIONS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -867,7 +869,7 @@ _clutter_double_to_fixed (double val)
|
|||||||
|
|
||||||
dbl.d = val;
|
dbl.d = val;
|
||||||
dbl.d = dbl.d + _magic;
|
dbl.d = dbl.d + _magic;
|
||||||
return dbl.i[0];
|
return dbl.i[_CFX_MAN];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -896,7 +898,7 @@ _clutter_double_to_int (double val)
|
|||||||
|
|
||||||
dbl.d = val;
|
dbl.d = val;
|
||||||
dbl.d = dbl.d + _magic;
|
dbl.d = dbl.d + _magic;
|
||||||
return ((int)dbl.i[0]) >> 16;
|
return ((int)dbl.i[_CFX_MAN]) >> 16;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -914,7 +916,7 @@ _clutter_double_to_uint (double val)
|
|||||||
|
|
||||||
dbl.d = val;
|
dbl.d = val;
|
||||||
dbl.d = dbl.d + _magic;
|
dbl.d = dbl.d + _magic;
|
||||||
return (dbl.i[0]) >> 16;
|
return (dbl.i[_CFX_MAN]) >> 16;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user