From bd7e93de6c7e0cde8f7b8db753039c79fb322957 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 17 Jul 2013 20:29:22 +0200 Subject: [PATCH] CKTfndMod(), assert some facts --- src/frontend/spiceif.c | 4 ++++ src/spicelib/analysis/cktmcrt.c | 2 ++ src/spicelib/devices/urc/urcsetup.c | 4 ++++ src/tclspice.c | 2 ++ 4 files changed, 12 insertions(+) diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index ae584b1f1..2447b59ae 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -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); diff --git a/src/spicelib/analysis/cktmcrt.c b/src/spicelib/analysis/cktmcrt.c index 5384d21a7..badc9a532 100644 --- a/src/spicelib/analysis/cktmcrt.c +++ b/src/spicelib/analysis/cktmcrt.c @@ -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)); diff --git a/src/spicelib/devices/urc/urcsetup.c b/src/spicelib/devices/urc/urcsetup.c index 50135e6d9..07e6ac329 100644 --- a/src/spicelib/devices/urc/urcsetup.c +++ b/src/spicelib/devices/urc/urcsetup.c @@ -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; diff --git a/src/tclspice.c b/src/tclspice.c index 2f8f9c2af..513fb1fb1 100644 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -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;