CKTfndMod(), assert some facts
This commit is contained in:
parent
e79135c556
commit
bd7e93de6c
|
|
@ -622,6 +622,8 @@ finddev_special(
|
|||
|
||||
type = -1;
|
||||
|
||||
// assert(second && *second == -1)
|
||||
// assert(third && *third == NULL)
|
||||
err = ft_sim->findModel (ckt, &type, modptr, name);
|
||||
if (err == OK) {
|
||||
*device_or_model = 1;
|
||||
|
|
@ -1220,6 +1222,8 @@ finddev(CKTcircuit *ckt, char *name, GENinstance **devptr, GENmodel **modptr)
|
|||
|
||||
type = -1;
|
||||
|
||||
// assert(second && *second == -1)
|
||||
// assert(third && *third == NULL)
|
||||
err = ft_sim->findModel (ckt, &type, modptr, name);
|
||||
if (err == OK)
|
||||
return (type);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ CKTmodCrt(CKTcircuit *ckt, int type, GENmodel **modfast, IFuid name)
|
|||
GENmodel *mymodfast = NULL;
|
||||
int error;
|
||||
|
||||
// assert(second)
|
||||
// assert(third && *third == NULL)
|
||||
error = CKTfndMod(ckt, &type, &mymodfast, name);
|
||||
if(error == E_NOMOD) {
|
||||
mymodfast = (GENmodel *) tmalloc((size_t) *(DEVices[type]->DEVmodSize));
|
||||
|
|
|
|||
|
|
@ -308,6 +308,8 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt)
|
|||
|
||||
modfast = NULL;
|
||||
type = -1;
|
||||
// assert(second && *second == -1)
|
||||
// assert(third && *third == NULL)
|
||||
error = CKTfndMod(ckt, &type, &modfast, varUid);
|
||||
if (error)
|
||||
return error;
|
||||
|
|
@ -325,6 +327,8 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt)
|
|||
|
||||
modfast = NULL;
|
||||
type = -1;
|
||||
// assert(second && *second == -1)
|
||||
// assert(third && *third == NULL)
|
||||
error = CKTfndMod(ckt, &type, &modfast, varUid);
|
||||
if (error)
|
||||
return error;
|
||||
|
|
|
|||
|
|
@ -1397,6 +1397,8 @@ get_mod_param TCL_CMDPROCARGS(clientData, interp, argc, argv)
|
|||
devptr = ft_sim->findInstance (ft_curckt->ci_ckt, name);
|
||||
if (!devptr) {
|
||||
typecode = -1;
|
||||
// assert(second && *second == -1)
|
||||
// assert(third && *third == NULL)
|
||||
err = ft_sim->findModel (ft_curckt->ci_ckt, &typecode, &modptr, name);
|
||||
} else {
|
||||
typecode = devptr->GENmodPtr->GENmodType;
|
||||
|
|
|
|||
Loading…
Reference in New Issue