shrink scope of expr_w_temper

This commit is contained in:
rlar 2017-03-26 18:54:01 +02:00
parent 872ceeedc7
commit 2809ccaa13
6 changed files with 9 additions and 11 deletions

View File

@ -1439,7 +1439,7 @@ com_alter_mod(wordlist *wl)
modfile = inp_pathopen(filename, readmode);
{
char *dir_name = ngdirname(filename);
modeldeck = inp_readall(modfile, dir_name, 0, 0);
modeldeck = inp_readall(modfile, dir_name, 0, 0, NULL);
free(dir_name);
}
tfree(input);

View File

@ -352,6 +352,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
wordlist *controls = NULL, *pre_controls = NULL;
FILE *lastin, *lastout, *lasterr;
double temperature_value;
bool expr_w_temper = FALSE;
double startTime, endTime;
@ -364,7 +365,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
char *dir_name = ngdirname(filename ? filename : ".");
startTime = seconds();
deck = inp_readall(fp, dir_name, comfile, intfile);
deck = inp_readall(fp, dir_name, comfile, intfile, &expr_w_temper);
endTime = seconds();
tfree(dir_name);

View File

@ -100,9 +100,6 @@ int dynMaxckt = 0; /* subckt.c 307 */
/* number of parameter substitutions */
long dynsubst; /* spicenum.c 221 */
/* Expression handling with 'temper' parameter required */
bool expr_w_temper = FALSE;
static char *readline(FILE *fd);
static int get_number_terminals(char *c);
@ -476,7 +473,7 @@ find_assignment(char *str)
*-------------------------------------------------------------------------*/
struct line *
inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile)
inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile, bool *expr_w_temper_p)
{
struct line *cc;
struct inp_read_t rv;
@ -535,6 +532,7 @@ inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile)
#ifndef XSPICE
inp_poly_err(working);
#endif
bool expr_w_temper = FALSE;
if (inp_compat_mode != COMPATMODE_SPICE3) {
/* Do all the compatibility stuff here */
working = cc->li_next;
@ -545,9 +543,9 @@ inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile)
inp_bsource_compat(working);
inp_dot_if(working);
expr_w_temper = inp_temper_compat(working);
} else {
expr_w_temper = FALSE;
}
if (expr_w_temper_p)
*expr_w_temper_p = expr_w_temper;
inp_add_series_resistor(working);

View File

@ -35,7 +35,7 @@ inp_nutsource(FILE *fp, bool comfile, char *filename)
wordlist *controls = NULL;
FILE *lastin, *lastout, *lasterr;
deck = inp_readall(fp, NULL, comfile, FALSE); /* still to check if . or filename instead of NULL */
deck = inp_readall(fp, NULL, comfile, FALSE, NULL); /* still to check if . or filename instead of NULL */
if (!deck)
return;

View File

@ -447,7 +447,6 @@ extern int NIpred(CKTcircuit *ckt);
#endif
extern IFfrontEnd *SPfrontEnd;
extern bool expr_w_temper;
struct circ;
extern void inp_evaluate_temper(struct circ *ckt);

View File

@ -212,7 +212,7 @@ extern void inp_source(char *file);
void inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile);
extern void inp_casefix(char *string);
extern void inp_list(FILE *file, struct line *deck, struct line *extras, int type);
extern struct line *inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile);
extern struct line *inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile, bool *expr_w_temper);
extern FILE *inp_pathopen(char *name, char *mode);
extern char *search_identifier(char *str, const char *identifier, char *str_begin);
extern struct line *line_nconc(struct line *head, struct line *rest);