[Mesa-dev] [PATCH mesa] egl/wayland: upcast before bitwise ops

Eric Engestrom eric.engestrom at intel.com
Thu Aug 16 14:23:43 UTC 2018


Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
---
 src/egl/drivers/dri2/platform_wayland.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 0913394b365255f6af63..f1680495210987d57ba6 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -818,8 +818,8 @@ create_wl_buffer(struct dri2_egl_display *dri2_dpy,
                                            __DRI_IMAGE_ATTRIB_MODIFIER_LOWER,
                                            &mod_lo);
       if (query) {
-         modifier = (uint64_t) mod_hi << 32;
-         modifier |= (uint64_t) (mod_lo & 0xffffffff);
+         modifier = ((uint64_t) mod_hi) << 32;
+         modifier |= ((uint64_t) mod_lo) & 0xffffffff;
       }
    }
 
@@ -1192,8 +1192,8 @@ dmabuf_handle_modifier(void *data, struct zwp_linux_dmabuf_v1 *dmabuf,
    dri2_dpy->formats |= (1 << visual_idx);
 
    mod = u_vector_add(&dri2_dpy->wl_modifiers[visual_idx]);
-   *mod = (uint64_t) modifier_hi << 32;
-   *mod |= (uint64_t) (modifier_lo & 0xffffffff);
+   *mod = ((uint64_t) modifier_hi) << 32u;
+   *mod |= ((uint64_t) modifier_lo) & 0xffffffff;
 }
 
 static const struct zwp_linux_dmabuf_v1_listener dmabuf_listener = {
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list