diff --git a/tests/testdnd.c b/tests/testdnd.c index 0f517dea92..ddfd4c28c5 100644 --- a/tests/testdnd.c +++ b/tests/testdnd.c @@ -295,8 +295,6 @@ static const char *target_table[] = { "application/x-rootwindow-drop" }; -static guint n_targets = sizeof(target_table) / sizeof(target_table[0]); - void target_drag_leave (GtkWidget *widget, GdkDrop *drop, @@ -503,7 +501,8 @@ popup_cb (gpointer data) gtk_window_set_position (GTK_WINDOW (popup_window), GTK_WIN_POS_MOUSE); grid = gtk_grid_new (); - targets = gdk_content_formats_new (target_table, n_targets - 1); /* no rootwin */ + /* no rootwin */ + targets = gdk_content_formats_new (target_table, G_N_ELEMENTS (target_table) - 1); for (i=0; i<3; i++) for (j=0; j<3; j++) @@ -610,7 +609,8 @@ main (int argc, char **argv) label = gtk_label_new ("Drop Here\n"); - targets = gdk_content_formats_new (target_table, n_targets - 1); /* no rootwin */ + /* no rootwin */ + targets = gdk_content_formats_new (target_table, G_N_ELEMENTS (target_table) - 1); gtk_drag_dest_set (label, GTK_DEST_DEFAULT_ALL, targets, @@ -662,7 +662,7 @@ main (int argc, char **argv) button = gtk_button_new_with_label ("Drag Here\n"); - targets = gdk_content_formats_new (target_table, n_targets); + targets = gdk_content_formats_new (target_table, G_N_ELEMENTS (target_table)); gtk_drag_source_set (button, GDK_BUTTON1_MASK | GDK_BUTTON3_MASK, targets, GDK_ACTION_COPY | GDK_ACTION_MOVE);