diff options
author | Eric Anholt <eric@anholt.net> | 2010-04-29 18:00:33 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-05-03 11:40:26 -0700 |
commit | 3623df68fa9f4db88c436425524bc27c7f59a051 (patch) | |
tree | b4e753adc15d8d791f335f32901c4043b8608c2c /glsl_parser_extras.cpp | |
parent | 81f49a774eec3990b0a6ffeca75119e6a3ef827d (diff) |
Store warnings and errors in a parser state infolog.
Cleans up compile warning about unused state in _mesa_glsl_warning. We
would want infolog handling roughly like this anyway.
Diffstat (limited to 'glsl_parser_extras.cpp')
-rw-r--r-- | glsl_parser_extras.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/glsl_parser_extras.cpp b/glsl_parser_extras.cpp index 4183d13..88767af 100644 --- a/glsl_parser_extras.cpp +++ b/glsl_parser_extras.cpp @@ -73,11 +73,15 @@ _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state, va_end(ap); printf("%s\n", buf); + + if (state->info_log) + free(state->info_log); + state->info_log = strdup(buf); } void -_mesa_glsl_warning(const YYLTYPE *locp, const _mesa_glsl_parse_state *state, +_mesa_glsl_warning(const YYLTYPE *locp, _mesa_glsl_parse_state *state, const char *fmt, ...) { char buf[1024]; @@ -92,6 +96,10 @@ _mesa_glsl_warning(const YYLTYPE *locp, const _mesa_glsl_parse_state *state, va_end(ap); printf("%s\n", buf); + + if (!state->info_log) { + state->info_log = strdup(buf); + } } |