+2008-04-09 Emmanuele Bassi <ebassi@openedhand.com>
+
+ * autogen.sh: Clean up a bit
+
+ * clutter/clutter-fixed.[ch]:
+ (clutter_double_to_fixed),
+ (clutter_double_to_int),
+ (clutter_double_to_uint): Make these functions public, as they
+ are expanded by their respective macros. This fixes the errors
+ from the linker trying to resolve their name.
+
2008-04-09 Neil Roberts <neil@o-hand.com>
Applied patch from bug #871
*/
#define CFX_SIN_STEP 0x00000192
+/* <private> */
+const double _magic = 68719476736.0 * 1.5;
+
+/* Where in the 64 bits of double is the mantisa */
+#if (__FLOAT_WORD_ORDER == 1234)
+#define _CFX_MAN 0
+#elif (__FLOAT_WORD_ORDER == 4321)
+#define _CFX_MAN 1
+#else
+#define CFX_NO_FAST_CONVERSIONS
+#endif
+
+/*
+ * clutter_double_to_fixed :
+ * @value: value to be converted
+ *
+ * A fast conversion from double precision floating to fixed point
+ *
+ * Return value: Fixed point representation of the value
+ *
+ * Since: 0.2
+ */
+ClutterFixed
+clutter_double_to_fixed (double val)
+{
+#ifdef CFX_NO_FAST_CONVERSIONS
+ return (ClutterFixed)(val * (double)CFX_ONE);
+#else
+ union
+ {
+ double d;
+ unsigned int i[2];
+ } dbl;
+
+ dbl.d = val;
+ dbl.d = dbl.d + _magic;
+ return dbl.i[_CFX_MAN];
+#endif
+}
+
+/*
+ * clutter_double_to_int :
+ * @value: value to be converted
+ *
+ * A fast conversion from doulbe precision floatint point to int;
+ * used this instead of casting double/float to int.
+ *
+ * Return value: Integer part of the double
+ *
+ * Since: 0.2
+ */
+gint
+clutter_double_to_int (double val)
+{
+#ifdef CFX_NO_FAST_CONVERSIONS
+ return (gint)(val);
+#else
+ union
+ {
+ double d;
+ unsigned int i[2];
+ } dbl;
+
+ dbl.d = val;
+ dbl.d = dbl.d + _magic;
+ return ((int)dbl.i[_CFX_MAN]) >> 16;
+#endif
+}
+
+guint
+clutter_double_to_uint (double val)
+{
+#ifdef CFX_NO_FAST_CONVERSIONS
+ return (guint)(val);
+#else
+ union
+ {
+ double d;
+ unsigned int i[2];
+ } dbl;
+
+ dbl.d = val;
+ dbl.d = dbl.d + _magic;
+ return (dbl.i[_CFX_MAN]) >> 16;
+#endif
+}
+
+#undef _CFX_MAN
/**
* clutter_sinx:
return clutter_pow2x (CFX_MUL (y, clutter_log2x (x)));
}
-
-/* <private> */
-const double _magic = 68719476736.0*1.5;
-
-/* Where in the 64 bits of double is the mantisa */
-#if (__FLOAT_WORD_ORDER == 1234)
-#define _CFX_MAN 0
-#elif (__FLOAT_WORD_ORDER == 4321)
-#define _CFX_MAN 1
-#else
-#define CFX_NO_FAST_CONVERSIONS
-#endif
-
-/*
- * clutter_double_to_fixed :
- * @value: value to be converted
- *
- * A fast conversion from double precision floating to fixed point
- *
- * Return value: Fixed point representation of the value
- *
- * Since: 0.2
- */
-ClutterFixed
-_clutter_double_to_fixed (double val)
-{
-#ifdef CFX_NO_FAST_CONVERSIONS
- return (ClutterFixed)(val * (double)CFX_ONE);
-#else
- union
- {
- double d;
- unsigned int i[2];
- } dbl;
-
- dbl.d = val;
- dbl.d = dbl.d + _magic;
- return dbl.i[_CFX_MAN];
-#endif
-}
-
-/*
- * clutter_double_to_int :
- * @value: value to be converted
- *
- * A fast conversion from doulbe precision floatint point to int;
- * used this instead of casting double/float to int.
- *
- * Return value: Integer part of the double
- *
- * Since: 0.2
- */
-gint
-_clutter_double_to_int (double val)
-{
-#ifdef CFX_NO_FAST_CONVERSIONS
- return (gint)(val);
-#else
- union
- {
- double d;
- unsigned int i[2];
- } dbl;
-
- dbl.d = val;
- dbl.d = dbl.d + _magic;
- return ((int)dbl.i[_CFX_MAN]) >> 16;
-#endif
-}
-
-guint
-_clutter_double_to_uint (double val)
-{
-#ifdef CFX_NO_FAST_CONVERSIONS
- return (guint)(val);
-#else
- union
- {
- double d;
- unsigned int i[2];
- } dbl;
-
- dbl.d = val;
- dbl.d = dbl.d + _magic;
- return (dbl.i[_CFX_MAN]) >> 16;
-#endif
-}
-
-#undef _CFX_MAN
-
*
* Convert a float value to fixed.
*/
-#define CLUTTER_FLOAT_TO_FIXED(x) (_clutter_double_to_fixed ((x)))
+#define CLUTTER_FLOAT_TO_FIXED(x) (clutter_double_to_fixed ((x)))
/**
* CLUTTER_FLOAT_TO_INT:
*
* Convert a float value to int.
*/
-#define CLUTTER_FLOAT_TO_INT(x) (_clutter_double_to_int ((x)))
+#define CLUTTER_FLOAT_TO_INT(x) (clutter_double_to_int ((x)))
/**
* CLUTTER_FLOAT_TO_UINT:
*
* Convert a float value to unsigned int.
*/
-#define CLUTTER_FLOAT_TO_UINT(x) (_clutter_double_to_uint ((x)))
+#define CLUTTER_FLOAT_TO_UINT(x) (clutter_double_to_uint ((x)))
/**
* CLUTTER_INT_TO_FIXED:
/*< public >*/
/* Fixed point math routines */
extern inline
-ClutterFixed clutter_qmulx (ClutterFixed op1, ClutterFixed op2);
+ClutterFixed clutter_qmulx (ClutterFixed op1,
+ ClutterFixed op2);
extern inline
-ClutterFixed clutter_qdivx (ClutterFixed op1, ClutterFixed op2);
+ClutterFixed clutter_qdivx (ClutterFixed op1,
+ ClutterFixed op2);
ClutterFixed clutter_sinx (ClutterFixed angle);
ClutterFixed clutter_sini (ClutterAngle angle);
guint clutter_powx (guint x, ClutterFixed y);
/* <private> */
-extern inline
-ClutterFixed _clutter_double_to_fixed (double value);
-
-extern inline
-gint _clutter_double_to_int (double value);
-
-extern inline
-guint _clutter_double_to_uint (double value);
+extern ClutterFixed clutter_double_to_fixed (double value);
+extern gint clutter_double_to_int (double value);
+extern guint clutter_double_to_unit (double value);
G_END_DECLS