[Mesa-dev] [PATCH 6/6] gallium-egl: Use native types rather than EGL ones

Emil Velikov emil.l.velikov at gmail.com
Thu Apr 11 16:22:35 PDT 2013


Change egl_g3d_wl_drm_common_query_buffer() to use boolean/int rather than
EGLBoolean/EGLint, based on the interface in native_wayland_bufmgr.h,

Resolves type conversion warnings spotted by gcc

x11/native_dri2.c:892:1: warning: initialization from incompatible pointer
type[enabled by default]
 };
 ^

x11/native_dri2.c:892:1: warning: (near initialization for
'dri2_display_wayland_bufmgr.query_buffer') [enabled by default]

wayland/native_drm.c:302:1: warning: initialization from incompatible pointer
type [enabled by default]
 };
 ^
wayland/native_drm.c:302:1: warning: (near initialization for
'wayland_drm_display_wayland_bufmgr.query_buffer') [enabled by default]

drm/native_drm.c:244:1: warning: initialization from incompatible pointer
type [enabled by default]
 };
 ^
drm/native_drm.c:244:1: warning: (near initialization for
'drm_display_wayland_bufmgr.query_buffer') [enabled by default]

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 .../egl/common/native_wayland_drm_bufmgr_helper.c        | 16 ++++++++--------
 .../egl/common/native_wayland_drm_bufmgr_helper.h        |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
index a9e7342..0711236 100644
--- a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
+++ b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
@@ -69,10 +69,10 @@ egl_g3d_wl_drm_common_wl_buffer_get_resource(struct native_display *ndpy,
    return wayland_drm_buffer_get_buffer(buffer);
 }
 
-EGLBoolean
+boolean
 egl_g3d_wl_drm_common_query_buffer(struct native_display *ndpy,
                                    struct wl_buffer *_buffer,
-                                   EGLint attribute, EGLint *value)
+                                   int attribute, int *value)
 {
    struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;
    struct pipe_resource *resource = buffer->driver_buffer;
@@ -85,21 +85,21 @@ egl_g3d_wl_drm_common_query_buffer(struct native_display *ndpy,
       switch (resource->format) {
       case PIPE_FORMAT_B8G8R8A8_UNORM:
          *value = EGL_TEXTURE_RGBA;
-         return EGL_TRUE;
+         return TRUE;
       case PIPE_FORMAT_B8G8R8X8_UNORM:
          *value = EGL_TEXTURE_RGB;
-         return EGL_TRUE;
+         return TRUE;
       default:
-         return EGL_FALSE;
+         return FALSE;
       }
    case EGL_WIDTH:
       *value = buffer->buffer.width;
-      return EGL_TRUE;
+      return TRUE;
    case EGL_HEIGHT:
       *value = buffer->buffer.height;
-      return EGL_TRUE;
+      return TRUE;
    default:
-      return EGL_FALSE;
+      return FALSE;
    }
 }
 
diff --git a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
index de00580..9eb986b 100644
--- a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
+++ b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
@@ -40,9 +40,9 @@ struct pipe_resource *
 egl_g3d_wl_drm_common_wl_buffer_get_resource(struct native_display *ndpy,
                                              struct wl_buffer *buffer);
 
-EGLBoolean
+boolean
 egl_g3d_wl_drm_common_query_buffer(struct native_display *ndpy,
                                    struct wl_buffer *buffer,
-                                   EGLint attribute, EGLint *value);
+                                   int attribute, int *value);
 
 #endif /* _NATIVE_WAYLAND_DRM_BUFMGR_HELPER_H_ */
-- 
1.8.2.1



More information about the mesa-dev mailing list