From 5f280d0c4416627810de73a6c68c422453d2b7d9 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Wed, 12 Feb 2014 20:13:15 +0000 Subject: [PATCH] egl_dri: rework dri extension handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use designated initialisers, and store the extensions pointers as const. The loader extensions __DRIdri2LoaderExtension and __DRIswrastLoaderExtension are setup by the platform backends so they should not be constified. Signed-off-by: Emil Velikov Reviewed-by: Ian Romanick Reviewed-by: Kristian Høgsberg --- src/egl/drivers/dri2/egl_dri2.c | 7 ++++--- src/egl/drivers/dri2/egl_dri2.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 81a354236f4..380bd7b095e 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -52,7 +52,7 @@ #include "egl_dri2.h" const __DRIuseInvalidateExtension use_invalidate = { - { __DRI_USE_INVALIDATE, 1 } + .base = { __DRI_USE_INVALIDATE, 1 } }; EGLint dri2_to_egl_attribute_map[] = { @@ -299,8 +299,9 @@ dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data) } const __DRIimageLookupExtension image_lookup_extension = { - { __DRI_IMAGE_LOOKUP, 1 }, - dri2_lookup_egl_image + .base = { __DRI_IMAGE_LOOKUP, 1 }, + + .lookupEGLImage = dri2_lookup_egl_image }; static const char dri_driver_path[] = DEFAULT_DRIVER_DIR; diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index e62e265b25e..44d6d74b948 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -150,14 +150,14 @@ struct dri2_egl_display int own_dri_screen; const __DRIconfig **driver_configs; void *driver; - __DRIcoreExtension *core; - __DRIdri2Extension *dri2; - __DRIswrastExtension *swrast; - __DRI2flushExtension *flush; - __DRItexBufferExtension *tex_buffer; - __DRIimageExtension *image; - __DRIrobustnessExtension *robustness; - __DRI2configQueryExtension *config; + const __DRIcoreExtension *core; + const __DRIdri2Extension *dri2; + const __DRIswrastExtension *swrast; + const __DRI2flushExtension *flush; + const __DRItexBufferExtension *tex_buffer; + const __DRIimageExtension *image; + const __DRIrobustnessExtension *robustness; + const __DRI2configQueryExtension *config; int fd; int own_device; -- 2.30.2