From 668123ae44da341438417e8908b41d3709669454 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 3 Feb 2018 13:07:29 +0100 Subject: [PATCH] analysis/cktpname.c, #4/4, cleanup --- src/spicelib/analysis/cktpname.c | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/src/spicelib/analysis/cktpname.c b/src/spicelib/analysis/cktpname.c index 6da37e2b7..d419e453e 100644 --- a/src/spicelib/analysis/cktpname.c +++ b/src/spicelib/analysis/cktpname.c @@ -2,15 +2,13 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ + /* + * CKTpName() + * + * Take a parameter by Name and set it on the specified device */ - /* - * CKTpName() - * - * Take a parameter by Name and set it on the specified device - */ - #include "ngspice/ngspice.h" #include "ngspice/ifsim.h" #include "ngspice/devdefs.h" @@ -19,32 +17,19 @@ Author: 1985 Thomas L. Quarles #include "ngspice/sperror.h" -/* ARGSUSED */ int 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 */ - { IFdevice *device = &(DEVices[dev]->DEVpublic); - int error; /* int to store evaluate error return codes in */ IFparm *p = device->instanceParms; IFparm *p_end = p + *(device->numInstanceParms); NG_IGNORE(name); - for(; p < p_end ; p++) { - if(!strcmp(parm, p->keyword)) { - error = CKTparam(ckt, *fast, - p->id, val, - NULL); - return error; - } - } + for (; p < p_end; p++) + if (!strcmp(parm, p->keyword)) + return CKTparam(ckt, *fast, p->id, val, NULL); + return E_BADPARM; }