Commit a9b02ab3 authored by Andrew Walton's avatar Andrew Walton Committed by Andrew Walton

Replace g_return_*() with g_assert() in private, internal functions.

2008-04-30  A. Walton  <awalton@gnome.org>

	* libnautilus-private/nautilus-clipboard.c:
	* libnautilus-private/nautilus-directory-async.c:
	* libnautilus-private/nautilus-directory.c:
	* libnautilus-private/nautilus-entry.c:
	* libnautilus-private/nautilus-file.c:
	* libnautilus-private/nautilus-horizontal-splitter.c:
	* libnautilus-private/nautilus-icon-canvas-item.c:
	* libnautilus-private/nautilus-icon-container.c:
	* libnautilus-private/nautilus-metafile.c:
	* libnautilus-private/nautilus-users-groups-cache.c:
	* libnautilus-private/nautilus-vfs-directory.c:
	* src/nautilus-emblem-sidebar.c:
	* src/nautilus-file-management-properties.c:
	* src/nautilus-window-manage-views.c:
	* src/nautilus-window.c:
	* src/nautilus-zoom-control.c:
	Replace g_return_*() with g_assert() in private, internal
	functions. Closes #530321.


svn path=/trunk/; revision=14114
parent 0e85a1ca
2008-04-30 A. Walton <awalton@gnome.org>
* libnautilus-private/nautilus-clipboard.c:
* libnautilus-private/nautilus-directory-async.c:
* libnautilus-private/nautilus-directory.c:
* libnautilus-private/nautilus-entry.c:
* libnautilus-private/nautilus-file.c:
* libnautilus-private/nautilus-horizontal-splitter.c:
* libnautilus-private/nautilus-icon-canvas-item.c:
* libnautilus-private/nautilus-icon-container.c:
* libnautilus-private/nautilus-metafile.c:
* libnautilus-private/nautilus-users-groups-cache.c:
* libnautilus-private/nautilus-vfs-directory.c:
* src/nautilus-emblem-sidebar.c:
* src/nautilus-file-management-properties.c:
* src/nautilus-window-manage-views.c:
* src/nautilus-window.c:
* src/nautilus-zoom-control.c:
Replace g_return_*() with g_assert() in private, internal
functions. Closes #530321.
2008-04-29 David Zeuthen <davidz@redhat.com> 2008-04-29 David Zeuthen <davidz@redhat.com>
* libnautilus-private/nautilus-autorun.c: * libnautilus-private/nautilus-autorun.c:
......
...@@ -66,7 +66,7 @@ struct _TargetCallbackData { ...@@ -66,7 +66,7 @@ struct _TargetCallbackData {
static void static void
cut_callback (gpointer target) cut_callback (gpointer target)
{ {
g_return_if_fail (target != NULL); g_assert (target != NULL);
g_signal_emit_by_name (target, "cut-clipboard"); g_signal_emit_by_name (target, "cut-clipboard");
} }
...@@ -74,7 +74,7 @@ cut_callback (gpointer target) ...@@ -74,7 +74,7 @@ cut_callback (gpointer target)
static void static void
copy_callback (gpointer target) copy_callback (gpointer target)
{ {
g_return_if_fail (target != NULL); g_assert (target != NULL);
g_signal_emit_by_name (target, "copy-clipboard"); g_signal_emit_by_name (target, "copy-clipboard");
} }
...@@ -82,7 +82,7 @@ copy_callback (gpointer target) ...@@ -82,7 +82,7 @@ copy_callback (gpointer target)
static void static void
paste_callback (gpointer target) paste_callback (gpointer target)
{ {
g_return_if_fail (target != NULL); g_assert (target != NULL);
g_signal_emit_by_name (target, "paste-clipboard"); g_signal_emit_by_name (target, "paste-clipboard");
} }
...@@ -93,7 +93,7 @@ editable_select_all_callback (gpointer target) ...@@ -93,7 +93,7 @@ editable_select_all_callback (gpointer target)
GtkEditable *editable; GtkEditable *editable;
editable = GTK_EDITABLE (target); editable = GTK_EDITABLE (target);
g_return_if_fail (editable != NULL); g_assert (editable != NULL);
gtk_editable_set_position (editable, -1); gtk_editable_set_position (editable, -1);
gtk_editable_select_region (editable, 0, -1); gtk_editable_select_region (editable, 0, -1);
...@@ -102,7 +102,7 @@ editable_select_all_callback (gpointer target) ...@@ -102,7 +102,7 @@ editable_select_all_callback (gpointer target)
static void static void
text_view_select_all_callback (gpointer target) text_view_select_all_callback (gpointer target)
{ {
g_return_if_fail (GTK_IS_TEXT_VIEW (target)); g_assert (GTK_IS_TEXT_VIEW (target));
g_signal_emit_by_name (target, "select-all", TRUE); g_signal_emit_by_name (target, "select-all", TRUE);
} }
...@@ -134,10 +134,10 @@ action_select_all_callback (GtkAction *action, ...@@ -134,10 +134,10 @@ action_select_all_callback (GtkAction *action,
{ {
TargetCallbackData *target_data; TargetCallbackData *target_data;
g_return_if_fail (callback_data != NULL); g_assert (callback_data != NULL);
target_data = g_object_get_data (callback_data, "Nautilus:clipboard_target_data"); target_data = g_object_get_data (callback_data, "Nautilus:clipboard_target_data");
g_return_if_fail (target_data != NULL); g_assert (target_data != NULL);
target_data->select_all_callback (callback_data); target_data->select_all_callback (callback_data);
} }
...@@ -393,7 +393,7 @@ selection_changed_callback (GtkWidget *widget, ...@@ -393,7 +393,7 @@ selection_changed_callback (GtkWidget *widget,
g_assert (target_data != NULL); g_assert (target_data != NULL);
editable = GTK_EDITABLE (widget); editable = GTK_EDITABLE (widget);
g_return_if_fail (editable != NULL); g_assert (editable != NULL);
if (gtk_editable_get_selection_bounds (editable, &start, &end) && start != end) { if (gtk_editable_get_selection_bounds (editable, &start, &end) && start != end) {
set_clipboard_menu_items_sensitive (target_data->action_group); set_clipboard_menu_items_sensitive (target_data->action_group);
......
...@@ -645,8 +645,8 @@ mime_db_changed_callback (GObject *ignore, NautilusDirectory *dir) ...@@ -645,8 +645,8 @@ mime_db_changed_callback (GObject *ignore, NautilusDirectory *dir)
{ {
NautilusFileAttributes attrs; NautilusFileAttributes attrs;
g_return_if_fail (dir != NULL); g_assert (dir != NULL);
g_return_if_fail (dir->details != NULL); g_assert (dir->details != NULL);
attrs = NAUTILUS_FILE_ATTRIBUTE_INFO | attrs = NAUTILUS_FILE_ATTRIBUTE_INFO |
NAUTILUS_FILE_ATTRIBUTE_LINK_INFO | NAUTILUS_FILE_ATTRIBUTE_LINK_INFO |
......
...@@ -1208,7 +1208,7 @@ change_directory_location (NautilusDirectory *directory, ...@@ -1208,7 +1208,7 @@ change_directory_location (NautilusDirectory *directory,
* to be moved. But if that did somehow happen, this function * to be moved. But if that did somehow happen, this function
* wouldn't do enough to handle it. * wouldn't do enough to handle it.
*/ */
g_return_if_fail (directory->details->as_file == NULL); g_assert (directory->details->as_file == NULL);
g_hash_table_remove (directories, g_hash_table_remove (directories,
directory->details->location); directory->details->location);
......
...@@ -353,7 +353,7 @@ static gboolean ...@@ -353,7 +353,7 @@ static gboolean
nautilus_entry_selection_clear (GtkWidget *widget, nautilus_entry_selection_clear (GtkWidget *widget,
GdkEventSelection *event) GdkEventSelection *event)
{ {
g_return_val_if_fail (NAUTILUS_IS_ENTRY (widget), FALSE); g_assert (NAUTILUS_IS_ENTRY (widget));
if (gdk_selection_owner_get (event->selection) == widget->window) { if (gdk_selection_owner_get (event->selection) == widget->window) {
return FALSE; return FALSE;
......
...@@ -360,9 +360,9 @@ nautilus_file_new_from_filename (NautilusDirectory *directory, ...@@ -360,9 +360,9 @@ nautilus_file_new_from_filename (NautilusDirectory *directory,
{ {
NautilusFile *file; NautilusFile *file;
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), NULL); g_assert (NAUTILUS_IS_DIRECTORY (directory));
g_return_val_if_fail (filename != NULL, NULL); g_assert (filename != NULL);
g_return_val_if_fail (filename[0] != '\0', NULL); g_assert (filename[0] != '\0');
if (NAUTILUS_IS_DESKTOP_DIRECTORY (directory)) { if (NAUTILUS_IS_DESKTOP_DIRECTORY (directory)) {
if (self_owned) { if (self_owned) {
...@@ -519,7 +519,7 @@ nautilus_file_get_internal (GFile *location, gboolean create) ...@@ -519,7 +519,7 @@ nautilus_file_get_internal (GFile *location, gboolean create)
GFile *parent; GFile *parent;
char *basename; char *basename;
g_return_val_if_fail (location != NULL, NULL); g_assert (location != NULL);
parent = g_file_get_parent (location); parent = g_file_get_parent (location);
...@@ -4853,7 +4853,7 @@ nautilus_file_get_octal_permissions_as_string (NautilusFile *file) ...@@ -4853,7 +4853,7 @@ nautilus_file_get_octal_permissions_as_string (NautilusFile *file)
{ {
guint32 permissions; guint32 permissions;
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL); g_assert (NAUTILUS_IS_FILE (file));
if (!nautilus_file_can_get_permissions (file)) { if (!nautilus_file_can_get_permissions (file)) {
return NULL; return NULL;
...@@ -4885,7 +4885,7 @@ nautilus_file_get_permissions_as_string (NautilusFile *file) ...@@ -4885,7 +4885,7 @@ nautilus_file_get_permissions_as_string (NautilusFile *file)
return NULL; return NULL;
} }
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL); g_assert (NAUTILUS_IS_FILE (file));
permissions = file->details->permissions; permissions = file->details->permissions;
is_directory = nautilus_file_is_directory (file); is_directory = nautilus_file_is_directory (file);
...@@ -4958,7 +4958,7 @@ format_item_count_for_display (guint item_count, ...@@ -4958,7 +4958,7 @@ format_item_count_for_display (guint item_count,
gboolean includes_directories, gboolean includes_directories,
gboolean includes_files) gboolean includes_files)
{ {
g_return_val_if_fail (includes_directories || includes_files, NULL); g_assert (includes_directories || includes_files);
return g_strdup_printf (includes_directories return g_strdup_printf (includes_directories
? (includes_files ? (includes_files
...@@ -4988,7 +4988,7 @@ nautilus_file_get_size_as_string (NautilusFile *file) ...@@ -4988,7 +4988,7 @@ nautilus_file_get_size_as_string (NautilusFile *file)
return NULL; return NULL;
} }
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL); g_assert (NAUTILUS_IS_FILE (file));
if (nautilus_file_is_directory (file)) { if (nautilus_file_is_directory (file)) {
if (!nautilus_file_get_directory_item_count (file, &item_count, &count_unreadable)) { if (!nautilus_file_get_directory_item_count (file, &item_count, &count_unreadable)) {
...@@ -5028,7 +5028,7 @@ nautilus_file_get_size_as_string_with_real_size (NautilusFile *file) ...@@ -5028,7 +5028,7 @@ nautilus_file_get_size_as_string_with_real_size (NautilusFile *file)
return NULL; return NULL;
} }
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL); g_assert (NAUTILUS_IS_FILE (file));
if (nautilus_file_is_directory (file)) { if (nautilus_file_is_directory (file)) {
if (!nautilus_file_get_directory_item_count (file, &item_count, &count_unreadable)) { if (!nautilus_file_get_directory_item_count (file, &item_count, &count_unreadable)) {
...@@ -5065,15 +5065,15 @@ nautilus_file_get_deep_count_as_string_internal (NautilusFile *file, ...@@ -5065,15 +5065,15 @@ nautilus_file_get_deep_count_as_string_internal (NautilusFile *file,
goffset total_size; goffset total_size;
/* Must ask for size or some kind of count, but not both. */ /* Must ask for size or some kind of count, but not both. */
g_return_val_if_fail (!report_size || (!report_directory_count && !report_file_count), NULL); g_assert (!report_size || (!report_directory_count && !report_file_count));
g_return_val_if_fail (report_size || report_directory_count || report_file_count, NULL); g_assert (report_size || report_directory_count || report_file_count);
if (file == NULL) { if (file == NULL) {
return NULL; return NULL;
} }
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL); g_assert (NAUTILUS_IS_FILE (file));
g_return_val_if_fail (nautilus_file_is_directory (file), NULL); g_assert (nautilus_file_is_directory (file));
status = nautilus_file_get_deep_counts status = nautilus_file_get_deep_counts
(file, &directory_count, &file_count, &unreadable_count, &total_size, FALSE); (file, &directory_count, &file_count, &unreadable_count, &total_size, FALSE);
......
...@@ -68,7 +68,7 @@ nautilus_horizontal_splitter_finalize (GObject *object) ...@@ -68,7 +68,7 @@ nautilus_horizontal_splitter_finalize (GObject *object)
static void static void
splitter_expand (NautilusHorizontalSplitter *splitter, int position) splitter_expand (NautilusHorizontalSplitter *splitter, int position)
{ {
g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter)); g_assert (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
if (position >= CLOSED_THRESHOLD) { if (position >= CLOSED_THRESHOLD) {
return; return;
...@@ -85,7 +85,7 @@ splitter_expand (NautilusHorizontalSplitter *splitter, int position) ...@@ -85,7 +85,7 @@ splitter_expand (NautilusHorizontalSplitter *splitter, int position)
static void static void
splitter_collapse (NautilusHorizontalSplitter *splitter, int position) splitter_collapse (NautilusHorizontalSplitter *splitter, int position)
{ {
g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter)); g_assert (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
splitter->details->saved_size = position; splitter->details->saved_size = position;
gtk_paned_set_position (GTK_PANED (splitter), 0); gtk_paned_set_position (GTK_PANED (splitter), 0);
...@@ -94,7 +94,7 @@ splitter_collapse (NautilusHorizontalSplitter *splitter, int position) ...@@ -94,7 +94,7 @@ splitter_collapse (NautilusHorizontalSplitter *splitter, int position)
static void static void
splitter_toggle (NautilusHorizontalSplitter *splitter, int position) splitter_toggle (NautilusHorizontalSplitter *splitter, int position)
{ {
g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter)); g_assert (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
if (gtk_paned_get_position (GTK_PANED (splitter)) >= CLOSED_THRESHOLD) { if (gtk_paned_get_position (GTK_PANED (splitter)) >= CLOSED_THRESHOLD) {
nautilus_horizontal_splitter_collapse (splitter); nautilus_horizontal_splitter_collapse (splitter);
......
...@@ -257,7 +257,7 @@ nautilus_icon_canvas_item_finalize (GObject *object) ...@@ -257,7 +257,7 @@ nautilus_icon_canvas_item_finalize (GObject *object)
{ {
NautilusIconCanvasItemDetails *details; NautilusIconCanvasItemDetails *details;
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (object)); g_assert (NAUTILUS_IS_ICON_CANVAS_ITEM (object));
details = NAUTILUS_ICON_CANVAS_ITEM (object)->details; details = NAUTILUS_ICON_CANVAS_ITEM (object)->details;
...@@ -757,7 +757,7 @@ get_current_canvas_bounds (EelCanvasItem *item) ...@@ -757,7 +757,7 @@ get_current_canvas_bounds (EelCanvasItem *item)
{ {
EelIRect bounds; EelIRect bounds;
g_return_val_if_fail (EEL_IS_CANVAS_ITEM (item), eel_irect_empty); g_assert (EEL_IS_CANVAS_ITEM (item));
bounds.x0 = item->x1; bounds.x0 = item->x1;
bounds.y0 = item->y1; bounds.y0 = item->y1;
...@@ -1466,12 +1466,12 @@ nautilus_icon_canvas_lighten_pixbuf (GdkPixbuf* src, guint lighten_value) { ...@@ -1466,12 +1466,12 @@ nautilus_icon_canvas_lighten_pixbuf (GdkPixbuf* src, guint lighten_value) {
guchar *target_pixels, *original_pixels; guchar *target_pixels, *original_pixels;
guchar *pixsrc, *pixdest; guchar *pixsrc, *pixdest;
g_return_val_if_fail (gdk_pixbuf_get_colorspace (src) == GDK_COLORSPACE_RGB, NULL); g_assert (gdk_pixbuf_get_colorspace (src) == GDK_COLORSPACE_RGB);
g_return_val_if_fail ((!gdk_pixbuf_get_has_alpha (src) g_assert ((!gdk_pixbuf_get_has_alpha (src)
&& gdk_pixbuf_get_n_channels (src) == 3) && gdk_pixbuf_get_n_channels (src) == 3)
|| (gdk_pixbuf_get_has_alpha (src) || (gdk_pixbuf_get_has_alpha (src)
&& gdk_pixbuf_get_n_channels (src) == 4), NULL); && gdk_pixbuf_get_n_channels (src) == 4));
g_return_val_if_fail (gdk_pixbuf_get_bits_per_sample (src) == 8, NULL); g_assert (gdk_pixbuf_get_bits_per_sample (src) == 8);
dest = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (src), dest = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (src),
gdk_pixbuf_get_has_alpha (src), gdk_pixbuf_get_has_alpha (src),
...@@ -2300,8 +2300,8 @@ get_icon_canvas_rectangle (NautilusIconCanvasItem *item, ...@@ -2300,8 +2300,8 @@ get_icon_canvas_rectangle (NautilusIconCanvasItem *item,
{ {
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item)); g_assert (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
g_return_if_fail (rect != NULL); g_assert (rect != NULL);
eel_canvas_w2c (EEL_CANVAS_ITEM (item)->canvas, eel_canvas_w2c (EEL_CANVAS_ITEM (item)->canvas,
item->details->x, item->details->x,
...@@ -2341,7 +2341,7 @@ hit_test_stretch_handle (NautilusIconCanvasItem *item, ...@@ -2341,7 +2341,7 @@ hit_test_stretch_handle (NautilusIconCanvasItem *item,
int knob_width, knob_height; int knob_width, knob_height;
int hit_corner; int hit_corner;
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item), FALSE); g_assert (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
/* Make sure there are handles to hit. */ /* Make sure there are handles to hit. */
if (!item->details->show_stretch_handles) { if (!item->details->show_stretch_handles) {
...@@ -2536,7 +2536,7 @@ nautilus_icon_canvas_item_accessible_do_action (AtkAction *accessible, int i) ...@@ -2536,7 +2536,7 @@ nautilus_icon_canvas_item_accessible_do_action (AtkAction *accessible, int i)
NautilusIcon *icon; NautilusIcon *icon;
NautilusIconContainer *container; NautilusIconContainer *container;
g_return_val_if_fail (i < LAST_ACTION, FALSE); g_assert (i < LAST_ACTION);
item = eel_accessibility_get_gobject (ATK_OBJECT (accessible)); item = eel_accessibility_get_gobject (ATK_OBJECT (accessible));
if (!item) { if (!item) {
...@@ -2578,7 +2578,7 @@ nautilus_icon_canvas_item_accessible_action_get_description (AtkAction *accessib ...@@ -2578,7 +2578,7 @@ nautilus_icon_canvas_item_accessible_action_get_description (AtkAction *accessib
{ {
NautilusIconCanvasItemAccessiblePrivate *priv; NautilusIconCanvasItemAccessiblePrivate *priv;
g_return_val_if_fail (i < LAST_ACTION, NULL); g_assert (i < LAST_ACTION);
priv = accessible_get_priv (ATK_OBJECT (accessible)); priv = accessible_get_priv (ATK_OBJECT (accessible));
if (priv->action_descriptions[i]) { if (priv->action_descriptions[i]) {
...@@ -2591,7 +2591,7 @@ nautilus_icon_canvas_item_accessible_action_get_description (AtkAction *accessib ...@@ -2591,7 +2591,7 @@ nautilus_icon_canvas_item_accessible_action_get_description (AtkAction *accessib
static const char * static const char *
nautilus_icon_canvas_item_accessible_action_get_name (AtkAction *accessible, int i) nautilus_icon_canvas_item_accessible_action_get_name (AtkAction *accessible, int i)
{ {
g_return_val_if_fail (i < LAST_ACTION, NULL); g_assert (i < LAST_ACTION);
return nautilus_icon_canvas_item_accessible_action_names[i]; return nautilus_icon_canvas_item_accessible_action_names[i];
} }
...@@ -2600,7 +2600,7 @@ static const char * ...@@ -2600,7 +2600,7 @@ static const char *
nautilus_icon_canvas_item_accessible_action_get_keybinding (AtkAction *accessible, nautilus_icon_canvas_item_accessible_action_get_keybinding (AtkAction *accessible,
int i) int i)
{ {
g_return_val_if_fail (i < LAST_ACTION, NULL); g_assert (i < LAST_ACTION);
return NULL; return NULL;
} }
...@@ -2612,7 +2612,7 @@ nautilus_icon_canvas_item_accessible_action_set_description (AtkAction *accessib ...@@ -2612,7 +2612,7 @@ nautilus_icon_canvas_item_accessible_action_set_description (AtkAction *accessib
{ {
NautilusIconCanvasItemAccessiblePrivate *priv; NautilusIconCanvasItemAccessiblePrivate *priv;
g_return_val_if_fail (i < LAST_ACTION, FALSE); g_assert (i < LAST_ACTION);
priv = accessible_get_priv (ATK_OBJECT (accessible)); priv = accessible_get_priv (ATK_OBJECT (accessible));
...@@ -3180,7 +3180,7 @@ nautilus_icon_canvas_item_accessible_create (GObject *for_object) ...@@ -3180,7 +3180,7 @@ nautilus_icon_canvas_item_accessible_create (GObject *for_object)
GString *item_text; GString *item_text;
item = NAUTILUS_ICON_CANVAS_ITEM (for_object); item = NAUTILUS_ICON_CANVAS_ITEM (for_object);
g_return_val_if_fail (item != NULL, NULL); g_assert (item != NULL);
type = nautilus_icon_canvas_item_accessible_get_type (); type = nautilus_icon_canvas_item_accessible_get_type ();
......
...@@ -954,7 +954,7 @@ sort_icons (NautilusIconContainer *container, ...@@ -954,7 +954,7 @@ sort_icons (NautilusIconContainer *container,
NautilusIconContainerClass *klass; NautilusIconContainerClass *klass;
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container); klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
g_return_if_fail (klass->compare_icons != NULL); g_assert (klass->compare_icons != NULL);
*icons = g_list_sort_with_data (*icons, compare_icons, container); *icons = g_list_sort_with_data (*icons, compare_icons, container);
} }
...@@ -1501,10 +1501,10 @@ placement_grid_position_is_free (PlacementGrid *grid, EelIRect pos) ...@@ -1501,10 +1501,10 @@ placement_grid_position_is_free (PlacementGrid *grid, EelIRect pos)
{ {
int x, y; int x, y;
g_return_val_if_fail (pos.x0 >= 0 && pos.x0 < grid->num_columns, TRUE); g_assert (pos.x0 >= 0 && pos.x0 < grid->num_columns);
g_return_val_if_fail (pos.y0 >= 0 && pos.y0 < grid->num_rows, TRUE); g_assert (pos.y0 >= 0 && pos.y0 < grid->num_rows);
g_return_val_if_fail (pos.x1 >= 0 && pos.x1 < grid->num_columns, TRUE); g_assert (pos.x1 >= 0 && pos.x1 < grid->num_columns);
g_return_val_if_fail (pos.y1 >= 0 && pos.y1 < grid->num_rows, TRUE); g_assert (pos.y1 >= 0 && pos.y1 < grid->num_rows);
for (x = pos.x0; x <= pos.x1; x++) { for (x = pos.x0; x <= pos.x1; x++) {
for (y = pos.y0; y <= pos.y1; y++) { for (y = pos.y0; y <= pos.y1; y++) {
...@@ -1522,10 +1522,10 @@ placement_grid_mark (PlacementGrid *grid, EelIRect pos) ...@@ -1522,10 +1522,10 @@ placement_grid_mark (PlacementGrid *grid, EelIRect pos)
{ {
int x, y; int x, y;
g_return_if_fail (pos.x0 >= 0 && pos.x0 < grid->num_columns); g_assert (pos.x0 >= 0 && pos.x0 < grid->num_columns);
g_return_if_fail (pos.y0 >= 0 && pos.y0 < grid->num_rows); g_assert (pos.y0 >= 0 && pos.y0 < grid->num_rows);
g_return_if_fail (pos.x1 >= 0 && pos.x1 < grid->num_columns); g_assert (pos.x1 >= 0 && pos.x1 < grid->num_columns);
g_return_if_fail (pos.y1 >= 0 && pos.y1 < grid->num_rows); g_assert (pos.y1 >= 0 && pos.y1 < grid->num_rows);
for (x = pos.x0; x <= pos.x1; x++) { for (x = pos.x0; x <= pos.x1; x++) {
for (y = pos.y0; y <= pos.y1; y++) { for (y = pos.y0; y <= pos.y1; y++) {
...@@ -4173,7 +4173,7 @@ nautilus_icon_container_search_delete_event (GtkWidget *widget, ...@@ -4173,7 +4173,7 @@ nautilus_icon_container_search_delete_event (GtkWidget *widget,
GdkEventAny *event, GdkEventAny *event,
NautilusIconContainer *container) NautilusIconContainer *container)
{ {
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); g_assert (GTK_IS_WIDGET (widget));
nautilus_icon_container_search_dialog_hide (widget, container); nautilus_icon_container_search_dialog_hide (widget, container);
...@@ -4185,7 +4185,7 @@ nautilus_icon_container_search_button_press_event (GtkWidget *widget, ...@@ -4185,7 +4185,7 @@ nautilus_icon_container_search_button_press_event (GtkWidget *widget,
GdkEventButton *event, GdkEventButton *event,
NautilusIconContainer *container) NautilusIconContainer *container)
{ {
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); g_assert (GTK_IS_WIDGET (widget));
nautilus_icon_container_search_dialog_hide (widget, container); nautilus_icon_container_search_dialog_hide (widget, container);
...@@ -4207,8 +4207,8 @@ nautilus_icon_container_search_iter (NautilusIconContainer *container, ...@@ -4207,8 +4207,8 @@ nautilus_icon_container_search_iter (NautilusIconContainer *container,
char *normalized_key, *case_normalized_key; char *normalized_key, *case_normalized_key;
char *normalized_name, *case_normalized_name; char *normalized_name, *case_normalized_name;
g_return_val_if_fail (key != NULL, FALSE); g_assert (key != NULL);
g_return_val_if_fail (n >= 1, FALSE); g_assert (n >= 1);
normalized_key = g_utf8_normalize (key, -1, G_NORMALIZE_ALL); normalized_key = g_utf8_normalize (key, -1, G_NORMALIZE_ALL);
if (!normalized_key) { if (!normalized_key) {
...@@ -4278,7 +4278,7 @@ nautilus_icon_container_search_move (GtkWidget *window, ...@@ -4278,7 +4278,7 @@ nautilus_icon_container_search_move (GtkWidget *window,
text = gtk_entry_get_text (GTK_ENTRY (container->details->search_entry)); text = gtk_entry_get_text (GTK_ENTRY (container->details->search_entry));
g_return_if_fail (text != NULL); g_assert (text != NULL);