diff options
author | Chad Versace <[email protected]> | 2012-11-19 11:43:51 -0800 |
---|---|---|
committer | Chad Versace <[email protected]> | 2012-11-19 15:09:55 -0800 |
commit | c9f5126b15440fecf6ff705d5b9766767c1712af (patch) | |
tree | e90ac5fcd1551b1d8838658c01c0ec00901c9fca /src/mesa/drivers | |
parent | 62332f41254c385e2290e8ee2d665c3116b3c1d6 (diff) |
intel: Use designated initializers for DRI extension structs
All Intel code is compiled with -std=c99. There is no excuse to not use
designated initializers.
As a nice benefit, the code is now more friendly to grep. Without
designated initializers, psychic prowess is required to find the
initialization of DRI extension function pointers with grep. I have
observed several people, when they first encounter the DRI code, fail at
statically chasing the DRI function pointers due to this problem.
Reviewed-by: Matt Turner <[email protected]>
Acked-by: Kenneth Graunke <[email protected]>
Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_screen.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 0194804db25..4e2742fe697 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -158,9 +158,11 @@ aub_dump_bmp(struct gl_context *ctx) } static const __DRItexBufferExtension intelTexBufferExtension = { - { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION }, - intelSetTexBuffer, - intelSetTexBuffer2, + .base = { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION }, + + .setTexBuffer = intelSetTexBuffer, + .setTexBuffer2 = intelSetTexBuffer2, + .releaseTexBuffer = NULL, }; static void @@ -186,9 +188,10 @@ intelDRI2Flush(__DRIdrawable *drawable) } static const struct __DRI2flushExtensionRec intelFlushExtension = { - { __DRI2_FLUSH, __DRI2_FLUSH_VERSION }, - intelDRI2Flush, - dri2InvalidateDrawable, + .base = { __DRI2_FLUSH, __DRI2_FLUSH_VERSION }, + + .flush = intelDRI2Flush, + .invalidate = dri2InvalidateDrawable, }; static struct intel_image_format intel_image_formats[] = { @@ -574,16 +577,17 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate) } static struct __DRIimageExtensionRec intelImageExtension = { - { __DRI_IMAGE, 5 }, - intel_create_image_from_name, - intel_create_image_from_renderbuffer, - intel_destroy_image, - intel_create_image, - intel_query_image, - intel_dup_image, - intel_validate_usage, - intel_create_image_from_names, - intel_from_planar + .base = { __DRI_IMAGE, 5 }, + + .createImageFromName = intel_create_image_from_name, + .createImageFromRenderbuffer = intel_create_image_from_renderbuffer, + .destroyImage = intel_destroy_image, + .createImage = intel_create_image, + .queryImage = intel_query_image, + .dupImage = intel_dup_image, + .validateUsage = intel_validate_usage, + .createImageFromNames = intel_create_image_from_names, + .fromPlanar = intel_from_planar }; static const __DRIextension *intelScreenExtensions[] = { |