Browse Source

CKTfndDev(), assert some facts

pre-master-46
rlar 13 years ago
parent
commit
6e7d70e4bb
  1. 2
      src/frontend/spiceif.c
  2. 2
      src/spicelib/analysis/noisean.c
  3. 2
      src/spicelib/analysis/tfanal.c
  4. 1
      src/spicelib/devices/cktcrte.c
  5. 2
      src/spicelib/devices/ind/mutsetup.c
  6. 1
      src/spicelib/parser/inpaname.c
  7. 1
      src/tclspice.c
  8. 1
      src/unsupported/snstart.c

2
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);

2
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 ??? */

2
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;

1
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) {

2
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];

1
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);

1
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;

1
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;

Loading…
Cancel
Save