[cogl/msvc-support] Bug 650833: Fix crash on 32-bit Windows



commit b3f3caf4ac42bbe0d4f06e6ccc6d127b219ed990
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Jul 18 12:47:24 2011 +0800

    Bug 650833: Fix crash on 32-bit Windows
    
    Declare int_part as double on cogl/cogl-texture-2d.c to avoid overflow
    in _cogl_texture_2d_wrap_coords on Windows 32-bit.  This may be a potential
    problem on other 32-bit systems too.  This change also runs fine on x64
    Windows, too.

 cogl/cogl-texture-2d.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c
index 71ff44a..de7d2ab 100644
--- a/cogl/cogl-texture-2d.c
+++ b/cogl/cogl-texture-2d.c
@@ -65,11 +65,11 @@ static void
 _cogl_texture_2d_wrap_coords (float t_1, float t_2,
                               float *out_t_1, float *out_t_2)
 {
-  float int_part;
+  double int_part;
 
   /* Wrap t_1 and t_2 to the range [0,1] */
 
-  modff (t_1 < t_2 ? t_1 : t_2, &int_part);
+  modff (t_1 < t_2 ? t_1 : t_2, (float*)&int_part);
   t_1 -= int_part;
   t_2 -= int_part;
   if (cogl_util_float_signbit (int_part))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]