[Piglit] [PATCH 4/4] util/fbo: Fix -Wunused-function warnings

Chad Versace chad.versace at linux.intel.com
Wed Jul 9 14:47:52 PDT 2014


Fix the warnings below.

piglit_fbo_framework.c:32:1: warning: ‘destroy’ defined but not used [-Wunused-function]
 destroy(struct piglit_gl_framework *gl_fw)
 ^
piglit_fbo_framework.c:44:1: warning: ‘run_test’ defined but not used [-Wunused-function]
 run_test(struct piglit_gl_framework *gl_fw,
 ^
piglit_fbo_framework.c:58:1: warning: ‘init_gl’ defined but not used [-Wunused-function]
 init_gl(struct piglit_wfl_framework *wfl_fw)
 ^

The problem was that most of the file was discarded by the preprocessor when
building for ES1. Fix it by carefully moving the #ifdef PIGLIT_USE_OPENGL_ES1 guards.

This patch shouldn't change any runtime behavior.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 tests/util/piglit-framework-gl/piglit_fbo_framework.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/util/piglit-framework-gl/piglit_fbo_framework.c b/tests/util/piglit-framework-gl/piglit_fbo_framework.c
index 8e82657..aedd9fe 100644
--- a/tests/util/piglit-framework-gl/piglit_fbo_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_fbo_framework.c
@@ -131,15 +131,18 @@ init_gl(struct piglit_wfl_framework *wfl_fw)
 struct piglit_gl_framework*
 piglit_fbo_framework_create(const struct piglit_gl_test_config *test_config)
 {
-#ifdef PIGLIT_USE_OPENGL_ES1
-	return NULL;
-#else
 	struct piglit_wfl_framework *wfl_fw;
 	struct piglit_gl_framework *gl_fw;
 
-	int32_t platform = piglit_wfl_framework_choose_platform(test_config);
+	int32_t platform;
 	bool ok = true;
 
+#ifdef PIGLIT_USE_OPENGL_ES1
+	return NULL;
+#endif
+
+	platform = piglit_wfl_framework_choose_platform(test_config);
+
 	if (test_config->window_samples > 1) {
 		puts("The FBO mode doesn't support multisampling\n");
 		piglit_report_result(PIGLIT_FAIL);
@@ -164,5 +167,4 @@ piglit_fbo_framework_create(const struct piglit_gl_test_config *test_config)
 fail:
 	destroy(gl_fw);
 	return NULL;
-#endif /* PIGLIT_USE_OPENGL_ES1 */
 }
-- 
2.0.0



More information about the Piglit mailing list