treewide: fix some format string issues

Use the proper specifier, and cast to a known type where the type
is not guaranteed by any standard.

See #3975
This commit is contained in:
Barnabás Pőcze 2024-04-23 18:58:26 +02:00 committed by Wim Taymans
parent bdca7cb1a0
commit 6a26e6dd3f
5 changed files with 8 additions and 7 deletions

View file

@ -92,8 +92,8 @@ impl_log_logtv(void *object,
if (impl->timestamp) {
struct timespec now;
clock_gettime(CLOCK_MONOTONIC_RAW, &now);
spa_scnprintf(timestamp, sizeof(timestamp), "[%05lu.%06lu]",
(now.tv_sec & 0x1FFFFFFF) % 100000, now.tv_nsec / 1000);
spa_scnprintf(timestamp, sizeof(timestamp), "[%05jd.%06jd]",
(intmax_t) (now.tv_sec & 0x1FFFFFFF) % 100000, (intmax_t) now.tv_nsec / 1000);
}
if (topic && topic->topic)