[clutter/msvc-support: 1/8] Update source files to avoid C99 usage



commit e9cf01c1b756ed295df4d7f40f4cc55e05204ddc
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Apr 19 18:30:15 2011 +0800

    Update source files to avoid C99 usage
    
    The 3 source files use C99 syntax or macros-make them C89 compliant and
    replace use of M_PI with G_PI, which is available from GLib

 tests/conform/test-cogl-materials.c    |   20 ++++++++++++++------
 tests/conform/test-cogl-pixel-buffer.c |    2 +-
 tests/micro-bench/test-picking.c       |    8 ++++----
 3 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/tests/conform/test-cogl-materials.c b/tests/conform/test-cogl-materials.c
index d5a21ab..7602625 100644
--- a/tests/conform/test-cogl-materials.c
+++ b/tests/conform/test-cogl-materials.c
@@ -70,14 +70,22 @@ test_material_with_primitives (TestState *state,
                                int x, int y,
                                guint32 color)
 {
-  CoglTextureVertex verts[4] = {
-    { .x = 0,          .y = 0,          .z = 0 },
-    { .x = 0,          .y = QUAD_WIDTH, .z = 0 },
-    { .x = QUAD_WIDTH, .y = QUAD_WIDTH, .z = 0 },
-    { .x = QUAD_WIDTH, .y = 0,          .z = 0 },
-  };
+  CoglTextureVertex verts[4];
   CoglHandle vbo;
 
+  verts[0].x = 0;
+  verts[0].y = 0;
+  verts[0].z = 0;
+  verts[1].x = 0;
+  verts[1].y = QUAD_WIDTH;
+  verts[1].z = 0;
+  verts[2].x = QUAD_WIDTH;
+  verts[2].y = QUAD_WIDTH;
+  verts[2].z = 0;
+  verts[3].x = QUAD_WIDTH;
+  verts[3].y = 0;
+  verts[3].z = 0;
+
   cogl_push_matrix ();
 
   cogl_translate (x * QUAD_WIDTH, y * QUAD_WIDTH, 0);
diff --git a/tests/conform/test-cogl-pixel-buffer.c b/tests/conform/test-cogl-pixel-buffer.c
index 112c646..d892c64 100644
--- a/tests/conform/test-cogl-pixel-buffer.c
+++ b/tests/conform/test-cogl-pixel-buffer.c
@@ -24,7 +24,7 @@ typedef struct test_tile
 
 static const ClutterColor
 buffer_colors[] =
-  {
+  {0
   };
 
 static const ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff };
diff --git a/tests/micro-bench/test-picking.c b/tests/micro-bench/test-picking.c
index f661729..3425afa 100644
--- a/tests/micro-bench/test-picking.c
+++ b/tests/micro-bench/test-picking.c
@@ -39,9 +39,9 @@ do_events (ClutterActor *stage)
 
   for (i = 0; i < n_events; i++)
     {
-      angle += (2.0 * M_PI) / (gdouble)n_actors;
-      while (angle > M_PI * 2.0)
-        angle -= M_PI * 2.0;
+      angle += (2.0 * G_PI) / (gdouble)n_actors;
+      while (angle > G_PI * 2.0)
+        angle -= G_PI * 2.0;
 
       /* If we synthesized events, they would be motion compressed;
        * calling get_actor_at_position() doesn't have that problem
@@ -99,7 +99,7 @@ main (int argc, char **argv)
 
   for (i = n_actors - 1; i >= 0; i--)
     {
-      angle = ((2.0 * M_PI) / (gdouble) n_actors) * i;
+      angle = ((2.0 * G_PI) / (gdouble) n_actors) * i;
 
       color.red = (1.0 - ABS ((MAX (0, MIN (n_actors/2.0 + 0, i))) /
                   (gdouble)(n_actors/4.0) - 1.0)) * 255.0;



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