mesa/fbo: do not assign a value that is never read later on
authorMartin Peres <martin.peres@linux.intel.com>
Wed, 25 Mar 2015 14:28:03 +0000 (16:28 +0200)
committerMartin Peres <martin.peres@linux.intel.com>
Wed, 1 Apr 2015 06:36:27 +0000 (09:36 +0300)
The issue has been detected by coverty.

v2:
- move the declaration of obj to the else clause (Brian Paul)

v3: Review by Brian Paul
- get rid of the obj declaration in favor of a direct reference

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
src/mesa/main/fbobject.c

index 072e1a8c8bbf5055d89c2c8201f29d0f8c77f6e1..3808b560e816ba46ed832cfc6483008ddfaf49c2 100644 (file)
@@ -1400,7 +1400,6 @@ create_render_buffers(struct gl_context *ctx, GLsizei n, GLuint *renderbuffers,
                       bool dsa)
 {
    const char *func = dsa ? "glCreateRenderbuffers" : "glGenRenderbuffers";
-   struct gl_renderbuffer *obj;
    GLuint first;
    GLint i;
 
@@ -1419,13 +1418,11 @@ create_render_buffers(struct gl_context *ctx, GLsizei n, GLuint *renderbuffers,
       renderbuffers[i] = name;
 
       if (dsa) {
-         obj = allocate_renderbuffer(ctx, name, func);
+         allocate_renderbuffer(ctx, name, func);
       } else {
-         obj = &DummyRenderbuffer;
-
-         /* insert the object into the hash table */
+         /* insert a dummy renderbuffer into the hash table */
          mtx_lock(&ctx->Shared->Mutex);
-         _mesa_HashInsert(ctx->Shared->RenderBuffers, name, obj);
+         _mesa_HashInsert(ctx->Shared->RenderBuffers, name, &DummyRenderbuffer);
          mtx_unlock(&ctx->Shared->Mutex);
       }
    }