From 4caec56fb8ebfe475a83315a12941d80808f4dee Mon Sep 17 00:00:00 2001 From: Eleni Maria Stea Date: Mon, 9 May 2022 14:59:37 +0300 Subject: [PATCH] modeprint, modetest, proptest: cast __u64 to uint64_t It seems that __u64 values are defined differently across systems. In glibc it's defined as unsigned long, in Linux kernel headers (int-ll64.h) as unsigned long long, and on FreeBSD as uint64_t so it matches glibc. A temporal solution is to cast all __u64 values to uint64_t to avoid warnings on Linux, but ideally we'd like a better fix in the future. See also: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/212 for discussion. Signed-off-by: Eleni Maria Stea --- 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 f424f19d..880269b0 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%" PRId64 " = %s\n", props->enums[j].value, props->enums[j].name); + printf("\t\t%" PRId64" = %s\n", (uint64_t)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 5fd22f79..d6ab9dc8 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -376,7 +376,7 @@ static void dump_prop(struct device *dev, drmModePropertyPtr prop, printf("\t\tenums:"); for (i = 0; i < prop->count_enums; i++) printf(" %s=%"PRIu64, prop->enums[i].name, - prop->enums[i].value); + (uint64_t)prop->enums[i].value); printf("\n"); } else if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) { printf("\t\tvalues:"); diff --git a/tests/proptest/proptest.c b/tests/proptest/proptest.c index 0ab0907d..88bed10b 100644 --- a/tests/proptest/proptest.c +++ b/tests/proptest/proptest.c @@ -127,7 +127,7 @@ dump_prop(uint32_t prop_id, uint64_t value) printf("\t\tenums:"); for (i = 0; i < prop->count_enums; i++) printf(" %s=%"PRIu64, prop->enums[i].name, - prop->enums[i].value); + (uint64_t)prop->enums[i].value); printf("\n"); } else if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) { printf("\t\tvalues:");