summaryrefslogtreecommitdiff
path: root/gtk/gtklist.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-07-18 23:39:26 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-07-18 23:39:26 +0000
commit4e2b60ac4d32c5bef5b192a12a59f8c2a3124f81 (patch)
tree63b0cecda2350e250c3a1de4a53f43befab1b076 /gtk/gtklist.c
parentb613a74cb20a480f9d95579243278660af300cee (diff)
downloadgtk+-4e2b60ac4d32c5bef5b192a12a59f8c2a3124f81.tar.gz
Patch from Matthias Clasen to remove remove all instances of
Wed Jul 18 19:28:46 2001 Owen Taylor <otaylor@redhat.com> * gtk/*.c: Patch from Matthias Clasen to remove remove all instances of g_return_if_fail (foo != NULL); that are immediately before a g_return_if_fail (GTK_IS_FOO (foo)); since the second check catches the NULL anyways.
Diffstat (limited to 'gtk/gtklist.c')
-rw-r--r--gtk/gtklist.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/gtk/gtklist.c b/gtk/gtklist.c
index 473c5d36d9..79e42b5a22 100644
--- a/gtk/gtklist.c
+++ b/gtk/gtklist.c
@@ -366,7 +366,6 @@ gtk_list_size_request (GtkWidget *widget,
GtkWidget *child;
GList *children;
- g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST (widget));
g_return_if_fail (requisition != NULL);
@@ -408,7 +407,6 @@ gtk_list_size_allocate (GtkWidget *widget,
GtkAllocation child_allocation;
GList *children;
- g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST (widget));
g_return_if_fail (allocation != NULL);
@@ -455,7 +453,6 @@ gtk_list_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
- g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
@@ -488,7 +485,6 @@ gtk_list_map (GtkWidget *widget)
GtkWidget *child;
GList *children;
- g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
@@ -513,7 +509,6 @@ gtk_list_unmap (GtkWidget *widget)
{
GtkList *list;
- g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST (widget));
if (!GTK_WIDGET_MAPPED (widget))
@@ -549,7 +544,6 @@ gtk_list_motion_notify (GtkWidget *widget,
gint focus_row = 0;
gint length = 0;
- g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_LIST (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -653,7 +647,6 @@ gtk_list_button_press (GtkWidget *widget,
GtkList *list;
GtkWidget *item;
- g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_LIST (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -784,7 +777,6 @@ gtk_list_button_release (GtkWidget *widget,
GtkList *list;
GtkWidget *item;
- g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_LIST (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -855,9 +847,7 @@ gtk_list_add (GtkContainer *container,
{
GList *item_list;
- g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_LIST (container));
- g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (widget));
item_list = g_list_alloc ();
@@ -872,7 +862,6 @@ gtk_list_remove (GtkContainer *container,
{
GList *item_list;
- g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_LIST (container));
g_return_if_fail (widget != NULL);
g_return_if_fail (container == GTK_CONTAINER (widget->parent));
@@ -895,7 +884,6 @@ gtk_list_forall (GtkContainer *container,
GtkWidget *child;
GList *children;
- g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_LIST (container));
g_return_if_fail (callback != NULL);
@@ -923,7 +911,6 @@ gtk_list_set_focus_child (GtkContainer *container,
{
GtkList *list;
- g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_LIST (container));
if (child)
@@ -1032,7 +1019,6 @@ gtk_list_insert_items (GtkList *list,
GList *last;
gint nchildren;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (!items)
@@ -1149,7 +1135,6 @@ void
gtk_list_append_items (GtkList *list,
GList *items)
{
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_insert_items (list, items, -1);
@@ -1159,7 +1144,6 @@ void
gtk_list_prepend_items (GtkList *list,
GList *items)
{
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_insert_items (list, items, 0);
@@ -1193,7 +1177,6 @@ gtk_list_clear_items (GtkList *list,
guint nchildren;
gboolean grab_focus = FALSE;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
nchildren = g_list_length (list->children);
@@ -1290,7 +1273,6 @@ gtk_list_child_position (GtkList *list,
GList *children;
gint pos;
- g_return_val_if_fail (list != NULL, -1);
g_return_val_if_fail (GTK_IS_LIST (list), -1);
g_return_val_if_fail (child != NULL, -1);
@@ -1327,7 +1309,6 @@ gtk_list_remove_items_internal (GtkList *list,
GList *work;
gboolean grab_focus = FALSE;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (!items)
@@ -1438,7 +1419,6 @@ void
gtk_list_set_selection_mode (GtkList *list,
GtkSelectionMode mode)
{
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (list->selection_mode == mode)
@@ -1463,7 +1443,6 @@ gtk_list_select_item (GtkList *list,
{
GList *tmp_list;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
tmp_list = g_list_nth (list->children, item);
@@ -1477,7 +1456,6 @@ gtk_list_unselect_item (GtkList *list,
{
GList *tmp_list;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
tmp_list = g_list_nth (list->children, item);
@@ -1505,7 +1483,6 @@ gtk_list_select_all (GtkList *list)
GtkContainer *container;
GList *work;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (!list->children)
@@ -1564,7 +1541,6 @@ gtk_list_unselect_all (GtkList *list)
GtkWidget *item;
GList *work;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (!list->children)
@@ -1612,7 +1588,6 @@ gtk_list_extend_selection (GtkList *list,
{
GtkContainer *container;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if ((gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (list)) ||
@@ -1640,7 +1615,6 @@ gtk_list_extend_selection (GtkList *list,
void
gtk_list_end_drag_selection (GtkList *list)
{
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
list->drag_selection = FALSE;
@@ -1665,7 +1639,6 @@ gtk_list_start_selection (GtkList *list)
GtkContainer *container;
gint focus_row;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (list))
@@ -1689,7 +1662,6 @@ gtk_list_end_selection (GtkList *list)
GtkWidget *item;
gint item_index;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if ((gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (list)) ||
@@ -1784,9 +1756,7 @@ void
gtk_list_toggle_row (GtkList *list,
GtkWidget *item)
{
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
- g_return_if_fail (item != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (item));
switch (list->selection_mode)
@@ -1883,7 +1853,6 @@ gtk_list_undo_selection (GtkList *list)
{
GList *work;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (list->selection_mode != GTK_SELECTION_EXTENDED ||
@@ -1936,9 +1905,7 @@ static void
gtk_real_list_select_child (GtkList *list,
GtkWidget *child)
{
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
- g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (child));
switch (child->state)
@@ -1956,9 +1923,7 @@ static void
gtk_real_list_unselect_child (GtkList *list,
GtkWidget *child)
{
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
- g_return_if_fail (child != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (child));
if (child->state == GTK_STATE_SELECTED)
@@ -1982,7 +1947,6 @@ gtk_list_set_anchor (GtkList *list,
{
GList *work;
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (list->selection_mode != GTK_SELECTION_EXTENDED || list->anchor >= 0)
@@ -2212,7 +2176,6 @@ gtk_list_scroll_vertical (GtkList *list,
GtkScrollType scroll_type,
gfloat position)
{
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (list))
@@ -2455,9 +2418,7 @@ static void
gtk_list_signal_toggle_focus_row (GtkListItem *list_item,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_toggle_focus_row (list);
@@ -2467,9 +2428,7 @@ static void
gtk_list_signal_select_all (GtkListItem *list_item,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_select_all (list);
@@ -2479,9 +2438,7 @@ static void
gtk_list_signal_unselect_all (GtkListItem *list_item,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_unselect_all (list);
@@ -2491,9 +2448,7 @@ static void
gtk_list_signal_undo_selection (GtkListItem *list_item,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_undo_selection (list);
@@ -2503,9 +2458,7 @@ static void
gtk_list_signal_start_selection (GtkListItem *list_item,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_start_selection (list);
@@ -2515,9 +2468,7 @@ static void
gtk_list_signal_end_selection (GtkListItem *list_item,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_end_selection (list);
@@ -2530,9 +2481,7 @@ gtk_list_signal_extend_selection (GtkListItem *list_item,
gboolean auto_start_selection,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_extend_selection (list, scroll_type, position,
@@ -2545,9 +2494,7 @@ gtk_list_signal_scroll_horizontal (GtkListItem *list_item,
gfloat position,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_scroll_horizontal (list, scroll_type, position);
@@ -2559,9 +2506,7 @@ gtk_list_signal_scroll_vertical (GtkListItem *list_item,
gfloat position,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_scroll_vertical (list, scroll_type, position);
@@ -2571,9 +2516,7 @@ static void
gtk_list_signal_toggle_add_mode (GtkListItem *list_item,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_toggle_add_mode (list);
@@ -2587,9 +2530,7 @@ gtk_list_signal_item_select (GtkListItem *list_item,
GList *tmp_list;
GList *sel_list;
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (GTK_WIDGET (list_item)->state != GTK_STATE_SELECTED)
@@ -2640,9 +2581,7 @@ gtk_list_signal_item_deselect (GtkListItem *list_item,
{
GList *node;
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if (GTK_WIDGET (list_item)->state != GTK_STATE_NORMAL)
@@ -2663,9 +2602,7 @@ static void
gtk_list_signal_item_toggle (GtkListItem *list_item,
GtkList *list)
{
- g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
if ((list->selection_mode == GTK_SELECTION_BROWSE ||
@@ -2694,9 +2631,7 @@ gtk_list_signal_drag_begin (GtkWidget *widget,
GdkDragContext *context,
GtkList *list)
{
- g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (widget));
- g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
gtk_list_drag_begin (GTK_WIDGET (list), context);
@@ -2708,7 +2643,6 @@ gtk_list_drag_begin (GtkWidget *widget,
{
GtkList *list;
- g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST (widget));
g_return_if_fail (context != NULL);