diff options
author | Benjamin Otte <otte@redhat.com> | 2011-02-19 20:45:54 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-03-26 23:48:42 +0100 |
commit | 8a16876fc7d0298fdff136befc95b5cc755f9aac (patch) | |
tree | 42acc2fc4733ed79156ef2d01527caa174124c4d /gtk/gtkdnd.c | |
parent | 0597ffff3dabf08a7ae2a026a340ddea66e61d06 (diff) | |
download | gtk+-8a16876fc7d0298fdff136befc95b5cc755f9aac.tar.gz |
dnd: Use G_N_ELEMENTS()
Now that we have wesome macros in glib 2.0, we can use them. Woohoo, GTK
2.0 will be so awesome in the future.
(Did anybody touch dnd code this millenium?)
Diffstat (limited to 'gtk/gtkdnd.c')
-rw-r--r-- | gtk/gtkdnd.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 15128c8e08..8e4ffdd1b1 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -305,8 +305,6 @@ static struct { { 0 , "dnd-none", dnd_cursor_none, NULL, NULL }, }; -static const gint n_drag_cursors = sizeof (drag_cursors) / sizeof (drag_cursors[0]); - /********************* * Utility functions * *********************/ @@ -731,7 +729,7 @@ gtk_drag_get_cursor (GdkDisplay *display, */ if (!info) { - for (i = 0 ; i < n_drag_cursors - 1; i++) + for (i = 0 ; i < G_N_ELEMENTS (drag_cursors) - 1; i++) if (drag_cursors[i].cursor != NULL) { g_object_unref (drag_cursors[i].cursor); @@ -739,7 +737,7 @@ gtk_drag_get_cursor (GdkDisplay *display, } } - for (i = 0 ; i < n_drag_cursors - 1; i++) + for (i = 0 ; i < G_N_ELEMENTS (drag_cursors) - 1; i++) if (drag_cursors[i].action == action) break; @@ -930,12 +928,12 @@ gtk_drag_update_cursor (GtkDragSourceInfo *info) if (!info->have_grab) return; - for (i = 0 ; i < n_drag_cursors - 1; i++) + for (i = 0 ; i < G_N_ELEMENTS (drag_cursors) - 1; i++) if (info->cursor == drag_cursors[i].cursor || info->cursor == info->drag_cursors[i]) break; - if (i == n_drag_cursors) + if (i == G_N_ELEMENTS (drag_cursors)) return; cursor = gtk_drag_get_cursor (gdk_cursor_get_display (info->cursor), @@ -3879,7 +3877,7 @@ gtk_drag_source_info_destroy (GtkDragSourceInfo *info) { gint i; - for (i = 0; i < n_drag_cursors; i++) + for (i = 0; i < G_N_ELEMENTS (drag_cursors); i++) { if (info->drag_cursors[i] != NULL) { |