summaryrefslogtreecommitdiffstats
path: root/ir_reader.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-06-17 15:15:35 -0700
committerKenneth Graunke <[email protected]>2010-06-19 11:44:21 -0700
commitb2ba6fac09df1f06161a7ea1ef1f25bb9fbe8a5a (patch)
tree084e10e2fd8bba3b9824a14f5facc03c327c4315 /ir_reader.cpp
parentca97bd395f476ad2b5a009f92edef4656aab3650 (diff)
Change error/warning functions to print to the info log.
Diffstat (limited to 'ir_reader.cpp')
-rw-r--r--ir_reader.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/ir_reader.cpp b/ir_reader.cpp
index 23981a0f514..5cbce333f41 100644
--- a/ir_reader.cpp
+++ b/ir_reader.cpp
@@ -22,6 +22,11 @@
*/
#include <cstdio>
#include <cstdarg>
+
+extern "C" {
+#include <talloc.h>
+}
+
#include "ir_reader.h"
#include "glsl_parser_extras.h"
#include "glsl_types.h"
@@ -86,17 +91,18 @@ ir_read_error(_mesa_glsl_parse_state *state, s_expression *expr,
state->error = true;
- printf("error: ");
+ state->info_log = talloc_strdup_append(state->info_log, "error: ");
va_start(ap, fmt);
- vprintf(fmt, ap);
+ state->info_log = talloc_vasprintf_append(state->info_log, fmt, ap);
va_end(ap);
- printf("\n");
+ state->info_log = talloc_strdup_append(state->info_log, "\n");
if (expr != NULL) {
- printf("...in this context:\n ");
+ state->info_log = talloc_strdup_append(state->info_log,
+ "...in this context:\n ");
expr->print();
- printf("\n\n");
+ state->info_log = talloc_strdup_append(state->info_log, "\n\n");
}
}