[Piglit] [PATCH] shader_runner: Fix GCC warnings.

Vinson Lee vlee at freedesktop.org
Fri Jan 10 19:28:30 PST 2014


This patch fixes these GCC warnings.

shaders/shader_runner.c: In function 'compare':
shader_runner.c:376:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
shader_runner.c: In function 'comparison_string':
shader_runner.c:395:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
shader_runner.c: In function 'piglit_display':
shader_runner.c:1628:8: warning: 'parameter_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
  value = lookup_enum_string(strings, &line, parameter_name);
        ^
shader_runner.c:1572:14: note: 'parameter_name' was declared here
  const char *parameter_name;
              ^
shader_runner.c:1629:17: warning: 'parameter' may be used uninitialized in this function [-Wmaybe-uninitialized]
  glTexParameteri(target, parameter, value);
                 ^
shader_runner.c:1571:9: note: 'parameter' was declared here
  GLenum parameter;
         ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/shaders/shader_runner.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index d78514b..018b143 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -373,6 +373,7 @@ compare(float ref, float value, enum comparison cmp)
 	}
 
 	assert(!"Should not get here.");
+	return false;
 }
 
 
@@ -392,6 +393,7 @@ comparison_string(enum comparison cmp)
 	}
 
 	assert(!"Should not get here.");
+	return false;
 }
 
 
@@ -1568,8 +1570,8 @@ handle_texparameter(const char *line)
 		{ "alpha", GL_ALPHA },
 	};
 	GLenum target = 0;
-	GLenum parameter;
-	const char *parameter_name;
+	GLenum parameter = GL_NONE;
+	const char *parameter_name = NULL;
 	const struct string_to_enum *strings = NULL;
 	GLenum value;
 
-- 
1.8.4.2



More information about the Piglit mailing list