From d16b32e6c81a1c4072e5591989c485c2c120dfc8 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 8 Mar 2011 19:56:48 +0100 Subject: [PATCH] Fix shadow and missing initialisation warnings --- midori/midori-browser.c | 6 +++--- toolbars/midori-transferbar.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index d4dce14e..44b9cdb4 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -4827,8 +4827,8 @@ static void midori_browser_switch_tab_cb (GtkWidget* menuitem, MidoriBrowser* browser) { - gint index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem), "index")); - midori_browser_set_current_page (browser, index); + gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem), "index")); + midori_browser_set_current_page (browser, page); } static gboolean @@ -4856,7 +4856,7 @@ midori_browser_notebook_button_press_event_after_cb (GtkNotebook* notebook, GList* tabs = gtk_container_get_children (GTK_CONTAINER (notebook)); GtkWidget* menuitem = sokoke_action_create_popup_menu_item ( gtk_action_group_get_action (browser->action_group, "TabNew")); - gint i; + gint i = 0; gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); menuitem = sokoke_action_create_popup_menu_item ( gtk_action_group_get_action (browser->action_group, "UndoTabClose")); diff --git a/toolbars/midori-transferbar.c b/toolbars/midori-transferbar.c index 7a67e252..06d2f6db 100644 --- a/toolbars/midori-transferbar.c +++ b/toolbars/midori-transferbar.c @@ -82,7 +82,7 @@ midori_transferbar_download_notify_progress_cb (WebKitDownload* download, gchar* transfer; gdouble* last_time; guint64* last_size; - gdouble time; + gdouble timestamp; guint64 size; gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress), @@ -92,18 +92,18 @@ midori_transferbar_download_notify_progress_cb (WebKitDownload* download, total = g_format_size_for_display (webkit_download_get_total_size (download)); last_time = g_object_get_data (G_OBJECT (download), "last-time"); last_size = g_object_get_data (G_OBJECT (download), "last-size"); - time = webkit_download_get_elapsed_time (download); + timestamp = webkit_download_get_elapsed_time (download); size = webkit_download_get_current_size (download); - if (time != *last_time) - transfer = g_format_size_for_display ((size - *last_size) / (time - *last_time)); + if (timestamp != *last_time) + transfer = g_format_size_for_display ((size - *last_size) / (timestamp - *last_time)); else /* i18n: Unknown number of bytes, used for transfer rate like ?B/s */ transfer = g_strdup (_("?B")); /* i18n: Download tooltip, 4KB of 43MB, 130KB/s */ size_text = g_strdup_printf (_("%s of %s, %s/s"), current, total, transfer); - if (time - *last_time > 5.0) + if (timestamp - *last_time > 5.0) { - *last_time = time; + *last_time = timestamp; *last_size = size; } g_free (current); -- 2.39.5