diff options
author | Chia-I Wu <[email protected]> | 2010-02-04 13:16:24 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-02-04 14:36:48 +0800 |
commit | 9a3de505dc5377a47a6ccb29fe60343feb2f5b14 (patch) | |
tree | ff22dddf5676b3223e0607b7a9b253518406184e /src/egl | |
parent | bdb9e202de2524821bec1a136d48af70df8fb60e (diff) |
egl: Convert drivers to use typecast macros.
Use macros to define the standard typecasts. This saves lots of
typings.
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/glx/egl_glx.c | 29 | ||||
-rw-r--r-- | src/egl/drivers/xdri/egl_xdri.c | 42 |
2 files changed, 10 insertions, 61 deletions
diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c index 8e6b5b07a2f..3cbfebe4881 100644 --- a/src/egl/drivers/glx/egl_glx.c +++ b/src/egl/drivers/glx/egl_glx.c @@ -116,35 +116,14 @@ struct GLX_egl_config int index; }; -/** cast wrapper */ -static struct GLX_egl_driver * -GLX_egl_driver(_EGLDriver *drv) -{ - return (struct GLX_egl_driver *) drv; -} - -static struct GLX_egl_display * -GLX_egl_display(_EGLDisplay *dpy) -{ - return (struct GLX_egl_display *) dpy->DriverData; -} - -static struct GLX_egl_context * -GLX_egl_context(_EGLContext *ctx) -{ - return (struct GLX_egl_context *) ctx; -} - -static struct GLX_egl_surface * -GLX_egl_surface(_EGLSurface *surf) -{ - return (struct GLX_egl_surface *) surf; -} +/* standard typecasts */ +_EGL_DRIVER_STANDARD_TYPECASTS(GLX_egl) static int GLX_egl_config_index(_EGLConfig *conf) { - return ((struct GLX_egl_config *) conf)->index; + struct GLX_egl_config *GLX_conf = GLX_egl_config(conf); + return GLX_conf->index; } diff --git a/src/egl/drivers/xdri/egl_xdri.c b/src/egl/drivers/xdri/egl_xdri.c index 68e659eb276..555473c00a5 100644 --- a/src/egl/drivers/xdri/egl_xdri.c +++ b/src/egl/drivers/xdri/egl_xdri.c @@ -112,43 +112,13 @@ struct xdri_egl_config -/** cast wrapper */ -static INLINE struct xdri_egl_driver * -xdri_egl_driver(_EGLDriver *drv) -{ - return (struct xdri_egl_driver *) drv; -} - +/* standard typecasts */ +_EGL_DRIVER_STANDARD_TYPECASTS(xdri_egl) -static INLINE struct xdri_egl_display * -lookup_display(_EGLDisplay *dpy) -{ - return (struct xdri_egl_display *) dpy->DriverData; -} - - -/** Map EGLSurface handle to xdri_egl_surface object */ -static INLINE struct xdri_egl_surface * -lookup_surface(_EGLSurface *surface) -{ - return (struct xdri_egl_surface *) surface; -} - - -/** Map EGLContext handle to xdri_egl_context object */ -static INLINE struct xdri_egl_context * -lookup_context(_EGLContext *context) -{ - return (struct xdri_egl_context *) context; -} - - -/** Map EGLConfig handle to xdri_egl_config object */ -static INLINE struct xdri_egl_config * -lookup_config(_EGLConfig *conf) -{ - return (struct xdri_egl_config *) conf; -} +#define lookup_display(dpy) xdri_egl_display(dpy) +#define lookup_context(ctx) xdri_egl_context(ctx) +#define lookup_surface(surf) xdri_egl_surface(surf) +#define lookup_config(conf) xdri_egl_config(conf) /** Get size of given window */ |