[1/2] util: fix warnings

Submitted by Marek Olšák on April 21, 2016, 3:39 p.m.

Details

Message ID 1461253197-20300-1-git-send-email-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Marek Olšák April 21, 2016, 3:39 p.m.
From: Marek Olšák <marek.olsak@amd.com>

---
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 4 +++-
 tests/util/piglit-shader.c                            | 1 +
 tests/util/piglit-util-gl.c                           | 5 +++++
 3 files changed, 9 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index faf758b..10f8821 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -264,6 +264,7 @@  make_config_attrib_list(const struct piglit_gl_test_config *test_config,
 	int i;
 
 	/* Derived class must not provide any context attributes. */
+	(void)junk;
 	assert(waffle_attrib_list_get(partial_attrib_list, WAFFLE_CONTEXT_API, &junk) == false);
 	assert(waffle_attrib_list_get(partial_attrib_list, WAFFLE_CONTEXT_PROFILE, &junk) == false);
 	assert(waffle_attrib_list_get(partial_attrib_list, WAFFLE_CONTEXT_MAJOR_VERSION, &junk) == false);
@@ -339,7 +340,7 @@  make_config_attrib_list(const struct piglit_gl_test_config *test_config,
 
 		default:
 			assert(0);
-			break;
+			return NULL;
 	}
 
 	/* There are no 3.1 core profiles -- the closest is 3.1 context without
@@ -638,6 +639,7 @@  piglit_wfl_framework_init(struct piglit_wfl_framework *wfl_fw,
 	static bool is_waffle_initialized = false;
 	static int32_t initialized_platform = 0;
 
+	(void)initialized_platform;
 	bool ok = true;
 
 	if (is_waffle_initialized) {
diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c
index dfc2d92..7ac5df1 100644
--- a/tests/util/piglit-shader.c
+++ b/tests/util/piglit-shader.c
@@ -34,6 +34,7 @@  void piglit_get_glsl_version(bool *es, int* major, int* minor)
 	const char *version_string;
 	int c; /* scanf count */
 
+	(void)c;
 	version_string = (const char*) glGetString(GL_SHADING_LANGUAGE_VERSION);
 	es_local = strncmp("OpenGL ES", version_string, 9) == 0;
 	if (es_local) {
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 2f5175b..37a6b31 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -492,6 +492,8 @@  piglit_compressed_image_size(GLenum format, unsigned width, unsigned height)
 {
 	unsigned bw, bh, bytes;
 	bool b = piglit_get_compressed_block_size(format, &bw, &bh, &bytes);
+
+	(void)b;
 	assert(b);
 	return ((width + bw - 1) / bw) * ((height + bh - 1) / bh) * bytes;
 }
@@ -508,6 +510,7 @@  piglit_compressed_pixel_offset(GLenum format, unsigned width,
 	unsigned bw, bh, bytes, offset;
 	bool b = piglit_get_compressed_block_size(format, &bw, &bh, &bytes);
 
+	(void)b;
 	assert(b);
 
 	assert(x % bw == 0);
@@ -2555,6 +2558,7 @@  piglit_rgbw_texture(GLenum internalFormat, int w, int h, GLboolean mip,
 		break;
 	default:
 		assert(0);
+		return 0;
 	}
 
 	glGenTextures(1, &tex);
@@ -2633,6 +2637,7 @@  GLuint piglit_integer_texture(GLenum internalFormat, int w, int h, int b, int a)
 		     GL_RGBA_INTEGER, GL_INT, img);
 
 	free(img);
+	return tex;
 }
 
 /**