From e8d8fb7bdc6b7c8f57e50f973f39c6025ec173ab Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 10 Dec 2008 04:24:28 -0500 Subject: [PATCH] Actually, let's make assembly error positions be option base 1. --- mojoshader.h | 2 +- mojoshader_assembler.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mojoshader.h b/mojoshader.h index cbac5a19..9f0b83c7 100644 --- a/mojoshader.h +++ b/mojoshader.h @@ -256,7 +256,7 @@ typedef struct MOJOSHADER_parseData * error, and -1 if there was an error before processing started. If >= 0, * MOJOSHADER_parse() sets this to the byte offset (starting at zero) into * the bytecode you supplied, and MOJOSHADER_assemble() sets this to a - * a line number in the source code you supplied (starting at zero). + * a line number in the source code you supplied (starting at one). */ int error_position; diff --git a/mojoshader_assembler.c b/mojoshader_assembler.c index 0e73d8b6..45f9df1f 100644 --- a/mojoshader_assembler.c +++ b/mojoshader_assembler.c @@ -1465,6 +1465,7 @@ static Context *build_context(const char *source, MOJOSHADER_malloc m, ctx->free = f; ctx->malloc_data = d; ctx->source = source; + ctx->linenum = 1; return ctx; } // build_context