[Mesa-dev] [PATCH] glsl: Move error message inside validation check reducing duplicate message handling

Paul Berry stereotype441 at gmail.com
Sun Oct 27 18:40:17 CET 2013


On 26 October 2013 00:47, Timothy Arceri <t_arceri at yahoo.com.au> wrote:

> On Fri, 2013-10-25 at 14:51 -0700, Paul Berry wrote:
>
>
> +   _mesa_glsl_error(&loc, state,
> >         +                    is_initializer ? "initializer" : "value"
> >         +                    " of type %s cannot be assigned to "
> >         +                    "variable of type %s",
> >         +                    rhs->type->name, lhs_type->name);
> >         +
> >
> >
> > This doesn't produce the output you want.  String concatenation happens
> at compile time and takes precedence over everything else, so this is being
> interpreted as:
> >
> >
> > _mesa_glsl_error(&loc, state, is_initializer ? "initializer" : "value of
> type %s cannot be assigned to variable of type %s", rhs->type->name,
> lhs_type->name);
> >
> >
> > Adding parenthesis doesn't help because string concatenation only works
> on string literals.  I believe what you actually want is:
> >
> >    _mesa_glsl_error(&loc, state,
> >                     "%s of type %s cannot be assigned to "
> >                     "variable of type %s",
> >                     is_initializer ? "initializer" : "value",
> >                     rhs->type->name, lhs_type->name);
> >
>
> Yes that makes sense thanks.
>
> >With that change, this patch is:
> >
> >
> > Reviewed-by: Paul Berry <stereotype441 at gmail.com>
> >
> >
> > Do you have push access?  I can push the patch for you (with this
> change) if you'd like.
> >
>
> No I don't have push access. Would be great if you could push this with
> the change.
>
> Thanks for the review.
>
> Tim
>

Ok, I've pushed it upstream.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131027/e568f301/attachment.html>


More information about the mesa-dev mailing list