numparam, #2/3, avoid global `nupa_inst_name'

This commit is contained in:
rlar 2016-04-27 18:42:52 +02:00
parent ca4278685d
commit 1bf2590caa
3 changed files with 4 additions and 5 deletions

View File

@ -72,7 +72,7 @@ bool defsubckt(dico_t *, struct card *, nupa_type categ);
int findsubckt(dico_t *, char *s);
bool nupa_substitute(dico_t *, char *s, char *r, bool err);
bool nupa_assignment(dico_t *, char *s, char mode);
bool nupa_subcktcall(dico_t *, char *s, char *x);
bool nupa_subcktcall(dico_t *, char *s, char *x, char *inst_name);
void nupa_subcktexit(dico_t *);
dico_t *nupa_fetchinstance(void);
nupa_type getidtype(dico_t *, char *s);

View File

@ -841,7 +841,7 @@ nupa_eval(struct card *card)
idef = findsubckt(dicoS, s);
if (idef > 0)
nupa_subcktcall(dicoS, dicoS->dynrefptr[idef], dicoS->dynrefptr[linenum]);
nupa_subcktcall(dicoS, dicoS->dynrefptr[idef], dicoS->dynrefptr[linenum], nupa_inst_name);
else
putlogfile('?', linenum, " illegal subckt call.");
} else if (c == 'U') { /* release local symbols = parameters */

View File

@ -20,7 +20,6 @@
/************ keywords ************/
extern char *nupa_inst_name; /* see spicenum.c */
extern long dynsubst; /* see inpcom.c */
#define ACT_CHARACTS 25 /* actual string length to be inserted and replaced */
@ -1534,7 +1533,7 @@ nupa_assignment(dico_t *dico, char *s, char mode)
bool
nupa_subcktcall(dico_t *dico, char *s, char *x)
nupa_subcktcall(dico_t *dico, char *s, char *x, char *inst_name)
/* s= a subckt define line, with formal params.
x= a matching subckt call line, with actual params
*/
@ -1736,7 +1735,7 @@ nupa_subcktcall(dico_t *dico, char *s, char *x)
}
/***** finally, execute the multi-assignment line */
dicostack_push(dico, nupa_inst_name); /* create local symbol scope */
dicostack_push(dico, inst_name); /* create local symbol scope */
if (narg != n) {
err = message(dico,