Commit 4dddfb2d authored by Matthias Clasen's avatar Matthias Clasen

Remove excess calls to g_return_if_fail from static and virtual functions.

parent 95ab2a72
2002-01-30 Matthias Clasen <matthiasc@poet.de>
* gtk/*.c: Remove excess g_return_if_fail calls from static
and virtual functions.
2002-01-30 Anders Carlsson <andersca@gnu.org>
* gtk/gtkstyle.c (gtk_default_render_icon): Allow a -1 icon size.
......
2002-01-30 Matthias Clasen <matthiasc@poet.de>
* gtk/*.c: Remove excess g_return_if_fail calls from static
and virtual functions.
2002-01-30 Anders Carlsson <andersca@gnu.org>
* gtk/gtkstyle.c (gtk_default_render_icon): Allow a -1 icon size.
......
2002-01-30 Matthias Clasen <matthiasc@poet.de>
* gtk/*.c: Remove excess g_return_if_fail calls from static
and virtual functions.
2002-01-30 Anders Carlsson <andersca@gnu.org>
* gtk/gtkstyle.c (gtk_default_render_icon): Allow a -1 icon size.
......
2002-01-30 Matthias Clasen <matthiasc@poet.de>
* gtk/*.c: Remove excess g_return_if_fail calls from static
and virtual functions.
2002-01-30 Anders Carlsson <andersca@gnu.org>
* gtk/gtkstyle.c (gtk_default_render_icon): Allow a -1 icon size.
......
2002-01-30 Matthias Clasen <matthiasc@poet.de>
* gtk/*.c: Remove excess g_return_if_fail calls from static
and virtual functions.
2002-01-30 Anders Carlsson <andersca@gnu.org>
* gtk/gtkstyle.c (gtk_default_render_icon): Allow a -1 icon size.
......
2002-01-30 Matthias Clasen <matthiasc@poet.de>
* gtk/*.c: Remove excess g_return_if_fail calls from static
and virtual functions.
2002-01-30 Anders Carlsson <andersca@gnu.org>
* gtk/gtkstyle.c (gtk_default_render_icon): Allow a -1 icon size.
......
2002-01-30 Matthias Clasen <matthiasc@poet.de>
* gtk/*.c: Remove excess g_return_if_fail calls from static
and virtual functions.
2002-01-30 Anders Carlsson <andersca@gnu.org>
* gtk/gtkstyle.c (gtk_default_render_icon): Allow a -1 icon size.
......
......@@ -210,11 +210,7 @@ gtk_accel_label_new (const gchar *string)
static void
gtk_accel_label_destroy (GtkObject *object)
{
GtkAccelLabel *accel_label;
g_return_if_fail (GTK_IS_ACCEL_LABEL (object));
accel_label = GTK_ACCEL_LABEL (object);
GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (object);
gtk_accel_label_set_accel_widget (accel_label, NULL);
gtk_accel_label_set_accel_closure (accel_label, NULL);
......@@ -268,15 +264,10 @@ static void
gtk_accel_label_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkAccelLabel *accel_label;
GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (widget);
PangoLayout *layout;
gint width;
g_return_if_fail (GTK_IS_ACCEL_LABEL (widget));
g_return_if_fail (requisition != NULL);
accel_label = GTK_ACCEL_LABEL (widget);
if (GTK_WIDGET_CLASS (parent_class)->size_request)
GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
......@@ -291,15 +282,9 @@ static gboolean
gtk_accel_label_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
GtkMisc *misc;
GtkAccelLabel *accel_label;
GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (widget);
GtkMisc *misc = GTK_MISC (accel_label);
PangoLayout *layout;
g_return_val_if_fail (GTK_IS_ACCEL_LABEL (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
accel_label = GTK_ACCEL_LABEL (widget);
misc = GTK_MISC (accel_label);
if (GTK_WIDGET_DRAWABLE (accel_label))
{
......
......@@ -297,9 +297,6 @@ gtk_alignment_size_request (GtkWidget *widget,
GtkAlignment *alignment;
GtkBin *bin;
g_return_if_fail (GTK_IS_ALIGNMENT (widget));
g_return_if_fail (requisition != NULL);
alignment = GTK_ALIGNMENT (widget);
bin = GTK_BIN (widget);
......@@ -328,9 +325,6 @@ gtk_alignment_size_allocate (GtkWidget *widget,
gint width, height;
gint x, y;
g_return_if_fail (GTK_IS_ALIGNMENT (widget));
g_return_if_fail (allocation != NULL);
widget->allocation = *allocation;
alignment = GTK_ALIGNMENT (widget);
bin = GTK_BIN (widget);
......
......@@ -234,10 +234,6 @@ gtk_arrow_expose (GtkWidget *widget,
gint extent;
gfloat xalign;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_ARROW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
{
arrow = GTK_ARROW (widget);
......
......@@ -267,6 +267,8 @@ void
gtk_button_box_set_child_size (GtkButtonBox *widget,
gint width, gint height)
{
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
widget->child_min_width = width;
widget->child_min_height = height;
}
......@@ -275,6 +277,8 @@ void
gtk_button_box_set_child_ipadding (GtkButtonBox *widget,
gint ipad_x, gint ipad_y)
{
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
widget->child_ipad_x = ipad_x;
widget->child_ipad_y = ipad_y;
}
......@@ -283,6 +287,7 @@ void
gtk_button_box_set_layout (GtkButtonBox *widget,
GtkButtonBoxStyle layout_style)
{
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
g_return_if_fail (layout_style >= GTK_BUTTONBOX_DEFAULT_STYLE &&
layout_style <= GTK_BUTTONBOX_END);
......@@ -301,6 +306,10 @@ void
gtk_button_box_get_child_size (GtkButtonBox *widget,
gint *width, gint *height)
{
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
g_return_if_fail (width != NULL);
g_return_if_fail (height != NULL);
*width = widget->child_min_width;
*height = widget->child_min_height;
}
......@@ -309,6 +318,10 @@ void
gtk_button_box_get_child_ipadding (GtkButtonBox *widget,
gint* ipad_x, gint *ipad_y)
{
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
g_return_if_fail (ipad_x != NULL);
g_return_if_fail (ipad_y != NULL);
*ipad_x = widget->child_ipad_x;
*ipad_y = widget->child_ipad_y;
}
......
......@@ -109,13 +109,10 @@ static void
gtk_bin_add (GtkContainer *container,
GtkWidget *child)
{
GtkBin *bin;
GtkBin *bin = GTK_BIN (container);
g_return_if_fail (GTK_IS_BIN (container));
g_return_if_fail (GTK_IS_WIDGET (child));
bin = GTK_BIN (container);
if (bin->child != NULL)
{
g_warning ("Attempting to add a widget with type %s to a %s, "
......@@ -136,13 +133,10 @@ static void
gtk_bin_remove (GtkContainer *container,
GtkWidget *child)
{
GtkBin *bin;
GtkBin *bin = GTK_BIN (container);
gboolean widget_was_visible;
g_return_if_fail (GTK_IS_BIN (container));
g_return_if_fail (GTK_IS_WIDGET (child));
bin = GTK_BIN (container);
g_return_if_fail (bin->child == child);
widget_was_visible = GTK_WIDGET_VISIBLE (child);
......@@ -163,13 +157,10 @@ gtk_bin_forall (GtkContainer *container,
GtkCallback callback,
gpointer callback_data)
{
GtkBin *bin;
GtkBin *bin = GTK_BIN (container);
g_return_if_fail (GTK_IS_BIN (container));
g_return_if_fail (callback != NULL);
bin = GTK_BIN (container);
if (bin->child)
(* callback) (bin->child, callback_data);
}
......
......@@ -548,7 +548,6 @@ gtk_binding_set_activate (GtkBindingSet *binding_set,
GtkBindingEntry *entry;
g_return_val_if_fail (binding_set != NULL, FALSE);
g_return_val_if_fail (object != NULL, FALSE);
g_return_val_if_fail (GTK_IS_OBJECT (object), FALSE);
keyval = gdk_keyval_to_lower (keyval);
......@@ -926,7 +925,6 @@ gtk_bindings_activate (GtkObject *object,
GtkWidget *widget;
gboolean handled = FALSE;
g_return_val_if_fail (object != NULL, FALSE);
g_return_val_if_fail (GTK_IS_OBJECT (object), FALSE);
if (!GTK_IS_WIDGET (object))
......
......@@ -356,7 +356,7 @@ gtk_box_pack_start (GtkBox *box,
GtkBoxChild *child_info;
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (child->parent == NULL);
child_info = g_new (GtkBoxChild, 1);
......@@ -391,7 +391,7 @@ gtk_box_pack_end (GtkBox *box,
GtkBoxChild *child_info;
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (child->parent == NULL);
child_info = g_new (GtkBoxChild, 1);
......@@ -420,9 +420,6 @@ void
gtk_box_pack_start_defaults (GtkBox *box,
GtkWidget *child)
{
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (child != NULL);
gtk_box_pack_start (box, child, TRUE, TRUE, 0);
}
......@@ -430,9 +427,6 @@ void
gtk_box_pack_end_defaults (GtkBox *box,
GtkWidget *child)
{
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (child != NULL);
gtk_box_pack_end (box, child, TRUE, TRUE, 0);
}
......@@ -505,7 +499,7 @@ gtk_box_reorder_child (GtkBox *box,
GList *list;
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_WIDGET (child));
list = box->children;
while (list)
......@@ -572,7 +566,7 @@ gtk_box_query_child_packing (GtkBox *box,
GtkBoxChild *child_info = NULL;
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_WIDGET (child));
list = box->children;
while (list)
......@@ -609,7 +603,7 @@ gtk_box_set_child_packing (GtkBox *box,
GtkBoxChild *child_info = NULL;
g_return_if_fail (GTK_IS_BOX (box));
g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_WIDGET (child));
list = box->children;
while (list)
......@@ -646,9 +640,6 @@ static void
gtk_box_add (GtkContainer *container,
GtkWidget *widget)
{
g_return_if_fail (GTK_IS_BOX (container));
g_return_if_fail (widget != NULL);
gtk_box_pack_start_defaults (GTK_BOX (container), widget);
}
......@@ -660,9 +651,6 @@ gtk_box_remove (GtkContainer *container,
GtkBoxChild *child;
GList *children;
g_return_if_fail (GTK_IS_BOX (container));
g_return_if_fail (widget != NULL);
box = GTK_BOX (container);
children = box->children;
......@@ -704,7 +692,6 @@ gtk_box_forall (GtkContainer *container,
GtkBoxChild *child;
GList *children;
g_return_if_fail (GTK_IS_BOX (container));
g_return_if_fail (callback != NULL);
box = GTK_BOX (container);
......
......@@ -595,8 +595,6 @@ gtk_button_realize (GtkWidget *widget)
gint attributes_mask;
gint border_width;
g_return_if_fail (GTK_IS_BUTTON (widget));
button = GTK_BUTTON (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
......@@ -908,10 +906,6 @@ static gboolean
gtk_button_expose (GtkWidget *widget,
GdkEventExpose *event)
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_BUTTON (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
{
GtkButton *button = GTK_BUTTON (widget);
......@@ -933,10 +927,6 @@ gtk_button_button_press (GtkWidget *widget,
{
GtkButton *button;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_BUTTON (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (event->type == GDK_BUTTON_PRESS)
{
button = GTK_BUTTON (widget);
......@@ -957,10 +947,6 @@ gtk_button_button_release (GtkWidget *widget,
{
GtkButton *button;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_BUTTON (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (event->button == 1)
{
button = GTK_BUTTON (widget);
......@@ -994,10 +980,6 @@ gtk_button_enter_notify (GtkWidget *widget,
GtkButton *button;
GtkWidget *event_widget;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_BUTTON (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
button = GTK_BUTTON (widget);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
......@@ -1018,10 +1000,6 @@ gtk_button_leave_notify (GtkWidget *widget,
GtkButton *button;
GtkWidget *event_widget;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_BUTTON (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
button = GTK_BUTTON (widget);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
......@@ -1079,8 +1057,6 @@ gtk_real_button_activate (GtkButton *button)
{
GtkWidget *widget = GTK_WIDGET (button);
g_return_if_fail (GTK_IS_BUTTON (button));
if (GTK_WIDGET_REALIZED (button) && !button->activate_timeout)
{
if (gdk_keyboard_grab (button->event_window, TRUE,
......
......@@ -1014,8 +1014,6 @@ gtk_calendar_realize (GtkWidget *widget)
gint attributes_mask;
GdkGCValues values;
g_return_if_fail (GTK_IS_CALENDAR (widget));
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
......@@ -1088,8 +1086,6 @@ gtk_calendar_unrealize (GtkWidget *widget)
GtkCalendarPrivateData *private_data;
gint i;
g_return_if_fail (GTK_IS_CALENDAR (widget));
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
......@@ -1313,9 +1309,6 @@ gtk_calendar_size_allocate (GtkWidget *widget,
GtkCalendar *calendar;
GtkCalendarPrivateData *private_data;
g_return_if_fail (GTK_IS_CALENDAR (widget));
g_return_if_fail (allocation != NULL);
widget->allocation = *allocation;
calendar = GTK_CALENDAR (widget);
......@@ -1408,10 +1401,6 @@ gtk_calendar_expose (GtkWidget *widget,
GtkCalendar *calendar;
GtkCalendarPrivateData *private_data;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CALENDAR (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
......@@ -2086,7 +2075,6 @@ gtk_calendar_select_month (GtkCalendar *calendar,
guint month,
guint year)
{
g_return_val_if_fail (calendar != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
g_return_val_if_fail (month <= 11, FALSE);
......@@ -2158,7 +2146,6 @@ gboolean
gtk_calendar_mark_day (GtkCalendar *calendar,
guint day)
{
g_return_val_if_fail (calendar != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
if (day >= 1 && day <= 31 && calendar->marked_date[day-1] == FALSE)
......@@ -2178,7 +2165,6 @@ gboolean
gtk_calendar_unmark_day (GtkCalendar *calendar,
guint day)
{
g_return_val_if_fail (calendar != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
if (day >= 1 && day <= 31 && calendar->marked_date[day-1] == TRUE)
......@@ -2222,10 +2208,6 @@ gtk_calendar_button_press (GtkWidget *widget,
gint x, y;
void (* action_func) (GtkCalendar *);
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CALENDAR (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
......@@ -2302,9 +2284,6 @@ gtk_calendar_enter_notify (GtkWidget *widget,
GtkCalendar *calendar;
GtkCalendarPrivateData *private_data;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
......@@ -2344,9 +2323,6 @@ gtk_calendar_leave_notify (GtkWidget *widget,
gint row;
gint col;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
......@@ -2398,8 +2374,6 @@ gtk_calendar_paint_arrow (GtkWidget *widget,
gint state;
gint width, height;
g_return_if_fail (widget != NULL);
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
......@@ -2476,8 +2450,6 @@ gtk_calendar_set_background (GtkWidget *widget)
GtkCalendarPrivateData *private_data;
gint i;
g_return_if_fail (GTK_IS_CALENDAR (widget));
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
......@@ -2511,8 +2483,6 @@ static void
gtk_calendar_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
g_return_if_fail (GTK_IS_CALENDAR (widget));
if (previous_style && GTK_WIDGET_REALIZED (widget))
gtk_calendar_set_background(widget);
}
......@@ -2521,8 +2491,6 @@ static void
gtk_calendar_state_changed (GtkWidget *widget,
GtkStateType previous_state)
{
g_return_if_fail (GTK_IS_CALENDAR (widget));
gtk_calendar_set_background (widget);
}
......@@ -2545,10 +2513,6 @@ gtk_calendar_key_press (GtkWidget *widget,
gint old_focus_row;
gint old_focus_col;
gint row, col, day;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CALENDAR (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
calendar = GTK_CALENDAR (widget);
return_val = FALSE;
......
......@@ -214,12 +214,7 @@ static void
gtk_check_button_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkToggleButton *toggle_button;
g_return_if_fail (GTK_IS_CHECK_BUTTON (widget));
g_return_if_fail (requisition != NULL);
toggle_button = GTK_TOGGLE_BUTTON (widget);
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (widget);
if (toggle_button->draw_indicator)
{
......@@ -271,9 +266,6 @@ gtk_check_button_size_allocate (GtkWidget *widget,
GtkButton *button;
GtkAllocation child_allocation;
g_return_if_fail (GTK_IS_CHECK_BUTTON (widget));
g_return_if_fail (allocation != NULL);
button = GTK_BUTTON (widget);
check_button = GTK_CHECK_BUTTON (widget);
toggle_button = GTK_TOGGLE_BUTTON (widget);
......@@ -335,10 +327,6 @@ gtk_check_button_expose (GtkWidget *widget,
GtkToggleButton *toggle_button;
GtkBin *bin;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CHECK_BUTTON (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
check_button = GTK_CHECK_BUTTON (widget);
toggle_button = GTK_TOGGLE_BUTTON (widget);
bin = GTK_BIN (widget);
......@@ -395,8 +383,6 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
gboolean interior_focus;
GdkWindow *window;
g_return_if_fail (GTK_IS_CHECK_BUTTON (check_button));
widget = GTK_WIDGET (check_button);
toggle_button = GTK_TOGGLE_BUTTON (check_button);
......
......@@ -308,10 +308,6 @@ static gint
gtk_check_menu_item_expose (GtkWidget *widget,
GdkEventExpose *event)
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CHECK_MENU_ITEM (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_CLASS (parent_class)->expose_event)
(* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
......@@ -323,11 +319,7 @@ gtk_check_menu_item_expose (GtkWidget *widget,
static void
gtk_check_menu_item_activate (GtkMenuItem *menu_item)
{
GtkCheckMenuItem *check_menu_item;
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (menu_item));
check_menu_item = GTK_CHECK_MENU_ITEM (menu_item);
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (menu_item);
check_menu_item->active = !check_menu_item->active;
gtk_check_menu_item_toggled (check_menu_item);
......@@ -340,9 +332,6 @@ static void
gtk_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
GdkRectangle *area)
{
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item));
g_return_if_fail (GTK_CHECK_MENU_ITEM_GET_CLASS (check_menu_item) != NULL);
if (GTK_CHECK_MENU_ITEM_GET_CLASS (check_menu_item)->draw_indicator)
(* GTK_CHECK_MENU_ITEM_GET_CLASS (check_menu_item)->draw_indicator) (check_menu_item, area);
}
......@@ -357,8 +346,6 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
gint width, height;
gint x, y;
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item));
if (GTK_WIDGET_DRAWABLE (check_menu_item))
{
widget = GTK_WIDGET (check_menu_item);
......
......@@ -618,9 +618,7 @@ gtk_container_child_get (GtkContainer *container,
{
va_list var_args;
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (child->parent == GTK_WIDGET (container));
......@@ -716,12 +714,7 @@ gtk_container_init (GtkContainer *container)
static void
gtk_container_destroy (GtkObject *object)
{
GtkContainer *container;
g_return_if_fail (object != NULL);
g_return_if_fail (GTK_IS_CONTAINER (object));
container = GTK_CONTAINER (object);
GtkContainer *container = GTK_CONTAINER (object);
if (GTK_CONTAINER_RESIZE_PENDING (container))
_gtk_container_dequeue_resize_handler (container);
......@@ -744,9 +737,7 @@ gtk_container_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
GtkContainer *container;
container = GTK_CONTAINER (object);
GtkContainer *container = GTK_CONTAINER (object);
switch (prop_id)
{
......@@ -771,9 +762,7 @@ gtk_container_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
GtkContainer *container;
container = GTK_CONTAINER (object);
GtkContainer *container = GTK_CONTAINER (object);
switch (prop_id)
{
......@@ -809,7 +798,6 @@ void
gtk_container_set_border_width (GtkContainer *container,
guint border_width)
{
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
if (container->border_width != border_width)
......@@ -857,9 +845,7 @@ void
gtk_container_add (GtkContainer *container,
GtkWidget *widget)
{
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));
if (widget->parent != NULL)
......@@ -892,9 +878,7 @@ void
gtk_container_remove (GtkContainer *container,
GtkWidget *widget)
{
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (widget->parent == GTK_WIDGET (container));
......@@ -926,7 +910,6 @@ void
gtk_container_set_resize_mode (GtkContainer *container,
GtkResizeMode resize_mode)
{
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
g_return_if_fail (resize_mode <= GTK_RESIZE_IMMEDIATE);
......@@ -984,9 +967,7 @@ gtk_container_set_reallocate_redraws (GtkContainer *container,
static GtkContainer*
gtk_container_get_resize_container (GtkContainer *container)
{
GtkWidget *widget;
widget = GTK_WIDGET (container);
GtkWidget *widget = GTK_WIDGET (container);
while (widget->parent)
{
......@@ -1035,7 +1016,6 @@ _gtk_container_queue_resize (GtkContainer *container)
{
GtkContainer *resize_container;
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
resize_container = gtk_container_get_resize_container (container);
......@@ -1094,7 +1074,6 @@ _gtk_container_queue_resize (GtkContainer *container)
void
gtk_container_check_resize (GtkContainer *container)
{
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
gtk_signal_emit (GTK_OBJECT (container), container_signals[CHECK_RESIZE]);
......@@ -1103,14 +1082,9 @@ gtk_container_check_resize (GtkContainer *container)
static void
gtk_container_real_check_resize (GtkContainer *container)
{
GtkWidget *widget;
GtkWidget *widget = GTK_WIDGET (container);
GtkRequisition requisition;
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
widget = GTK_WIDGET (container);
gtk_widget_size_request (widget, &requisition);
if (requisition.width > widget->