From 69995999c5c5313ca357aab86eb59d1c3edd3b05 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 18 Mar 2012 09:34:01 -0500 Subject: don't subtract one time_t from another --- src/datetime-service.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index 5b92029..b565f21 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -613,15 +613,15 @@ auth_func (ECal *ecal, } static gint -compare_comp_instances (gconstpointer a, - gconstpointer b) +compare_comp_instances (gconstpointer ga, gconstpointer gb) { - const struct comp_instance *ci_a = a; - const struct comp_instance *ci_b = b; - time_t d = ci_a->start - ci_b->start; - if (d < 0) return -1; - else if (d > 0) return 1; - return 0; + const struct comp_instance * a = ga; + const struct comp_instance * b = gb; + + /* sort by start time */ + if (a->start < b->start) return -1; + if (a->start > b->start) return 1; + return 0; } static gboolean -- cgit v1.2.3