Browse Source

tiny rewrite, don't invoke strlen() to check for strlen() == 1

pre-master-46
rlar 16 years ago
parent
commit
e3ea250a4d
  1. 5
      ChangeLog
  2. 4
      src/spicelib/parser/inp2dot.c
  3. 7
      src/spicelib/parser/inppas3.c

5
ChangeLog

@ -1,3 +1,8 @@
2010-11-06 Robert Larice
* src/spicelib/parser/inp2dot.c ,
* src/spicelib/parser/inppas3.c :
tiny rewrite, don't invoke strlen() to check for strlen() == 1
2010-11-06 Robert Larice
* src/xspice/idn/idndig.c :
change a (int) cast application, to avoid type conversion warnings

4
src/spicelib/parser/inp2dot.c

@ -52,10 +52,8 @@ dot_noise(char *line, CKTcircuit *ckt, INPtables *tab, card *current,
is, extract 'xxxx'. If not, report an error. */
if (name != NULL) {
int length;
length = strlen(name);
if (((*name == 'V') || (*name == 'v')) && (length == 1)) {
if ((*name == 'V' || *name == 'v') && !name[1]) {
INPgetNetTok(&line, &nname1, 0);
INPtermInsert(ckt, &nname1, tab, &node1);

7
src/spicelib/parser/inppas3.c

@ -36,7 +36,6 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
IFvalue ptemp; /* a value structure to package
resistance into */
int which; /* which analysis we are performing */
int length; /* length of a name */
CKTnode *node1; /* the first node's node pointer */
#ifdef TRACE
@ -70,8 +69,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
/* check to see if in the form V(xxx) and grab the xxx */
if( *name == 0) break; /* end of line */
length = strlen(name);
if( (*name == 'V' || *(name) == 'v') && (length == 1)){
if( (*name == 'V' || *name == 'v') && !name[1] ) {
/* looks like V - must be V(xx) - get xx now*/
INPgetTok(&line,&name,1);
if (INPtermInsert(ckt,&name,tab,&node1)!=E_EXISTS)
@ -104,8 +102,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
INPgetTok(&line,&name,1);
/* check to see if in the form V(xxx) and grab the xxx */
if( *name == 0) break; /* end of line */
length = strlen(name);
if( (*name == 'V' || *(name) == 'v') && (length == 1)){
if( (*name == 'V' || *name == 'v') && !name[1] ) {
/* looks like V - must be V(xx) - get xx now*/
INPgetTok(&line,&name,1);
if (INPtermInsert(ckt,&name,tab,&node1)!=E_EXISTS)

Loading…
Cancel
Save