bugfix no. 2859013, comments

This commit is contained in:
h_vogt
2009-09-20 20:28:12 +00:00
parent 881908ec47
commit 2eba12d518
4 changed files with 128 additions and 137 deletions
+23 -23
View File
@@ -10,7 +10,7 @@ Author: 1985 Thomas L. Quarles
#include "inp.h"
/* global input model table. */
INPmodel *modtab;
INPmodel *modtab = NULL;
/*--------------------------------------------------------------
* This fcn takes the model name and looks to see if it is already
@@ -21,35 +21,35 @@ INPmodel *modtab;
int INPmakeMod(char *token, int type, card * line)
{
register INPmodel **i;
register INPmodel **i;
/* First cycle through model table and see if model name
already exists in there. If it does, just return. */
for (i = &modtab; *i != (INPmodel *) NULL; i = &((*i)->INPnextModel)) {
if (strcmp((*i)->INPmodName, token) == 0) {
return (OK);
}
}
/* First cycle through model table and see if model name
already exists in there. If it does, just return. */
for (i = &modtab; *i != (INPmodel *) NULL; i = &((*i)->INPnextModel)) {
if (strcmp((*i)->INPmodName, token) == 0) {
return (OK);
}
}
/* Model name was not already in model table. Therefore stick
it in the model table. Then reutrn. */
/* Model name was not already in model table. Therefore stick
it in the model table. Then return. */
#ifdef TRACE
/* debug statement */
printf("In INPmakeMod, about to insert new model name = %s . . .\n", token);
/* debug statement */
printf("In INPmakeMod, about to insert new model name = %s . . .\n", token);
#endif
*i = (INPmodel *) MALLOC(sizeof(INPmodel));
if (*i == NULL)
return (E_NOMEM);
*i = (INPmodel *) MALLOC(sizeof(INPmodel));
if (*i == NULL)
return (E_NOMEM);
(*i)->INPmodName = token; /* model name */
(*i)->INPmodType = type; /* model type */
(*i)->INPnextModel = (INPmodel *) NULL; /* pointer to next model (end of list) */
(*i)->INPmodUsed = 0; /* model is unused */
(*i)->INPmodLine = line; /* model line */
(*i)->INPmodfast = NULL;
return (OK);
(*i)->INPmodName = token; /* model name */
(*i)->INPmodType = type; /* model type */
(*i)->INPnextModel = (INPmodel *) NULL; /* pointer to next model (end of list) */
(*i)->INPmodUsed = 0; /* model is unused */
(*i)->INPmodLine = line; /* model line */
(*i)->INPmodfast = NULL;
return (OK);
}
+11 -17
View File
@@ -45,18 +45,14 @@ NON-STANDARD FEATURES
============================================================================*/
/* #include "prefix.h" */
#include "ngspice.h"
#include <stdio.h>
#include "inpdefs.h" /* maschmann : kleinbuchstaben */
#include "devdefs.h" /* maschmann : kleinbuchstaben */
//#include "util.h"
#include "ifsim.h" /* maschmann : kleinbuchstaben */
#include "cpstd.h" /* maschmann : kleinbuchstaben */
#include "fteext.h" /* maschmann : kleinbuchstaben */
#include "inpdefs.h"
#include "devdefs.h"
#include "ifsim.h"
#include "cpstd.h"
#include "fteext.h"
#include "mifproto.h"
#include "mifdefs.h"
@@ -64,8 +60,8 @@ NON-STANDARD FEATURES
#include "suffix.h"
/* This is the table of all models known to the program. */
/* It is now defined in inpdefs.h 6.19.2003 -- SDB. */
/* This is the table of all models known to the program.
It is now defined in inpmkmod.c. */
extern INPmodel *modtab;
extern SPICEdev **DEVices; /* info about all device types */
@@ -86,13 +82,11 @@ defaulted later by MIFsetup(). The function returns NULL when
successful, and an error string on failure.
*/
/* char *MIFgetMod(ckt,name,model,tab) */ /* former buggy calling method */
char *MIFgetMod(
void *ckt, /* The circuit structure */
char *name, /* The name of the model to look for */
INPmodel **model, /* The model found/created */
INPtables *tab /* Table of model info from first pass */
void *ckt, /* The circuit structure */
char *name, /* The name of the model to look for */
INPmodel **model, /* The model found/created */
INPtables *tab /* Table of model info from first pass */
)
{
INPmodel *modtmp;