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

This commit is contained in:
rlar 2010-11-06 17:22:06 +00:00
parent fbe0def68e
commit e3ea250a4d
3 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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);

View File

@ -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)