On Sun, Mar 26, 2017 at 5:51 PM, Edward O'Callaghan <
funfunc...@folklore1984.net> wrote:

> V.1:
> We memset number of elements without multiplication by the
> element size.
>
> V.2:
> We explicitly set each member to -1 over using a confusing
> memset().
>
> Signed-off-by: Edward O'Callaghan <funfunc...@folklore1984.net>
> ---
>  src/mesa/main/formatquery.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
> index 598d34d..6aa57ec 100644
> --- a/src/mesa/main/formatquery.c
> +++ b/src/mesa/main/formatquery.c
> @@ -1564,7 +1564,7 @@ _mesa_GetInternalformati64v(GLenum target, GLenum
> internalformat,
>      * no pname can return a negative value, we fill params32 with negative
>      * values as reference values, that can be used to know what copy-back
> to
>      * params */
> -   memset(params32, -1, 16);
> +   for (i = 0; i < realSize; i++) params32[i] = -1;
>

We'd generally write that for loop on two lines.

for (i = 0; i < realSize; i++)
   params32[i] = -1;

-Brian


>
>     /* For GL_MAX_COMBINED_DIMENSIONS we need to get back 2 32-bit
> integers,
>      * and at the same time we only need 2. So for that pname, we call the
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to