[gnome-builder/gnome-builder-3-26] fix various uninitialized warnings



commit 7649d9ed09fc1f6abe82a7d1a1b579f8a14a0274
Author: Christian Hergert <chergert redhat com>
Date:   Sun Dec 17 02:55:01 2017 -0800

    fix various uninitialized warnings

 contrib/gstyle/gstyle-colorlexer.c                 |    2 +-
 contrib/gstyle/gstyle-palette.c                    |    4 ++--
 plugins/clang/ide-clang-code-indexer.c             |    2 +-
 .../flatpak/gbp-flatpak-configuration-provider.c   |    2 +-
 plugins/xml-pack/ide-xml-rng-parser.c              |    2 +-
 plugins/xml-pack/ide-xml-sax.c                     |   12 ++++++------
 plugins/xml-pack/ide-xml-symbol-node.c             |    2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/contrib/gstyle/gstyle-colorlexer.c b/contrib/gstyle/gstyle-colorlexer.c
index e1db50b..7b7e2b2 100644
--- a/contrib/gstyle/gstyle-colorlexer.c
+++ b/contrib/gstyle/gstyle-colorlexer.c
@@ -2980,7 +2980,7 @@ gstyle_colorlexer_parse (const gchar *data)
 {
   GPtrArray *ar;
   GstyleColorItem *item;
-  GstyleColorScanner s;
+  GstyleColorScanner s = { 0 };
   gint token;
 
   if (gstyle_str_empty0 (data))
diff --git a/contrib/gstyle/gstyle-palette.c b/contrib/gstyle/gstyle-palette.c
index b2acb6d..b5f9112 100644
--- a/contrib/gstyle/gstyle-palette.c
+++ b/contrib/gstyle/gstyle-palette.c
@@ -133,8 +133,8 @@ static GstyleColor *
 gstyle_palette_xml_get_color (xmlTextReaderPtr reader)
 {
   GstyleColor *color = NULL;
-  g_autofree gchar *name;
-  g_autofree gchar *value;
+  g_autofree gchar *name = NULL;
+  g_autofree gchar *value = NULL;
 
   g_assert (reader != NULL);
 
diff --git a/plugins/clang/ide-clang-code-indexer.c b/plugins/clang/ide-clang-code-indexer.c
index 7962cb4..cb8d0ec 100644
--- a/plugins/clang/ide-clang-code-indexer.c
+++ b/plugins/clang/ide-clang-code-indexer.c
@@ -145,7 +145,7 @@ ide_clang_code_indexer_generate_key_cb (GObject       *object,
   g_autoptr(IdeClangTranslationUnit) unit = NULL;
   g_autoptr(GTask) task = user_data;
   g_autoptr(GError) error = NULL;
-  g_autofree gchar *key;
+  g_autofree gchar *key = NULL;
   IdeSourceLocation *location;
 
   g_assert (IDE_IS_CLANG_SERVICE (service));
diff --git a/plugins/flatpak/gbp-flatpak-configuration-provider.c 
b/plugins/flatpak/gbp-flatpak-configuration-provider.c
index 91f6875..c849698 100644
--- a/plugins/flatpak/gbp-flatpak-configuration-provider.c
+++ b/plugins/flatpak/gbp-flatpak-configuration-provider.c
@@ -109,7 +109,7 @@ gbp_flatpak_configuration_provider_save_worker (GTask        *task,
       gboolean in_build_options;
       gboolean config_opts_replaced;
       gboolean build_options_replaced;
-      guint opts_per_line;
+      guint opts_per_line = 0;
       guint nested_curly_braces;
 
       GbpFlatpakConfiguration *configuration = (GbpFlatpakConfiguration *)g_ptr_array_index 
(self->configurations, i);
diff --git a/plugins/xml-pack/ide-xml-rng-parser.c b/plugins/xml-pack/ide-xml-rng-parser.c
index aee81f5..ca2e835 100644
--- a/plugins/xml-pack/ide-xml-rng-parser.c
+++ b/plugins/xml-pack/ide-xml-rng-parser.c
@@ -1977,7 +1977,7 @@ ide_xml_rng_parser_parse (IdeXmlRngParser *self,
                           GFile           *file)
 {
   IdeXmlSchema *schema = NULL;
-  g_autofree gchar *url;
+  g_autofree gchar *url = NULL;
   xmlDoc *doc;
   xmlNode *root;
   gint options;
diff --git a/plugins/xml-pack/ide-xml-sax.c b/plugins/xml-pack/ide-xml-sax.c
index a0f445c..0a4415f 100644
--- a/plugins/xml-pack/ide-xml-sax.c
+++ b/plugins/xml-pack/ide-xml-sax.c
@@ -337,12 +337,12 @@ ide_xml_sax_get_location (IdeXmlSax    *self,
                           const gchar **content,
                           gsize        *size)
 {
-  gint tmp_line;
-  gint tmp_line_offset;
-  gint tmp_end_line;
-  gint tmp_end_line_offset;
-  const gchar *tmp_content;
-  gsize tmp_size;
+  gint tmp_line = 0;
+  gint tmp_line_offset = 0;
+  gint tmp_end_line = 0;
+  gint tmp_end_line_offset = 0;
+  const gchar *tmp_content = NULL;
+  gsize tmp_size = 0;
 
   g_return_val_if_fail (IDE_IS_XML_SAX (self), FALSE);
   g_return_val_if_fail (self->context != NULL, FALSE);
diff --git a/plugins/xml-pack/ide-xml-symbol-node.c b/plugins/xml-pack/ide-xml-symbol-node.c
index 8aaa988..9fa48f5 100644
--- a/plugins/xml-pack/ide-xml-symbol-node.c
+++ b/plugins/xml-pack/ide-xml-symbol-node.c
@@ -737,7 +737,7 @@ ide_xml_symbol_node_print (IdeXmlSymbolNode  *self,
                            gboolean           show_value,
                            gboolean           show_attributes)
 {
-  g_autofree gchar *spacer;
+  g_autofree gchar *spacer = NULL;
   guint n_children;
   IdeXmlSymbolNode *child;
   Attribute *attr;


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