getexpress(), ia ==> ia_ptr - (const) s
This commit is contained in:
parent
44c5410490
commit
dc8eb2b956
|
|
@ -1340,23 +1340,24 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
||||||
returns tpe=='R' if (numeric, 'S' if (string only
|
returns tpe=='R' if (numeric, 'S' if (string only
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
|
const char *ia_ptr;
|
||||||
const char *ls_ptr;
|
const char *ls_ptr;
|
||||||
const char *iptr;
|
const char *iptr;
|
||||||
iptr = *pi - s + s;
|
iptr = *pi - s + s;
|
||||||
int ia, level;
|
int level;
|
||||||
char c, d;
|
char c, d;
|
||||||
nupa_type tpe;
|
nupa_type tpe;
|
||||||
|
|
||||||
ls_ptr = s + strlen(s);
|
ls_ptr = s + strlen(s);
|
||||||
ia = (int) (iptr - s) + 1;
|
(ia_ptr - s) = (int) (iptr - s) + 1;
|
||||||
|
|
||||||
while ((ia < (ls_ptr - s)) && (s[ia - 1] <= ' '))
|
while (((ia_ptr - s) < (ls_ptr - s)) && (s[(ia_ptr - s) - 1] <= ' '))
|
||||||
ia++; /*white space ? */
|
(ia_ptr - s)++; /*white space ? */
|
||||||
|
|
||||||
if (s[ia - 1] == '"') {
|
if (s[(ia_ptr - s) - 1] == '"') {
|
||||||
/* string constant */
|
/* string constant */
|
||||||
ia++;
|
(ia_ptr - s)++;
|
||||||
iptr = ia + s;
|
iptr = (ia_ptr - s) + s;
|
||||||
|
|
||||||
while (((iptr - s) < (ls_ptr - s)) && (s[(iptr - s) - 1] != '"'))
|
while (((iptr - s) < (ls_ptr - s)) && (s[(iptr - s) - 1] != '"'))
|
||||||
iptr++;
|
iptr++;
|
||||||
|
|
@ -1369,10 +1370,10 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (s[ia - 1] == '{')
|
if (s[(ia_ptr - s) - 1] == '{')
|
||||||
ia++;
|
(ia_ptr - s)++;
|
||||||
|
|
||||||
iptr = ia - 1 + s;
|
iptr = (ia_ptr - s) - 1 + s;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
@ -1408,7 +1409,7 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
||||||
tpe = NUPA_REAL;
|
tpe = NUPA_REAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pscopy(tstr_p, s, ia-1, (int) (iptr - s) - ia);
|
pscopy(tstr_p, s, (int)(ia_ptr - s)-1, (int) (iptr - s) - (int) (ia_ptr - s));
|
||||||
|
|
||||||
if (s[(iptr - s) - 1] == '}')
|
if (s[(iptr - s) - 1] == '}')
|
||||||
iptr++;
|
iptr++;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue