diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-03-18 09:34:01 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-03-18 09:34:01 -0500 |
commit | 69995999c5c5313ca357aab86eb59d1c3edd3b05 (patch) | |
tree | 083b7afefdb25ec55af8ef13aa601b3e4d75d1bd /src/datetime-service.c | |
parent | 1523323751cba68b7db8a3c39c35882d34590efc (diff) | |
download | ayatana-indicator-datetime-69995999c5c5313ca357aab86eb59d1c3edd3b05.tar.gz ayatana-indicator-datetime-69995999c5c5313ca357aab86eb59d1c3edd3b05.tar.bz2 ayatana-indicator-datetime-69995999c5c5313ca357aab86eb59d1c3edd3b05.zip |
don't subtract one time_t from another
Diffstat (limited to 'src/datetime-service.c')
-rw-r--r-- | src/datetime-service.c | 16 |
1 files 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 |