*: use long long to print time_t
Since we can't assume time_t to be long, int, or even long long, this
consistently uses %lld/long long (or %llu/unsigned long long in a few
cases) to print time_t/susecond_t values. This should fix a bunch of
warnings, on NetBSD in particular.
(Unfortunately, there seems to be no "PRId64" style printing macro for
time_t...)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c
index 414885f..a352436 100644
--- a/isisd/isis_adjacency.c
+++ b/isisd/isis_adjacency.c
@@ -396,7 +396,8 @@
vty_out (vty, "%-13s", adj_state2string (adj->adj_state));
now = time (NULL);
if (adj->last_upd)
- vty_out (vty, "%-9lu", adj->last_upd + adj->hold_time - now);
+ vty_out (vty, "%-9llu",
+ (unsigned long long)adj->last_upd + adj->hold_time - now);
else
vty_out (vty, "- ");
vty_out (vty, "%-10s", snpa_print (adj->snpa));
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c
index fd93efa..a4cbba6 100644
--- a/isisd/isis_spf.c
+++ b/isisd/isis_spf.c
@@ -1456,8 +1456,8 @@
assert (area->is_type & level);
if (isis->debugs & DEBUG_SPF_EVENTS)
- zlog_debug ("ISIS-Spf (%s) L%d SPF schedule called, lastrun %d sec ago",
- area->area_tag, level, diff);
+ zlog_debug ("ISIS-Spf (%s) L%d SPF schedule called, lastrun %lld sec ago",
+ area->area_tag, level, (long long)diff);
if (spftree->pending)
return ISIS_OK;
@@ -1476,8 +1476,9 @@
area->min_spf_interval[1] - diff);
if (isis->debugs & DEBUG_SPF_EVENTS)
- zlog_debug ("ISIS-Spf (%s) L%d SPF scheduled %d sec from now",
- area->area_tag, level, area->min_spf_interval[level-1] - diff);
+ zlog_debug ("ISIS-Spf (%s) L%d SPF scheduled %lld sec from now",
+ area->area_tag, level,
+ (long long)(area->min_spf_interval[level-1] - diff));
spftree->pending = 1;
diff --git a/isisd/isisd.c b/isisd/isisd.c
index ce6a262..2431557 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -1297,8 +1297,8 @@
vty_out_timestr(vty, spftree->last_run_timestamp);
vty_out (vty, "%s", VTY_NEWLINE);
- vty_out (vty, " last run duration : %u msec%s",
- spftree->last_run_duration, VTY_NEWLINE);
+ vty_out (vty, " last run duration : %llu msec%s",
+ (unsigned long long)spftree->last_run_duration, VTY_NEWLINE);
vty_out (vty, " run count : %d%s",
spftree->runcount, VTY_NEWLINE);