String offset wrong. Expression were translated incorrectly.

This commit is contained in:
pnenzi 2005-08-26 20:22:26 +00:00
parent 8e4fb4cef8
commit 8274fff4fe
2 changed files with 11 additions and 5 deletions

View File

@ -2,6 +2,12 @@
============================ Rework-16 ==================================
2005-08-26 Paolo Nenzi <p.nenzi@ieee.org>
* src/fronted/dotcards.c: expressions were not parsed correctly, the bug
was in the offset from string base: corrected.
2005-08-23 Paolo Nenzi <p.nenzi@ieee.org>
* src/xspice/icm/xtradev/aswitch/cfunc.mod: Added minimum on resistance

View File

@ -451,35 +451,35 @@ fixem(char *string)
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "mag(v(%s))", string + 3);
else if (eq(string + 2, "0"))
else if (eq(string + 3, "0"))
(void) sprintf(buf, "mag(-v(%s))", s);
else (void) sprintf(buf, "mag(v(%s)-v(%s))", string + 3, s);
} else if (ciprefix("vp(", string)) {
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "ph(v(%s))", string + 3);
else if (eq(string + 2, "0"))
else if (eq(string + 3, "0"))
(void) sprintf(buf, "ph(-v(%s))", s);
else (void) sprintf(buf, "ph(v(%s)-v(%s))", string + 3, s);
} else if (ciprefix("vi(", string)) {
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "imag(v(%s))", string + 3);
else if (eq(string + 2, "0"))
else if (eq(string + 3, "0"))
(void) sprintf(buf, "imag(-v(%s))", s);
else (void) sprintf(buf, "imag(v(%s)-v(%s))", string + 3, s);
} else if (ciprefix("vr(", string)) {
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "real(v(%s))", string + 3);
else if (eq(string + 2, "0"))
else if (eq(string + 3, "0"))
(void) sprintf(buf, "real(-v(%s))", s);
else (void) sprintf(buf, "real(v(%s)-v(%s))", string + 3, s);
} else if (ciprefix("vdb(", string)) {
for (s = string; *s && (*s != ','); s++) ; *s++ = '\0';
for (t = s; *t && (*t != ')'); t++) ; *t = '\0';
if (eq(s, "0")) (void) sprintf(buf, "db(v(%s))", string + 4);
else if (eq(string + 2, "0"))
else if (eq(string + 4, "0"))
(void) sprintf(buf, "db(-v(%s))", s);
else (void) sprintf(buf, "db(v(%s)-v(%s))", string + 4, s);
} else if (ciprefix("i(", string)) {