numparam, unify `entry' variable
This commit is contained in:
parent
a67b74ab9f
commit
c2028203a8
|
|
@ -51,7 +51,7 @@ typedef struct { /* the input scanner data structure */
|
||||||
|
|
||||||
void initdico(dico_t *);
|
void initdico(dico_t *);
|
||||||
int donedico(dico_t *);
|
int donedico(dico_t *);
|
||||||
void dico_free_entry(entry_t *entry_p);
|
void dico_free_entry(entry_t *);
|
||||||
bool defsubckt(dico_t *, char *s, int w, char categ);
|
bool defsubckt(dico_t *, char *s, int w, char categ);
|
||||||
int findsubckt(dico_t *, char *s, SPICE_DSTRINGPTR subname);
|
int findsubckt(dico_t *, char *s, SPICE_DSTRINGPTR subname);
|
||||||
bool nupa_substitute(dico_t *, char *s, char *r, bool err);
|
bool nupa_substitute(dico_t *, char *s, char *r, bool err);
|
||||||
|
|
|
||||||
|
|
@ -535,19 +535,19 @@ static void
|
||||||
dump_symbol_table(dico_t *dico, NGHASHPTR htable_p, FILE *cp_out)
|
dump_symbol_table(dico_t *dico, NGHASHPTR htable_p, FILE *cp_out)
|
||||||
{
|
{
|
||||||
char *name; /* current symbol */
|
char *name; /* current symbol */
|
||||||
entry_t *entry_p; /* current entry */
|
entry_t *entry; /* current entry */
|
||||||
NGHASHITER iter; /* hash iterator - thread safe */
|
NGHASHITER iter; /* hash iterator - thread safe */
|
||||||
|
|
||||||
NGHASH_FIRST(&iter);
|
NGHASH_FIRST(&iter);
|
||||||
for (entry_p = (entry_t *) nghash_enumerateRE(htable_p, &iter);
|
for (entry = (entry_t *) nghash_enumerateRE(htable_p, &iter);
|
||||||
entry_p;
|
entry;
|
||||||
entry_p = (entry_t *) nghash_enumerateRE(htable_p, &iter))
|
entry = (entry_t *) nghash_enumerateRE(htable_p, &iter))
|
||||||
{
|
{
|
||||||
if (entry_p->tp == 'R') {
|
if (entry->tp == 'R') {
|
||||||
spice_dstring_reinit(& dico->lookup_buf);
|
spice_dstring_reinit(& dico->lookup_buf);
|
||||||
scopy_lower(& dico->lookup_buf, entry_p->symbol);
|
scopy_lower(& dico->lookup_buf, entry->symbol);
|
||||||
name = spice_dstring_value(& dico->lookup_buf);
|
name = spice_dstring_value(& dico->lookup_buf);
|
||||||
fprintf(cp_out, " ---> %s = %g\n", name, entry_p->vl);
|
fprintf(cp_out, " ---> %s = %g\n", name, entry->vl);
|
||||||
spice_dstring_free(& dico->lookup_buf);
|
spice_dstring_free(& dico->lookup_buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -597,7 +597,7 @@ nupa_get_param(char *param_name, int *found)
|
||||||
{
|
{
|
||||||
int depth; /* nested subcircit depth */
|
int depth; /* nested subcircit depth */
|
||||||
char *up_name; /* current parameter upper case */
|
char *up_name; /* current parameter upper case */
|
||||||
entry_t *entry_p; /* current entry */
|
entry_t *entry; /* current entry */
|
||||||
dico_t *dico; /* local copy for speed */
|
dico_t *dico; /* local copy for speed */
|
||||||
double result = 0; /* parameter value */
|
double result = 0; /* parameter value */
|
||||||
|
|
||||||
|
|
@ -610,9 +610,9 @@ nupa_get_param(char *param_name, int *found)
|
||||||
for (depth = dico->stack_depth; depth >= 0; depth--) {
|
for (depth = dico->stack_depth; depth >= 0; depth--) {
|
||||||
NGHASHPTR htable_p = dico->symbols[depth];
|
NGHASHPTR htable_p = dico->symbols[depth];
|
||||||
if (htable_p) {
|
if (htable_p) {
|
||||||
entry_p = (entry_t *) nghash_find(htable_p, up_name);
|
entry = (entry_t *) nghash_find(htable_p, up_name);
|
||||||
if (entry_p) {
|
if (entry) {
|
||||||
result = entry_p->vl;
|
result = entry->vl;
|
||||||
*found = 1;
|
*found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -628,7 +628,7 @@ void
|
||||||
nupa_add_param(char *param_name, double value)
|
nupa_add_param(char *param_name, double value)
|
||||||
{
|
{
|
||||||
char *up_name; /* current parameter upper case */
|
char *up_name; /* current parameter upper case */
|
||||||
entry_t *entry_p; /* current entry */
|
entry_t *entry; /* current entry */
|
||||||
dico_t *dico; /* local copy for speed */
|
dico_t *dico; /* local copy for speed */
|
||||||
NGHASHPTR htable_p; /* hash table of interest */
|
NGHASHPTR htable_p; /* hash table of interest */
|
||||||
|
|
||||||
|
|
@ -647,12 +647,12 @@ nupa_add_param(char *param_name, double value)
|
||||||
|
|
||||||
htable_p = dico->symbols[dico->stack_depth];
|
htable_p = dico->symbols[dico->stack_depth];
|
||||||
|
|
||||||
entry_p = attrib(dico, htable_p, up_name, 'N');
|
entry = attrib(dico, htable_p, up_name, 'N');
|
||||||
if (entry_p) {
|
if (entry) {
|
||||||
entry_p->vl = value;
|
entry->vl = value;
|
||||||
entry_p->tp = 'R';
|
entry->tp = 'R';
|
||||||
entry_p->ivl = 0;
|
entry->ivl = 0;
|
||||||
entry_p->sbbase = NULL;
|
entry->sbbase = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
spice_dstring_free(& dico->lookup_buf);
|
spice_dstring_free(& dico->lookup_buf);
|
||||||
|
|
@ -663,7 +663,7 @@ void
|
||||||
nupa_add_inst_param(char *param_name, double value)
|
nupa_add_inst_param(char *param_name, double value)
|
||||||
{
|
{
|
||||||
char *up_name; /* current parameter upper case */
|
char *up_name; /* current parameter upper case */
|
||||||
entry_t *entry_p; /* current entry */
|
entry_t *entry; /* current entry */
|
||||||
dico_t *dico; /* local copy for speed */
|
dico_t *dico; /* local copy for speed */
|
||||||
|
|
||||||
dico = dicoS;
|
dico = dicoS;
|
||||||
|
|
@ -674,12 +674,12 @@ nupa_add_inst_param(char *param_name, double value)
|
||||||
if (!(dico->inst_symbols))
|
if (!(dico->inst_symbols))
|
||||||
dico->inst_symbols = nghash_init(NGHASH_MIN_SIZE);
|
dico->inst_symbols = nghash_init(NGHASH_MIN_SIZE);
|
||||||
|
|
||||||
entry_p = attrib(dico, dico->inst_symbols, up_name, 'N');
|
entry = attrib(dico, dico->inst_symbols, up_name, 'N');
|
||||||
if (entry_p) {
|
if (entry) {
|
||||||
entry_p->vl = value;
|
entry->vl = value;
|
||||||
entry_p->tp = 'R';
|
entry->tp = 'R';
|
||||||
entry_p->ivl = 0;
|
entry->ivl = 0;
|
||||||
entry_p->sbbase = NULL;
|
entry->sbbase = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
spice_dstring_free(& dico->lookup_buf);
|
spice_dstring_free(& dico->lookup_buf);
|
||||||
|
|
@ -694,7 +694,7 @@ nupa_add_inst_param(char *param_name, double value)
|
||||||
void
|
void
|
||||||
nupa_copy_inst_dico(void)
|
nupa_copy_inst_dico(void)
|
||||||
{
|
{
|
||||||
entry_t *entry_p; /* current entry */
|
entry_t *entry; /* current entry */
|
||||||
dico_t *dico; /* local copy for speed */
|
dico_t *dico; /* local copy for speed */
|
||||||
NGHASHITER iter; /* hash iterator - thread safe */
|
NGHASHITER iter; /* hash iterator - thread safe */
|
||||||
|
|
||||||
|
|
@ -705,12 +705,12 @@ nupa_copy_inst_dico(void)
|
||||||
fprintf(stderr, "stack depth should be zero.\n");
|
fprintf(stderr, "stack depth should be zero.\n");
|
||||||
|
|
||||||
NGHASH_FIRST(&iter);
|
NGHASH_FIRST(&iter);
|
||||||
for (entry_p = (entry_t *) nghash_enumerateRE(dico->inst_symbols, &iter);
|
for (entry = (entry_t *) nghash_enumerateRE(dico->inst_symbols, &iter);
|
||||||
entry_p;
|
entry;
|
||||||
entry_p = (entry_t *) nghash_enumerateRE(dico->inst_symbols, &iter))
|
entry = (entry_t *) nghash_enumerateRE(dico->inst_symbols, &iter))
|
||||||
{
|
{
|
||||||
nupa_add_param(entry_p->symbol, entry_p->vl);
|
nupa_add_param(entry->symbol, entry->vl);
|
||||||
dico_free_entry(entry_p);
|
dico_free_entry(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
nghash_free(dico->inst_symbols, NULL, NULL);
|
nghash_free(dico->inst_symbols, NULL, NULL);
|
||||||
|
|
|
||||||
|
|
@ -272,12 +272,12 @@ initdico(dico_t *dico)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
dico_free_entry(entry_t *entry_p)
|
dico_free_entry(entry_t *entry)
|
||||||
{
|
{
|
||||||
if (entry_p->symbol)
|
if (entry->symbol)
|
||||||
txfree(entry_p->symbol);
|
txfree(entry->symbol);
|
||||||
|
|
||||||
txfree(entry_p);
|
txfree(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -312,7 +312,7 @@ dicostack_pop(dico_t *dico)
|
||||||
{
|
{
|
||||||
char *inst_name; /* name of subcircuit instance */
|
char *inst_name; /* name of subcircuit instance */
|
||||||
char *param_p; /* qualified inst parameter name */
|
char *param_p; /* qualified inst parameter name */
|
||||||
entry_t *entry_p; /* current entry */
|
entry_t *entry; /* current entry */
|
||||||
NGHASHPTR htable_p; /* current hash table */
|
NGHASHPTR htable_p; /* current hash table */
|
||||||
NGHASHITER iter; /* hash iterator - thread safe */
|
NGHASHITER iter; /* hash iterator - thread safe */
|
||||||
|
|
||||||
|
|
@ -332,15 +332,15 @@ dicostack_pop(dico_t *dico)
|
||||||
spice_dstring_init(¶m_name);
|
spice_dstring_init(¶m_name);
|
||||||
|
|
||||||
NGHASH_FIRST(&iter);
|
NGHASH_FIRST(&iter);
|
||||||
for (entry_p = (entry_t *) nghash_enumerateRE(htable_p, &iter);
|
for (entry = (entry_t *) nghash_enumerateRE(htable_p, &iter);
|
||||||
entry_p;
|
entry;
|
||||||
entry_p = (entry_t *) nghash_enumerateRE(htable_p, &iter))
|
entry = (entry_t *) nghash_enumerateRE(htable_p, &iter))
|
||||||
{
|
{
|
||||||
spice_dstring_reinit(¶m_name);
|
spice_dstring_reinit(¶m_name);
|
||||||
param_p = spice_dstring_print(¶m_name, "%s.%s",
|
param_p = spice_dstring_print(¶m_name, "%s.%s",
|
||||||
inst_name, entry_p->symbol);
|
inst_name, entry->symbol);
|
||||||
nupa_add_inst_param(param_p, entry_p->vl);
|
nupa_add_inst_param(param_p, entry->vl);
|
||||||
dico_free_entry(entry_p);
|
dico_free_entry(entry);
|
||||||
}
|
}
|
||||||
nghash_free(htable_p, NULL, NULL);
|
nghash_free(htable_p, NULL, NULL);
|
||||||
spice_dstring_free(¶m_name);
|
spice_dstring_free(¶m_name);
|
||||||
|
|
@ -370,16 +370,16 @@ static entry_t *
|
||||||
entrynb(dico_t *dico, char *s)
|
entrynb(dico_t *dico, char *s)
|
||||||
{
|
{
|
||||||
int depth; /* stack depth */
|
int depth; /* stack depth */
|
||||||
entry_t *entry_p; /* search hash table */
|
entry_t *entry; /* search hash table */
|
||||||
NGHASHPTR htable_p; /* hash table */
|
NGHASHPTR htable_p; /* hash table */
|
||||||
|
|
||||||
/* look at the current scope and then backup the stack */
|
/* look at the current scope and then backup the stack */
|
||||||
for (depth = dico->stack_depth; depth >= 0; depth--) {
|
for (depth = dico->stack_depth; depth >= 0; depth--) {
|
||||||
htable_p = dico->symbols[depth];
|
htable_p = dico->symbols[depth];
|
||||||
if (htable_p) {
|
if (htable_p) {
|
||||||
entry_p = (entry_t *) nghash_find(htable_p, s);
|
entry = (entry_t *) nghash_find(htable_p, s);
|
||||||
if (entry_p)
|
if (entry)
|
||||||
return (entry_p);
|
return (entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -391,12 +391,12 @@ char
|
||||||
getidtype(dico_t *dico, char *s)
|
getidtype(dico_t *dico, char *s)
|
||||||
/* test if identifier s is known. Answer its type, or '?' if not in table */
|
/* test if identifier s is known. Answer its type, or '?' if not in table */
|
||||||
{
|
{
|
||||||
entry_t *entry_p; /* hash table entry */
|
entry_t *entry; /* hash table entry */
|
||||||
char itp = '?'; /* assume unknown */
|
char itp = '?'; /* assume unknown */
|
||||||
|
|
||||||
entry_p = entrynb(dico, s);
|
entry = entrynb(dico, s);
|
||||||
if (entry_p)
|
if (entry)
|
||||||
itp = entry_p->tp;
|
itp = entry->tp;
|
||||||
|
|
||||||
return (itp);
|
return (itp);
|
||||||
}
|
}
|
||||||
|
|
@ -407,20 +407,20 @@ fetchnumentry(dico_t *dico, char *t, bool *perr)
|
||||||
{
|
{
|
||||||
bool err = *perr;
|
bool err = *perr;
|
||||||
double u;
|
double u;
|
||||||
entry_t *entry_p; /* hash table entry */
|
entry_t *entry; /* hash table entry */
|
||||||
|
|
||||||
entry_p = entrynb(dico, t); /* no keyword */
|
entry = entrynb(dico, t); /* no keyword */
|
||||||
/*dbg -- if (k <= 0) { printf("Dico num lookup fails."); } */
|
/*dbg -- if (k <= 0) { printf("Dico num lookup fails."); } */
|
||||||
|
|
||||||
while (entry_p && (entry_p->tp == 'P'))
|
while (entry && (entry->tp == 'P'))
|
||||||
entry_p = entry_p->pointer;
|
entry = entry->pointer;
|
||||||
|
|
||||||
if (entry_p)
|
if (entry)
|
||||||
if (entry_p->tp != 'R')
|
if (entry->tp != 'R')
|
||||||
entry_p = NULL;
|
entry = NULL;
|
||||||
|
|
||||||
if (entry_p) {
|
if (entry) {
|
||||||
u = entry_p->vl;
|
u = entry->vl;
|
||||||
} else {
|
} else {
|
||||||
err = message(dico, "Undefined number [%s]\n", t);
|
err = message(dico, "Undefined number [%s]\n", t);
|
||||||
u = 0.0;
|
u = 0.0;
|
||||||
|
|
@ -440,24 +440,24 @@ attrib(dico_t *dico, NGHASHPTR htable_p, char *t, char op)
|
||||||
/* seek or attribute dico entry number for string t.
|
/* seek or attribute dico entry number for string t.
|
||||||
Option op='N' : force a new entry, if tos>level and old is valid.
|
Option op='N' : force a new entry, if tos>level and old is valid.
|
||||||
*/
|
*/
|
||||||
entry_t *entry_p; /* symbol table entry */
|
entry_t *entry; /* symbol table entry */
|
||||||
|
|
||||||
entry_p = (entry_t *) nghash_find(htable_p, t);
|
entry = (entry_t *) nghash_find(htable_p, t);
|
||||||
if (entry_p && (op == 'N') &&
|
if (entry && (op == 'N') &&
|
||||||
(entry_p->level < dico->stack_depth) && (entry_p->tp != '?'))
|
(entry->level < dico->stack_depth) && (entry->tp != '?'))
|
||||||
{
|
{
|
||||||
entry_p = NULL;
|
entry = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entry_p) {
|
if (!entry) {
|
||||||
entry_p = TMALLOC(entry_t, 1);
|
entry = TMALLOC(entry_t, 1);
|
||||||
entry_p->symbol = strdup(t);
|
entry->symbol = strdup(t);
|
||||||
entry_p->tp = '?'; /* signal Unknown */
|
entry->tp = '?'; /* signal Unknown */
|
||||||
entry_p->level = dico->stack_depth;
|
entry->level = dico->stack_depth;
|
||||||
nghash_insert(htable_p, t, entry_p);
|
nghash_insert(htable_p, t, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
return entry_p;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -467,12 +467,12 @@ attrib(dico_t *dico, NGHASHPTR htable_p, char *t, char op)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
del_attrib(void *e_p)
|
del_attrib(void *entry_p)
|
||||||
{
|
{
|
||||||
entry_t *entry_p = (entry_t*)e_p;
|
entry_t *entry = (entry_t*) entry_p;
|
||||||
if(entry_p) {
|
if(entry) {
|
||||||
tfree(entry_p->symbol);
|
tfree(entry->symbol);
|
||||||
tfree(entry_p);
|
tfree(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -497,7 +497,7 @@ nupa_define(dico_t *dico,
|
||||||
*/
|
*/
|
||||||
char c;
|
char c;
|
||||||
bool err, warn;
|
bool err, warn;
|
||||||
entry_t *entry_p; /* spice table entry */
|
entry_t *entry; /* spice table entry */
|
||||||
NGHASHPTR htable_p; /* hash table */
|
NGHASHPTR htable_p; /* hash table */
|
||||||
|
|
||||||
NG_IGNORE(pval);
|
NG_IGNORE(pval);
|
||||||
|
|
@ -508,36 +508,36 @@ nupa_define(dico_t *dico,
|
||||||
|
|
||||||
htable_p = dico->symbols[dico->stack_depth];
|
htable_p = dico->symbols[dico->stack_depth];
|
||||||
|
|
||||||
entry_p = attrib(dico, htable_p, t, op);
|
entry = attrib(dico, htable_p, t, op);
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
||||||
if (!entry_p) {
|
if (!entry) {
|
||||||
|
|
||||||
err = message(dico, " Symbol table overflow\n");
|
err = message(dico, " Symbol table overflow\n");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (entry_p->tp == 'P')
|
if (entry->tp == 'P')
|
||||||
entry_p = entry_p->pointer; /* pointer indirection */
|
entry = entry->pointer; /* pointer indirection */
|
||||||
|
|
||||||
if (entry_p)
|
if (entry)
|
||||||
c = entry_p->tp;
|
c = entry->tp;
|
||||||
else
|
else
|
||||||
c = ' ';
|
c = ' ';
|
||||||
|
|
||||||
if ((c == 'R') || (c == 'S') || (c == '?')) {
|
if ((c == 'R') || (c == 'S') || (c == '?')) {
|
||||||
|
|
||||||
entry_p->vl = z;
|
entry->vl = z;
|
||||||
entry_p->tp = tpe;
|
entry->tp = tpe;
|
||||||
entry_p->ivl = w;
|
entry->ivl = w;
|
||||||
entry_p->sbbase = base;
|
entry->sbbase = base;
|
||||||
/* if ((c != '?') && (i <= dico->stack[dico->tos])) { */
|
/* if ((c != '?') && (i <= dico->stack[dico->tos])) { */
|
||||||
if (c == '?')
|
if (c == '?')
|
||||||
entry_p->level = dico->stack_depth; /* promote! */
|
entry->level = dico->stack_depth; /* promote! */
|
||||||
|
|
||||||
/* warn about re-write to a global scope! */
|
/* warn about re-write to a global scope! */
|
||||||
if (entry_p->level < dico->stack_depth)
|
if (entry->level < dico->stack_depth)
|
||||||
warn = message(dico, "%s:%d overwritten.\n", t, entry_p->level);
|
warn = message(dico, "%s:%d overwritten.\n", t, entry->level);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* suppress error message, resulting from multiple definition of
|
/* suppress error message, resulting from multiple definition of
|
||||||
|
|
@ -600,7 +600,7 @@ findsubckt(dico_t *dico, char *s, SPICE_DSTRINGPTR subname)
|
||||||
returns 0 if not found, else the stored definition line number value
|
returns 0 if not found, else the stored definition line number value
|
||||||
and the name in string subname */
|
and the name in string subname */
|
||||||
{
|
{
|
||||||
entry_t *entry_p; /* symbol table entry */
|
entry_t *entry; /* symbol table entry */
|
||||||
SPICE_DSTRING ustr; /* u= subckt name is last token in string s */
|
SPICE_DSTRING ustr; /* u= subckt name is last token in string s */
|
||||||
int j, k;
|
int j, k;
|
||||||
int line; /* stored line number */
|
int line; /* stored line number */
|
||||||
|
|
@ -618,10 +618,10 @@ findsubckt(dico_t *dico, char *s, SPICE_DSTRINGPTR subname)
|
||||||
k--;
|
k--;
|
||||||
|
|
||||||
pscopy_up(&ustr, s, k + 1, j - k);
|
pscopy_up(&ustr, s, k + 1, j - k);
|
||||||
entry_p = entrynb(dico, spice_dstring_value(&ustr));
|
entry = entrynb(dico, spice_dstring_value(&ustr));
|
||||||
|
|
||||||
if (entry_p && (entry_p->tp == 'U')) {
|
if (entry && (entry->tp == 'U')) {
|
||||||
line = entry_p->ivl;
|
line = entry->ivl;
|
||||||
scopyd(subname, &ustr);
|
scopyd(subname, &ustr);
|
||||||
} else {
|
} else {
|
||||||
line = 0;
|
line = 0;
|
||||||
|
|
@ -1169,7 +1169,7 @@ evaluate(dico_t *dico, SPICE_DSTRINGPTR qstr_p, char *t, unsigned char mode)
|
||||||
double u = 0.0;
|
double u = 0.0;
|
||||||
int j, lq;
|
int j, lq;
|
||||||
char dt;
|
char dt;
|
||||||
entry_t *entry_p;
|
entry_t *entry;
|
||||||
bool numeric, done, nolookup;
|
bool numeric, done, nolookup;
|
||||||
bool err;
|
bool err;
|
||||||
|
|
||||||
|
|
@ -1180,32 +1180,32 @@ evaluate(dico_t *dico, SPICE_DSTRINGPTR qstr_p, char *t, unsigned char mode)
|
||||||
if (mode == 1) {
|
if (mode == 1) {
|
||||||
/* string? */
|
/* string? */
|
||||||
stupcase(t);
|
stupcase(t);
|
||||||
entry_p = entrynb(dico, t);
|
entry = entrynb(dico, t);
|
||||||
nolookup = !entry_p;
|
nolookup = !entry;
|
||||||
|
|
||||||
while (entry_p && (entry_p->tp == 'P'))
|
while (entry && (entry->tp == 'P'))
|
||||||
entry_p = entry_p->pointer; /* follow pointer chain */
|
entry = entry->pointer; /* follow pointer chain */
|
||||||
|
|
||||||
/* pointer chain */
|
/* pointer chain */
|
||||||
if (entry_p)
|
if (entry)
|
||||||
dt = entry_p->tp;
|
dt = entry->tp;
|
||||||
else
|
else
|
||||||
dt = ' ';
|
dt = ' ';
|
||||||
|
|
||||||
/* data type: Real or String */
|
/* data type: Real or String */
|
||||||
if (dt == 'R') {
|
if (dt == 'R') {
|
||||||
u = entry_p->vl;
|
u = entry->vl;
|
||||||
numeric = 1;
|
numeric = 1;
|
||||||
} else if (dt == 'S') {
|
} else if (dt == 'S') {
|
||||||
/* suppose source text "..." at */
|
/* suppose source text "..." at */
|
||||||
j = entry_p->ivl;
|
j = entry->ivl;
|
||||||
lq = 0;
|
lq = 0;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
j++;
|
j++;
|
||||||
lq++;
|
lq++;
|
||||||
dt = /* ibf->bf[j]; */ entry_p->sbbase[j];
|
dt = /* ibf->bf[j]; */ entry->sbbase[j];
|
||||||
|
|
||||||
if (cpos('3', spice_dstring_value(&dico->option)) <= 0)
|
if (cpos('3', spice_dstring_value(&dico->option)) <= 0)
|
||||||
dt = upcase(dt); /* spice-2 */
|
dt = upcase(dt); /* spice-2 */
|
||||||
|
|
@ -1218,7 +1218,7 @@ evaluate(dico_t *dico, SPICE_DSTRINGPTR qstr_p, char *t, unsigned char mode)
|
||||||
} while (!done);
|
} while (!done);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entry_p)
|
if (!entry)
|
||||||
err = message(dico,
|
err = message(dico,
|
||||||
"\"%s\" not evaluated.%s\n", t,
|
"\"%s\" not evaluated.%s\n", t,
|
||||||
nolookup ? " Lookup failure." : "");
|
nolookup ? " Lookup failure." : "");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue