summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/framebuffer.c
diff options
context:
space:
mode:
authorRob Herring <[email protected]>2017-05-30 15:30:38 -0500
committerRob Herring <[email protected]>2017-06-07 20:44:26 -0500
commitf4b5510872b94a434a5223e35a67db322aad5e8b (patch)
treeb3002db5c1f8a80711bdca45df3ec6aabf39931a /src/mesa/main/framebuffer.c
parent18348a383dae41567fd333db6f848fbc8ff7d99b (diff)
mesa/main: fix gl_buffer_index enum comparison
For clang, enums are unsigned by default and gives the following warning: external/mesa3d/src/mesa/main/buffers.c:764:21: warning: comparison of constant -1 with expression of type 'gl_buffer_index' is always false [-Wtautological-constant-out-of-range-compare] if (srcBuffer == -1) { ~~~~~~~~~ ^ ~~ Replace -1 with an enum value to fix this. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Rob Herring <[email protected]>
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r--src/mesa/main/framebuffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 993cd37137b..c4eecf6ce96 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -251,7 +251,7 @@ _mesa_reference_framebuffer_(struct gl_framebuffer **ptr,
oldFb->RefCount--;
deleteFlag = (oldFb->RefCount == 0);
mtx_unlock(&oldFb->Mutex);
-
+
if (deleteFlag)
oldFb->Delete(oldFb);
@@ -624,7 +624,7 @@ static void
update_color_read_buffer(struct gl_context *ctx, struct gl_framebuffer *fb)
{
(void) ctx;
- if (fb->_ColorReadBufferIndex == -1 ||
+ if (fb->_ColorReadBufferIndex == BUFFER_NONE ||
fb->DeletePending ||
fb->Width == 0 ||
fb->Height == 0) {