From 2ba878ca1b709c018caa8fac60322c6e1c768c58 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 30 Jan 2011 02:14:08 -0500 Subject: [PATCH] Silence unused variable warnings in gail --- modules/other/gail/gailentry.c | 9 +++++---- modules/other/gail/gailexpander.c | 2 -- modules/other/gail/gailrenderercell.c | 3 --- modules/other/gail/gailtextview.c | 2 -- modules/other/gail/gailtoplevel.c | 2 -- modules/other/gail/gailtreeview.c | 19 +++---------------- modules/other/gail/tests/ferret.c | 6 ++---- modules/other/gail/tests/testcombo.c | 3 --- modules/other/gail/tests/testlib.c | 3 --- modules/other/gail/tests/testpaned.c | 3 --- 10 files changed, 10 insertions(+), 42 deletions(-) diff --git a/modules/other/gail/gailentry.c b/modules/other/gail/gailentry.c index 9aa9e5f1d..f4a537d34 100644 --- a/modules/other/gail/gailentry.c +++ b/modules/other/gail/gailentry.c @@ -618,7 +618,7 @@ gail_entry_get_character_extents (AtkText *text, GtkWidget *widget; GtkEntry *entry; PangoRectangle char_rect; - gint index, cursor_index, x_layout, y_layout; + gint index, x_layout, y_layout; const gchar *entry_text; gint start_pos, end_pos; @@ -635,8 +635,9 @@ gail_entry_get_character_extents (AtkText *text, entry_text = gtk_entry_get_text (entry); index = g_utf8_offset_to_pointer (entry_text, offset) - entry_text; - cursor_index = g_utf8_offset_to_pointer (entry_text, end_pos) - entry_text; + /* FIXME: entry->preedit cannot be accessed directly + cursor_index = g_utf8_offset_to_pointer (entry_text, end_pos) - entry_text; if (index > cursor_index) index += entry->preedit_length; */ @@ -654,7 +655,7 @@ gail_entry_get_offset_at_point (AtkText *text, { GtkWidget *widget; GtkEntry *entry; - gint index, cursor_index, x_layout, y_layout; + gint index, x_layout, y_layout; const gchar *entry_text; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); @@ -682,8 +683,8 @@ gail_entry_get_offset_at_point (AtkText *text, gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start_pos, &end_pos); - cursor_index = g_utf8_offset_to_pointer (entry_text, end_pos) - entry_text; /* FIXME: entry->preedit_length cannot be accessed directly + cursor_index = g_utf8_offset_to_pointer (entry_text, end_pos) - entry_text; if (index >= cursor_index && entry->preedit_length) { if (index >= cursor_index + entry->preedit_length) diff --git a/modules/other/gail/gailexpander.c b/modules/other/gail/gailexpander.c index 7e1952f79..25251702c 100644 --- a/modules/other/gail/gailexpander.c +++ b/modules/other/gail/gailexpander.c @@ -209,7 +209,6 @@ gail_expander_ref_child (AtkObject *obj, GtkWidget *widget; GtkWidget *label; gint index; - gint count; g_return_val_if_fail (GAIL_IS_CONTAINER (obj), NULL); g_return_val_if_fail ((i >= 0), NULL); @@ -225,7 +224,6 @@ gail_expander_ref_child (AtkObject *obj, */ label = gtk_expander_get_label_widget (GTK_EXPANDER (widget)); if (label) { - count = g_list_length (children); for (index = 0; index <= i; index++) { tmp_list = g_list_nth (children, index); if (label == GTK_WIDGET (tmp_list->data)) { diff --git a/modules/other/gail/gailrenderercell.c b/modules/other/gail/gailrenderercell.c index 233e5c41e..f423947a2 100644 --- a/modules/other/gail/gailrenderercell.c +++ b/modules/other/gail/gailrenderercell.c @@ -70,7 +70,6 @@ gail_renderer_cell_new (void) { GObject *object; AtkObject *atk_object; - GailRendererCell *cell; object = g_object_new (GAIL_TYPE_RENDERER_CELL, NULL); @@ -79,7 +78,5 @@ gail_renderer_cell_new (void) atk_object = ATK_OBJECT (object); atk_object->role = ATK_ROLE_TABLE_CELL; - cell = GAIL_RENDERER_CELL(object); - return atk_object; } diff --git a/modules/other/gail/gailtextview.c b/modules/other/gail/gailtextview.c index 00b45b0aa..a36a82941 100644 --- a/modules/other/gail/gailtextview.c +++ b/modules/other/gail/gailtextview.c @@ -508,7 +508,6 @@ gail_text_view_get_offset_at_point (AtkText *text, AtkCoordType coords) { GtkTextView *view; - GtkTextBuffer *buffer; GtkTextIter loc_itr; gint x_widget, y_widget, x_window, y_window, buff_x, buff_y; GtkWidget *widget; @@ -521,7 +520,6 @@ gail_text_view_get_offset_at_point (AtkText *text, return -1; view = GTK_TEXT_VIEW (widget); - buffer = gtk_text_view_get_buffer (view); window = gtk_text_view_get_window (view, GTK_TEXT_WINDOW_WIDGET); gdk_window_get_origin (window, &x_widget, &y_widget); diff --git a/modules/other/gail/gailtoplevel.c b/modules/other/gail/gailtoplevel.c index 29ff3a593..f0ea75e18 100644 --- a/modules/other/gail/gailtoplevel.c +++ b/modules/other/gail/gailtoplevel.c @@ -341,7 +341,6 @@ is_combo_window (GtkWidget *widget) { GtkWidget *child; AtkObject *obj; - GtkAccessible *accessible; child = gtk_bin_get_child (GTK_BIN (widget)); @@ -360,7 +359,6 @@ is_combo_window (GtkWidget *widget) obj = gtk_widget_get_accessible (child); obj = atk_object_get_parent (obj); - accessible = GTK_ACCESSIBLE (obj); return FALSE; } diff --git a/modules/other/gail/gailtreeview.c b/modules/other/gail/gailtreeview.c index 29c5fac86..7cbaf2031 100644 --- a/modules/other/gail/gailtreeview.c +++ b/modules/other/gail/gailtreeview.c @@ -1479,10 +1479,7 @@ gail_tree_view_add_row_selection (AtkTable *table, else { set_iter_nth_row (tree_view, &iter_to_row, row); - if (&iter_to_row != NULL) - gtk_tree_selection_select_iter (selection, &iter_to_row); - else - return FALSE; + gtk_tree_selection_select_iter (selection, &iter_to_row); } } @@ -3936,7 +3933,6 @@ static void toggle_cell_toggled (GailCell *cell) { GailTreeViewCellInfo *cell_info; - GtkTreeView *tree_view; GtkTreePath *path; gchar *pathstring; GList *renderers, *cur_renderer; @@ -3955,7 +3951,6 @@ toggle_cell_toggled (GailCell *cell) gail_return_if_fail (cell_info->cell_col_ref); gail_return_if_fail (cell_info->cell_row_ref); - tree_view = GTK_TREE_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (parent))); path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref); gail_return_if_fail (path); pathstring = gtk_tree_path_to_string (path); @@ -3993,15 +3988,11 @@ edit_cell (GailCell *cell) GtkTreeView *tree_view; GtkTreePath *path; AtkObject *parent; - gboolean is_container_cell = FALSE; editing = TRUE; parent = atk_object_get_parent (ATK_OBJECT (cell)); if (GAIL_IS_CONTAINER_CELL (parent)) - { - is_container_cell = TRUE; - parent = atk_object_get_parent (parent); - } + parent = atk_object_get_parent (parent); cell_info = find_cell_info (GAIL_TREE_VIEW (parent), cell, NULL, TRUE); gail_return_if_fail (cell_info); @@ -4023,15 +4014,11 @@ activate_cell (GailCell *cell) GtkTreeView *tree_view; GtkTreePath *path; AtkObject *parent; - gboolean is_container_cell = FALSE; editing = TRUE; parent = atk_object_get_parent (ATK_OBJECT (cell)); if (GAIL_IS_CONTAINER_CELL (parent)) - { - is_container_cell = TRUE; - parent = atk_object_get_parent (parent); - } + parent = atk_object_get_parent (parent); cell_info = find_cell_info (GAIL_TREE_VIEW (parent), cell, NULL, TRUE); gail_return_if_fail (cell_info); diff --git a/modules/other/gail/tests/ferret.c b/modules/other/gail/tests/ferret.c index cb9db66df..b8882e812 100644 --- a/modules/other/gail/tests/ferret.c +++ b/modules/other/gail/tests/ferret.c @@ -269,7 +269,8 @@ typedef struct static void _send_to_magnifier(gint x, gint y, gint w, gint h) { - int desc, length_msg; + int desc; + int length_msg G_GNUC_UNUSED; gchar buff[100]; sprintf (buff, "~5:%d,%d", x+w/2, y+h/2); @@ -1330,12 +1331,9 @@ _print_text_attributes (AtkText *aobject) gchar *output_str, *label_str; gint start_offset, end_offset, caret_offset; gint attribute_set_len, attribute_offset, i; - gint n_chars; gint group_num; TabNumber tab_n = TEXT; - n_chars = atk_text_get_character_count(aobject); - group_num = _print_groupname (tab_n, TEXT_ATTRIBUTES, "Text Attributes at Caret"); diff --git a/modules/other/gail/tests/testcombo.c b/modules/other/gail/tests/testcombo.c index ca47eab61..7fdfea3e4 100644 --- a/modules/other/gail/tests/testcombo.c +++ b/modules/other/gail/tests/testcombo.c @@ -14,7 +14,6 @@ static void _check_children (AtkObject *obj) gint n_children, i, j; AtkObject *child; AtkObject *grand_child; - AtkObject *parent; n_children = atk_object_get_n_accessible_children (obj); @@ -28,7 +27,6 @@ static void _check_children (AtkObject *obj) { child = atk_object_ref_accessible_child (obj, 1); g_return_if_fail (atk_object_get_role (child) == ATK_ROLE_TEXT); - parent = atk_object_get_parent (child); j = atk_object_get_index_in_parent (child); if (j != 1) g_print ("*** inconsistency between parent and children %d %d ***\n", @@ -38,7 +36,6 @@ static void _check_children (AtkObject *obj) child = atk_object_ref_accessible_child (obj, 0); g_return_if_fail (atk_object_get_role (child) == ATK_ROLE_LIST); - parent = atk_object_get_parent (child); j = atk_object_get_index_in_parent (child); if (j != 0) g_print ("*** inconsistency between parent and children %d %d ***\n", diff --git a/modules/other/gail/tests/testlib.c b/modules/other/gail/tests/testlib.c index 2b195cede..eea91b502 100644 --- a/modules/other/gail/tests/testlib.c +++ b/modules/other/gail/tests/testlib.c @@ -553,7 +553,6 @@ _create_select_tests_window (AtkObject *obj, TLruntest runtest, OutputWindow **outwin) { - AtkText *textwidget; GtkWidget *hbuttonbox; GtkWidget *scrolledWindow; @@ -561,8 +560,6 @@ _create_select_tests_window (AtkObject *obj, { md[window_no] = (MainDialog *) malloc (sizeof(MainDialog)); - textwidget = ATK_TEXT (obj); - /* Setup Window */ md[window_no]->selecttestsTitle = "Test Setting"; md[window_no]->selecttestsWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/modules/other/gail/tests/testpaned.c b/modules/other/gail/tests/testpaned.c index 3b2a7cb75..748e955a7 100644 --- a/modules/other/gail/tests/testpaned.c +++ b/modules/other/gail/tests/testpaned.c @@ -52,11 +52,8 @@ static gint _test_paned (gpointer data) { AtkObject *obj = ATK_OBJECT (data); AtkRole role = atk_object_get_role (obj); - GtkWidget *widget; static gint times = 0; - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); - if (role == ATK_ROLE_SPLIT_PANE) { GValue *value, val; -- 2.43.2