From 44a2cb9886223df8ee497f5ecd19123f7a3ca5ea Mon Sep 17 00:00:00 2001 From: Antoine Jacoutot Date: Wed, 11 Sep 2013 09:17:14 +0200 Subject: 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 --- calendar/alarm-notify/alarm.c | 6 +++--- 1 file 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); -- cgit v1.2.3