month-view: initialize variable

Some compilers seem to be over-pessimistic and abort the build with:

 gcal-month-view.c: In function 'gcal_month_view_drag_drop':
 gcal-month-view.c:908:32: error: 'timespan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
            GDateTime *new_end = g_date_time_add (new_start, timespan);

Even though the usage of the variable is guarded by an equal if as the assignment

https://bugzilla.gnome.org/show_bug.cgi?id=770667
This commit is contained in:
Dominique Leuenberger
2016-08-31 17:16:40 -03:00
committed by Georges Basile Stavracas Neto
parent faf61122fd
commit 1b90c8b413
+1 -1
View File
@@ -865,7 +865,7 @@ gcal_month_view_drag_drop (GtkWidget *widget,
gint cell, diff;
gint start_month, current_month;
gint start_year, current_year;
GTimeSpan timespan;
GTimeSpan timespan = 0;
cell = get_dnd_cell (widget, x, y);
event_widget = gtk_drag_get_source_widget (context);