]> Pileus Git - ~andy/gtk/commitdiff
a11y: Fix for -Wmissing-declarations
authorBenjamin Otte <otte@redhat.com>
Tue, 2 Oct 2012 17:13:30 +0000 (19:13 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 2 Oct 2012 17:32:38 +0000 (19:32 +0200)
I'll add a bunch of fixes for gcc complaining about
-Wmissing-declarations after finding a bunch of cases today where I had
forgotten to make functions static in the CSS code.

A thorn in those patches is G_DEFINE_TYPE() which doesn't allow making
the get_type() function static, so I added definitions for that function
above the G_DEFINE_TYPE().

After those patches, GTK should compile without warnings when this flag
is enabled.

gtk/a11y/Makefile.am
gtk/a11y/gail.c
gtk/a11y/gail.h [new file with mode: 0644]
gtk/a11y/gtkiconviewaccessible.c
gtk/a11y/gtklinkbuttonaccessible.c
gtk/a11y/gtktreeviewaccessible.c
gtk/gtkmain.c

index 303cad6962b9ee013c98cb2789cc54c2406ee872..1bc1419efc4cec373c40ea81e977028ffa78c8de 100644 (file)
@@ -54,6 +54,7 @@ gail_c_sources =                      \
        gailmisc.c
 
 gail_private_h_sources =               \
+       gail.h                          \
        gtkarrowaccessible.h            \
        gtkbooleancellaccessible.h      \
        gtkboxaccessible.h              \
index 82c657e335f851430038f3655da893d5770078c8..8f50846da8452f1fcd56c7db1fd20410a1785aad 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "config.h"
 
+#include "gail.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 
diff --git a/gtk/a11y/gail.h b/gtk/a11y/gail.h
new file mode 100644 (file)
index 0000000..6280451
--- /dev/null
@@ -0,0 +1,30 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GTK_GAIL_H__
+#define __GTK_GAIL_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+void            _gtk_accessibility_shutdown             (void);
+void            _gtk_accessibility_init                 (void);
+
+G_END_DECLS
+
+#endif /* __GTK_GAIL_H__ */
index 40333b7b8c3317c85c0259b0711718582ec4b8cd..533df60f8515958515d34989329f09e697d9e7ee 100644 (file)
@@ -51,6 +51,8 @@ typedef struct
 
 } GtkIconViewItemAccessibleClass;
 
+GType _gtk_icon_view_item_accessible_get_type (void);
+
 static gboolean gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item);
 
 static void atk_component_item_interface_init (AtkComponentIface *iface);
index 37ea3a70e5c101450e1de6f709a0f4c9f9d38ce7..9e002f2efe4fb42cbef536591dc331233221e350 100644 (file)
@@ -37,6 +37,8 @@ struct _GtkLinkButtonAccessibleLinkClass
 
 static void atk_action_interface_init (AtkActionIface *iface);
 
+GType _gtk_link_button_accessible_link_get_type (void);
+
 G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessibleLink, _gtk_link_button_accessible_link, ATK_TYPE_HYPERLINK,
                          G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init))
 
index 6e1d3c7fbd05a4b2ea0b9b2435843653d6ce73da..36fbf31383cf5a76c37a0f4f24ba53e9cfb1757b 100644 (file)
@@ -1669,11 +1669,11 @@ to_visible_column_id (GtkTreeView *treeview,
   return id - invisible;
 }
 
-void
-_gtk_tree_view_accessible_do_add_column (GtkTreeViewAccessible *accessible,
-                                         GtkTreeView           *treeview,
-                                         GtkTreeViewColumn     *column,
-                                         guint                  id)
+static void
+gtk_tree_view_accessible_do_add_column (GtkTreeViewAccessible *accessible,
+                                        GtkTreeView           *treeview,
+                                        GtkTreeViewColumn     *column,
+                                        guint                  id)
 {
   guint row, n_rows, n_cols;
 
@@ -1706,17 +1706,17 @@ _gtk_tree_view_accessible_add_column (GtkTreeView       *treeview,
   if (obj == NULL)
     return;
 
-  _gtk_tree_view_accessible_do_add_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
-                                           treeview,
-                                           column,
-                                           to_visible_column_id (treeview, id));
+  gtk_tree_view_accessible_do_add_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
+                                          treeview,
+                                          column,
+                                          to_visible_column_id (treeview, id));
 }
 
-void
-_gtk_tree_view_accessible_do_remove_column (GtkTreeViewAccessible *accessible,
-                                            GtkTreeView           *treeview,
-                                            GtkTreeViewColumn     *column,
-                                            guint                  id)
+static void
+gtk_tree_view_accessible_do_remove_column (GtkTreeViewAccessible *accessible,
+                                           GtkTreeView           *treeview,
+                                           GtkTreeViewColumn     *column,
+                                           guint                  id)
 {
   GtkTreeViewAccessibleCellInfo *cell_info;
   GHashTableIter iter;
@@ -1761,10 +1761,10 @@ _gtk_tree_view_accessible_remove_column (GtkTreeView       *treeview,
   if (obj == NULL)
     return;
 
-  _gtk_tree_view_accessible_do_remove_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
-                                              treeview,
-                                              column,
-                                              to_visible_column_id (treeview, id));
+  gtk_tree_view_accessible_do_remove_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
+                                             treeview,
+                                             column,
+                                             to_visible_column_id (treeview, id));
 }
 
 void
@@ -1795,10 +1795,10 @@ _gtk_tree_view_accessible_toggle_visibility (GtkTreeView       *treeview,
     {
       id = get_column_number (treeview, column);
 
-      _gtk_tree_view_accessible_do_add_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
-                                               treeview,
-                                               column,
-                                               id);
+      gtk_tree_view_accessible_do_add_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
+                                              treeview,
+                                              column,
+                                              id);
     }
   else
     {
@@ -1815,10 +1815,10 @@ _gtk_tree_view_accessible_toggle_visibility (GtkTreeView       *treeview,
             break;
         }
 
-      _gtk_tree_view_accessible_do_remove_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
-                                                  treeview,
-                                                  column,
-                                                  id);
+      gtk_tree_view_accessible_do_remove_column (GTK_TREE_VIEW_ACCESSIBLE (obj),
+                                                 treeview,
+                                                 column,
+                                                 id);
     }
 }
 
index 1fd7f192888da909fa3e1799aaaad08516558407..80dd3e4db1b36799453996824e8ed17e8a000b75 100644 (file)
 #include "gtkwidgetprivate.h"
 #include "gtkwindowprivate.h"
 
+#include "a11y/gail.h"
 #include "a11y/gailutil.h"
 
 /* Private type definitions
@@ -669,10 +670,6 @@ gettext_initialization (void)
 #endif  
 }
 
-/* XXX: Remove me after getting rid of gail */
-extern void _gtk_accessibility_init (void);
-extern void _gtk_accessibility_shutdown (void);
-
 static void
 do_post_parse_initialization (int    *argc,
                               char ***argv)