[Mesa-dev] [PATCH] mesa: initialize variables to silence compiler warnings

Anuj Phogat anuj.phogat at gmail.com
Wed Jul 22 12:17:46 PDT 2015


On Tue, Jul 21, 2015 at 5:42 PM, Brian Paul <brianp at vmware.com> wrote:
> ---
>  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 3365c7a..376874e 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -1331,7 +1331,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];
>  }
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

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


More information about the mesa-dev mailing list