[Mesa-dev] [PATCH 11/11] glsl: add cast to silence MSVC double->float assignment warning
Brian Paul
brianp at vmware.com
Wed Jan 23 09:00:02 PST 2013
On 01/23/2013 07:25 AM, Ian Romanick wrote:
> On 01/22/2013 07:51 PM, Brian Paul wrote:
>> ---
>> src/glsl/s_expression.cpp | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/glsl/s_expression.cpp b/src/glsl/s_expression.cpp
>> index 57de9d3..52fa7ae 100644
>> --- a/src/glsl/s_expression.cpp
>> +++ b/src/glsl/s_expression.cpp
>> @@ -79,7 +79,7 @@ read_atom(void *ctx, const char *&src, char
>> *&symbol_buffer)
>> int i = strtol(src, &int_end, 10);
>> // If strtod matched more characters, it must have a decimal part
>> if (float_end > int_end)
>> - expr = new(ctx) s_float(f);
>> + expr = new(ctx) s_float((float) f);
>
> I think changing the type of f and the return type (and name?) of
> glsl_strtod is better. Every single user of that function assigns the
> result to a float.
I'll post a series which adds glsl_strtof() and uses that instead of
strtod().
-Brian
More information about the mesa-dev
mailing list