egl_dri2: Use _EGL_DRIVER_STANDARD_TYPECASTS.
authorChia-I Wu <olvaffe@gmail.com>
Fri, 5 Feb 2010 03:38:34 +0000 (11:38 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Fri, 5 Feb 2010 03:45:01 +0000 (11:45 +0800)
It saves the driver from defining the boring typecasts itself.

src/egl/drivers/dri2/egl_dri2.c

index 3bdac2944cb044e2c8fc5ed87175f379e4c91c75..d53f1375305a351dbeaef63b6ed19b27f7f81ee0 100644 (file)
@@ -97,35 +97,8 @@ struct dri2_egl_config
    const __DRIconfig *dri_config;
 };
 
-static struct dri2_egl_driver *
-dri2_egl_driver(_EGLDriver *drv)
-{
-   return (struct dri2_egl_driver *) drv;
-}
-
-static struct dri2_egl_display *
-dri2_egl_display(_EGLDisplay *dpy)
-{
-   return (struct dri2_egl_display *) dpy->DriverData;
-}
-
-static struct dri2_egl_context *
-dri2_egl_context(_EGLContext *ctx)
-{
-   return (struct dri2_egl_context *) ctx;
-}
-
-static struct dri2_egl_surface *
-dri2_egl_surface(_EGLSurface *surf)
-{
-   return (struct dri2_egl_surface *) surf;
-}
-
-static struct dri2_egl_config *
-dri2_egl_config(_EGLConfig *conf)
-{
-   return (struct dri2_egl_config *) conf;
-}
+/* standard typecasts */
+_EGL_DRIVER_STANDARD_TYPECASTS(dri2_egl)
 
 EGLint dri2_to_egl_attribute_map[] = {
    0,