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 <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Simon Ser <contact@emersion.fr>
main
Alex Richardson 2021-10-05 12:10:08 +01:00 committed by Simon Ser
parent d77ccdf3ba
commit fda3d0010f
3 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -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)) {

View File

@ -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)) {