Avoid unnecessary includes

Including string.h makes the compiler complain about parameters
and variables called index, which is not nice.
This commit is contained in:
Matthias Clasen 2011-07-10 00:02:02 -04:00
parent ddfa756ac7
commit a20c7ed214
4 changed files with 11 additions and 16 deletions

View File

@ -19,7 +19,6 @@
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "gtkpango.h"
#include "gtkentryaccessible.h"
@ -142,7 +141,7 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
gtk_entry = GTK_ENTRY (widget);
entry = GTK_ENTRY_ACCESSIBLE (atk_obj);
if (strcmp (pspec->name, "cursor-position") == 0)
if (g_strcmp0 (pspec->name, "cursor-position") == 0)
{
if (check_for_selection_change (entry, gtk_entry))
g_signal_emit_by_name (atk_obj, "text_selection_changed");
@ -152,19 +151,19 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
g_signal_emit_by_name (atk_obj, "text_caret_moved",
entry->cursor_position);
}
else if (strcmp (pspec->name, "selection-bound") == 0)
else if (g_strcmp0 (pspec->name, "selection-bound") == 0)
{
if (check_for_selection_change (entry, gtk_entry))
g_signal_emit_by_name (atk_obj, "text_selection_changed");
}
else if (strcmp (pspec->name, "editable") == 0)
else if (g_strcmp0 (pspec->name, "editable") == 0)
{
gboolean value;
g_object_get (obj, "editable", &value, NULL);
atk_object_notify_state_change (atk_obj, ATK_STATE_EDITABLE, value);
}
else if (strcmp (pspec->name, "visibility") == 0)
else if (g_strcmp0 (pspec->name, "visibility") == 0)
{
gboolean visibility;
AtkRole new_role;

View File

@ -19,7 +19,6 @@
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "gtkexpanderaccessible.h"
@ -147,13 +146,13 @@ gtk_expander_accessible_notify_gtk (GObject *obj,
expander = GTK_EXPANDER (obj);
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (expander));
;
if (strcmp (pspec->name, "label") == 0)
if (g_strcmp0 (pspec->name, "label") == 0)
{
if (atk_obj->name == NULL)
g_object_notify (G_OBJECT (atk_obj), "accessible-name");
g_signal_emit_by_name (atk_obj, "visible_data_changed");
}
else if (strcmp (pspec->name, "expanded") == 0)
else if (g_strcmp0 (pspec->name, "expanded") == 0)
{
atk_object_notify_state_change (atk_obj, ATK_STATE_CHECKED,
gtk_expander_get_expanded (expander));

View File

@ -19,8 +19,6 @@
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include <gtk/gtkpango.h>
#include "gtklabelaccessible.h"
@ -82,12 +80,12 @@ gtk_label_accessible_notify_gtk (GObject *obj,
accessible = GTK_LABEL_ACCESSIBLE (atk_obj);
if (strcmp (pspec->name, "label") == 0)
if (g_strcmp0 (pspec->name, "label") == 0)
{
const gchar *text;
text = gtk_label_get_text (GTK_LABEL (widget));
if (strcmp (accessible->text, text) == 0)
if (g_strcmp0 (accessible->text, text) == 0)
return;
/* Create a delete text and an insert text signal */
@ -108,13 +106,13 @@ gtk_label_accessible_notify_gtk (GObject *obj,
g_signal_emit_by_name (atk_obj, "visible_data_changed");
}
else if (strcmp (pspec->name, "cursor-position") == 0)
else if (g_strcmp0 (pspec->name, "cursor-position") == 0)
{
g_signal_emit_by_name (atk_obj, "text_caret_moved",
_gtk_label_get_cursor_position (GTK_LABEL (widget)));
g_signal_emit_by_name (atk_obj, "text_selection_changed");
}
else if (strcmp (pspec->name, "selection-bound") == 0)
else if (g_strcmp0 (pspec->name, "selection-bound") == 0)
{
g_signal_emit_by_name (atk_obj, "text_selection_changed");
}

View File

@ -19,7 +19,6 @@
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "gtkscrolledwindowaccessible.h"
@ -31,7 +30,7 @@ visibility_changed (GObject *object,
GParamSpec *pspec,
gpointer user_data)
{
if (!strcmp (pspec->name, "visible"))
if (!g_strcmp0 (pspec->name, "visible"))
{
gint index;
gint n_children;