Removed preprocessor_clearerror().
authorRyan C. Gordon <icculus@icculus.org>
Tue, 10 Feb 2009 10:43:37 -0500
changeset 557 ef6a607a5618
parent 556 04282775cc2c
child 558 314c86ff14dd
Removed preprocessor_clearerror().
mojoshader_internal.h
mojoshader_preprocessor.c
--- a/mojoshader_internal.h	Mon Feb 09 19:26:29 2009 -0500
+++ b/mojoshader_internal.h	Tue Feb 10 10:43:37 2009 -0500
@@ -342,7 +342,6 @@
 
 void preprocessor_end(Preprocessor *pp);
 const char *preprocessor_error(Preprocessor *pp);
-void preprocessor_clearerror(Preprocessor *pp);
 int preprocessor_outofmemory(Preprocessor *pp);
 const char *preprocessor_nexttoken(Preprocessor *_ctx,
                                    unsigned int *_len, Token *_token);
--- a/mojoshader_preprocessor.c	Mon Feb 09 19:26:29 2009 -0500
+++ b/mojoshader_preprocessor.c	Tue Feb 10 10:43:37 2009 -0500
@@ -304,17 +304,16 @@
 } // preprocessor_end
 
 
-void preprocessor_clearerror(Preprocessor *_ctx)
-{
-    Context *ctx = (Context *) _ctx;
-    ctx->isfail = 0;
-} // preprocessor_clearerror
-
-
 const char *preprocessor_error(Preprocessor *_ctx)
 {
     Context *ctx = (Context *) _ctx;
-    return ctx->isfail ? ctx->failstr : NULL;
+    if (ctx->isfail)
+    {
+        ctx->isfail = 0;
+        return ctx->failstr;
+    } // if
+
+    return NULL;
 } // preprocessor_error
 
 
@@ -670,7 +669,6 @@
                 error_count++;
             } // else
 
-            preprocessor_clearerror(pp);
             continue;
         } // if