getexpress(), return `tpe' per reference

This commit is contained in:
rlar 2016-05-22 12:33:47 +02:00
parent 49bdcc3e3d
commit 0c363d7b4f
1 changed files with 6 additions and 5 deletions

View File

@ -1333,8 +1333,8 @@ getword(const char *s, SPICE_DSTRINGPTR tstr_p)
}
static nupa_type
getexpress(SPICE_DSTRINGPTR tstr_p, const char **pi)
static void
getexpress(nupa_type *type, SPICE_DSTRINGPTR tstr_p, const char **pi)
/* returns expression-like string until next separator
Input i=position before expr, output i=just after expr, on separator.
returns tpe=='R' if (numeric, 'S' if (string only
@ -1410,7 +1410,8 @@ getexpress(SPICE_DSTRINGPTR tstr_p, const char **pi)
*pi = p + 1;
return tpe;
if (type)
*type = tpe;
}
@ -1464,7 +1465,7 @@ nupa_assignment(dico_t *dico, char *s, char mode)
error = message(dico, " = sign expected.\n");
const char *tmp = s + i;
dtype = getexpress(&ustr, &tmp);
getexpress(&dtype, &ustr, &tmp);
i = (int) (tmp - s);
if (dtype == NUPA_REAL) {
@ -1673,7 +1674,7 @@ nupa_subcktcall(dico_t *dico, char *s, char *x, char *inst_name)
} else if (t_p[k] == '{') {
char *aux = spice_dstring_value(&tstr);
const char *tmp = aux + j;
getexpress(&ustr, &tmp);
getexpress(NULL, &ustr, &tmp);
j = (int) (tmp - aux);
j--; /* confusion: j was in Turbo Pascal convention */
} else {