[Mesa-dev] [PATCH 1/4] glsl: simplify +INF check

Kenneth Graunke kenneth at whitecape.org
Wed May 31 03:16:41 UTC 2017


ir_reader and S-expression parsing are only used by the unit tests for
lower_jumps().  They're not used during actual compilation at all.

If it weren't for those unit tests, I'd be happy to see them deleted.

On Tuesday, May 30, 2017 4:34:11 PM PDT Ian Romanick wrote:
> Ken: Is this code still used?
> 
> On 05/30/2017 03:45 PM, Vlad Golovkin wrote:
> > ---
> >  src/compiler/glsl/s_expression.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/compiler/glsl/s_expression.cpp b/src/compiler/glsl/s_expression.cpp
> > index f82e155a6b..0e05c4bba7 100644
> > --- a/src/compiler/glsl/s_expression.cpp
> > +++ b/src/compiler/glsl/s_expression.cpp
> > @@ -69,7 +69,7 @@ read_atom(void *ctx, const char *&src, char *&symbol_buffer)
> >     // Check for the special symbol '+INF', which means +Infinity.  Note: C99
> >     // requires strtof to parse '+INF' as +Infinity, but we still support some
> >     // non-C99-compliant compilers (e.g. MSVC).
> > -   if (n == 4 && strncmp(src, "+INF", 4) == 0) {
> > +   if (n == 4 && memcmp(src, "+INF", 4) == 0) {
> >        expr = new(ctx) s_float(INFINITY);
> >     } else {
> >        // Check if the atom is a number.
> > 
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170530/a9594a66/attachment.sig>


More information about the mesa-dev mailing list