From: Brian Paul Date: Sat, 28 Feb 2009 05:21:42 +0000 (-0700) Subject: mesa: convert macro to inline function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8bf25a17d2f8f888e8e8a4f7a2c6d68c6c06f6e8;p=mesa.git mesa: convert macro to inline function --- diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index 5073ccbef59..beab535b15f 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -203,11 +203,14 @@ _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) * Verifies there is free space in the buffer to write the value and * increments the pointer. */ -#define WRITE_RECORD( CTX, V ) \ - if (CTX->Select.BufferCount < CTX->Select.BufferSize) { \ - CTX->Select.Buffer[CTX->Select.BufferCount] = (V); \ - } \ - CTX->Select.BufferCount++; +static INLINE void +write_record(GLcontext *ctx, GLuint value) +{ + if (ctx->Select.BufferCount < ctx->Select.BufferSize) { + ctx->Select.Buffer[ctx->Select.BufferCount] = value; + } + ctx->Select.BufferCount++; +} /** @@ -256,11 +259,11 @@ write_hit_record(GLcontext *ctx) zmin = (GLuint) ((GLfloat) zscale * ctx->Select.HitMinZ); zmax = (GLuint) ((GLfloat) zscale * ctx->Select.HitMaxZ); - WRITE_RECORD( ctx, ctx->Select.NameStackDepth ); - WRITE_RECORD( ctx, zmin ); - WRITE_RECORD( ctx, zmax ); + write_record( ctx, ctx->Select.NameStackDepth ); + write_record( ctx, zmin ); + write_record( ctx, zmax ); for (i = 0; i < ctx->Select.NameStackDepth; i++) { - WRITE_RECORD( ctx, ctx->Select.NameStack[i] ); + write_record( ctx, ctx->Select.NameStack[i] ); } ctx->Select.Hits++;