From 1bf2590caa3c679b92e77ffc2c2ce48d0c039124 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 27 Apr 2016 18:42:52 +0200 Subject: [PATCH] numparam, #2/3, avoid global `nupa_inst_name' --- src/frontend/numparam/numparam.h | 2 +- src/frontend/numparam/spicenum.c | 2 +- src/frontend/numparam/xpressn.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/frontend/numparam/numparam.h b/src/frontend/numparam/numparam.h index b58f29b41..4aea3d15b 100644 --- a/src/frontend/numparam/numparam.h +++ b/src/frontend/numparam/numparam.h @@ -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); diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 9042621be..a10e64beb 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -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 */ diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 77ba05029..72d57ca35 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -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,