aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/feedback.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-02-27 22:21:42 -0700
committerBrian Paul <[email protected]>2009-02-28 09:35:16 -0700
commit8bf25a17d2f8f888e8e8a4f7a2c6d68c6c06f6e8 (patch)
tree89d7099e65e9631f6391fe1ad422c6a097c2d86a /src/mesa/main/feedback.c
parentbf8a187f71bd667a0dc0f70164a897d8e62361a8 (diff)
mesa: convert macro to inline function
Diffstat (limited to 'src/mesa/main/feedback.c')
-rw-r--r--src/mesa/main/feedback.c21
1 files changed, 12 insertions, 9 deletions
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++;