Date:2012-06-03 07:04:27 (11 years 9 months ago)
Author:Werner Almesberger
Commit:c2414a5d2c24ce26a0962dabb8f7b6394f5ef3e3
Message:b2/: resolve FN in subst_init and don't consider an FN match evidence of existance

Files: b2/boom.c (1 diff)
b2/subex.c (2 diffs)
b2/subst.c (3 diffs)
b2/subst.h (2 diffs)

Change Details

b2/boom.c
136136    int i;
137137
138138    dollar = unique("$");
139    subst_init();
139140    subex_init();
140141    for (i = 1; i != argc; i++) {
141142        if (*argv[i] != '-') {
b2/subex.c
2929#define FIELDS 10 /* fields in KiCad schematics */
3030
3131
32static const char *fn = NULL, *f[FIELDS];
32static const char *f[FIELDS];
3333
3434/* Jump targets that can never be reached. */
3535static struct subst jump_end;
...... 
248248    int i;
249249    char tmp[4];
250250
251    fn = unique("FN");
252251    for (i = 0; i != FIELDS; i++) {
253252        sprintf(tmp, "F%d", i);
254253        f[i] = unique(tmp);
b2/subst.c
2525#include "subst.h"
2626
2727
28const char *fn;
29
30
2831/* ----- Rule set construction --------------------------------------------- */
2932
3033
...... 
297300    while (sub) {
298301        switch (sub->type) {
299302        case st_match:
300            if (sub->u.match.src == var)
303            if (sub->u.match.src == var && var != fn)
301304                return 1;
302305            break;
303306        case st_assign:
...... 
459462{
460463    recurse_dump(file, sub, 0);
461464}
465
466
467void subst_init(void)
468{
469    fn = unique("FN");
470}
b2/subst.h
7373#define MULT_CHARS "GMkmunpf"
7474
7575
76extern const char *fn;
77
78
7679struct subst *subst_match(const char *src, const char *re);
7780struct subst *subst_assign(const char *dst, enum relop op, const char *pat);
7881struct subst *subst_end(void);
...... 
8487
8588void subst_dump(FILE *file, const struct subst *sub);
8689
90void subst_init(void);
91
8792#endif /* !SUBST_H */

Archive Download the corresponding diff file

Branches:
master



interactive