diff options
author | Michal Krol <[email protected]> | 2009-11-21 20:41:48 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2009-11-21 20:41:48 +0100 |
commit | abe1f332983e5c70d75b5ae83f06c0dfdd081a26 (patch) | |
tree | 93fb1dec081fdffe0c80b041a21b1a01a0730ead /src/glsl/pp/sl_pp_context.c | |
parent | b89cd8afc510541a18f2f5c04884637626e104e1 (diff) |
glsl/pp: Do purification and tokenisation in a single step.
Diffstat (limited to 'src/glsl/pp/sl_pp_context.c')
-rw-r--r-- | src/glsl/pp/sl_pp_context.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 8ce189d955c..134588d9066 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -46,6 +46,12 @@ sl_pp_context_create(void) return NULL; } + context->getc_buf = malloc(64 * sizeof(char)); + if (!context->getc_buf) { + sl_pp_context_destroy(context); + return NULL; + } + context->macro_tail = &context->macro; context->if_ptr = SL_PP_MAX_IF_NESTING; context->if_value = 1; @@ -62,6 +68,7 @@ sl_pp_context_destroy(struct sl_pp_context *context) if (context) { free(context->cstr_pool); sl_pp_macro_free(context->macro); + free(context->getc_buf); free(context); } } |