event: Receive the time_t directly
There is absolutely no reason to receive a pointer to an integer when we can receive the actual integer.
This commit is contained in:
+3
-3
@@ -1531,7 +1531,7 @@ gcal_event_compare (GcalEvent *event1,
|
||||
gint
|
||||
gcal_event_compare_with_current (GcalEvent *event1,
|
||||
GcalEvent *event2,
|
||||
time_t *current_time)
|
||||
time_t current_time)
|
||||
{
|
||||
time_t time1, time2;
|
||||
time_t diff1, diff2;
|
||||
@@ -1545,8 +1545,8 @@ gcal_event_compare_with_current (GcalEvent *event1,
|
||||
|
||||
time1 = g_date_time_to_unix (event1->dt_start);
|
||||
time2 = g_date_time_to_unix (event2->dt_start);
|
||||
diff1 = time1 - *current_time;
|
||||
diff2 = time2 - *current_time;
|
||||
diff1 = time1 - current_time;
|
||||
diff2 = time2 - current_time;
|
||||
|
||||
if (diff1 != diff2)
|
||||
{
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ gint gcal_event_compare (GcalEvent
|
||||
|
||||
gint gcal_event_compare_with_current (GcalEvent *event1,
|
||||
GcalEvent *event2,
|
||||
time_t *current_time);
|
||||
time_t current_time);
|
||||
|
||||
void gcal_event_set_recurrence (GcalEvent *event,
|
||||
GcalRecurrence *recur);
|
||||
|
||||
@@ -69,7 +69,7 @@ sort_event_data (GcalEvent *a,
|
||||
GcalEvent *b,
|
||||
gpointer user_data)
|
||||
{
|
||||
return gcal_event_compare_with_current (a, b, user_data);
|
||||
return gcal_event_compare_with_current (a, b, GPOINTER_TO_INT (user_data));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -330,7 +330,7 @@ query_completed_cb (GcalShellSearchProvider *self,
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
|
||||
|
||||
current_time_t = time (NULL);
|
||||
events = g_list_sort_with_data (events, (GCompareDataFunc) sort_event_data, ¤t_time_t);
|
||||
events = g_list_sort_with_data (events, (GCompareDataFunc) sort_event_data, GINT_TO_POINTER (current_time_t));
|
||||
for (l = events; l != NULL; l = g_list_next (l))
|
||||
{
|
||||
const gchar *uid;
|
||||
|
||||
Reference in New Issue
Block a user