CKTfndDev(), assert some facts

This commit is contained in:
rlar 2013-07-17 20:26:43 +02:00
parent d9fbb36ac7
commit 6e7d70e4bb
8 changed files with 12 additions and 0 deletions

View File

@ -614,6 +614,7 @@ finddev_special(
int err;
int type = -1;
// assert(third && *third == NULL); for all invocations
err = ft_sim->findInstance (ckt, &type, devptr, name);
if (err == OK) {
*device_or_model = 0;
@ -1215,6 +1216,7 @@ finddev(CKTcircuit *ckt, char *name, GENinstance **devptr, GENmodel **modptr)
int err;
int type = -1;
// assert(third && *third == NULL); for all invocations
err = ft_sim->findInstance (ckt, &type, devptr, name);
if (err == OK)
return (type);

View File

@ -48,6 +48,7 @@ NOISEan (CKTcircuit *ckt, int restart)
inst = NULL;
code = CKTtypelook("Vsource");
if (code != -1) {
// assert(third && *third == NULL);
error = CKTfndDev(ckt, NULL, &inst, job->input);
if (!error && !((VSRCinstance *)inst)->VSRCacGiven) {
errMsg = TMALLOC(char, strlen(noacinput) + 1);
@ -58,6 +59,7 @@ NOISEan (CKTcircuit *ckt, int restart)
code = CKTtypelook("Isource");
if (code != -1 && inst==NULL) {
// assert(third && *third == NULL);
error = CKTfndDev(ckt, NULL, &inst, job->input);
if (error) {
/* XXX ??? */

View File

@ -51,6 +51,7 @@ TFanal(CKTcircuit *ckt, int restart)
Itype = CKTtypelook("Isource");
Vtype = CKTtypelook("Vsource");
if(Itype != -1) {
// assert(third && *third == NULL);
error = CKTfndDev(ckt, NULL, &ptr, job->TFinSrc);
if(error ==0) {
job->TFinIsI = 1;
@ -61,6 +62,7 @@ TFanal(CKTcircuit *ckt, int restart)
}
if( (Vtype != -1) && (ptr==NULL) ) {
// assert(third && *third == NULL);
error = CKTfndDev(ckt, NULL, &ptr, job->TFinSrc);
job->TFinIsV = 1;
job->TFinIsI = 0;

View File

@ -29,6 +29,7 @@ CKTcrtElt(CKTcircuit *ckt, GENmodel *modPtr, GENinstance **inInstPtr, IFuid name
if(!modPtr)
return E_NOMOD;
// assert(third && *third == NULL);
error = CKTfndDev(ckt, NULL, &instPtr, name);
if (error == OK) {

View File

@ -43,6 +43,7 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
return(E_INTERN);
}
// assert(third);
error = CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind1), here->MUTindName1);
if(error) {
IFuid namarray[2];
@ -52,6 +53,7 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
"%s: coupling to non-existant inductor %s.",
namarray);
}
// assert(third);
error = CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind2), here->MUTindName2);
if(error) {
IFuid namarray[2];

View File

@ -40,6 +40,7 @@ INPaName(char *parm, IFvalue * val, CKTcircuit *ckt, int *dev, char *devnam,
* (name, type, direct pointer) - the type and direct pointer
* WILL be set on return unless error is not OK
*/
// assert(third) for all invocations
error = sim->findInstance (ckt, dev, fast, devnam);
if (error)
return (error);

View File

@ -1394,6 +1394,7 @@ get_mod_param TCL_CMDPROCARGS(clientData, interp, argc, argv)
/* get the unique IFuid for name (device/model) */
INPretrieve(&name, ft_curckt->ci_symtab);
// assert(third && *third == NULL);
err = ft_sim->findInstance (ft_curckt->ci_ckt, &typecode, &devptr, name);
if (err != OK) {
typecode = -1;

View File

@ -42,6 +42,7 @@ SENstartup(CKTcircuit *ckt, int restart)
type = -1;
fast = NULL;
// assert(third && *third == NULL);
err = CKTfndDev(ckt, &type, &fast, ckt->CKTsenInfo->SENdevices[i]);
if (err != OK)
return err;