numparam, #2/2, nupa_copy(), use struct card * argument
This commit is contained in:
parent
19dfaf03f3
commit
77da3c6f26
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
struct card;
|
||||
|
||||
extern char *nupa_copy(char *s, int linenum);
|
||||
extern char *nupa_copy(struct card *c);
|
||||
extern int nupa_eval(struct card *card);
|
||||
extern int nupa_signal(int sig, char *info);
|
||||
extern void nupa_scan(char * s, int linenum, int is_subckt);
|
||||
|
|
|
|||
|
|
@ -730,7 +730,7 @@ nupa_copy_inst_dico(void)
|
|||
|
||||
|
||||
char *
|
||||
nupa_copy(char *s, int linenum)
|
||||
nupa_copy(struct card *deck)
|
||||
/* returns a copy (not quite) of s in freshly allocated memory.
|
||||
linenum, for info only, is the source line number.
|
||||
origin pointer s is kept, memory is freed later in nupa_done.
|
||||
|
|
@ -744,6 +744,9 @@ nupa_copy(char *s, int linenum)
|
|||
- substitute placeholders for all {..} --> 10-digit numeric values.
|
||||
*/
|
||||
{
|
||||
char * const s = deck->line;
|
||||
const int linenum = deck->linenum;
|
||||
|
||||
char *t;
|
||||
int ls;
|
||||
char c, d;
|
||||
|
|
@ -762,7 +765,7 @@ nupa_copy(char *s, int linenum)
|
|||
|
||||
if ((!inexpansionS) && (linenum >= 0) && (linenum <= dynmaxline)) {
|
||||
linecountS++;
|
||||
dicoS->dynrefptr[linenum] = s;
|
||||
dicoS->dynrefptr[linenum] = deck->line;
|
||||
c = transform(dicoS, &u, incontrolS, &keywd);
|
||||
if (c == 'C')
|
||||
incontrolS = 1;
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ inp_subcktexpand(struct card *deck) {
|
|||
}
|
||||
/* now copy instances */
|
||||
for (c = deck; c; c = c->nextcard) /* first Numparam pass */
|
||||
c->line = nupa_copy(c->line, c->linenum);
|
||||
c->line = nupa_copy(c);
|
||||
|
||||
#ifdef TRACE
|
||||
fprintf(stderr, "Numparams transformed deck:\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue