summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-08-11 13:59:45 -0600
committerBrian Paul <[email protected]>2010-08-11 15:06:12 -0600
commitd1dda951c85f65612ed6fe080728f67fdc93d232 (patch)
treeef9a86e34902c4815ac1cd9dab7e811d477551d8
parent6dc89d221d43fad5f3edbb903997160af071bec0 (diff)
glsl2: move declarations before code
-rw-r--r--src/glsl/glcpp/pp.c6
1 files 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);