Mesa (master): mesa: initialize variables to silence compiler warnings

Brian Paul brianp at kemper.freedesktop.org
Fri Jul 24 02:21:43 UTC 2015


Module: Mesa
Branch: master
Commit: dbefffa5b4c438008d44db106b5774f575cb495f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dbefffa5b4c438008d44db106b5774f575cb495f

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Jul 21 18:42:41 2015 -0600

mesa: initialize variables to silence compiler warnings

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

---

 src/mesa/main/fbobject.c  |    4 ++--
 src/mesa/main/shaderapi.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index f46554b..cc342c2 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -3304,7 +3304,7 @@ _mesa_FramebufferTexture(GLenum target, GLenum attachment,
    GET_CURRENT_CONTEXT(ctx);
    struct gl_framebuffer *fb;
    struct gl_texture_object *texObj;
-   GLboolean layered;
+   GLboolean layered = GL_FALSE;
 
    const char *func = "FramebufferTexture";
 
@@ -3347,7 +3347,7 @@ _mesa_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment,
    GET_CURRENT_CONTEXT(ctx);
    struct gl_framebuffer *fb;
    struct gl_texture_object *texObj;
-   GLboolean layered;
+   GLboolean layered = GL_FALSE;
 
    const char *func = "glNamedFramebufferTexture";
 
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 34d280a..b86f22e 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1432,7 +1432,7 @@ void GLAPIENTRY
 _mesa_GetObjectParameterfvARB(GLhandleARB object, GLenum pname,
                               GLfloat *params)
 {
-   GLint iparams[1];  /* XXX is one element enough? */
+   GLint iparams[1] = {0};  /* XXX is one element enough? */
    _mesa_GetObjectParameterivARB(object, pname, iparams);
    params[0] = (GLfloat) iparams[0];
 }




More information about the mesa-commit mailing list