[Xfce4-commits] [xfce/garcon] 01/01: Fix compilation warnings (Bug #14598)

noreply at xfce.org noreply at xfce.org
Sun Aug 26 15:55:42 CEST 2018


This is an automated email from the git hooks/post-receive script.

e   r   i   c       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/garcon.

commit 1b750f242a196749ffdd3156b559fffc3fc9ffc7
Author: Andre Miranda <andreldm at xfce.org>
Date:   Fri Aug 10 22:07:10 2018 -0300

    Fix compilation warnings (Bug #14598)
---
 garcon-gtk/garcon-gtk-menu.c |  4 ++--
 garcon/garcon-menu-item.c    |  2 +-
 garcon/garcon-menu-merger.c  | 14 ++++++++++++--
 garcon/garcon-menu-node.c    |  6 ++++--
 garcon/garcon-menu-node.h    |  3 ++-
 tests/test-menu-parser.c     |  9 +++++----
 6 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/garcon-gtk/garcon-gtk-menu.c b/garcon-gtk/garcon-gtk-menu.c
index f31a1ed..665e253 100644
--- a/garcon-gtk/garcon-gtk-menu.c
+++ b/garcon-gtk/garcon-gtk-menu.c
@@ -1049,7 +1049,7 @@ garcon_gtk_menu_set_menu (GarconGtkMenu *menu,
     }
 
   if (garcon_menu != NULL)
-    menu->priv->menu = g_object_ref (G_OBJECT (garcon_menu));
+    menu->priv->menu = GARCON_MENU (g_object_ref (G_OBJECT (garcon_menu)));
   else
     menu->priv->menu = NULL;
 
@@ -1076,7 +1076,7 @@ garcon_gtk_menu_get_menu (GarconGtkMenu *menu)
 {
   g_return_val_if_fail (GARCON_GTK_IS_MENU (menu), NULL);
   if (menu->priv->menu != NULL)
-    return g_object_ref (G_OBJECT (menu->priv->menu));
+    return GARCON_MENU (g_object_ref (G_OBJECT (menu->priv->menu)));
   return NULL;
 }
 
diff --git a/garcon/garcon-menu-item.c b/garcon/garcon-menu-item.c
index ca8cb63..a69f228 100644
--- a/garcon/garcon-menu-item.c
+++ b/garcon/garcon-menu-item.c
@@ -1027,7 +1027,7 @@ garcon_menu_item_reload_from_file (GarconMenuItem  *item,
     {
       if (G_LIKELY (item->priv->file != NULL))
         g_object_unref (G_OBJECT (item->priv->file));
-      item->priv->file = g_object_ref (G_OBJECT (file));
+      item->priv->file = G_FILE (g_object_ref (G_OBJECT (file)));
 
       g_object_notify (G_OBJECT (item), "file");
     }
diff --git a/garcon/garcon-menu-merger.c b/garcon/garcon-menu-merger.c
index f263434..24537de 100644
--- a/garcon/garcon-menu-merger.c
+++ b/garcon/garcon-menu-merger.c
@@ -872,6 +872,15 @@ garcon_menu_parser_insert_elements (GNode *node,
 
 
 
+static void
+garcon_menu_merger_object_ref (gpointer data,
+                               gpointer user_data)
+{
+  g_object_ref (G_OBJECT (data));
+}
+
+
+
 static gboolean
 garcon_menu_merger_process_merge_files (GNode                   *node,
                                         GarconMenuMergerContext *context)
@@ -906,7 +915,7 @@ garcon_menu_merger_process_merge_files (GNode                   *node,
       g_object_unref (parser);
 
       merger->priv->file_stack = g_list_copy (context->file_stack);
-      g_list_foreach (merger->priv->file_stack, (GFunc) g_object_ref, NULL);
+      g_list_foreach (merger->priv->file_stack, garcon_menu_merger_object_ref, NULL);
 
       if (G_LIKELY (garcon_menu_merger_run (merger, 
                                             context->merge_files, 
@@ -1028,7 +1037,8 @@ collect_moves (GNode  *node,
 
 
 static gboolean
-remove_moves (GNode *node)
+remove_moves (GNode   *node,
+              gpointer data)
 {
   if (garcon_menu_node_tree_get_node_type (node) == GARCON_MENU_NODE_TYPE_MOVE)
     garcon_menu_node_tree_free (node);
diff --git a/garcon/garcon-menu-node.c b/garcon/garcon-menu-node.c
index f43937e..955c1e6 100644
--- a/garcon/garcon-menu-node.c
+++ b/garcon/garcon-menu-node.c
@@ -276,7 +276,8 @@ garcon_menu_node_create (GarconMenuNodeType node_type,
 
 
 GarconMenuNode *
-garcon_menu_node_copy (GarconMenuNode *node)
+garcon_menu_node_copy (GarconMenuNode *node,
+                       gpointer        data)
 {
   GarconMenuNode *copy;
 
@@ -808,7 +809,8 @@ garcon_menu_node_tree_copy (GNode *tree)
 
 
 static gboolean
-free_children (GNode *tree)
+free_children (GNode   *tree,
+               gpointer data)
 {
   garcon_menu_node_tree_free_data (tree);
   return FALSE;
diff --git a/garcon/garcon-menu-node.h b/garcon/garcon-menu-node.h
index fc20518..132ac7f 100644
--- a/garcon/garcon-menu-node.h
+++ b/garcon/garcon-menu-node.h
@@ -101,7 +101,8 @@ GarconMenuNodeType        garcon_menu_node_get_node_type                (GarconM
 GarconMenuNode           *garcon_menu_node_create                       (GarconMenuNodeType      node_type,
                                                                          gpointer                first_value,
                                                                          ...) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
-GarconMenuNode           *garcon_menu_node_copy                         (GarconMenuNode         *node) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
+GarconMenuNode           *garcon_menu_node_copy                         (GarconMenuNode         *node,
+                                                                         gpointer                data) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
 const gchar              *garcon_menu_node_get_string                   (GarconMenuNode         *node);
 void                      garcon_menu_node_set_string                   (GarconMenuNode         *node,
                                                                          const gchar            *value);
diff --git a/tests/test-menu-parser.c b/tests/test-menu-parser.c
index 43138db..8ec2d9d 100644
--- a/tests/test-menu-parser.c
+++ b/tests/test-menu-parser.c
@@ -36,8 +36,8 @@
 
 
 
-static gboolean print_node (GNode *node,
-                            gint   depth);
+static gboolean print_node (GNode   *node,
+                            gpointer depth);
 
 
 
@@ -77,10 +77,11 @@ print_child_nodes (GNode *node,
 
 
 static gboolean
-print_node (GNode *node,
-            gint   depth)
+print_node (GNode    *node,
+            gpointer  data)
 {
   gint i;
+  gint depth = GPOINTER_TO_INT (data);
 
 #define INDENT {for (i = 0; i < depth; ++i) g_print (" ");}
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list