From 9494f8d9af1496a912aa32a8799200d8e188881e Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 18 Nov 2017 12:45:58 +0100 Subject: [PATCH] getexpress(), change signature, return char * to continue with --- src/frontend/numparam/xpressn.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 5fb2e9724..49aa4d640 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -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 {