getexpress(), change signature, return char * to continue with
This commit is contained in:
parent
0c363d7b4f
commit
9494f8d9af
|
|
@ -1333,14 +1333,14 @@ getword(const char *s, SPICE_DSTRINGPTR tstr_p)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
getexpress(nupa_type *type, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
||||
static const char *
|
||||
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
|
||||
*/
|
||||
{
|
||||
const char *xia_ptr = *pi;
|
||||
const char *xia_ptr = pi;
|
||||
const char * const ls_ptr = xia_ptr + strlen(xia_ptr);
|
||||
const char *p;
|
||||
nupa_type tpe;
|
||||
|
|
@ -1408,10 +1408,10 @@ getexpress(nupa_type *type, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
|||
if (tpe == NUPA_STRING)
|
||||
p++; /* beyond quote */
|
||||
|
||||
*pi = p + 1;
|
||||
|
||||
if (type)
|
||||
*type = tpe;
|
||||
|
||||
return p + 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1465,7 +1465,7 @@ nupa_assignment(dico_t *dico, char *s, char mode)
|
|||
error = message(dico, " = sign expected.\n");
|
||||
|
||||
const char *tmp = s + i;
|
||||
getexpress(&dtype, &ustr, &tmp);
|
||||
tmp = getexpress(&dtype, &ustr, tmp);
|
||||
i = (int) (tmp - s);
|
||||
|
||||
if (dtype == NUPA_REAL) {
|
||||
|
|
@ -1674,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(NULL, &ustr, &tmp);
|
||||
tmp = getexpress(NULL, &ustr, tmp);
|
||||
j = (int) (tmp - aux);
|
||||
j--; /* confusion: j was in Turbo Pascal convention */
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue