diff options
author | Michal Krol <[email protected]> | 2009-12-20 13:53:17 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2009-12-20 21:19:03 +0100 |
commit | 9c15948125109d6eda7da25a2749680b830e8b82 (patch) | |
tree | 4f7bc330fa4103e339ccb7e7cc401df00496de11 /src/glsl/apps | |
parent | e0f57a37b2533a92359942a9698427922883d227 (diff) |
glsl/apps: Update after glsl pp interface changes.
Diffstat (limited to 'src/glsl/apps')
-rw-r--r-- | src/glsl/apps/process.c | 27 | ||||
-rw-r--r-- | src/glsl/apps/tokenise.c | 4 |
2 files changed, 9 insertions, 22 deletions
diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index d7bc16577e0..569890210f2 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -41,9 +41,7 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; struct sl_pp_context *context; - struct sl_pp_token_info *tokens; unsigned int version; - unsigned int tokens_eaten; struct sl_pp_token_info *outtokens; FILE *out; unsigned int i; @@ -90,7 +88,7 @@ main(int argc, memset(&options, 0, sizeof(options)); - context = sl_pp_context_create(); + context = sl_pp_context_create(inbuf, &options); if (!context) { fprintf(out, "$CONTEXERROR\n"); @@ -99,23 +97,12 @@ main(int argc, return 1; } - if (sl_pp_tokenise(context, inbuf, &options, &tokens)) { + if (sl_pp_version(context, &version)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); free(inbuf); fclose(out); - return 1; - } - - free(inbuf); - - if (sl_pp_version(context, tokens, &version, &tokens_eaten)) { - fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); - - sl_pp_context_destroy(context); - free(tokens); - fclose(out); return -1; } @@ -125,7 +112,7 @@ main(int argc, printf("Error: %s\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); - free(tokens); + free(inbuf); fclose(out); return 0; } @@ -135,21 +122,21 @@ main(int argc, printf("Error: %s\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); - free(tokens); + free(inbuf); fclose(out); return 0; } - if (sl_pp_process(context, &tokens[tokens_eaten], &outtokens)) { + if (sl_pp_process(context, &outtokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); - free(tokens); + free(inbuf); fclose(out); return -1; } - free(tokens); + free(inbuf); for (i = 0; outtokens[i].token != SL_PP_EOF; i++) { switch (outtokens[i].token) { diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 91368c32a45..9ff73157e9c 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -87,7 +87,7 @@ main(int argc, memset(&options, 0, sizeof(options)); - context = sl_pp_context_create(); + context = sl_pp_context_create(inbuf, &options); if (!context) { fprintf(out, "$CONTEXERROR\n"); @@ -96,7 +96,7 @@ main(int argc, return 1; } - if (sl_pp_tokenise(context, inbuf, &options, &tokens)) { + if (sl_pp_tokenise(context, &tokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); |