From 81ca8b93f212d1946c70660041ce97d98f352608 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Jan 2009 15:56:19 -0700 Subject: swrast: replace macro with inline function --- src/mesa/swrast/s_context.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/mesa/swrast/s_context.h') diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index a511d1c9a1..46a5fa24f8 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -238,7 +238,20 @@ extern void _swrast_update_texture_samplers(GLcontext *ctx); -#define SWRAST_CONTEXT(ctx) ((SWcontext *)ctx->swrast_context) +/** Return SWcontext for the given GLcontext */ +static INLINE SWcontext * +SWRAST_CONTEXT(GLcontext *ctx) +{ + return (SWcontext *) ctx->swrast_context; +} + +/** const version of above */ +static INLINE const SWcontext * +CONST_SWRAST_CONTEXT(const GLcontext *ctx) +{ + return (const SWcontext *) ctx->swrast_context; +} + #define RENDER_START(SWctx, GLctx) \ do { \ -- cgit v1.2.3