CKTfndDev(), #1/6, whitespace

This commit is contained in:
rlar 2013-06-30 12:47:24 +02:00
parent 025c1e751e
commit 8a69f5c1c8
1 changed files with 64 additions and 64 deletions

View File

@ -27,7 +27,7 @@ CKTfndDev(CKTcircuit *ckt, int *type, GENinstance **fast, IFuid name, GENmodel *
GENinstance *here; GENinstance *here;
GENmodel *mods; GENmodel *mods;
if(fast != NULL && if (fast != NULL &&
*fast != NULL) *fast != NULL)
{ {
/* already have fast, so nothing much to do just get & set type */ /* already have fast, so nothing much to do just get & set type */
@ -36,7 +36,7 @@ CKTfndDev(CKTcircuit *ckt, int *type, GENinstance **fast, IFuid name, GENmodel *
return(OK); return(OK);
} }
if(modfast) { if (modfast) {
/* have model, just need device */ /* have model, just need device */
mods = modfast; mods = modfast;
here = find_instance(mods->GENinstances, name); here = find_instance(mods->GENinstances, name);
@ -67,7 +67,7 @@ CKTfndDev(CKTcircuit *ckt, int *type, GENinstance **fast, IFuid name, GENmodel *
*fast = here; *fast = here;
return OK; return OK;
} }
if(mods->GENmodName == modname) { if (mods->GENmodName == modname) {
return E_NODEV; return E_NODEV;
} }
} }
@ -75,21 +75,21 @@ CKTfndDev(CKTcircuit *ckt, int *type, GENinstance **fast, IFuid name, GENmodel *
return E_NOMOD; return E_NOMOD;
} else if (*type == -1) { } else if (*type == -1) {
/* look through all types (UGH - worst case - take forever) */ /* look through all types (UGH - worst case - take forever) */
for(*type = 0; *type < DEVmaxnum; (*type)++) { for (*type = 0; *type < DEVmaxnum; (*type)++) {
/* need to find model & device */ /* need to find model & device */
/* look through all models */ /* look through all models */
for(mods = ckt->CKThead[*type]; mods != NULL; for (mods = ckt->CKThead[*type]; mods != NULL;
mods = mods->GENnextModel) mods = mods->GENnextModel)
{ {
/* and all instances */ /* and all instances */
if(modname == NULL || mods->GENmodName == modname) { if (modname == NULL || mods->GENmodName == modname) {
here = find_instance(mods->GENinstances, name); here = find_instance(mods->GENinstances, name);
if (here) { if (here) {
if(fast != 0) if (fast != 0)
*fast = here; *fast = here;
return OK; return OK;
} }
if(mods->GENmodName == modname) { if (mods->GENmodName == modname) {
return E_NODEV; return E_NODEV;
} }
} }