Actually, let's make assembly error positions be option base 1.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 10 Dec 2008 04:24:28 -0500
changeset 489 414b70b829d7
parent 488 1a318d011c00
child 490 14b6586d9c43
Actually, let's make assembly error positions be option base 1.
mojoshader.h
mojoshader_assembler.c
--- a/mojoshader.h	Wed Dec 10 04:22:06 2008 -0500
+++ b/mojoshader.h	Wed Dec 10 04:24:28 2008 -0500
@@ -256,7 +256,7 @@
      *  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;
 
--- a/mojoshader_assembler.c	Wed Dec 10 04:22:06 2008 -0500
+++ b/mojoshader_assembler.c	Wed Dec 10 04:24:28 2008 -0500
@@ -1465,6 +1465,7 @@
     ctx->free = f;
     ctx->malloc_data = d;
     ctx->source = source;
+    ctx->linenum = 1;
 
     return ctx;
 } // build_context