diff options
author | Eleni Maria Stea <elene.mst@gmail.com> | 2022-05-09 14:59:37 +0300 |
---|---|---|
committer | Eleni Maria Stea <elene.mst@gmail.com> | 2022-05-09 15:53:56 +0300 |
commit | 4caec56fb8ebfe475a83315a12941d80808f4dee (patch) | |
tree | 060b806454120e42b00bba1710a1e2975e23872f | |
parent | c907d4ade13a0ef883972f4bafdc94bc8c1f3573 (diff) |
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 <elene.mst@gmail.com>
-rw-r--r-- | tests/modeprint/modeprint.c | 2 | ||||
-rw-r--r-- | tests/modetest/modetest.c | 2 | ||||
-rw-r--r-- | 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:"); |