aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2012-11-19 13:40:00 -0800
committerChad Versace <[email protected]>2012-11-19 15:09:55 -0800
commit62332f41254c385e2290e8ee2d665c3116b3c1d6 (patch)
treea65f1611ee3dc4dda78d7f11e41b22382479528d /src/mesa/drivers
parentfdd6d146d988f920744592ad7ba5667ef2981620 (diff)
dri: Use designated initializers for DRI extension structs
The dri directory 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/common/dri_util.c57
1 files changed, 30 insertions, 27 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 983bbea49da..917b9465b74 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -563,40 +563,43 @@ dri2GetAPIMask(__DRIscreen *screen)
/** Core interface */
const __DRIcoreExtension driCoreExtension = {
- { __DRI_CORE, __DRI_CORE_VERSION },
- NULL,
- driDestroyScreen,
- driGetExtensions,
- driGetConfigAttrib,
- driIndexConfigAttrib,
- NULL,
- driDestroyDrawable,
- NULL,
- NULL,
- driCopyContext,
- driDestroyContext,
- driBindContext,
- driUnbindContext
+ .base = { __DRI_CORE, __DRI_CORE_VERSION },
+
+ .createNewScreen = NULL,
+ .destroyScreen = driDestroyScreen,
+ .getExtensions = driGetExtensions,
+ .getConfigAttrib = driGetConfigAttrib,
+ .indexConfigAttrib = driIndexConfigAttrib,
+ .createNewDrawable = NULL,
+ .destroyDrawable = driDestroyDrawable,
+ .swapBuffers = NULL,
+ .createNewContext = NULL,
+ .copyContext = driCopyContext,
+ .destroyContext = driDestroyContext,
+ .bindContext = driBindContext,
+ .unbindContext = driUnbindContext
};
/** DRI2 interface */
const __DRIdri2Extension driDRI2Extension = {
- { __DRI_DRI2, 3 },
- dri2CreateNewScreen,
- dri2CreateNewDrawable,
- dri2CreateNewContext,
- dri2GetAPIMask,
- dri2CreateNewContextForAPI,
- dri2AllocateBuffer,
- dri2ReleaseBuffer,
- dri2CreateContextAttribs
+ .base = { __DRI_DRI2, 3 },
+
+ .createNewScreen = dri2CreateNewScreen,
+ .createNewDrawable = dri2CreateNewDrawable,
+ .createNewContext = dri2CreateNewContext,
+ .getAPIMask = dri2GetAPIMask,
+ .createNewContextForAPI = dri2CreateNewContextForAPI,
+ .allocateBuffer = dri2AllocateBuffer,
+ .releaseBuffer = dri2ReleaseBuffer,
+ .createContextAttribs = dri2CreateContextAttribs
};
const __DRI2configQueryExtension dri2ConfigQueryExtension = {
- { __DRI2_CONFIG_QUERY, __DRI2_CONFIG_QUERY_VERSION },
- dri2ConfigQueryb,
- dri2ConfigQueryi,
- dri2ConfigQueryf,
+ .base = { __DRI2_CONFIG_QUERY, __DRI2_CONFIG_QUERY_VERSION },
+
+ .configQueryb = dri2ConfigQueryb,
+ .configQueryi = dri2ConfigQueryi,
+ .configQueryf = dri2ConfigQueryf,
};
void