diff --git a/ChangeLog b/ChangeLog index 1d0ec402f..36bd58aeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2010-07-24 Robert Larice + * src/include/inpdefs.h , + * src/spicelib/devices/ndev/ndevacld.c , + * src/spicelib/devices/ndev/ndevask.c , + * src/spicelib/devices/ndev/ndevdel.c , + * src/spicelib/devices/ndev/ndevdump.c , + * src/spicelib/devices/ndev/ndevmdel.c , + * src/spicelib/devices/ndev/ndevparm.c , + * src/spicelib/devices/ndev/ndevpzld.c , + * src/spicelib/devices/ndev/ndevset.c , + * src/spicelib/devices/ndev/ndevtemp.c , + * src/spicelib/devices/ndev/ndevtrun.c , + * src/spicelib/parser/inp2n.c : + convert K&R function definitions to ansi style + use the GENmodel and GENinstance type instead of void* + 2010-07-24 Robert Larice fix dangerous things, potential bugs, at least for big endian machines * src/frontend/inp.c , @@ -6,7 +22,7 @@ should fail on a big endian machine * src/frontend/spiceif.c , the value of an union, made of a bool (unsigned char), an int, etc, - is silently cast into an int. + is silently cast into an int. This can introduce stack noise, in the CP_BOOL case * src/frontend/variable.c : a `variable' is created with type CP_NUM, diff --git a/src/include/inpdefs.h b/src/include/inpdefs.h index ee78f139d..ba02bcd77 100644 --- a/src/include/inpdefs.h +++ b/src/include/inpdefs.h @@ -132,6 +132,7 @@ void INP2J(CKTcircuit *, INPtables *, card *); void INP2K(CKTcircuit *, INPtables *, card *); void INP2L(CKTcircuit *, INPtables *, card *); void INP2M(CKTcircuit *, INPtables *, card *); +void INP2N(CKTcircuit *, INPtables *, card *); void INP2O(CKTcircuit *, INPtables *, card *); void INP2P(CKTcircuit *, INPtables *, card *); void INP2Q(CKTcircuit *, INPtables *, card *, void *); diff --git a/src/spicelib/devices/ndev/ndevacld.c b/src/spicelib/devices/ndev/ndevacld.c index e33f0a878..2f973b3ee 100644 --- a/src/spicelib/devices/ndev/ndevacld.c +++ b/src/spicelib/devices/ndev/ndevacld.c @@ -17,9 +17,7 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NDEVacLoad(inModel, ckt) - GENmodel *inModel; - CKTcircuit *ckt; +NDEVacLoad(GENmodel *inModel, CKTcircuit *ckt) { return (OK); diff --git a/src/spicelib/devices/ndev/ndevask.c b/src/spicelib/devices/ndev/ndevask.c index cc3e6618e..6bb94dd6e 100644 --- a/src/spicelib/devices/ndev/ndevask.c +++ b/src/spicelib/devices/ndev/ndevask.c @@ -16,12 +16,12 @@ Author: 1987 Thomas L. Quarles /* ARGSUSED */ int -NDEVask(ckt, inInst, which, value, select) - CKTcircuit *ckt; - GENinstance *inInst; - int which; - IFvalue *value; - IFvalue *select; +NDEVask( + CKTcircuit *ckt, + GENinstance *inInst, + int which, + IFvalue *value, + IFvalue *select ) { return (OK); /* NOTREACHED */ diff --git a/src/spicelib/devices/ndev/ndevdel.c b/src/spicelib/devices/ndev/ndevdel.c index eea8d953e..fbf88384b 100644 --- a/src/spicelib/devices/ndev/ndevdel.c +++ b/src/spicelib/devices/ndev/ndevdel.c @@ -10,10 +10,10 @@ University of Science and Technology of China #include "suffix.h" int -NDEVdelete(inModel, name, kill) - GENmodel *inModel; - IFuid name; - GENinstance **kill; +NDEVdelete( + GENmodel *inModel, + IFuid name, + GENinstance **kill ) { NDEVmodel *model = (NDEVmodel *)inModel; diff --git a/src/spicelib/devices/ndev/ndevdump.c b/src/spicelib/devices/ndev/ndevdump.c index 6bbd3da1f..d2e099593 100644 --- a/src/spicelib/devices/ndev/ndevdump.c +++ b/src/spicelib/devices/ndev/ndevdump.c @@ -21,9 +21,9 @@ static int state_numDC = 0; static int state_numTR = 0; void -NDEV_dump(inModel, ckt) - GENmodel *inModel; - CKTcircuit *ckt; +NDEV_dump( + GENmodel *inModel, + CKTcircuit *ckt ) { } @@ -31,10 +31,10 @@ NDEV_dump(inModel, ckt) void -NDEV_acct(inModel, ckt, file) - GENmodel *inModel; - CKTcircuit *ckt; - FILE *file; +NDEV_acct( + GENmodel *inModel, + CKTcircuit *ckt, + FILE *file ) { } diff --git a/src/spicelib/devices/ndev/ndevmdel.c b/src/spicelib/devices/ndev/ndevmdel.c index c6095b6a6..08648cb56 100644 --- a/src/spicelib/devices/ndev/ndevmdel.c +++ b/src/spicelib/devices/ndev/ndevmdel.c @@ -9,10 +9,10 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group #include "suffix.h" int -NDEVmDelete(inModel, modname, kill) - GENmodel **inModel; - IFuid modname; - GENmodel *kill; +NDEVmDelete( + GENmodel **inModel, + IFuid modname, + GENmodel *kill ) { diff --git a/src/spicelib/devices/ndev/ndevparm.c b/src/spicelib/devices/ndev/ndevparm.c index e68ae3117..c613f3fa5 100644 --- a/src/spicelib/devices/ndev/ndevparm.c +++ b/src/spicelib/devices/ndev/ndevparm.c @@ -11,11 +11,11 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group #include "suffix.h" int -NDEVparam(param, value, inInst, select) - int param; - IFvalue *value; - GENinstance *inInst; - IFvalue *select; +NDEVparam( + int param, + IFvalue *value, + GENinstance *inInst, + IFvalue *select ) { NDEVinstance *inst = (NDEVinstance *) inInst; switch (param) { diff --git a/src/spicelib/devices/ndev/ndevpzld.c b/src/spicelib/devices/ndev/ndevpzld.c index f4d3362d0..ffc115ea4 100644 --- a/src/spicelib/devices/ndev/ndevpzld.c +++ b/src/spicelib/devices/ndev/ndevpzld.c @@ -12,10 +12,10 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NDEVpzLoad(inModel, ckt, s) - GENmodel *inModel; - register CKTcircuit *ckt; - SPcomplex *s; +NDEVpzLoad( + GENmodel *inModel, + register CKTcircuit *ckt, + SPcomplex *s ) { return (OK); diff --git a/src/spicelib/devices/ndev/ndevset.c b/src/spicelib/devices/ndev/ndevset.c index c3502cd03..d847a93b2 100644 --- a/src/spicelib/devices/ndev/ndevset.c +++ b/src/spicelib/devices/ndev/ndevset.c @@ -19,7 +19,7 @@ if (size && (!(var =(type *)calloc(1, (unsigned)(size)*sizeof(type))))) {\ return(E_NOMEM);\ } -int NDEVmodelConnect(GENmodel *inModel); +int NDEVmodelConnect(NDEVmodel *inModel); int NDEVsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) @@ -73,9 +73,9 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\ } -int NDEVmodelConnect(GENmodel *inModel) +int NDEVmodelConnect(NDEVmodel *inModel) { - NDEVmodel *model = (NDEVmodel *)inModel; + NDEVmodel *model = inModel; struct hostent *hostlist; /* List of hosts returned by gethostbyname. */ char dotted_ip[15]; /* Buffer for converting the resolved address to diff --git a/src/spicelib/devices/ndev/ndevtemp.c b/src/spicelib/devices/ndev/ndevtemp.c index 9a9eb7bc5..abb7ac724 100644 --- a/src/spicelib/devices/ndev/ndevtemp.c +++ b/src/spicelib/devices/ndev/ndevtemp.c @@ -15,9 +15,9 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group #define NIL(type) ((type *)0) int -NDEVtemp(inModel, ckt) - GENmodel *inModel; - register CKTcircuit *ckt; +NDEVtemp( + GENmodel *inModel, + register CKTcircuit *ckt ) /* * perform the temperature update to the diode */ diff --git a/src/spicelib/devices/ndev/ndevtrun.c b/src/spicelib/devices/ndev/ndevtrun.c index 2bb861bcb..162f272b4 100644 --- a/src/spicelib/devices/ndev/ndevtrun.c +++ b/src/spicelib/devices/ndev/ndevtrun.c @@ -12,10 +12,10 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NDEVtrunc(inModel, ckt, timeStep) - GENmodel *inModel; - register CKTcircuit *ckt; - double *timeStep; +NDEVtrunc( + GENmodel *inModel, + register CKTcircuit *ckt, + double *timeStep ) { diff --git a/src/spicelib/parser/inp2n.c b/src/spicelib/parser/inp2n.c index 7fa1d6ee6..45534775c 100644 --- a/src/spicelib/parser/inp2n.c +++ b/src/spicelib/parser/inp2n.c @@ -40,7 +40,7 @@ void INP2N(CKTcircuit *ckt, INPtables * tab, card * current) int error1; /* secondary error code temporary */ int i; INPmodel *thismodel; /* pointer to model structure describing our model */ - void *mdfast = NULL; /* pointer to the actual model */ + GENmodel *mdfast = NULL; /* pointer to the actual model */ GENinstance *fast; /* pointer to the actual instance */ NDEVinstance *pinst; IFvalue ptemp; /* a value structure to package resistance into */