From 7c8ac352aa4dd7026de51164d98e24f386537580 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 10 Feb 2009 10:43:37 -0500 Subject: [PATCH] Removed preprocessor_clearerror(). --- mojoshader_internal.h | 1 - mojoshader_preprocessor.c | 16 +++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/mojoshader_internal.h b/mojoshader_internal.h index 46415902..77640792 100644 --- a/mojoshader_internal.h +++ b/mojoshader_internal.h @@ -342,7 +342,6 @@ Preprocessor *preprocessor_start(const char *fname, const char *source, 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); diff --git a/mojoshader_preprocessor.c b/mojoshader_preprocessor.c index 584ce5f3..3a142e9d 100644 --- a/mojoshader_preprocessor.c +++ b/mojoshader_preprocessor.c @@ -304,17 +304,16 @@ void preprocessor_end(Preprocessor *_ctx) } // 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 @@ include_close = (MOJOSHADER_includeClose) 0x1; error_count++; } // else - preprocessor_clearerror(pp); continue; } // if