*: 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/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index ebcc717..2e4e69d 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -299,13 +299,13 @@
else if (d)
snprintf (buf, size, "%1ldd%02ldh%02ldm", d, h, m);
else if (h)
- snprintf (buf, size, "%ldh%02ldm%02lds", h, m, t->tv_sec);
+ snprintf (buf, size, "%ldh%02ldm%02lds", h, m, (long)t->tv_sec);
else if (m)
- snprintf (buf, size, "%ldm%02lds", m, t->tv_sec);
+ snprintf (buf, size, "%ldm%02lds", m, (long)t->tv_sec);
else if (ms)
- snprintf (buf, size, "%ld.%03lds", t->tv_sec, ms);
+ snprintf (buf, size, "%ld.%03lds", (long)t->tv_sec, ms);
else
- snprintf (buf, size, "%ld usecs", t->tv_usec);
+ snprintf (buf, size, "%ld usecs", (long)t->tv_usec);
return buf;
}