Mesa (mesa_7_7_branch): progs/test: Initialize variable in prog_parameter.

Andre Maasikas andrem at kemper.freedesktop.org
Tue Dec 8 00:55:09 PST 2009


Module: Mesa
Branch: mesa_7_7_branch
Commit: 3e8b2fda215689b9a77c73020a1efc523995931e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e8b2fda215689b9a77c73020a1efc523995931e

Author: Vinson Lee <vlee at vmware.com>
Date:   Mon Dec  7 18:40:37 2009 -0800

progs/test: Initialize variable in prog_parameter.

Silences uninitialized variable compiler warning.

---

 progs/tests/prog_parameter.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/progs/tests/prog_parameter.c b/progs/tests/prog_parameter.c
index 0241f3a..2de7e29 100644
--- a/progs/tests/prog_parameter.c
+++ b/progs/tests/prog_parameter.c
@@ -192,6 +192,7 @@ static void Init( void )
    GLfloat * params;
    GLint max_program_env_parameters;
    GLint max_program_local_parameters;
+   int i;
 
 
    printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
@@ -238,6 +239,10 @@ static void Init( void )
 
    params = malloc(max_program_env_parameters * 4 * sizeof(GLfloat));
 
+   for (i = 0; i < max_program_env_parameters * 4; i++) {
+      params[i] = 0.0F;
+   }
+
    pass &= set_parameter_batch(max_program_env_parameters, params, "Env",
 			       program_env_parameter4fv,
 			       program_env_parameters4fv,



More information about the mesa-commit mailing list