Correct usage of datatypes in a number of places

This commit is contained in:
Enrico Tröger 2008-11-16 01:04:12 +01:00 committed by Christian Dywan
parent b9a183c316
commit c49ed67ab0
8 changed files with 12 additions and 10 deletions

View file

@ -55,7 +55,7 @@ typedef struct
KatzeNetStatus status;
gchar* mime_type;
gchar* data;
gsize length;
goffset length;
} KatzeNetRequest;
typedef gboolean (*KatzeNetStatusCb) (KatzeNetRequest* request,

View file

@ -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

View file

@ -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;
}

View file

@ -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? */

View file

@ -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);

View file

@ -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);

View file

@ -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,

View file

@ -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);
}