From bbfa7f6030dcc2b6ddbed15310e08d83f4d9e869 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Forysiuk?= Date: Fri, 29 Apr 2011 03:41:04 +0200 Subject: [PATCH] Fix GCC 4.6 warnings about set but unused variables --- extensions/adblock.c | 4 ++-- extensions/feed-panel/feed-panel.c | 3 --- katze/katze-arrayaction.c | 3 --- katze/katze-scrolled.c | 6 ++---- midori/main.c | 5 ++--- midori/midori-array.c | 2 -- midori/midori-browser.c | 15 +-------------- midori/midori-searchaction.c | 16 ---------------- panels/midori-bookmarks.c | 2 -- 9 files changed, 7 insertions(+), 49 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index 00055b2c..acc74a2f 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -1221,10 +1221,10 @@ adblock_frame_add_private (const gchar* line, if (strchr (data[0], ',')) { gchar** domains; - gint max, i; + gint i; domains = g_strsplit (data[0], ",", -1); - for (max = i = 0; domains[i]; i++) + for (i = 0; domains[i]; i++) { new_blockcss = g_strdup_printf ("%s;\nsites['%s']+=',%s'", blockcssprivate, g_strstrip (domains[i]), data[1]); diff --git a/extensions/feed-panel/feed-panel.c b/extensions/feed-panel/feed-panel.c index efc881c9..760dab69 100644 --- a/extensions/feed-panel/feed-panel.c +++ b/extensions/feed-panel/feed-panel.c @@ -430,11 +430,8 @@ feed_panel_popup_item (GtkWidget* menu, gpointer callback, FeedPanel* panel) { - const gchar* uri; GtkWidget* menuitem; - uri = katze_item_get_uri (item); - menuitem = gtk_image_menu_item_new_from_stock (stock_id, NULL); if (label) gtk_label_set_text_with_mnemonic (GTK_LABEL (gtk_bin_get_child ( diff --git a/katze/katze-arrayaction.c b/katze/katze-arrayaction.c index d448ba65..1f9af0f5 100644 --- a/katze/katze-arrayaction.c +++ b/katze/katze-arrayaction.c @@ -551,7 +551,6 @@ katze_array_action_item_notify_cb (KatzeItem* item, GParamSpec* pspec, GtkToolItem* toolitem) { - KatzeArrayAction* array_action; const gchar* property; const gchar* title; const gchar* desc; @@ -561,8 +560,6 @@ katze_array_action_item_notify_cb (KatzeItem* item, if (!G_IS_PARAM_SPEC_STRING (pspec)) return; - array_action = (KatzeArrayAction*)g_object_get_data ( - G_OBJECT (toolitem), "KatzeArrayAction"); property = g_param_spec_get_name (pspec); if (!strcmp (property, "name")) { diff --git a/katze/katze-scrolled.c b/katze/katze-scrolled.c index 6d2109d6..d9ed5ad9 100644 --- a/katze/katze-scrolled.c +++ b/katze/katze-scrolled.c @@ -311,13 +311,12 @@ do_timeout_scroll (KatzeScrolled* scrolled) GtkScrolledWindow* gtk_scrolled = GTK_SCROLLED_WINDOW (scrolled); GtkAdjustment* hadjustment; GtkAdjustment* vadjustment; - gdouble hpage_size, hupper, hlower, hvalue, new_hvalue; - gdouble vpage_size, vupper, vlower, vvalue, new_vvalue; + gdouble hpage_size, hupper, hvalue, new_hvalue; + gdouble vpage_size, vupper, vvalue, new_vvalue; hadjustment = gtk_scrolled_window_get_hadjustment (gtk_scrolled); hpage_size = gtk_adjustment_get_page_size (hadjustment); hupper = gtk_adjustment_get_upper (hadjustment); - hlower = gtk_adjustment_get_lower (hadjustment); hvalue = gtk_adjustment_get_value (hadjustment); new_hvalue = calculate_timeout_scroll_values (hvalue, hupper - hpage_size, @@ -329,7 +328,6 @@ do_timeout_scroll (KatzeScrolled* scrolled) vadjustment = gtk_scrolled_window_get_vadjustment (gtk_scrolled); vpage_size = gtk_adjustment_get_page_size (vadjustment); vupper = gtk_adjustment_get_upper (vadjustment); - vlower = gtk_adjustment_get_lower (vadjustment); vvalue = gtk_adjustment_get_value (vadjustment); new_vvalue = calculate_timeout_scroll_values (vvalue, vupper - vpage_size, diff --git a/midori/main.c b/midori/main.c index e95fca28..0eba309d 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1536,12 +1536,11 @@ snapshot_load_finished_cb (GtkWidget* web_view, { GError* error; GtkPrintOperation* operation = gtk_print_operation_new (); - GtkPrintOperationAction action = GTK_PRINT_OPERATION_ACTION_EXPORT; - GtkPrintOperationResult result; gtk_print_operation_set_export_filename (operation, filename); error = NULL; - result = webkit_web_frame_print_full (web_frame, operation, action, &error); + webkit_web_frame_print_full (web_frame, operation, + GTK_PRINT_OPERATION_ACTION_EXPORT, &error); if (error != NULL) { diff --git a/midori/midori-array.c b/midori/midori-array.c index c6494715..e6194aa3 100644 --- a/midori/midori-array.c +++ b/midori/midori-array.c @@ -703,12 +703,10 @@ static void string_append_item (GString* string, KatzeItem* item) { - gchar* markup; gchar* metadata; g_return_if_fail (KATZE_IS_ITEM (item)); - markup = NULL; metadata = katze_item_metadata_to_xbel (item); if (KATZE_IS_ARRAY (item)) { diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 345dda6b..e74246be 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -599,10 +599,8 @@ midori_view_notify_title_cb (GtkWidget* widget, MidoriBrowser* browser) { MidoriView* view = MIDORI_VIEW (widget); - const gchar* uri; const gchar* title; - uri = midori_view_get_display_uri (view); title = midori_view_get_display_title (view); if (midori_view_get_load_status (view) == MIDORI_LOAD_COMMITTED) @@ -832,7 +830,7 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, { GtkListStore* model; GtkCellRenderer* renderer; - guint i, n; + guint n; sqlite3_stmt* statement; gint result; const gchar* sqlcmd; @@ -852,7 +850,6 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, 0, _("Toplevel folder"), 1, PANGO_ELLIPSIZE_END, -1); gtk_combo_box_set_active (GTK_COMBO_BOX (combo_folder), 0); - i = 0; n = 1; sqlcmd = "SELECT title from bookmarks where uri=''"; result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); @@ -1496,12 +1493,10 @@ midori_browser_tab_destroy_cb (GtkWidget* widget, MidoriBrowser* browser) { KatzeItem* item; - const gchar* uri; if (browser->proxy_array && MIDORI_IS_VIEW (widget)) { item = midori_view_get_proxy_item (MIDORI_VIEW (widget)); - uri = katze_item_get_uri (item); if (browser->trash && !midori_view_is_blank (MIDORI_VIEW (widget))) katze_array_add_item (browser->trash, item); katze_array_remove_item (browser->proxy_array, item); @@ -4401,7 +4396,6 @@ _action_clear_private_data_activate (GtkAction* action, { GtkWidget* content_area; GdkScreen* screen; - GtkIconTheme* icon_theme; GtkSizeGroup* sizegroup; GtkWidget* hbox; GtkWidget* alignment; @@ -4426,7 +4420,6 @@ _action_clear_private_data_activate (GtkAction* action, screen = gtk_widget_get_screen (GTK_WIDGET (browser)); if (screen) { - icon_theme = gtk_icon_theme_get_for_screen (screen); gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_CLEAR); } sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); @@ -5617,9 +5610,6 @@ static void midori_browser_set_history (MidoriBrowser* browser, KatzeArray* history) { - time_t now; - gint64 day; - if (browser->history == history) return; @@ -5638,9 +5628,6 @@ midori_browser_set_history (MidoriBrowser* browser, g_signal_connect (browser->history, "clear", G_CALLBACK (midori_browser_history_clear_cb), browser); - now = time (NULL); - day = sokoke_time_t_to_julian (&now); - g_object_set (_action_by_name (browser, "Location"), "history", browser->history, NULL); } diff --git a/midori/midori-searchaction.c b/midori/midori-searchaction.c index 34d83743..279ddb0d 100644 --- a/midori/midori-searchaction.c +++ b/midori/midori-searchaction.c @@ -674,8 +674,6 @@ midori_search_action_set_search_engines (MidoriSearchAction* search_action, KatzeArray* search_engines) { GSList* proxies; - GtkWidget* alignment; - GtkWidget* entry; g_return_if_fail (MIDORI_IS_SEARCH_ACTION (search_action)); g_return_if_fail (!search_engines || @@ -702,16 +700,6 @@ midori_search_action_set_search_engines (MidoriSearchAction* search_action, proxies = gtk_action_get_proxies (GTK_ACTION (search_action)); if (!proxies) return; - - do - if (GTK_IS_TOOL_ITEM (proxies->data)) - { - alignment = gtk_bin_get_child (GTK_BIN (proxies->data)); - entry = gtk_bin_get_child (GTK_BIN (alignment)); - - /* FIXME: Unset the current item if it isn't in the list */ - } - while ((proxies = g_slist_next (proxies))); } KatzeItem* @@ -824,13 +812,11 @@ midori_search_action_dialog_render_icon_cb (GtkTreeViewColumn* column, GtkWidget* treeview) { KatzeItem* item; - MidoriSearchAction* search_action; GdkPixbuf* icon; const gchar* icon_name; gtk_tree_model_get (model, iter, 0, &item, -1); - search_action = g_object_get_data (G_OBJECT (treeview), "search-action"); if ((icon = midori_search_action_get_icon (item, treeview, &icon_name, FALSE))) { g_object_set (renderer, "pixbuf", icon, "yalign", 0.25, NULL); @@ -1168,14 +1154,12 @@ static void midori_search_action_dialog_default_cb (GtkWidget* widget, MidoriSearchAction* search_action) { - KatzeArray* search_engines; GtkWidget* treeview; GtkTreeSelection* selection; GtkTreeModel* liststore; GtkTreeIter iter; KatzeItem* item; - search_engines = search_action->search_engines; treeview = search_action->treeview; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); if (gtk_tree_selection_get_selected (selection, &liststore, &iter)) diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index adfe2cf9..680fef64 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -337,10 +337,8 @@ midori_bookmarks_row_changed_cb (GtkTreeModel* model, { KatzeItem* item; GtkTreeIter parent; - sqlite3* db; gchar* parent_name; - db = g_object_get_data (G_OBJECT (bookmarks->array), "db"); gtk_tree_model_get (model, iter, 0, &item, -1); if (gtk_tree_model_iter_parent (model, &parent, iter)) -- 2.39.5