parser/inpdpar.c, cleanup, use a 'switch'
This commit is contained in:
parent
81f7b6f40d
commit
00e7af3c61
|
|
@ -67,8 +67,6 @@ INPdevParse(char **line, CKTcircuit *ckt, int dev, GENinstance *fast,
|
||||||
goto quit;
|
goto quit;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
int type;
|
|
||||||
|
|
||||||
val = INPgetValue(ckt, line,
|
val = INPgetValue(ckt, line,
|
||||||
ft_sim->devices[dev]->instanceParms[i].dataType,
|
ft_sim->devices[dev]->instanceParms[i].dataType,
|
||||||
tab);
|
tab);
|
||||||
|
|
@ -85,12 +83,16 @@ INPdevParse(char **line, CKTcircuit *ckt, int dev, GENinstance *fast,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete the union val */
|
/* delete the union val */
|
||||||
type = ft_sim->devices[dev]->instanceParms[i].dataType;
|
switch (ft_sim->devices[dev]->instanceParms[i].dataType & IF_VARTYPES) {
|
||||||
type &= IF_VARTYPES;
|
case IF_REALVEC:
|
||||||
if (type == IF_REALVEC)
|
|
||||||
tfree(val->v.vec.rVec);
|
tfree(val->v.vec.rVec);
|
||||||
else if (type == IF_INTVEC)
|
break;
|
||||||
|
case IF_INTVEC:
|
||||||
tfree(val->v.vec.iVec);
|
tfree(val->v.vec.iVec);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
FREE(parm);
|
FREE(parm);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue