From: Brian Paul Date: Mon, 21 Feb 2011 22:11:44 +0000 (-0700) Subject: mesa: convert macros to inline functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e9ff76aa81d9bd973d46b7e46f1e4ece2112a5b7;p=mesa.git mesa: convert macros to inline functions --- diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 4e391dde494..8c115c73c65 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -192,41 +192,41 @@ _mesa_Flush( void ); /** * Flush vertices. - * - * \param ctx GL context. - * \param newstate new state. + * \param newstate bitmask of _NEW_x flags * * Checks if dd_function_table::NeedFlush is marked to flush stored vertices, * and calls dd_function_table::FlushVertices if so. Marks * __struct gl_contextRec::NewState with \p newstate. */ -#define FLUSH_VERTICES(ctx, newstate) \ -do { \ - if (MESA_VERBOSE & VERBOSE_STATE) \ - _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\ - if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \ - ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \ - ctx->NewState |= newstate; \ -} while (0) +static INLINE void +FLUSH_VERTICES(struct gl_context *ctx, GLbitfield newstate) +{ + if (MESA_VERBOSE & VERBOSE_STATE) + _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION); + if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) + ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); + ctx->NewState |= newstate; +} + /** * Flush current state. - * - * \param ctx GL context. - * \param newstate new state. + * \param newstate bitmask of _NEW_x flags * * Checks if dd_function_table::NeedFlush is marked to flush current state, * and calls dd_function_table::FlushVertices if so. Marks * __struct gl_contextRec::NewState with \p newstate. */ -#define FLUSH_CURRENT(ctx, newstate) \ -do { \ - if (MESA_VERBOSE & VERBOSE_STATE) \ - _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION); \ - if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \ - ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \ - ctx->NewState |= newstate; \ -} while (0) +static INLINE void +FLUSH_CURRENT(struct gl_context *ctx, GLbitfield newstate) +{ + if (MESA_VERBOSE & VERBOSE_STATE) + _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION); + if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) + ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); + ctx->NewState |= newstate; +} + /** * Macro to assert that the API call was made outside the