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

Ian Romanick idr at freedesktop.org
Tue May 30 23:34:11 UTC 2017


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.
> 



More information about the mesa-dev mailing list