Mercurial > ~dholland > hg > tradcpp > index.cgi
comparison macro.c @ 169:80e243f2047d
Revert addition of "isspecial" field in struct macro.
It doesn't do anything useful any more.
author | David A. Holland |
---|---|
date | Fri, 12 Jun 2015 02:01:00 -0400 |
parents | 8d8a4bfd4684 |
children | 2ee7db420643 |
comparison
equal
deleted
inserted
replaced
168:8d8a4bfd4684 | 169:80e243f2047d |
---|---|
54 struct stringarray params; | 54 struct stringarray params; |
55 struct expansionitemarray expansion; | 55 struct expansionitemarray expansion; |
56 char *name; | 56 char *name; |
57 unsigned hash; | 57 unsigned hash; |
58 bool hasparams; | 58 bool hasparams; |
59 bool isspecial; | |
60 bool inuse; | 59 bool inuse; |
61 }; | 60 }; |
62 DECLARRAY(macro, static UNUSED); | 61 DECLARRAY(macro, static UNUSED); |
63 DEFARRAY(macro, static); | 62 DEFARRAY(macro, static); |
64 DECLARRAY(macroarray, static UNUSED); | 63 DECLARRAY(macroarray, static UNUSED); |
170 m->defplace = *p1; | 169 m->defplace = *p1; |
171 m->expansionplace = *p2; | 170 m->expansionplace = *p2; |
172 m->hash = hash; | 171 m->hash = hash; |
173 m->name = dostrdup(name); | 172 m->name = dostrdup(name); |
174 m->hasparams = false; | 173 m->hasparams = false; |
175 m->isspecial = false; | |
176 stringarray_init(&m->params); | 174 stringarray_init(&m->params); |
177 expansionitemarray_init(&m->expansion); | 175 expansionitemarray_init(&m->expansion); |
178 m->inuse = false; | 176 m->inuse = false; |
179 return m; | 177 return m; |
180 } | 178 } |
196 macro_eq(const struct macro *m1, const struct macro *m2) | 194 macro_eq(const struct macro *m1, const struct macro *m2) |
197 { | 195 { |
198 unsigned num1, num2, i; | 196 unsigned num1, num2, i; |
199 struct expansionitem *ei1, *ei2; | 197 struct expansionitem *ei1, *ei2; |
200 const char *p1, *p2; | 198 const char *p1, *p2; |
201 | |
202 if (m2->isspecial) { | |
203 return false; | |
204 } | |
205 | 199 |
206 if (strcmp(m1->name, m2->name) != 0) { | 200 if (strcmp(m1->name, m2->name) != 0) { |
207 return false; | 201 return false; |
208 } | 202 } |
209 | 203 |
606 { | 600 { |
607 struct macro *m; | 601 struct macro *m; |
608 struct expansionitem *ei; | 602 struct expansionitem *ei; |
609 | 603 |
610 m = macro_define_common_start(p, "__FILE__", p); | 604 m = macro_define_common_start(p, "__FILE__", p); |
611 m->isspecial = true; | |
612 ei = expansionitem_create_file(); | 605 ei = expansionitem_create_file(); |
613 expansionitemarray_add(&m->expansion, ei, NULL); | 606 expansionitemarray_add(&m->expansion, ei, NULL); |
614 macro_define_common_end(m); | 607 macro_define_common_end(m); |
615 } | 608 } |
616 | 609 |
619 { | 612 { |
620 struct macro *m; | 613 struct macro *m; |
621 struct expansionitem *ei; | 614 struct expansionitem *ei; |
622 | 615 |
623 m = macro_define_common_start(p, "__LINE__", p); | 616 m = macro_define_common_start(p, "__LINE__", p); |
624 m->isspecial = true; | |
625 ei = expansionitem_create_line(); | 617 ei = expansionitem_create_line(); |
626 expansionitemarray_add(&m->expansion, ei, NULL); | 618 expansionitemarray_add(&m->expansion, ei, NULL); |
627 macro_define_common_end(m); | 619 macro_define_common_end(m); |
628 } | 620 } |
629 | 621 |