shrink scope of expr_w_temper
This commit is contained in:
parent
872ceeedc7
commit
2809ccaa13
|
|
@ -1439,7 +1439,7 @@ com_alter_mod(wordlist *wl)
|
||||||
modfile = inp_pathopen(filename, readmode);
|
modfile = inp_pathopen(filename, readmode);
|
||||||
{
|
{
|
||||||
char *dir_name = ngdirname(filename);
|
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);
|
free(dir_name);
|
||||||
}
|
}
|
||||||
tfree(input);
|
tfree(input);
|
||||||
|
|
|
||||||
|
|
@ -352,6 +352,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
|
||||||
wordlist *controls = NULL, *pre_controls = NULL;
|
wordlist *controls = NULL, *pre_controls = NULL;
|
||||||
FILE *lastin, *lastout, *lasterr;
|
FILE *lastin, *lastout, *lasterr;
|
||||||
double temperature_value;
|
double temperature_value;
|
||||||
|
bool expr_w_temper = FALSE;
|
||||||
|
|
||||||
double startTime, endTime;
|
double startTime, endTime;
|
||||||
|
|
||||||
|
|
@ -364,7 +365,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
|
||||||
char *dir_name = ngdirname(filename ? filename : ".");
|
char *dir_name = ngdirname(filename ? filename : ".");
|
||||||
|
|
||||||
startTime = seconds();
|
startTime = seconds();
|
||||||
deck = inp_readall(fp, dir_name, comfile, intfile);
|
deck = inp_readall(fp, dir_name, comfile, intfile, &expr_w_temper);
|
||||||
endTime = seconds();
|
endTime = seconds();
|
||||||
tfree(dir_name);
|
tfree(dir_name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,6 @@ int dynMaxckt = 0; /* subckt.c 307 */
|
||||||
/* number of parameter substitutions */
|
/* number of parameter substitutions */
|
||||||
long dynsubst; /* spicenum.c 221 */
|
long dynsubst; /* spicenum.c 221 */
|
||||||
|
|
||||||
/* Expression handling with 'temper' parameter required */
|
|
||||||
bool expr_w_temper = FALSE;
|
|
||||||
|
|
||||||
|
|
||||||
static char *readline(FILE *fd);
|
static char *readline(FILE *fd);
|
||||||
static int get_number_terminals(char *c);
|
static int get_number_terminals(char *c);
|
||||||
|
|
@ -476,7 +473,7 @@ find_assignment(char *str)
|
||||||
*-------------------------------------------------------------------------*/
|
*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
struct line *
|
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 line *cc;
|
||||||
struct inp_read_t rv;
|
struct inp_read_t rv;
|
||||||
|
|
@ -535,6 +532,7 @@ inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile)
|
||||||
#ifndef XSPICE
|
#ifndef XSPICE
|
||||||
inp_poly_err(working);
|
inp_poly_err(working);
|
||||||
#endif
|
#endif
|
||||||
|
bool expr_w_temper = FALSE;
|
||||||
if (inp_compat_mode != COMPATMODE_SPICE3) {
|
if (inp_compat_mode != COMPATMODE_SPICE3) {
|
||||||
/* Do all the compatibility stuff here */
|
/* Do all the compatibility stuff here */
|
||||||
working = cc->li_next;
|
working = cc->li_next;
|
||||||
|
|
@ -545,9 +543,9 @@ inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile)
|
||||||
inp_bsource_compat(working);
|
inp_bsource_compat(working);
|
||||||
inp_dot_if(working);
|
inp_dot_if(working);
|
||||||
expr_w_temper = inp_temper_compat(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);
|
inp_add_series_resistor(working);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ inp_nutsource(FILE *fp, bool comfile, char *filename)
|
||||||
wordlist *controls = NULL;
|
wordlist *controls = NULL;
|
||||||
FILE *lastin, *lastout, *lasterr;
|
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)
|
if (!deck)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,6 @@ extern int NIpred(CKTcircuit *ckt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern IFfrontEnd *SPfrontEnd;
|
extern IFfrontEnd *SPfrontEnd;
|
||||||
extern bool expr_w_temper;
|
|
||||||
|
|
||||||
struct circ;
|
struct circ;
|
||||||
extern void inp_evaluate_temper(struct circ *ckt);
|
extern void inp_evaluate_temper(struct circ *ckt);
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ extern void inp_source(char *file);
|
||||||
void inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile);
|
void inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile);
|
||||||
extern void inp_casefix(char *string);
|
extern void inp_casefix(char *string);
|
||||||
extern void inp_list(FILE *file, struct line *deck, struct line *extras, int type);
|
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 FILE *inp_pathopen(char *name, char *mode);
|
||||||
extern char *search_identifier(char *str, const char *identifier, char *str_begin);
|
extern char *search_identifier(char *str, const char *identifier, char *str_begin);
|
||||||
extern struct line *line_nconc(struct line *head, struct line *rest);
|
extern struct line *line_nconc(struct line *head, struct line *rest);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue