[Piglit] [PATCH] Fix for bug #70015

Ian Romanick idr at freedesktop.org
Tue Oct 1 13:49:15 PDT 2013


Change the commit message to "Don't use dynamically sized arrays".
Maybe mention in the body of the commit message that it fixes the build
for Visual Studio.

With that fixed and the change below,

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

Of course, wait to hear from Vinson that it actually fixes the problem. :)

On 10/01/2013 01:12 PM, Nicholas Mack wrote:
> Cc: "Vinson Lee" <vlee at freedesktop.org>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70015
> ---
>  tests/spec/gl-3.2/get-active-attrib-returns-all-inputs.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/spec/gl-3.2/get-active-attrib-returns-all-inputs.c b/tests/spec/gl-3.2/get-active-attrib-returns-all-inputs.c
> index c604eb2..624de85 100644
> --- a/tests/spec/gl-3.2/get-active-attrib-returns-all-inputs.c
> +++ b/tests/spec/gl-3.2/get-active-attrib-returns-all-inputs.c
> @@ -72,7 +72,6 @@ static const char *fstext =
>  	"}\n";
>  
>  static GLuint prog;
> -const int bufSize = 100;
>  
>  bool
>  check_that_attrib_is_active(const char *attrib_name)
> @@ -82,11 +81,11 @@ check_that_attrib_is_active(const char *attrib_name)
>  	GLsizei length;
>  	GLint size;
>  	GLenum type;
> -	GLchar name[bufSize];
> +	GLchar name[100];
>  
>  	glGetProgramiv(prog, GL_ACTIVE_ATTRIBUTES, &numAttribs);
>  	for (i = 0; i < numAttribs; i++) {
> -		glGetActiveAttrib(prog, i, bufSize, &length, &size,
> +		glGetActiveAttrib(prog, i, 100, &length, &size,
                                           ^^^
Use ARRAY_SIZE(name) or sizeof(name) here.

>  				  &type, name);
>  		if (strcmp(name, attrib_name) == 0) {
>  			return piglit_check_gl_error(GL_NO_ERROR);
> 



More information about the Piglit mailing list