comparison lwasm/list.c @ 50:f55650f5e9b8

Fixed problems with macro expansion supression
author lost@l-w.ca
date Tue, 05 Apr 2011 00:12:58 -0600
parents bd8b3fbd1e28
children 428068681cbf
comparison
equal deleted inserted replaced
49:bd8b3fbd1e28 50:f55650f5e9b8
33 /* 33 /*
34 Do listing 34 Do listing
35 */ 35 */
36 void do_list(asmstate_t *as) 36 void do_list(asmstate_t *as)
37 { 37 {
38 line_t *cl, *nl; 38 line_t *cl, *nl, *nl2;
39 FILE *of; 39 FILE *of;
40 int i; 40 int i;
41 char *obytes = NULL; 41 unsigned char *obytes = NULL;
42 int obytelen = 0; 42 int obytelen = 0;
43 43
44 char *tc; 44 char *tc;
45 45
46 if (!(as -> flags & FLAG_LIST)) 46 if (!(as -> flags & FLAG_LIST))
74 if (nc == 0) 74 if (nc == 0)
75 break; 75 break;
76 } 76 }
77 obytes = lw_alloc(obytelen); 77 obytes = lw_alloc(obytelen);
78 nc = 0; 78 nc = 0;
79 for (nl = cl; ; nl = nl -> next) 79 for (nl2 = cl; ; nl2 = nl2 -> next)
80 { 80 {
81 int i; 81 int i;
82 for (i = 0; i < nl -> outputl; i++) 82 for (i = 0; i < nl2 -> outputl; i++)
83 { 83 {
84 obytes[nc++] = nl -> output[i]; 84 obytes[nc++] = nl2 -> output[i];
85 } 85 }
86 if (nc >= obytelen) 86 if (nc >= obytelen)
87 break; 87 break;
88 } 88 }
89 nl = nl -> next; 89 nl = nl -> next;