[pango/wip/meson: 5/10] examples: Initialize variables



commit c5a6c44e9eaf0d6e2f9d2cbf8c549af479685a08
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed May 17 14:57:41 2017 +0100

    examples: Initialize variables
    
    Avoid a compiler warning for potentially uninitialized variables.

 examples/cairotwisted.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/examples/cairotwisted.c b/examples/cairotwisted.c
index 83645dd..d2d1cd3 100644
--- a/examples/cairotwisted.c
+++ b/examples/cairotwisted.c
@@ -167,7 +167,7 @@ curve_length (double x0, double y0,
   cairo_surface_t *surface;
   cairo_t *cr;
   cairo_path_t *path;
-  cairo_path_data_t *data, current_point;
+  cairo_path_data_t *data, current_point = {0,};
   int i;
   double length;
 
@@ -218,7 +218,7 @@ static parametrization_t *
 parametrize_path (cairo_path_t *path)
 {
   int i;
-  cairo_path_data_t *data, last_move_to, current_point;
+  cairo_path_data_t *data, last_move_to = {0,}, current_point = {0,};
   parametrization_t *parametrization;
 
   parametrization = g_malloc (path->num_data * sizeof (parametrization[0]));
@@ -325,7 +325,7 @@ point_on_path (parametrized_path_t *param,
 {
   int i;
   double ratio, the_y = *y, the_x = *x, dx, dy;
-  cairo_path_data_t *data, last_move_to, current_point;
+  cairo_path_data_t *data, last_move_to = {0,}, current_point = {0,};
   cairo_path_t *path = param->path;
   parametrization_t *parametrization = param->parametrization;
 


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