From 6e7d70e4bbf6aeba77cc189af4d880fc57c09567 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 17 Jul 2013 20:26:43 +0200 Subject: [PATCH] CKTfndDev(), assert some facts --- src/frontend/spiceif.c | 2 ++ src/spicelib/analysis/noisean.c | 2 ++ src/spicelib/analysis/tfanal.c | 2 ++ src/spicelib/devices/cktcrte.c | 1 + src/spicelib/devices/ind/mutsetup.c | 2 ++ src/spicelib/parser/inpaname.c | 1 + src/tclspice.c | 1 + src/unsupported/snstart.c | 1 + 8 files changed, 12 insertions(+) diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 0046eae65..1077a3f72 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -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); diff --git a/src/spicelib/analysis/noisean.c b/src/spicelib/analysis/noisean.c index eb738892b..3e274765e 100644 --- a/src/spicelib/analysis/noisean.c +++ b/src/spicelib/analysis/noisean.c @@ -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 ??? */ diff --git a/src/spicelib/analysis/tfanal.c b/src/spicelib/analysis/tfanal.c index 21dba5d2d..5fe9d3f5e 100644 --- a/src/spicelib/analysis/tfanal.c +++ b/src/spicelib/analysis/tfanal.c @@ -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; diff --git a/src/spicelib/devices/cktcrte.c b/src/spicelib/devices/cktcrte.c index 9c3843c62..a113a5763 100644 --- a/src/spicelib/devices/cktcrte.c +++ b/src/spicelib/devices/cktcrte.c @@ -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) { diff --git a/src/spicelib/devices/ind/mutsetup.c b/src/spicelib/devices/ind/mutsetup.c index 142de763d..f43654fca 100644 --- a/src/spicelib/devices/ind/mutsetup.c +++ b/src/spicelib/devices/ind/mutsetup.c @@ -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]; diff --git a/src/spicelib/parser/inpaname.c b/src/spicelib/parser/inpaname.c index c0ffd83e4..4878a9536 100644 --- a/src/spicelib/parser/inpaname.c +++ b/src/spicelib/parser/inpaname.c @@ -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); diff --git a/src/tclspice.c b/src/tclspice.c index add166b63..f03d3f287 100644 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -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; diff --git a/src/unsupported/snstart.c b/src/unsupported/snstart.c index 28524e679..389457415 100644 --- a/src/unsupported/snstart.c +++ b/src/unsupported/snstart.c @@ -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;