From d1dda951c85f65612ed6fe080728f67fdc93d232 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Aug 2010 13:59:45 -0600 Subject: [PATCH] glsl2: move declarations before code --- src/glsl/glcpp/pp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glsl/glcpp/pp.c b/src/glsl/glcpp/pp.c index 7aa1a968de7..3adccf72aab 100644 --- a/src/glsl/glcpp/pp.c +++ b/src/glsl/glcpp/pp.c @@ -28,6 +28,8 @@ void glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...) { + va_list ap; + parser->error = 1; parser->info_log = talloc_asprintf_append(parser->info_log, "%u:%u(%u): " @@ -35,7 +37,6 @@ glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...) locp->source, locp->first_line, locp->first_column); - va_list ap; va_start(ap, fmt); parser->info_log = talloc_vasprintf_append(parser->info_log, fmt, ap); va_end(ap); @@ -45,13 +46,14 @@ glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...) void glcpp_warning (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...) { + va_list ap; + parser->info_log = talloc_asprintf_append(parser->info_log, "%u:%u(%u): " "preprocessor warning: ", locp->source, locp->first_line, locp->first_column); - va_list ap; va_start(ap, fmt); parser->info_log = talloc_vasprintf_append(parser->info_log, fmt, ap); va_end(ap); -- 2.30.2