Module: Mesa
Branch: glsl-pp-rework-2
Commit: 1cf021475a6628cdf4c26457bc7ca0c603fe2c7c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1cf021475a6628cdf4c26457bc7ca0c603fe2c7c

Author: Michal Krol <[email protected]>
Date:   Sat Nov 21 20:43:02 2009 +0100

slang: No need to purify source text for tokeniser.

---

 src/mesa/shader/slang/slang_compile.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/mesa/shader/slang/slang_compile.c 
b/src/mesa/shader/slang/slang_compile.c
index 44c8897..f2342bf 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -2592,34 +2592,24 @@ compile_with_grammar(const char *source,
    unsigned int maxVersion;
    int result;
    struct sl_pp_purify_options options;
-   char *outbuf;
    char errmsg[200] = "";
    unsigned int errline = 0;
    struct sl_pp_token_info *intokens;
    unsigned int tokens_eaten;
 
-   memset(&options, 0, sizeof(options));
-   if (sl_pp_purify(source, &options, &outbuf, errmsg, sizeof(errmsg), 
&errline)) {
-      slang_info_log_error(infolog, errmsg);
-      return GL_FALSE;
-   }
-
    context = sl_pp_context_create();
    if (!context) {
       slang_info_log_error(infolog, "out of memory");
-      free(outbuf);
       return GL_FALSE;
    }
 
-   if (sl_pp_tokenise(context, outbuf, &intokens)) {
+   memset(&options, 0, sizeof(options));
+   if (sl_pp_tokenise(context, &options, source, &intokens)) {
       slang_info_log_error(infolog, "%s", 
sl_pp_context_error_message(context));
       sl_pp_context_destroy(context);
-      free(outbuf);
       return GL_FALSE;
    }
 
-   free(outbuf);
-
    if (sl_pp_version(context, intokens, &version, &tokens_eaten)) {
       slang_info_log_error(infolog, "%s", 
sl_pp_context_error_message(context));
       sl_pp_context_destroy(context);

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to