Browse Source

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()
pre-master-46
rlar 9 years ago
parent
commit
a2347a28d6
  1. 1
      src/spicelib/parser/inp2c.c
  2. 1
      src/spicelib/parser/inp2j.c
  3. 1
      src/spicelib/parser/inp2l.c
  4. 4
      src/spicelib/parser/inp2m.c
  5. 1
      src/spicelib/parser/inp2n.c
  6. 1
      src/spicelib/parser/inp2p.c
  7. 1
      src/spicelib/parser/inp2r.c
  8. 1
      src/spicelib/parser/inp2y.c
  9. 1
      src/spicelib/parser/inp2z.c

1
src/spicelib/parser/inp2c.c

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

1
src/spicelib/parser/inp2j.c

@ -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")

1
src/spicelib/parser/inp2l.c

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

4
src/spicelib/parser/inp2m.c

@ -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

1
src/spicelib/parser/inp2n.c

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

1
src/spicelib/parser/inp2p.c

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

1
src/spicelib/parser/inp2r.c

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

1
src/spicelib/parser/inp2y.c

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

1
src/spicelib/parser/inp2z.c

@ -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…
Cancel
Save