[Piglit] [PATCH 2/2] gl-1.0-readpixsanity: Eliminate use of variable length arrays.

Matt Turner mattst88 at gmail.com
Wed Oct 29 14:17:30 PDT 2014


On Wed, Oct 29, 2014 at 4:48 AM,  <jfonseca at vmware.com> wrote:
> From: José Fonseca <jfonseca at vmware.com>
>
> Non-standard GCC extension.
> ---
>  tests/spec/gl-1.0/readpix.c | 64 ++++++++++++++++++++++++++-------------------
>  1 file changed, 37 insertions(+), 27 deletions(-)
>
> diff --git a/tests/spec/gl-1.0/readpix.c b/tests/spec/gl-1.0/readpix.c
> index 7ee0be9..26f44a6 100644
> --- a/tests/spec/gl-1.0/readpix.c
> +++ b/tests/spec/gl-1.0/readpix.c
> @@ -100,7 +100,9 @@ check_rgba(void)
>         double err;
>         int xerr, yerr;
>         float expected[4], expected_rgba[4], actual_rgba[4];
> -       GLfloat buf[piglit_width][piglit_height][4];
> +       const int w = piglit_width;
> +       const int h = piglit_height;
> +       GLfloat *buf = (GLfloat *)malloc(h * w * 4 * sizeof *buf);

Don't cast malloc.


More information about the Piglit mailing list