Browse Source

defsubckt(), cleanup

pre-master-46
rlar 8 years ago
parent
commit
44a17a14f7
  1. 12
      src/frontend/numparam/xpressn.c

12
src/frontend/numparam/xpressn.c

@ -516,24 +516,24 @@ defsubckt(dico_t *dico, struct card *card, nupa_type categ)
const char *i_ptr, *j_ptr; const char *i_ptr, *j_ptr;
i_ptr = s; i_ptr = s;
while (((i_ptr - s) < (ls_ptr - s)) && (s[(i_ptr - s)] != '.'))
while ((i_ptr < ls_ptr) && (*i_ptr != '.'))
i_ptr++; /* skip 1st dotword */ i_ptr++; /* skip 1st dotword */
while (((i_ptr - s) < (ls_ptr - s)) && (s[(i_ptr - s)] > ' '))
while ((i_ptr < ls_ptr) && (*i_ptr > ' '))
i_ptr++; i_ptr++;
while (((i_ptr - s) < (ls_ptr - s)) && (s[(i_ptr - s)] <= ' '))
while ((i_ptr < ls_ptr) && (*i_ptr <= ' '))
i_ptr++; /* skip blank */ i_ptr++; /* skip blank */
j_ptr = i_ptr; j_ptr = i_ptr;
while (((j_ptr - s) < (ls_ptr - s)) && (s[(j_ptr - s)] > ' '))
while ((j_ptr < ls_ptr) && (*j_ptr > ' '))
j_ptr++; j_ptr++;
if ((j_ptr - s) > (i_ptr - s)) {
if (j_ptr > i_ptr) {
SPICE_DSTRING ustr; /* temp user string */ SPICE_DSTRING ustr; /* temp user string */
spice_dstring_init(&ustr); spice_dstring_init(&ustr);
pscopy_up(&ustr, s, (int) (i_ptr - s), (int) (j_ptr - s) - (int) (i_ptr - s));
pscopy_up(&ustr, s, (int) (i_ptr - s), (int) (j_ptr - i_ptr));
err = nupa_define(dico, spice_dstring_value(&ustr), ' ', categ, 0.0, w, NULL); err = nupa_define(dico, spice_dstring_value(&ustr), ' ', categ, 0.0, w, NULL);
spice_dstring_free(&ustr); spice_dstring_free(&ustr);
} else { } else {

Loading…
Cancel
Save