changeset 446:194787ce2a77 3.0

Adjusted listings to convert tabs to spaces; assume 8 space tabs
author lost@l-w.ca
date Thu, 04 Nov 2010 22:40:57 -0600
parents 7899511b2102
children 00924eeb2ec8
files ChangeLog configure.ac lwasm/list.c
diffstat 3 files changed, 39 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Oct 30 15:22:55 2010 -0600
+++ b/ChangeLog	Thu Nov 04 22:40:57 2010 -0600
@@ -13,6 +13,15 @@
 
 Also, the software affected may follow in [].
 
+Version 3.0.2
+
+[ ] Listings now assume an 8 space tab and convert tabs to spaces
+
+Version 3.0.1
+
+[!] Corrected major memory leak
+[!] Corrected code generation errors
+
 Version 3.0
 
 [*] Completely new architecture for lwasm
--- a/configure.ac	Sat Oct 30 15:22:55 2010 -0600
+++ b/configure.ac	Thu Nov 04 22:40:57 2010 -0600
@@ -1,4 +1,4 @@
-AC_INIT([LWTools], [3.0.1], [lost@l-w.ca])
+AC_INIT([LWTools], [3.0.2-dev], [lost@l-w.ca])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 AC_PROG_CC
 gl_EARLY
--- a/lwasm/list.c	Sat Oct 30 15:22:55 2010 -0600
+++ b/lwasm/list.c	Thu Nov 04 22:40:57 2010 -0600
@@ -40,7 +40,7 @@
 	line_t *cl;
 	FILE *of;
 	int i;
-	
+	char *tc;
 	if (!(as -> flags & FLAG_LIST))
 		return;
 
@@ -116,9 +116,35 @@
 			}
 			fprintf(of, " ");
 		}
-		/* the 34.34 below is deliberately chosen so that the start of the line text is at
+		/* the 32.32 below is deliberately chosen so that the start of the line text is at
 		   a multiple of 8 from the start of the list line */
-		fprintf(of, "(%34.34s):%05d %s\n", cl -> linespec, cl -> lineno, cl -> ltext);
+		fprintf(of, "(%32.32s):%05d ", cl -> linespec, cl -> lineno);
+		i = 0;
+		for (tc = cl -> ltext; *tc; tc++)
+		{
+			if ((*tc) == '\t')
+			{
+				if (i % 8 == 0)
+				{
+					i += 8;
+					fprintf(of, "        ");
+				}
+				else
+				{
+					while (i % 8)
+					{
+						fprintf(of, " ");
+						i++;
+					}
+				}
+			}
+			else
+			{
+				fprintf(of, "%c", *tc);
+				i++;
+			}
+		}
+		fprintf(of, "\n");
 		if (cl -> outputl > 8)
 		{
 			for (i = 8; i < cl -> outputl; i++)