[gnome-builder] gstyle: fix uninitialized variable warnings



commit ef369fd87ce001197e7b7b0fff14d1a97c56e08e
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Tue Sep 11 09:23:34 2018 +0200

    gstyle: fix uninitialized variable warnings
    
    however we never reach this path because of
    the g_assert_not_reached use

 src/gstyle/gstyle-color-panel.c | 6 +++---
 src/gstyle/gstyle-color-plane.c | 6 +++---
 src/gstyle/gstyle-slidein.c     | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/gstyle/gstyle-color-panel.c b/src/gstyle/gstyle-color-panel.c
index e4f1486dc..80ddb05ed 100644
--- a/src/gstyle/gstyle-color-panel.c
+++ b/src/gstyle/gstyle-color-panel.c
@@ -181,7 +181,7 @@ void
 gstyle_color_panel_set_filter (GstyleColorPanel  *self,
                                GstyleColorFilter  filter)
 {
-  GstyleColorFilterFunc filter_func;
+  GstyleColorFilterFunc filter_func = NULL;
 
   g_return_if_fail (GSTYLE_IS_COLOR_PANEL (self));
 
@@ -839,7 +839,7 @@ static void
 set_preferred_unit (GstyleColorPanel *self,
                    GstyleColorUnit  preferred_unit)
 {
-  GIcon *icon;
+  GIcon *icon = NULL;
 
   g_assert (GSTYLE_IS_COLOR_PANEL (self));
 
@@ -974,7 +974,7 @@ void
 _gstyle_color_panel_update_prefs_page (GstyleColorPanel *self,
                                        const gchar      *page_name)
 {
-  GstyleColorPanelPrefs prefs_type;
+  GstyleColorPanelPrefs prefs_type = GSTYLE_COLOR_PANEL_PREFS_COMPONENTS;
 
   g_assert (GSTYLE_IS_COLOR_PANEL (self));
 
diff --git a/src/gstyle/gstyle-color-plane.c b/src/gstyle/gstyle-color-plane.c
index edac9c3be..890dc5d14 100644
--- a/src/gstyle/gstyle-color-plane.c
+++ b/src/gstyle/gstyle-color-plane.c
@@ -236,7 +236,7 @@ set_cursor_from_xyz (GstyleColorPlane *self,
   gdouble hsv_h, hsv_s, hsv_v;
   GstyleCielab lab;
   GdkRGBA rgba = {0};
-  gdouble x, y;
+  gdouble x = 0.0, y = 0.0;
 
   g_assert (GSTYLE_IS_COLOR_PLANE (self));
   g_assert (xyz != NULL);
@@ -361,7 +361,7 @@ gstyle_color_plane_set_preferred_unit (GstyleColorPlane *self,
                                        GstyleColorUnit   preferred_unit)
 {
   GstyleColorPlanePrivate *priv = gstyle_color_plane_get_instance_private (self);
-  gdouble max_range;
+  gdouble max_range = 0.0;
 
   g_return_if_fail (GSTYLE_IS_COLOR_PLANE (self));
 
@@ -1261,7 +1261,7 @@ gstyle_color_plane_set_mode (GstyleColorPlane     *self,
 {
   GstyleColorPlanePrivate *priv = gstyle_color_plane_get_instance_private (self);
   gdouble hsv_h, hsv_s, hsv_v;
-  gdouble ref_val;
+  gdouble ref_val = 0.0;
   GstyleCielab lab;
   GdkRGBA rgba = {0};
 
diff --git a/src/gstyle/gstyle-slidein.c b/src/gstyle/gstyle-slidein.c
index 015c99cb7..08af6afb6 100644
--- a/src/gstyle/gstyle-slidein.c
+++ b/src/gstyle/gstyle-slidein.c
@@ -339,7 +339,7 @@ animate_stop (GstyleSlidein *self)
 static void
 animation_done_cb (GstyleSlidein *self)
 {
-  GstyleSlideinDirectionType animation_direction;
+  GstyleSlideinDirectionType animation_direction = GSTYLE_SLIDEIN_DIRECTION_TYPE_NONE;
 
   g_assert (GSTYLE_IS_SLIDEIN (self));
 


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