diff options
author | Antoine Jacoutot <antoine@mtier.org> | 2013-09-11 15:17:14 +0800 |
---|---|---|
committer | Antoine Jacoutot <antoine@mtier.org> | 2013-09-11 15:18:13 +0800 |
commit | 44a2cb9886223df8ee497f5ecd19123f7a3ca5ea (patch) | |
tree | 6ee9371ee3dfe7f2f0baf887e47f76605db36c85 | |
parent | d473e0a333b0a965dafb0fcde325e3f600f28e3c (diff) | |
download | gsoc2013-evolution-44a2cb9886223df8ee497f5ecd19123f7a3ca5ea.tar.gz gsoc2013-evolution-44a2cb9886223df8ee497f5ecd19123f7a3ca5ea.tar.zst gsoc2013-evolution-44a2cb9886223df8ee497f5ecd19123f7a3ca5ea.zip |
calendar: do not assume time_t is long
On Linux time_t is long, on OpenBSD time_t is long long... so printf
statements using %lu on 32-bit platforms will break on !Linux.
The only portable way to print a time_t is using a cast and casting to
"long long" (gint64) is probably the most portable way.
https://bugzilla.gnome.org/show_bug.cgi?id=707829
-rw-r--r-- | calendar/alarm-notify/alarm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/calendar/alarm-notify/alarm.c b/calendar/alarm-notify/alarm.c index 99d3dd669b..670aab68c6 100644 --- a/calendar/alarm-notify/alarm.c +++ b/calendar/alarm-notify/alarm.c @@ -97,7 +97,7 @@ alarm_ready_cb (gpointer data) if (ar->trigger > now) break; - debug (("Process alarm with trigger %lu", ar->trigger)); + debug (("Process alarm with trigger %" G_GINT64_FORMAT, (gint64)ar->trigger)); notify_id = ar; ar_copy = *ar; @@ -153,8 +153,8 @@ setup_timeout (void) /* Add the time out */ debug ( - ("Setting timeout for %d.%2d (from now) %lu %lu", - diff / 60, diff % 60, ar->trigger, now)); + ("Setting timeout for %d.%2d (from now) %" G_GINT64_FORMAT "%" G_GINT64_FORMAT, + diff / 60, diff % 60, (gint64)ar->trigger, (gint64)now)); debug ((" %s", ctime (&ar->trigger))); debug ((" %s", ctime (&now))); timeout_id = g_timeout_add_seconds (diff, alarm_ready_cb, NULL); |