egl/wayland: remove sign from bitfield `formats`
authorEric Engestrom <eric.engestrom@intel.com>
Thu, 16 Aug 2018 14:26:10 +0000 (15:26 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Thu, 16 Aug 2018 16:38:18 +0000 (17:38 +0100)
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_wayland.c

index f8001ec4b661f6dce20b94c2f3bc1b1d9c6e8866..a6588632f776de58df480a3a823d98664be544ec 100644 (file)
@@ -223,7 +223,7 @@ struct dri2_egl_display
    struct zwp_linux_dmabuf_v1 *wl_dmabuf;
    struct u_vector          *wl_modifiers;
    bool                      authenticated;
-   int                       formats;
+   unsigned                  formats;
    uint32_t                  capabilities;
    char                     *device_name;
 #endif
index 0913394b365255f6af6301547d61eff6686ba885..43cf00b8ac05aaefb2ec8b20de5c02ec0996e354 100644 (file)
@@ -1059,7 +1059,7 @@ dri2_wl_create_wayland_buffer_from_image(_EGLDriver *drv,
    if (visual_idx == -1)
       goto bad_format;
 
-   if (!(dri2_dpy->formats & (1 << visual_idx)))
+   if (!(dri2_dpy->formats & (1u << visual_idx)))
       goto bad_format;
 
    buffer = create_wl_buffer(dri2_dpy, NULL, image);
@@ -1140,7 +1140,7 @@ drm_handle_format(void *data, struct wl_drm *drm, uint32_t format)
    if (visual_idx == -1)
       return;
 
-   dri2_dpy->formats |= (1 << visual_idx);
+   dri2_dpy->formats |= (1u << visual_idx);
 }
 
 static void
@@ -1189,7 +1189,7 @@ dmabuf_handle_modifier(void *data, struct zwp_linux_dmabuf_v1 *dmabuf,
        modifier_lo == (DRM_FORMAT_MOD_INVALID & 0xffffffff))
       return;
 
-   dri2_dpy->formats |= (1 << visual_idx);
+   dri2_dpy->formats |= (1u << visual_idx);
 
    mod = u_vector_add(&dri2_dpy->wl_modifiers[visual_idx]);
    *mod = (uint64_t) modifier_hi << 32;
@@ -1288,7 +1288,7 @@ dri2_wl_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
       for (unsigned j = 0; j < ARRAY_SIZE(dri2_wl_visuals); j++) {
          struct dri2_egl_config *dri2_conf;
 
-         if (!(dri2_dpy->formats & (1 << j)))
+         if (!(dri2_dpy->formats & (1u << j)))
             continue;
 
          dri2_conf = dri2_add_config(disp, dri2_dpy->driver_configs[i],
@@ -1906,7 +1906,7 @@ shm_handle_format(void *data, struct wl_shm *shm, uint32_t format)
    if (visual_idx == -1)
       return;
 
-   dri2_dpy->formats |= (1 << visual_idx);
+   dri2_dpy->formats |= (1u << visual_idx);
 }
 
 static const struct wl_shm_listener shm_listener = {