From 4140af6d2924332652c97ab57a4217b49ed6b06d Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 3 Feb 2018 17:38:23 +0100 Subject: [PATCH] parser/inpdpar.c, #2/6, cleanup, use a 'switch' --- src/spicelib/parser/inpdpar.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/spicelib/parser/inpdpar.c b/src/spicelib/parser/inpdpar.c index f2bb851e6..ebbb9e477 100644 --- a/src/spicelib/parser/inpdpar.c +++ b/src/spicelib/parser/inpdpar.c @@ -67,8 +67,6 @@ INPdevParse(char **line, CKTcircuit *ckt, int dev, GENinstance *fast, goto quit; } - int type; - val = INPgetValue(ckt, line, ft_sim->devices[dev]->instanceParms[i].dataType, tab); @@ -85,12 +83,16 @@ INPdevParse(char **line, CKTcircuit *ckt, int dev, GENinstance *fast, } /* delete the union val */ - type = ft_sim->devices[dev]->instanceParms[i].dataType; - type &= IF_VARTYPES; - if (type == IF_REALVEC) + switch (ft_sim->devices[dev]->instanceParms[i].dataType & IF_VARTYPES) { + case IF_REALVEC: tfree(val->v.vec.rVec); - else if (type == IF_INTVEC) + break; + case IF_INTVEC: tfree(val->v.vec.iVec); + break; + default: + break; + } FREE(parm); }