Browse Source

.gllobal bug

pre-master-46
h_vogt 16 years ago
parent
commit
204362044e
  1. 3
      ChangeLog
  2. 38
      src/frontend/subckt.c

3
ChangeLog

@ -1,3 +1,6 @@
2010-01-17 Holger Vogt
* subckt.c: .global bug by R. Larice
2010-01-16 Dietmar Warning 2010-01-16 Dietmar Warning
* tests/transmission: Only few tests should be easier, more examples under * tests/transmission: Only few tests should be easier, more examples under
examples/TransmissionLine at next examples/TransmissionLine at next

38
src/frontend/subckt.c

@ -245,26 +245,28 @@ inp_subcktexpand(struct line *deck)
/* Added by H.Tanaka to find global nodes */ /* Added by H.Tanaka to find global nodes */
for(i=0;i<128;i++) strcpy(node[i],"");/* Clear global node holder */ for(i=0;i<128;i++) strcpy(node[i],"");/* Clear global node holder */
for (c = deck; c; c = c->li_next) { for (c = deck; c; c = c->li_next) {
if (ciprefix(".global", c->li_line)) {
s = c->li_line;
txfree(gettok(&s));
numgnode=0;
while(*s) {
i=0;
t=s;
for (/*s*/; *s && !isspace(*s); s++) i++;
strncpy(node[numgnode],t,i+1); /* i+1: include \0 character */
while (isspace(*s)) s++;
numgnode++;
} /* node[] holds name of global node */
if (ciprefix(".global", c->li_line)) {
s = c->li_line;
txfree(gettok(&s));
numgnode=0;
while(*s) {
i=0;
t=s;
for (/*s*/; *s && !isspace(*s); s++) i++;
strncpy(node[numgnode],t,i);
if(i>0 && t[i-1] != '\0')
node[numgnode][i] = '\0';
while (isspace(*s)) s++;
numgnode++;
} /* node[] holds name of global node */
#ifdef TRACE #ifdef TRACE
printf("***Global node option has been found.***\n");
for(i=0;i<numgnode;i++)
printf("***Global node no.%d is %s.***\n",i,node[i]);
printf("\n");
printf("***Global node option has been found.***\n");
for(i=0;i<numgnode;i++)
printf("***Global node no.%d is %s.***\n",i,node[i]);
printf("\n");
#endif /* TRACE */ #endif /* TRACE */
c->li_line[0] = '*'; /* comment it out */
}/* if(ciprefix.. */
c->li_line[0] = '*'; /* comment it out */
}/* if(ciprefix.. */
} /* for(c=deck.. */ } /* for(c=deck.. */
/* Let's do a few cleanup things... Get rid of ( ) around node /* Let's do a few cleanup things... Get rid of ( ) around node

Loading…
Cancel
Save