aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonin Décimo <antonin.decimo@gmail.com>2019-08-09 15:20:52 +0200
committerDrew DeVault <sir@cmpwn.com>2019-08-12 09:37:21 +0900
commit39c5d93dea03544bf1923e9092fc8d1f66d212e0 (patch)
treec8a160302dd189c8177199578cf1ce204ce2b7e3
parent68b4a5305e8dfca2056d0b49d947e8df831c6961 (diff)
backend/drm: use UINT64_C for uint64_t literals
Prevents an integer promotion bug during the byte-shift.
-rw-r--r--backend/drm/drm.c5
1 files 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 <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <inttypes.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -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++;
}