From c49ed67ab07dd17fe8cc02af2c19db16db411720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Sun, 16 Nov 2008 01:04:12 +0100 Subject: [PATCH] Correct usage of datatypes in a number of places --- katze/katze-net.h | 2 +- katze/katze-throbber.c | 2 +- katze/katze-utils.c | 3 ++- midori/main.c | 2 +- midori/midori-browser.c | 3 ++- midori/midori-locationaction.c | 4 ++-- midori/midori-locationentry.c | 4 ++-- midori/midori-view.c | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/katze/katze-net.h b/katze/katze-net.h index 2b6f78c8..3aa12805 100644 --- a/katze/katze-net.h +++ b/katze/katze-net.h @@ -55,7 +55,7 @@ typedef struct KatzeNetStatus status; gchar* mime_type; gchar* data; - gsize length; + goffset length; } KatzeNetRequest; typedef gboolean (*KatzeNetStatusCb) (KatzeNetRequest* request, diff --git a/katze/katze-throbber.c b/katze/katze-throbber.c index 9ec60242..68b61bb1 100644 --- a/katze/katze-throbber.c +++ b/katze/katze-throbber.c @@ -793,7 +793,7 @@ katze_throbber_aligned_coords (GtkWidget* widget, gtk_misc_get_alignment (GTK_MISC (widget), &xalign, &yalign); if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - xalign = 1.0 - xalign; + xalign = 1.0f - xalign; gtk_misc_get_padding (GTK_MISC (widget), &xpad, &ypad); *ax = floor (widget->allocation.x + xpad diff --git a/katze/katze-utils.c b/katze/katze-utils.c index f91542e1..048f2428 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -308,7 +308,8 @@ katze_property_proxy (gpointer object, gtk_widget_set_sensitive (widget, pspec->flags & G_PARAM_WRITABLE); - g_object_set_data (G_OBJECT (widget), "property", (gchar*)property); + g_object_set_data_full (G_OBJECT (widget), "property", + g_strdup (property), g_free); return widget; } diff --git a/midori/main.c b/midori/main.c index 2e994ac5..5e0c119c 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1369,7 +1369,7 @@ main (int argc, continue; gchar* fullname = g_build_filename (addon_path, filename, NULL); - gchar* exception = NULL; + exception = NULL; gjs_script_from_file (js_context, fullname, &exception); if (exception) /* FIXME: Do we want to print this somewhere else? */ diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 221ba366..ce8b3049 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2056,7 +2056,8 @@ _action_location_secondary_icon_released (GtkAction* action, menuitem), gtk_image_new_from_stock (STOCK_NEWS_FEED, GTK_ICON_SIZE_MENU)); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); - g_object_set_data (G_OBJECT (menuitem), "uri", (gchar*)uri); + g_object_set_data_full (G_OBJECT (menuitem), + "uri", g_strup ((gchar*)uri), g_free); g_signal_connect (menuitem, "activate", G_CALLBACK (midori_browser_menu_feed_item_activate_cb), browser); diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 57220740..17f1d55f 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -317,7 +317,7 @@ midori_location_action_create_tool_item (GtkAction* action) gtk_tool_item_set_expand (GTK_TOOL_ITEM (toolitem), TRUE); location_entry = midori_location_entry_new (); - alignment = gtk_alignment_new (0, 0.5, 1, 0.1); + alignment = gtk_alignment_new (0.0f, 0.5f, 1.0f, 0.1f); gtk_container_add (GTK_CONTAINER (alignment), location_entry); gtk_widget_show (location_entry); gtk_container_add (GTK_CONTAINER (toolitem), alignment); @@ -339,7 +339,7 @@ midori_location_action_key_press_event_cb (GtkWidget* widget, case GDK_KP_Enter: case GDK_Return: { - if ((uri = gtk_entry_get_text (GTK_ENTRY (widget)))) + if ((uri = gtk_entry_get_text (GTK_ENTRY (widget))) && *uri) { g_signal_emit (action, signals[SUBMIT_URI], 0, uri, (event->state & GDK_MOD1_MASK) ? TRUE : FALSE); diff --git a/midori/midori-locationentry.c b/midori/midori-locationentry.c index 1e9a4766..3f4dd2a8 100644 --- a/midori/midori-locationentry.c +++ b/midori/midori-locationentry.c @@ -72,8 +72,8 @@ gtk_entry_get_pixel_ranges (GtkEntry *entry, PangoLayout *layout = gtk_entry_get_layout (entry); PangoLayoutLine *line = pango_layout_get_lines (layout)->data; const char *text = pango_layout_get_text (layout); - gint start_index = g_utf8_offset_to_pointer (text, start_char) - text; - gint end_index = g_utf8_offset_to_pointer (text, end_char) - text; + gsize start_index = g_utf8_offset_to_pointer (text, start_char) - text; + gsize end_index = g_utf8_offset_to_pointer (text, end_char) - text; gint real_n_ranges, i; pango_layout_line_get_x_ranges (line, diff --git a/midori/midori-view.c b/midori/midori-view.c index d16de49e..65ba2eca 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1313,7 +1313,7 @@ webkit_web_inspector_inspect_web_view_cb (WebKitWebInspector* inspector, gray_icon = gdk_pixbuf_copy (icon); if (gray_icon) { - gdk_pixbuf_saturate_and_pixelate (gray_icon, gray_icon, 0.1, FALSE); + gdk_pixbuf_saturate_and_pixelate (gray_icon, gray_icon, 0.1f, FALSE); gtk_window_set_icon (GTK_WINDOW (window), gray_icon); g_object_unref (gray_icon); }