a11y: Fix for -Wmissing-declarations

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.
This commit is contained in:
Benjamin Otte 2012-10-02 19:13:30 +02:00
parent eddac4911f
commit 9e486139ca
7 changed files with 64 additions and 30 deletions

View File

@ -54,6 +54,7 @@ gail_c_sources = \
gailmisc.c
gail_private_h_sources = \
gail.h \
gtkarrowaccessible.h \
gtkbooleancellaccessible.h \
gtkboxaccessible.h \

View File

@ -17,6 +17,8 @@
#include "config.h"
#include "gail.h"
#include <stdio.h>
#include <stdlib.h>

30
gtk/a11y/gail.h Normal file
View File

@ -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__ */

View 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);

View 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))

View 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);
}
}

View File

@ -128,6 +128,7 @@
#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)