[Piglit] [PATCH] GL_ARB_ubo/maxblocks: don't use dynamically sized array

Brian Paul brianp at vmware.com
Thu Aug 2 08:51:57 PDT 2012


To fix MSVC build.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=53062
---
 tests/spec/arb_uniform_buffer_object/maxblocks.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_uniform_buffer_object/maxblocks.c b/tests/spec/arb_uniform_buffer_object/maxblocks.c
index a8c4c4a..6f67b59 100644
--- a/tests/spec/arb_uniform_buffer_object/maxblocks.c
+++ b/tests/spec/arb_uniform_buffer_object/maxblocks.c
@@ -236,12 +236,10 @@ pass_link_test(int y_index,
 {
 	bool pass = true;
 	GLuint prog;
-	GLuint bos[vs_blocks + fs_blocks];
+	GLuint *bos = (GLuint *) calloc(vs_blocks + fs_blocks, sizeof(GLuint));
 	GLint active_blocks;
 	int i;
 
-	memset(bos, 0, sizeof(bos));
-
 	prog = build_shaders(vs_prefix, vs_blocks,
 			     fs_prefix, fs_blocks);
 
@@ -268,6 +266,8 @@ pass_link_test(int y_index,
 	glDeleteBuffers(active_blocks, bos);
 	glDeleteProgram(prog);
 
+	free(bos);
+
 	return pass;
 }
 
-- 
1.7.3.4



More information about the Piglit mailing list