inp2*.c, cleanup, drop redundant initialisation
which can be dropped to the recently fixed INPgetMod(), see
inpgmod.c, INPgetMod(), bug fix, missing 'model' assignment
Note:
there have been INPgetMod() invocations without initialisation,
causing access to non-initialised memory with the unfixed INPgetMod()
This commit is contained in:
parent
56b2342df3
commit
a2347a28d6
|
|
@ -65,7 +65,6 @@ void INP2C(CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
if (INPlookMod(model)) {
|
||||
/* If this is a valid model connect it */
|
||||
INPinsert(&model, tab);
|
||||
thismodel = NULL;
|
||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||
if (thismodel != NULL) {
|
||||
if (mytype != thismodel->INPmodType) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ void INP2J(CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
INPtermInsert(ckt, &nname3, tab, &node3);
|
||||
INPgetTok(&line, &model, 1);
|
||||
INPinsert(&model, tab);
|
||||
thismodel = NULL;
|
||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||
if (thismodel != NULL) {
|
||||
if (thismodel->INPmodType != INPtypelook("JFET")
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ void INP2L(CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
if (INPlookMod(model)) {
|
||||
/* If this is a valid model connect it */
|
||||
INPinsert(&model, tab);
|
||||
thismodel = NULL;
|
||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||
if (thismodel != NULL) {
|
||||
if (mytype != thismodel->INPmodType) {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
INPgetNetTok (&line, &nname5, 1); /* get 5th token */
|
||||
save = line; /* saj - save the posn for later if
|
||||
the default mosfet model is used */
|
||||
thismodel = NULL;
|
||||
#ifdef TRACE
|
||||
printf("INP2M: checking for 4 node device\n");
|
||||
#endif
|
||||
|
|
@ -93,7 +92,6 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
/* 5th token is not a model in the table */
|
||||
nodeflag = 1; /* now specify a 5 node device */
|
||||
INPgetNetTok (&line, &nname6, 1); /* get next token */
|
||||
thismodel = NULL;
|
||||
#ifdef TRACE
|
||||
printf("INP2M: checking for 5 node device\n");
|
||||
#endif
|
||||
|
|
@ -103,7 +101,6 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
/* 6th token is not a model in the table */
|
||||
nodeflag = 2; /* now specify a 6 node device */
|
||||
INPgetNetTok (&line, &nname7, 1); /* get next token */
|
||||
thismodel = NULL;
|
||||
#ifdef TRACE
|
||||
printf("INP2M: checking for 6 node device\n");
|
||||
#endif
|
||||
|
|
@ -192,7 +189,6 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
|
||||
|
||||
INPinsert (&model, tab);
|
||||
thismodel = NULL;
|
||||
#ifdef TRACE
|
||||
printf("INP2M: Looking up model\n");
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ void INP2N(CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
if (INPlookMod(model)) {
|
||||
/* If this is a valid model connect it */
|
||||
INPinsert(&model, tab);
|
||||
thismodel = NULL;
|
||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||
if (thismodel != NULL) {
|
||||
if (mytype != thismodel->INPmodType) {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ int num, i;
|
|||
INPgetTok(&line,&model,1);
|
||||
if(*model) { /* token isn't null */
|
||||
INPinsert(&model,tab);
|
||||
thismodel = NULL;
|
||||
current->error = INPgetMod(ckt,model,&thismodel,tab);
|
||||
if(thismodel != NULL) {
|
||||
if(mytype != thismodel->INPmodType) {
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@ void INP2R(CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
printf("In INP2R, Valid R Model: %s\n", model);
|
||||
#endif
|
||||
INPinsert(&model, tab);
|
||||
thismodel = NULL;
|
||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||
if (thismodel != NULL) {
|
||||
if (mytype != thismodel->INPmodType) {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ int lenvalgiven = 0;
|
|||
INPgetTok(&line,&model,1);
|
||||
if(*model) { /* token isn't null */
|
||||
INPinsert(&model,tab);
|
||||
thismodel = NULL;
|
||||
current->error = INPgetMod(ckt,model,&thismodel,tab);
|
||||
INPgetTok(&line,&model,1);
|
||||
if (strcmp(model, "len") == 0) {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ void INP2Z(CKTcircuit *ckt, INPtables * tab, card * current)
|
|||
INPtermInsert(ckt, &nname3, tab, &node3);
|
||||
INPgetTok(&line, &model, 1);
|
||||
INPinsert(&model, tab);
|
||||
thismodel = NULL;
|
||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||
if (thismodel != NULL) {
|
||||
if ( thismodel->INPmodType != INPtypelook("MES")
|
||||
|
|
|
|||
Loading…
Reference in New Issue