From 39c5d93dea03544bf1923e9092fc8d1f66d212e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Fri, 9 Aug 2019 15:20:52 +0200 Subject: [PATCH] backend/drm: use UINT64_C for uint64_t literals Prevents an integer promotion bug during the byte-shift. --- backend/drm/drm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 881f10f6..bc74a506 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -1427,7 +1428,7 @@ int handle_drm_event(int fd, uint32_t mask, void *data) { } void restore_drm_outputs(struct wlr_drm_backend *drm) { - uint64_t to_close = (1L << wl_list_length(&drm->outputs)) - 1; + uint64_t to_close = (UINT64_C(1) << wl_list_length(&drm->outputs)) - 1; struct wlr_drm_connector *conn; wl_list_for_each(conn, &drm->outputs, link) { @@ -1444,7 +1445,7 @@ void restore_drm_outputs(struct wlr_drm_backend *drm) { struct wlr_drm_connector *conn; wl_list_for_each(conn, &drm->outputs, link) { if (conn->state != WLR_DRM_CONN_CLEANUP || !conn->pageflip_pending) { - to_close &= ~(1 << i); + to_close &= ~(UINT64_C(1) << i); } i++; }