diff options
author | Michal Krol <[email protected]> | 2009-06-17 13:49:06 +0200 |
---|---|---|
committer | Michal Krol <[email protected]> | 2009-09-07 10:11:43 +0200 |
commit | f24322fbf6599b31f07ebc548e390c77b803d67c (patch) | |
tree | a550e9dd12bcceb9acc76bc677b645e4f1b21f17 /src/glsl/apps/version.c | |
parent | f24ec185c531d2b2209df01901c90eca57ca711f (diff) |
glsl: Introduce sl_pp_context and maintain a reuseable pool of strings.
Diffstat (limited to 'src/glsl/apps/version.c')
-rw-r--r-- | src/glsl/apps/version.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index b49395ba97f..c56ae9dde9a 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -41,6 +41,7 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; + struct sl_pp_context context; struct sl_pp_token_info *tokens; unsigned int version; unsigned int tokens_eaten; @@ -83,18 +84,23 @@ main(int argc, free(inbuf); - if (sl_pp_tokenise(outbuf, &tokens)) { + sl_pp_context_init(&context); + + if (sl_pp_tokenise(&context, outbuf, &tokens)) { + sl_pp_context_destroy(&context); free(outbuf); return 1; } free(outbuf); - if (sl_pp_version(tokens, &version, &tokens_eaten)) { + if (sl_pp_version(&context, tokens, &version, &tokens_eaten)) { + sl_pp_context_destroy(&context); free(tokens); return -1; } + sl_pp_context_destroy(&context); free(tokens); out = fopen(argv[2], "wb"); |