Fixed unsigned overflow in sine alpha functions
authorTomas Frydrych <tf@openedhand.com>
Mon, 11 Jun 2007 15:47:26 +0000 (15:47 +0000)
committerTomas Frydrych <tf@openedhand.com>
Mon, 11 Jun 2007 15:47:26 +0000 (15:47 +0000)
ChangeLog
clutter/clutter-alpha.c

index 07aa1c1..87b69ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-11  Tomas Frydrych  <tf@openedhand.com>
+
+       * clutter/clutter-alpha.c:
+       (clutter_alpha_sine_inc):
+       (clutter_alpha_sine_dec):
+       (clutter_alpha_sine_half):
+       Fixed unsigned overflow.
+       
 2007-06-11  Emmanuele Bassi  <ebassi@openedhand.com>
 
        * clutter/clutter-event.h: Add full modifier masks enums.
index 9850984..392d2cd 100644 (file)
@@ -629,7 +629,7 @@ clutter_sine_inc_func (ClutterAlpha *alpha,
 
   sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA;
 
-  return CFX_INT (sine);
+  return ((guint32)sine) >> CFX_Q;
 }
 
 /**
@@ -663,7 +663,7 @@ clutter_sine_dec_func (ClutterAlpha *alpha,
 
   sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA;
 
-  return CFX_INT (sine);
+  return ((guint32)sine) >> CFX_Q;
 }
 
 /**
@@ -697,7 +697,7 @@ clutter_sine_half_func (ClutterAlpha *alpha,
 
   sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA;
 
-  return CFX_INT (sine);
+  return ((guint32)sine) >> CFX_Q;
 }
 
 /**