diff options
Diffstat (limited to 'src/mesa/drivers/x11/xmesaP.h')
-rw-r--r-- | src/mesa/drivers/x11/xmesaP.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 9d4e6946090..bcac0557b98 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -480,12 +480,14 @@ extern const int xmesa_kernel1[16]; /* * Return pointer to XMesaContext corresponding to a Mesa GLcontext. * Since we're using structure containment, it's just a cast!. + * XXX should use inlined function for better type safety. */ #define XMESA_CONTEXT(MESACTX) ((XMesaContext) (MESACTX)) /* * Return pointer to XMesaBuffer corresponding to a Mesa GLframebuffer. * Since we're using structure containment, it's just a cast!. + * XXX should use inlined function for better type safety. */ #define XMESA_BUFFER(MESABUFF) ((XMesaBuffer) (MESABUFF)) @@ -520,6 +522,16 @@ xmesa_set_renderbuffer_funcs(struct xmesa_renderbuffer *xrb, enum pixel_format pixelformat, GLint depth); +/** + * Using a function instead of an ordinary cast is safer. + */ +static INLINE struct xmesa_renderbuffer * +xmesa_renderbuffer(struct gl_renderbuffer *rb) +{ + return (struct xmesa_renderbuffer *) rb; +} + + /* Plugged into the software rasterizer. Try to use internal * swrast-style point, line and triangle functions. */ |