[clutter/clutter-1.10] paint-node: Initialize ClutterPaintOperation



commit 133e663878f958e5cafe8d09bb1ffef9956dcd31
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue Mar 20 16:11:52 2012 +0000

    paint-node: Initialize ClutterPaintOperation
    
    Don't leave it to the compiler.

 clutter/clutter-paint-node-private.h |    2 ++
 clutter/clutter-paint-node.c         |    8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter-paint-node-private.h b/clutter/clutter-paint-node-private.h
index 7c68a09..b91187f 100644
--- a/clutter/clutter-paint-node-private.h
+++ b/clutter/clutter-paint-node-private.h
@@ -70,6 +70,8 @@ struct _ClutterPaintNodeClass
   JsonNode*(* serialize) (ClutterPaintNode *node);
 };
 
+#define PAINT_OP_INIT   { PAINT_OP_INVALID }
+
 typedef enum {
   PAINT_OP_INVALID = 0,
   PAINT_OP_TEX_RECT,
diff --git a/clutter/clutter-paint-node.c b/clutter/clutter-paint-node.c
index c71a74b..00987e6 100644
--- a/clutter/clutter-paint-node.c
+++ b/clutter/clutter-paint-node.c
@@ -846,7 +846,7 @@ void
 clutter_paint_node_add_rectangle (ClutterPaintNode      *node,
                                   const ClutterActorBox *rect)
 {
-  ClutterPaintOperation operation;
+  ClutterPaintOperation operation = PAINT_OP_INIT;
 
   g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
   g_return_if_fail (rect != NULL);
@@ -878,7 +878,7 @@ clutter_paint_node_add_texture_rectangle (ClutterPaintNode      *node,
                                           float                  x_2,
                                           float                  y_2)
 {
-  ClutterPaintOperation operation;
+  ClutterPaintOperation operation = PAINT_OP_INIT;
 
   g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
   g_return_if_fail (rect != NULL);
@@ -906,7 +906,7 @@ void
 clutter_paint_node_add_path (ClutterPaintNode *node,
                              CoglPath         *path)
 {
-  ClutterPaintOperation operation;
+  ClutterPaintOperation operation = PAINT_OP_INIT;
 
   g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
   g_return_if_fail (cogl_is_path (path));
@@ -933,7 +933,7 @@ void
 clutter_paint_node_add_primitive (ClutterPaintNode *node,
                                   CoglPrimitive    *primitive)
 {
-  ClutterPaintOperation operation;
+  ClutterPaintOperation operation = PAINT_OP_INIT;
 
   g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
   g_return_if_fail (cogl_is_primitive (primitive));



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