[libgd] Fix gcc warnings



commit 840b6826be4299a405259d16593f0e6860d8fd94
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Feb 28 17:25:37 2013 -0500

    Fix gcc warnings

 libgd/gd-header-bar.c    |    5 +++--
 libgd/gd-header-button.c |   15 ---------------
 libgd/gd-icon-utils.c    |    2 +-
 libgd/gd-main-view.c     |    5 +++--
 4 files changed, 7 insertions(+), 20 deletions(-)
---
diff --git a/libgd/gd-header-bar.c b/libgd/gd-header-bar.c
index c362ded..0d5fcec 100644
--- a/libgd/gd-header-bar.c
+++ b/libgd/gd-header-bar.c
@@ -19,6 +19,8 @@
 
 #include "gd-header-bar.h"
 
+#include <string.h>
+
 /* TODO
  * - wm communication
  */
@@ -159,7 +161,6 @@ gd_header_bar_get_size (GtkWidget      *widget,
   GList *l;
   gint nvis_children;
   gint minimum, natural;
-  gint padding;
   GtkBorder css_borders;
 
   minimum = natural = 0;
@@ -493,7 +494,7 @@ gd_header_bar_size_allocate (GtkWidget     *widget,
          i = nvis_children - 1;
        }
 
-      for (l; l != NULL; (packing == GTK_PACK_START) ? (l = l->next) : (l = l->prev))
+      for (; l != NULL; (packing == GTK_PACK_START) ? (l = l->next) : (l = l->prev))
         {
           child = l->data;
           if (!gtk_widget_get_visible (child->widget))
diff --git a/libgd/gd-header-button.c b/libgd/gd-header-button.c
index 9dd16c5..4e27c43 100644
--- a/libgd/gd-header-button.c
+++ b/libgd/gd-header-button.c
@@ -235,13 +235,6 @@ rebuild_child (GdHeaderButton *self)
     }
 }
 
-static const gchar *
-button_get_label (GdHeaderButton *self)
-{
-  GdHeaderButtonPrivate *priv = GET_PRIVATE (self);
-  return priv->label;
-}
-
 static void
 button_set_label (GdHeaderButton *self,
                   const gchar    *label)
@@ -273,13 +266,6 @@ button_set_use_markup (GdHeaderButton *self,
     }
 }
 
-static const gchar *
-button_get_symbolic_icon_name (GdHeaderButton *self)
-{
-  GdHeaderButtonPrivate *priv = GET_PRIVATE (self);
-  return priv->symbolic_icon_name;
-}
-
 static void
 button_set_symbolic_icon_name (GdHeaderButton *self,
                                const gchar    *symbolic_icon_name)
@@ -315,7 +301,6 @@ gd_header_button_generic_set_property (GObject      *object,
                                        GParamSpec   *pspec)
 {
   GdHeaderButton *self = GD_HEADER_BUTTON (object);
-  GdHeaderButtonPrivate *priv = GET_PRIVATE (self);
 
   switch (prop_id)
     {
diff --git a/libgd/gd-icon-utils.c b/libgd/gd-icon-utils.c
index 79611d2..37a5606 100644
--- a/libgd/gd-icon-utils.c
+++ b/libgd/gd-icon-utils.c
@@ -82,7 +82,7 @@ gd_create_symbolic_icon (const gchar *name,
     goto out;
 
   pixbuf = gtk_icon_info_load_symbolic_for_context (info, style, NULL, NULL);
-  gtk_icon_info_free (info);
+  g_object_unref (info);
 
   if (pixbuf == NULL)
     goto out;
diff --git a/libgd/gd-main-view.c b/libgd/gd-main-view.c
index d22bd7e..8e23083 100644
--- a/libgd/gd-main-view.c
+++ b/libgd/gd-main-view.c
@@ -230,7 +230,7 @@ gd_main_view_get_counter_icon (GdMainView *self,
   PangoLayout *layout;
   PangoAttrList *attr_list;
   PangoAttribute *attr;
-  const PangoFontDescription *desc;
+  PangoFontDescription *desc;
   GdkRGBA color;
 
   context = gtk_widget_get_style_context (GTK_WIDGET (self));
@@ -272,8 +272,9 @@ gd_main_view_get_counter_icon (GdMainView *self,
   pango_attr_list_insert (attr_list, attr);
   pango_layout_set_attributes (layout, attr_list);
 
-  desc = gtk_style_context_get_font (context, 0);
+  gtk_style_context_get (context, GTK_STATE_FLAG_NORMAL, "font", &desc, NULL);
   pango_layout_set_font_description (layout, desc);
+  pango_font_description_free (desc);
 
   gtk_style_context_get_color (context, 0, &color);
   gdk_cairo_set_source_rgba (emblem_cr, &color);


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