analysis/cktpname.c, cleanup, mostly whitespace

This commit is contained in:
rlar 2018-01-01 15:09:44 +01:00
parent ba6eff6e13
commit c3a26e3cd2
1 changed files with 23 additions and 27 deletions

View File

@ -2,14 +2,12 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
/* /*
* CKTpName() * CKTpName()
* *
* Take a parameter by Name and set it on the specified device * Take a parameter by Name and set it on the specified device
*/ */
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "ngspice/ifsim.h" #include "ngspice/ifsim.h"
@ -19,33 +17,31 @@ Author: 1985 Thomas L. Quarles
#include "ngspice/sperror.h" #include "ngspice/sperror.h"
/* ARGSUSED */ /* the name of the parameter to set */
/* the parameter union containing the value to set */
/* the circuit this device is a member of */
/* the device type code to the device being parsed */
/* the name of the device being parsed */
/* direct pointer to device being parsed */
int int
CKTpName(char *parm, IFvalue *val, CKTcircuit *ckt, int dev, char *name, GENinstance **fast) CKTpName(char *parm, IFvalue *val, CKTcircuit *ckt, int dev, char *name, GENinstance **fast)
/* the name of the parameter to set */
/* the parameter union containing the value to set */
/* the circuit this device is a member of */
/* the device type code to the device being parsed */
/* the name of the device being parsed */
/* direct pointer to device being parsed */
{ {
int error; /* int to store evaluate error return codes in */
int i; int i;
NG_IGNORE(name); NG_IGNORE(name);
for(i = 0 ; i < *(DEVices[dev]->DEVpublic.numInstanceParms) ; i++) { for (i = 0; i < *(DEVices[dev]->DEVpublic.numInstanceParms); i++)
if(!strcmp(parm, DEVices[dev]->DEVpublic.instanceParms[i].keyword)) { if (!strcmp(parm, DEVices[dev]->DEVpublic.instanceParms[i].keyword)) {
error = CKTparam(ckt, *fast, int error = CKTparam(ckt, *fast,
DEVices[dev]->DEVpublic.instanceParms[i].id, val, DEVices[dev]->DEVpublic.instanceParms[i].id, val, NULL);
NULL); if (error)
if(error) return(error); return error;
break; break;
} }
}
if(i == *(DEVices[dev]->DEVpublic.numInstanceParms)) { if (i == *(DEVices[dev]->DEVpublic.numInstanceParms))
return(E_BADPARM); return E_BADPARM;
}
return(OK); return OK;
} }