|
|
|
@ -18,19 +18,13 @@ CKTfndMod(CKTcircuit *ckt, int *type, GENmodel **modfast, IFuid modname) |
|
|
|
{ |
|
|
|
GENmodel *mods; |
|
|
|
|
|
|
|
if(modfast != NULL && *modfast != NULL) { |
|
|
|
/* already have modfast, so nothing to do */ |
|
|
|
if(type) *type = (*modfast)->GENmodType; |
|
|
|
return *modfast; |
|
|
|
} |
|
|
|
if(*type >=0 && *type < DEVmaxnum) { |
|
|
|
/* have device type, need to find model */ |
|
|
|
/* look through all models */ |
|
|
|
for(mods=ckt->CKThead[*type]; mods != NULL ; |
|
|
|
mods = mods->GENnextModel) { |
|
|
|
if(mods->GENmodName == modname) { |
|
|
|
*modfast = mods; |
|
|
|
return *modfast; |
|
|
|
return mods; |
|
|
|
} |
|
|
|
} |
|
|
|
return NULL; |
|
|
|
@ -42,8 +36,7 @@ CKTfndMod(CKTcircuit *ckt, int *type, GENmodel **modfast, IFuid modname) |
|
|
|
for(mods=ckt->CKThead[*type];mods!=NULL; |
|
|
|
mods = mods->GENnextModel) { |
|
|
|
if(mods->GENmodName == modname) { |
|
|
|
*modfast = mods; |
|
|
|
return *modfast; |
|
|
|
return mods; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|