[Spice-devel] [PATCH spice-common] Add missing struct field initializers

Daniel P. Berrange berrange at redhat.com
Wed Apr 25 02:58:05 PDT 2012


From: "Daniel P. Berrange" <berrange at redhat.com>

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 common/canvas_base.c |    4 +++-
 common/sw_canvas.c   |    6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 8f5b0c8..4f40306 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -2988,7 +2988,7 @@ static void canvas_draw_stroke(SpiceCanvas *spice_canvas, SpiceRect *bbox,
 {
     CanvasBase *canvas = (CanvasBase *)spice_canvas;
     SpiceCanvas *surface_canvas = NULL;
-    StrokeGC gc = { { 0 } };
+    StrokeGC gc;
     lineGCOps ops = {
         stroke_fill_spans,
         stroke_fill_rects
@@ -2997,6 +2997,8 @@ static void canvas_draw_stroke(SpiceCanvas *spice_canvas, SpiceRect *bbox,
     unsigned int i;
     int dashed;
 
+    memset(&gc, 0, sizeof(gc));
+
     pixman_region32_init_rect(&gc.dest_region,
                               bbox->left, bbox->top,
                               bbox->right - bbox->left,
diff --git a/common/sw_canvas.c b/common/sw_canvas.c
index 2c1782b..4b10383 100644
--- a/common/sw_canvas.c
+++ b/common/sw_canvas.c
@@ -659,7 +659,7 @@ static void __blend_image(SpiceCanvas *spice_canvas,
 
     mask = NULL;
     if (overall_alpha != 0xff) {
-        pixman_color_t color = { 0 };
+        pixman_color_t color = { 0, 0, 0, 0 };
         color.alpha = overall_alpha * 0x101;
         mask = pixman_image_create_solid_fill(&color);
     }
@@ -752,7 +752,7 @@ static void __blend_scale_image(SpiceCanvas *spice_canvas,
 
     mask = NULL;
     if (overall_alpha != 0xff) {
-        pixman_color_t color = { 0 };
+        pixman_color_t color = { 0, 0, 0, 0 };
         color.alpha = overall_alpha * 0x101;
         mask = pixman_image_create_solid_fill(&color);
     }
@@ -1044,7 +1044,7 @@ static void canvas_draw_text(SpiceCanvas *spice_canvas, SpiceRect *bbox,
     pixman_region32_t dest_region;
     pixman_image_t *str_mask, *brush;
     SpiceString *str;
-    SpicePoint pos = { 0, };
+    SpicePoint pos = { 0, 0 };
     int depth;
 
     pixman_region32_init_rect(&dest_region,
-- 
1.7.7.6



More information about the Spice-devel mailing list