From fda3d0010fa3a292d857271f24e400bb2dfbad3d Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Tue, 5 Oct 2021 12:10:08 +0100 Subject: [PATCH] Fix -Werror=format build errors on FreeBSD On 64-bit FreeBSD targets uint64_t is generally defined as `unsigned long` and not `unsigned long long`. Use the PRI macros to fix -Wformat. Signed-off-by: Alex Richardson Reviewed-by: Simon Ser --- tests/modeprint/modeprint.c | 2 +- tests/modetest/modetest.c | 2 +- tests/proptest/proptest.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c index ad727e12..f424f19d 100644 --- a/tests/modeprint/modeprint.c +++ b/tests/modeprint/modeprint.c @@ -113,7 +113,7 @@ static int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, ui } else { for (j = 0; j < props->count_enums; j++) { - printf("\t\t%lld = %s\n", props->enums[j].value, props->enums[j].name); + printf("\t\t%" PRId64 " = %s\n", props->enums[j].value, props->enums[j].name); if (props->enums[j].value == value) name = props->enums[j].name; } diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index eca08ef9..5746357f 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -381,7 +381,7 @@ static void dump_prop(struct device *dev, drmModePropertyPtr prop, if (drm_property_type_is(prop, DRM_MODE_PROP_ENUM)) { printf("\t\tenums:"); for (i = 0; i < prop->count_enums; i++) - printf(" %s=%llu", prop->enums[i].name, + printf(" %s=%"PRIu64, prop->enums[i].name, prop->enums[i].value); printf("\n"); } else if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) { diff --git a/tests/proptest/proptest.c b/tests/proptest/proptest.c index 5abbf029..0ab0907d 100644 --- a/tests/proptest/proptest.c +++ b/tests/proptest/proptest.c @@ -126,7 +126,7 @@ dump_prop(uint32_t prop_id, uint64_t value) if (drm_property_type_is(prop, DRM_MODE_PROP_ENUM)) { printf("\t\tenums:"); for (i = 0; i < prop->count_enums; i++) - printf(" %s=%llu", prop->enums[i].name, + printf(" %s=%"PRIu64, prop->enums[i].name, prop->enums[i].value); printf("\n"); } else if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) {