> Absolutely not. All the casts do is clutter the code. This is a > completely worthless warning from Visual Studio. It generates only > noise. I have never seen a case where it was actually useful. There > are pragmas and command line options to disable specific warnings. You > should do that. > > Brian, could you please revert those patches. I don't want that crap in > code that I maintain. Seriously.
What about this patch: From 40136f460562d49a21877fdb52d9ddbf8ae6f7b9 Mon Sep 17 00:00:00 2001 From: Gon Solo <gons...@gmail.com> Date: Fri, 12 Mar 2010 21:39:59 +0100 Subject: [PATCH] Use strof. C99 is 11 years now. --- src/mesa/main/imports.c | 7 +++++++ src/mesa/main/imports.h | 3 +++ src/mesa/shader/lex.yy.c | 8 ++++---- src/mesa/shader/program_lexer.l | 8 ++++---- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 56e8195..d77b36c 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -810,6 +810,13 @@ _mesa_strtod( const char *s, char **end ) #endif } +/** Wrapper around strtof() */ +float +_mesa_strtof( const char *s, char **end ) +{ + return strtof(s, end); +} + /** Compute simple checksum/hash for a string */ unsigned int _mesa_str_checksum(const char *str) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index fb4a00e..c30be11 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -578,6 +578,9 @@ _mesa_strdup( const char *s ); extern double _mesa_strtod( const char *s, char **end ); +extern float +_mesa_strtof( const char *s, char **end ); + extern unsigned int _mesa_str_checksum(const char *str); diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index d1af35f..6d09d1d 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -2212,7 +2212,7 @@ case 142: YY_RULE_SETUP #line 326 "program_lexer.l" { - yylval->real = _mesa_strtod(yytext, NULL); + yylval->real = _mesa_strtof(yytext, NULL); return REAL; } YY_BREAK @@ -2224,7 +2224,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 330 "program_lexer.l" { - yylval->real = _mesa_strtod(yytext, NULL); + yylval->real = _mesa_strtof(yytext, NULL); return REAL; } YY_BREAK @@ -2232,7 +2232,7 @@ case 144: YY_RULE_SETUP #line 334 "program_lexer.l" { - yylval->real = _mesa_strtod(yytext, NULL); + yylval->real = _mesa_strtof(yytext, NULL); return REAL; } YY_BREAK @@ -2240,7 +2240,7 @@ case 145: YY_RULE_SETUP #line 338 "program_lexer.l" { - yylval->real = _mesa_strtod(yytext, NULL); + yylval->real = _mesa_strtof(yytext, NULL); return REAL; } YY_BREAK diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index 83bc508..fe18272 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -324,19 +324,19 @@ ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require return INTEGER; } {num}?{frac}{exp}? { - yylval->real = _mesa_strtod(yytext, NULL); + yylval->real = _mesa_strtof(yytext, NULL); return REAL; } {num}"."/[^.] { - yylval->real = _mesa_strtod(yytext, NULL); + yylval->real = _mesa_strtof(yytext, NULL); return REAL; } {num}{exp} { - yylval->real = _mesa_strtod(yytext, NULL); + yylval->real = _mesa_strtof(yytext, NULL); return REAL; } {num}"."{exp} { - yylval->real = _mesa_strtod(yytext, NULL); + yylval->real = _mesa_strtof(yytext, NULL); return REAL; } -- 1.6.3.3 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev