findsubname(), local scope for `nest' `j' and `h'
This commit is contained in:
parent
45f3749bb1
commit
ab152c99fc
|
|
@ -153,9 +153,7 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
|
||||||
{
|
{
|
||||||
SPICE_DSTRING name; /* extract a name */
|
SPICE_DSTRING name; /* extract a name */
|
||||||
char *s; /* current dstring */
|
char *s; /* current dstring */
|
||||||
int h, j, k, nest, ls;
|
int k, ls;
|
||||||
|
|
||||||
h = 0;
|
|
||||||
|
|
||||||
ls = spice_dstring_length(dstr_p);
|
ls = spice_dstring_length(dstr_p);
|
||||||
s = spice_dstring_value(dstr_p);
|
s = spice_dstring_value(dstr_p);
|
||||||
|
|
@ -168,11 +166,11 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
|
||||||
while ((k >= 0) && (s[k] <= ' '))
|
while ((k >= 0) && (s[k] <= ' '))
|
||||||
k--;
|
k--;
|
||||||
|
|
||||||
h = k + 1; /* at h: space */
|
int h = k + 1; /* at h: space */
|
||||||
while ((k >= 0) && (s[k] > ' ')) {
|
while ((k >= 0) && (s[k] > ' ')) {
|
||||||
|
|
||||||
if (s[k] == '}') {
|
if (s[k] == '}') {
|
||||||
nest = 1;
|
int nest = 1;
|
||||||
k--;
|
k--;
|
||||||
|
|
||||||
while ((nest > 0) && (k >= 0)) {
|
while ((nest > 0) && (k >= 0)) {
|
||||||
|
|
@ -194,7 +192,7 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
|
||||||
entry_t *entry;
|
entry_t *entry;
|
||||||
/* check for known subckt name */
|
/* check for known subckt name */
|
||||||
spice_dstring_reinit(&name);
|
spice_dstring_reinit(&name);
|
||||||
j = k + 1;
|
int j = k + 1;
|
||||||
while (alfanum(s[j])) {
|
while (alfanum(s[j])) {
|
||||||
cadd(&name, toupper_c(s[j]));
|
cadd(&name, toupper_c(s[j]));
|
||||||
j++;
|
j++;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue