From aa5d48da3b6e182b01daa720ecf189bbae28c832 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 15 May 2016 20:01:31 +0200 Subject: [PATCH] nupa_substitute(), drop unused argument `err' --- src/frontend/numparam/numparam.h | 2 +- src/frontend/numparam/spicenum.c | 4 ++-- src/frontend/numparam/xpressn.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frontend/numparam/numparam.h b/src/frontend/numparam/numparam.h index 416ab27fb..162c6f782 100644 --- a/src/frontend/numparam/numparam.h +++ b/src/frontend/numparam/numparam.h @@ -65,7 +65,7 @@ int donedico(dico_t *); void dico_free_entry(entry_t *); 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_substitute(dico_t *, char *s, char *r); bool nupa_assignment(dico_t *, char *s, char mode); bool nupa_subcktcall(dico_t *, char *s, char *x, char *inst_name); void nupa_subcktexit(dico_t *); diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 6c253865e..bde028447 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -819,10 +819,10 @@ nupa_eval(struct card *card) #endif if (c == 'P') { /* evaluate parameters */ - // err = nupa_substitute(dico, dico->dynrefptr[linenum], s, 0); + // err = nupa_substitute(dico, dico->dynrefptr[linenum], s); nupa_assignment(dicoS, dicoS->dynrefptr[linenum], 'N'); } else if (c == 'B') { /* substitute braces line */ - err = nupa_substitute(dicoS, dicoS->dynrefptr[linenum], s, 0); + err = nupa_substitute(dicoS, dicoS->dynrefptr[linenum], s); } else if (c == 'X') { /* compute args of subcircuit, if required */ char *inst_name = copy_substring(s, skip_non_ws(s)); diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index eeb92aea5..7251a504c 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -1187,15 +1187,17 @@ insertnumber(dico_t *dico, int i, char *s, SPICE_DSTRINGPTR ustr_p) bool -nupa_substitute(dico_t *dico, char *s, char *r, bool err) +nupa_substitute(dico_t *dico, char *s, char *r) /* s: pointer to original source line. r: pointer to result line, already heavily modified wrt s anywhere we find a 10-char numstring in r, substitute it. bug: wont flag overflow! */ { - int i, k, ls, level, nnest, ir; + int i, k, ls, level, nnest, ir = 0; char c, d; + bool err = 0; + SPICE_DSTRING qstr; /* temp result dynamic string */ SPICE_DSTRING tstr; /* temp dynamic string */ @@ -1203,8 +1205,6 @@ nupa_substitute(dico_t *dico, char *s, char *r, bool err) spice_dstring_init(&tstr); i = 0; ls = (int) strlen(s); - err = 0; - ir = 0; while ((i < ls) && !err) { i++;