summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/clear.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-11-08 22:18:40 -0700
committerBrian Paul <[email protected]>2017-11-09 14:13:59 -0700
commitf8bae523d98953aa17105ecf12c5db499deb58ad (patch)
tree718d93771894324eaf2cbb94bbc8769dc2680080 /src/mesa/main/clear.c
parent366453f4d36e75bb4d8ec66feb5db7c92c748739 (diff)
mesa: s/GLint/gl_buffer_index/ for _ColorDrawBufferIndexes
Also fix local variable declarations and replace -1 with BUFFER_NONE. No Piglit changes. Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/mesa/main/clear.c')
-rw-r--r--src/mesa/main/clear.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index c5e7f1346b0..be604426a0a 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -194,9 +194,9 @@ clear(struct gl_context *ctx, GLbitfield mask, bool no_error)
if (mask & GL_COLOR_BUFFER_BIT) {
GLuint i;
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
- GLint buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[i];
+ gl_buffer_index buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[i];
- if (buf >= 0 && color_buffer_writes_enabled(ctx, i)) {
+ if (buf != BUFFER_NONE && color_buffer_writes_enabled(ctx, i)) {
bufferMask |= 1 << buf;
}
}
@@ -321,9 +321,10 @@ make_color_buffer_mask(struct gl_context *ctx, GLint drawbuffer)
break;
default:
{
- GLint buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[drawbuffer];
+ gl_buffer_index buf =
+ ctx->DrawBuffer->_ColorDrawBufferIndexes[drawbuffer];
- if (buf >= 0 && att[buf].Renderbuffer) {
+ if (buf != BUFFER_NONE && att[buf].Renderbuffer) {
mask |= 1 << buf;
}
}