fix compile warnings

Fallout from running make CFLAGS="-Werror"; mostly missing casts and
constness issues.
This commit is contained in:
Benjamin Otte 2009-06-17 10:28:03 +02:00
parent 272c30bbc2
commit 1a385c50f0
10 changed files with 21 additions and 18 deletions

View File

@ -211,15 +211,15 @@ do_rotated_text (GtkWidget *do_widget)
label = gtk_label_new (text); label = gtk_label_new (text);
gtk_container_add (GTK_CONTAINER (box), label); gtk_container_add (GTK_CONTAINER (box), label);
gtk_label_set_angle (label, 45); gtk_label_set_angle (GTK_LABEL (label), 45);
/* Set up fancy stuff on the label */ /* Set up fancy stuff on the label */
layout = gtk_label_get_layout (label); layout = gtk_label_get_layout (GTK_LABEL (label));
pango_cairo_context_set_shape_renderer (pango_layout_get_context (layout), pango_cairo_context_set_shape_renderer (pango_layout_get_context (layout),
fancy_shape_renderer, fancy_shape_renderer,
NULL, NULL); NULL, NULL);
attrs = create_fancy_attr_list_for_layout (layout); attrs = create_fancy_attr_list_for_layout (layout);
gtk_label_set_attributes (label, attrs); gtk_label_set_attributes (GTK_LABEL (label), attrs);
pango_attr_list_unref (attrs); pango_attr_list_unref (attrs);
} }

View File

@ -2452,7 +2452,7 @@ gchar *
gdk_pixbuf_format_get_description (GdkPixbufFormat *format) gdk_pixbuf_format_get_description (GdkPixbufFormat *format)
{ {
gchar *domain; gchar *domain;
gchar *description; const gchar *description;
g_return_val_if_fail (format != NULL, NULL); g_return_val_if_fail (format != NULL, NULL);
if (format->domain != NULL) if (format->domain != NULL)

View File

@ -449,7 +449,7 @@ gtk_activatable_do_set_related_action (GtkActivatable *activatable,
/* Some apps are using the object data directly... /* Some apps are using the object data directly...
* so continue to set it for a bit longer * so continue to set it for a bit longer
*/ */
g_object_set_data (activatable, "gtk-action", NULL); g_object_set_data (G_OBJECT (activatable), "gtk-action", NULL);
/* /*
* We don't want prev_action to be activated * We don't want prev_action to be activated
@ -478,7 +478,7 @@ gtk_activatable_do_set_related_action (GtkActivatable *activatable,
_gtk_action_add_to_proxy_list (action, GTK_WIDGET (activatable)); _gtk_action_add_to_proxy_list (action, GTK_WIDGET (activatable));
g_object_set_data (activatable, "gtk-action", action); g_object_set_data (G_OBJECT (activatable), "gtk-action", action);
} }
} }
} }

View File

@ -483,7 +483,7 @@ grab_dnd_keys (GtkWidget *widget,
gdk_flush (); gdk_flush ();
gdk_error_trap_pop (); gdk_error_trap_pop ();
gdk_window_add_filter (NULL, root_key_filter, GDK_WINDOW_XID (window)); gdk_window_add_filter (NULL, root_key_filter, (gpointer) GDK_WINDOW_XID (window));
} }
static void static void
@ -497,7 +497,7 @@ ungrab_dnd_keys (GtkWidget *widget,
window = widget->window; window = widget->window;
root = gdk_screen_get_root_window (gtk_widget_get_screen (widget)); root = gdk_screen_get_root_window (gtk_widget_get_screen (widget));
gdk_window_remove_filter (NULL, root_key_filter, GDK_WINDOW_XID (window)); gdk_window_remove_filter (NULL, root_key_filter, (gpointer) GDK_WINDOW_XID (window));
gdk_error_trap_push (); gdk_error_trap_push ();

View File

@ -1079,7 +1079,8 @@ gtk_handle_box_button_press (GtkWidget *widget,
gint root_x, root_y; gint root_x, root_y;
gint width, height; gint width, height;
gtk_invisible_set_screen (GTK_INVISIBLE (invisible), gtk_widget_get_screen (hb)); gtk_invisible_set_screen (GTK_INVISIBLE (invisible),
gtk_widget_get_screen (GTK_WIDGET (hb)));
gdk_window_get_deskrelative_origin (hb->bin_window, &desk_x, &desk_y); gdk_window_get_deskrelative_origin (hb->bin_window, &desk_x, &desk_y);
gdk_window_get_origin (hb->bin_window, &root_x, &root_y); gdk_window_get_origin (hb->bin_window, &root_x, &root_y);
gdk_drawable_get_size (hb->bin_window, &width, &height); gdk_drawable_get_size (hb->bin_window, &width, &height);

View File

@ -9014,12 +9014,14 @@ gtk_icon_view_accessible_model_row_changed (GtkTreeModel *tree_model,
GtkIconViewItem *item; GtkIconViewItem *item;
GtkIconViewAccessible *a11y_view; GtkIconViewAccessible *a11y_view;
GtkIconViewItemAccessible *a11y_item; GtkIconViewItemAccessible *a11y_item;
gchar *name, *text; const gchar *name;
gchar *text;
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data)); atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
a11y_view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj); a11y_view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
index = gtk_tree_path_get_indices(path)[0]; index = gtk_tree_path_get_indices(path)[0];
a11y_item = gtk_icon_view_accessible_find_child (atk_obj, index); a11y_item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (
gtk_icon_view_accessible_find_child (atk_obj, index));
if (a11y_item) if (a11y_item)
{ {

View File

@ -10331,7 +10331,7 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view)
return; return;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (tree_view)); toplevel = gtk_widget_get_toplevel (GTK_WIDGET (tree_view));
screen = gtk_widget_get_screen (tree_view); screen = gtk_widget_get_screen (GTK_WIDGET (tree_view));
if (tree_view->priv->search_window != NULL) if (tree_view->priv->search_window != NULL)
{ {

View File

@ -2518,17 +2518,17 @@ test_message_area (void)
"</interface>"; "</interface>";
error = NULL; error = NULL;
builder = builder_new_from_string (buffer, -1, &error); builder = builder_new_from_string (buffer, -1, NULL);
g_assert (error == NULL); g_assert (error == NULL);
obj = gtk_builder_get_object (builder, "infobar1"); obj = gtk_builder_get_object (builder, "infobar1");
g_assert (GTK_IS_INFO_BAR (obj)); g_assert (GTK_IS_INFO_BAR (obj));
obj1 = gtk_builder_get_object (builder, "content"); obj1 = gtk_builder_get_object (builder, "content");
g_assert (GTK_IS_LABEL (obj1)); g_assert (GTK_IS_LABEL (obj1));
g_assert (gtk_widget_get_parent (gtk_widget_get_parent (obj1)) == obj); g_assert (gtk_widget_get_parent (gtk_widget_get_parent (GTK_WIDGET (obj1))) == GTK_WIDGET (obj));
obj1 = gtk_builder_get_object (builder, "button_ok"); obj1 = gtk_builder_get_object (builder, "button_ok");
g_assert (GTK_IS_BUTTON (obj1)); g_assert (GTK_IS_BUTTON (obj1));
g_assert (gtk_widget_get_parent (gtk_widget_get_parent (obj1)) == obj); g_assert (gtk_widget_get_parent (gtk_widget_get_parent (GTK_WIDGET (obj1))) == GTK_WIDGET (obj));
g_object_unref (builder); g_object_unref (builder);
} }

View File

@ -2127,7 +2127,7 @@ gail_tree_view_get_cell_area (GailCellParent *parent,
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
cell_index = atk_object_get_index_in_parent (ATK_OBJECT (cell)); cell_index = atk_object_get_index_in_parent (ATK_OBJECT (cell));
renderers = gtk_cel_layout_get_cells (GTK_CELL_LAYOUT (tv_col)); renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tv_col));
renderer = g_list_nth_data (renderers, cell_index); renderer = g_list_nth_data (renderers, cell_index);
found = gtk_tree_view_column_cell_get_position (tv_col, renderer, &cell_start, &cell_width); found = gtk_tree_view_column_cell_get_position (tv_col, renderer, &cell_start, &cell_width);
@ -3177,7 +3177,7 @@ update_cell_value (GailRendererCell *renderer_cell,
gtk_tree_view_column_cell_set_cell_data (cell_info->cell_col_ref, gtk_tree_view_column_cell_set_cell_data (cell_info->cell_col_ref,
tree_model, &iter, is_expander, is_expanded); tree_model, &iter, is_expander, is_expanded);
} }
renderers = gtk_cell_layout_get_cells (GKT_CELL_LAYOUT (cell_info->cell_col_ref)); renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_info->cell_col_ref));
gail_return_val_if_fail (renderers, FALSE); gail_return_val_if_fail (renderers, FALSE);
/* /*

View File

@ -5297,7 +5297,7 @@ entry_toggle_pulse (GtkWidget *checkbutton,
GtkWidget *entry) GtkWidget *entry)
{ {
g_object_set_data (G_OBJECT (entry), "progress-pulse", g_object_set_data (G_OBJECT (entry), "progress-pulse",
GINT_TO_POINTER (GTK_TOGGLE_BUTTON (checkbutton)->active)); GUINT_TO_POINTER ((guint) GTK_TOGGLE_BUTTON (checkbutton)->active));
} }
static void static void