From 58166e645971a4812fef23702f45cacc8e64e419 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 24 Oct 2009 17:55:54 -0400 Subject: Prefer G_N_ELEMENTS over sizeof calculations. --- calendar/gui/e-day-view.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index af6fdc66e7..46a37ddc46 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -112,7 +112,6 @@ static GtkTargetEntry target_table[] = { { (gchar *) "text/x-calendar", 0, TARGET_VCALENDAR }, { (gchar *) "text/calendar", 0, TARGET_VCALENDAR } }; -static guint n_targets = sizeof(target_table) / sizeof(target_table[0]); static void e_day_view_destroy (GtkObject *object); static void e_day_view_realize (GtkWidget *widget); @@ -1336,11 +1335,11 @@ e_day_view_init (EDayView *day_view) /* Set up the drop sites. */ gtk_drag_dest_set (day_view->top_canvas, GTK_DEST_DEFAULT_ALL, - target_table, n_targets, + target_table, G_N_ELEMENTS (target_table), GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK); gtk_drag_dest_set (day_view->main_canvas, GTK_DEST_DEFAULT_ALL, - target_table, n_targets, + target_table, G_N_ELEMENTS (target_table), GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK); /* connect to ECalendarView's signals */ @@ -3927,8 +3926,8 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, day_view->resize_bars_event_num = -1; } - target_list = gtk_target_list_new (target_table, - n_targets); + target_list = gtk_target_list_new ( + target_table, G_N_ELEMENTS (target_table)); gtk_drag_begin (widget, target_list, GDK_ACTION_COPY | GDK_ACTION_MOVE, 1, (GdkEvent*)mevent); @@ -4030,8 +4029,8 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, day_view->resize_bars_event_num = -1; } - target_list = gtk_target_list_new (target_table, - n_targets); + target_list = gtk_target_list_new ( + target_table, G_N_ELEMENTS (target_table)); gtk_drag_begin (widget, target_list, GDK_ACTION_COPY | GDK_ACTION_MOVE, 1, (GdkEvent*)mevent); -- cgit