From a8aa5e2c41651df90e23e77ad7ddf15ca63cfd1f Mon Sep 17 00:00:00 2001 From: pnenzi Date: Wed, 31 Dec 2003 16:12:08 +0000 Subject: [PATCH] Code cleaned. Added compilation of TXLfindBr and TXLaccept but non included into device. --- src/spicelib/devices/txl/Makefile.am | 2 ++ src/spicelib/devices/txl/txlacct.c | 9 +++------ src/spicelib/devices/txl/txlask.c | 14 ++++---------- src/spicelib/devices/txl/txldefs.h | 3 ++- src/spicelib/devices/txl/txldel.c | 5 +---- src/spicelib/devices/txl/txldest.c | 3 +-- src/spicelib/devices/txl/txlext.h | 18 ++++++------------ src/spicelib/devices/txl/txlfbr.c | 9 +++------ src/spicelib/devices/txl/txlinit.c | 8 ++++---- src/spicelib/devices/txl/txlload.c | 8 +++----- src/spicelib/devices/txl/txlmask.c | 6 +----- src/spicelib/devices/txl/txlmdel.c | 5 +---- src/spicelib/devices/txl/txlmpar.c | 5 +---- src/spicelib/devices/txl/txlparam.c | 6 +----- src/spicelib/devices/txl/txlsetup.c | 10 +++------- 15 files changed, 36 insertions(+), 75 deletions(-) diff --git a/src/spicelib/devices/txl/Makefile.am b/src/spicelib/devices/txl/Makefile.am index 6070d74b4..ef89e32dc 100755 --- a/src/spicelib/devices/txl/Makefile.am +++ b/src/spicelib/devices/txl/Makefile.am @@ -4,8 +4,10 @@ noinst_LIBRARIES = libtxl.a libtxl_a_SOURCES = \ txl.c \ + txlacct.c \ txlask.c \ txldest.c \ + txlfbr.c \ txlload.c \ txlmdel.c \ txlparam.c \ diff --git a/src/spicelib/devices/txl/txlacct.c b/src/spicelib/devices/txl/txlacct.c index bde3e0327..fdc535725 100644 --- a/src/spicelib/devices/txl/txlacct.c +++ b/src/spicelib/devices/txl/txlacct.c @@ -6,7 +6,6 @@ Author: 1992 Charles Hough #include "ngspice.h" -#include #include "cktdefs.h" #include "txldefs.h" #include "sperror.h" @@ -14,14 +13,12 @@ Author: 1992 Charles Hough int -TXLaccept(ckt,inModel) - register CKTcircuit *ckt; - GENmodel *inModel; +TXLaccept(CKTcircuit *ckt, GENmodel *inModel) /* set up the breakpoint table. */ { - register TXLmodel *model = (TXLmodel *)inModel; - register TXLinstance *here; + TXLmodel *model = (TXLmodel *)inModel; + TXLinstance *here; int hint; double h, v, v1; NODE *nd; diff --git a/src/spicelib/devices/txl/txlask.c b/src/spicelib/devices/txl/txlask.c index 369776fcb..9b3efc0e5 100644 --- a/src/spicelib/devices/txl/txlask.c +++ b/src/spicelib/devices/txl/txlask.c @@ -6,7 +6,6 @@ Author: 1992 Charles Hough #include "ngspice.h" -#include #include "const.h" #include "txldefs.h" #include "ifsim.h" @@ -17,12 +16,7 @@ Author: 1992 Charles Hough /*ARGSUSED*/ int -TXLask(ckt,inst,which,value,select) - CKTcircuit *ckt; - GENinstance *inst; - int which; - IFvalue *value; - IFvalue *select; +TXLask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select) { TXLinstance *fast = (TXLinstance *)inst; switch(which) { @@ -32,9 +26,9 @@ TXLask(ckt,inst,which,value,select) case TXL_IN_NODE: value->iValue = fast->TXLposNode; return(OK); - case TXL_LENGTH: - value->rValue = fast->TXLlength; - return(OK); + case TXL_LENGTH: + value->rValue = fast->TXLlength; + return(OK); default: return(E_BADPARM); } diff --git a/src/spicelib/devices/txl/txldefs.h b/src/spicelib/devices/txl/txldefs.h index 06a2d4954..9a26f551a 100644 --- a/src/spicelib/devices/txl/txldefs.h +++ b/src/spicelib/devices/txl/txldefs.h @@ -28,6 +28,7 @@ typedef struct sTXLinstance { TXLine *txline2; /* pointer to SWEC txline type. temporary storage */ char *in_node_name; char *out_node_name; + int TXLbranch; /* unused */ double *TXLposPosptr; double *TXLposNegptr; @@ -47,7 +48,7 @@ typedef struct sTXLinstance { unsigned TXLibr1Given : 1; unsigned TXLibr2Given : 1; unsigned TXLdcGiven : 1; - unsigned TXLlengthgiven : 1; /* flag to indicate C was specified */ + unsigned TXLlengthgiven : 1; /* flag to indicate C was specified */ } TXLinstance ; diff --git a/src/spicelib/devices/txl/txldel.c b/src/spicelib/devices/txl/txldel.c index df4ba420e..b8770d1fe 100644 --- a/src/spicelib/devices/txl/txldel.c +++ b/src/spicelib/devices/txl/txldel.c @@ -12,10 +12,7 @@ Author: 1992 Charles Hough int -TXLdelete(inModel,name,inst) - GENmodel *inModel; - IFuid name; - GENinstance **inst; +TXLdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { TXLmodel *model = (TXLmodel *)inModel; TXLinstance **fast = (TXLinstance **)inst; diff --git a/src/spicelib/devices/txl/txldest.c b/src/spicelib/devices/txl/txldest.c index 0dc75791b..3963bdcba 100644 --- a/src/spicelib/devices/txl/txldest.c +++ b/src/spicelib/devices/txl/txldest.c @@ -11,8 +11,7 @@ Author: 1992 Charles Hough void -TXLdestroy(inModel) - GENmodel **inModel; +TXLdestroy(GENmodel **inModel) { TXLmodel **model = (TXLmodel **)inModel; TXLinstance *here; diff --git a/src/spicelib/devices/txl/txlext.h b/src/spicelib/devices/txl/txlext.h index 2ad036a7f..df28d17ca 100644 --- a/src/spicelib/devices/txl/txlext.h +++ b/src/spicelib/devices/txl/txlext.h @@ -1,19 +1,13 @@ -#ifdef __STDC__ -/* extern int TXLaccept(CKTcircuit*,GENmodel*); */ + +extern int TXLaccept(CKTcircuit*,GENmodel*); +extern int TXLask(CKTcircuit*, GENinstance*, int, IFvalue*, IFvalue*); extern int TXLdelete(GENmodel*,IFuid,GENinstance**); extern void TXLdestroy(GENmodel**); +extern int TXLfindBr(CKTcircuit*, GENmodel*, IFuid); extern int TXLload(GENmodel*,CKTcircuit*); +extern int TXLmodAsk(CKTcircuit*, GENmodel*, int, IFvalue*); + extern int TXLmDelete(GENmodel**,IFuid,GENmodel*); extern int TXLmParam(int,IFvalue*,GENmodel*); extern int TXLparam(int,IFvalue*,GENinstance*,IFvalue*); extern int TXLsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); -#else /* stdc */ -/* extern int TXLaccept(); */ -extern int TXLdelete(); -extern void TXLdestroy(); -extern int TXLload(); -extern int TXLmDelete(); -extern int TXLmParam(); -extern int TXLparam(); -extern int TXLsetup(); -#endif /* stdc */ diff --git a/src/spicelib/devices/txl/txlfbr.c b/src/spicelib/devices/txl/txlfbr.c index ca88e6a6e..46902abd7 100644 --- a/src/spicelib/devices/txl/txlfbr.c +++ b/src/spicelib/devices/txl/txlfbr.c @@ -13,13 +13,10 @@ Author: 1992 Charles Hough int -TXLfindBr(ckt,inModel,name) - register CKTcircuit *ckt; - GENmodel *inModel; - register IFuid name; +TXLfindBr(CKTcircuit *ckt, GENmodel *inModel, IFuid name) { - register TXLmodel *model = (TXLmodel *)inModel; - register TXLinstance *here; + TXLmodel *model = (TXLmodel *)inModel; + TXLinstance *here; int error; CKTnode *tmp; diff --git a/src/spicelib/devices/txl/txlinit.c b/src/spicelib/devices/txl/txlinit.c index 107a628a6..611626074 100644 --- a/src/spicelib/devices/txl/txlinit.c +++ b/src/spicelib/devices/txl/txlinit.c @@ -53,15 +53,15 @@ SPICEdev TXLinfo = { DEVpzSetup : NULL, DEVtemperature: NULL, DEVtrunc : NULL, - DEVfindBranch : NULL, /* TXLfindBranch, */ + DEVfindBranch : NULL, /* TXLfindBranch default: disabled */ DEVacLoad : TXLload, /* ac load */ - DEVaccept : NULL, + DEVaccept : NULL, /* TXLaccept default: disabled */ DEVdestroy : TXLdestroy, DEVmodDelete : TXLmDelete, DEVdelete : TXLdelete, DEVsetic : NULL, - DEVask : NULL, - DEVmodAsk : NULL, + DEVask : TXLask, + DEVmodAsk : TXLmodAsk, DEVpzLoad : NULL, DEVconvTest : NULL, DEVsenSetup : NULL, diff --git a/src/spicelib/devices/txl/txlload.c b/src/spicelib/devices/txl/txlload.c index 6077d56cd..3be53c048 100644 --- a/src/spicelib/devices/txl/txlload.c +++ b/src/spicelib/devices/txl/txlload.c @@ -26,12 +26,10 @@ static void copy_tx(); /*ARGSUSED*/ int -TXLload(inModel,ckt) - GENmodel *inModel; - CKTcircuit *ckt; +TXLload(GENmodel *inModel, CKTcircuit *ckt) { - register TXLmodel *model = (TXLmodel *)inModel; - register TXLinstance *here; + TXLmodel *model = (TXLmodel *)inModel; + TXLinstance *here; TXLine *tx, *tx2; int k, l; int time, time2; diff --git a/src/spicelib/devices/txl/txlmask.c b/src/spicelib/devices/txl/txlmask.c index e0783803a..427f64633 100644 --- a/src/spicelib/devices/txl/txlmask.c +++ b/src/spicelib/devices/txl/txlmask.c @@ -18,11 +18,7 @@ Author: 1992 Charles Hough /* ARGSUSED */ int -TXLmodAsk(ckt,inModel,which,value) - CKTcircuit *ckt; - GENmodel *inModel; - int which; - IFvalue *value; +TXLmodAsk(CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value) { TXLmodel *model = (TXLmodel *)inModel; switch(which) { diff --git a/src/spicelib/devices/txl/txlmdel.c b/src/spicelib/devices/txl/txlmdel.c index d509c76d2..cd77360da 100644 --- a/src/spicelib/devices/txl/txlmdel.c +++ b/src/spicelib/devices/txl/txlmdel.c @@ -12,10 +12,7 @@ Author: 1992 Charles Hough int -TXLmDelete(inModel,modname,kill) - GENmodel **inModel; - IFuid modname; - GENmodel *kill; +TXLmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) { TXLmodel **model = (TXLmodel **)inModel; TXLmodel *modfast = (TXLmodel *)kill; diff --git a/src/spicelib/devices/txl/txlmpar.c b/src/spicelib/devices/txl/txlmpar.c index da23aa279..feda49fac 100644 --- a/src/spicelib/devices/txl/txlmpar.c +++ b/src/spicelib/devices/txl/txlmpar.c @@ -14,10 +14,7 @@ Author: 1992 Charles Hough int -TXLmParam(param,value,inModel) - int param; - IFvalue *value; - GENmodel *inModel; +TXLmParam(int param, IFvalue *value, GENmodel *inModel) { register TXLmodel *model = (TXLmodel *)inModel; switch(param) { diff --git a/src/spicelib/devices/txl/txlparam.c b/src/spicelib/devices/txl/txlparam.c index 160af8156..de8869ee2 100644 --- a/src/spicelib/devices/txl/txlparam.c +++ b/src/spicelib/devices/txl/txlparam.c @@ -14,11 +14,7 @@ Author: 1992 Charles Hough /* ARGSUSED */ int -TXLparam(param,value,inst,select) - int param; - IFvalue *value; - GENinstance *inst; - IFvalue *select; +TXLparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select) { TXLinstance *here = (TXLinstance *)inst; switch(param) { diff --git a/src/spicelib/devices/txl/txlsetup.c b/src/spicelib/devices/txl/txlsetup.c index 18ba09afa..70b852d3a 100644 --- a/src/spicelib/devices/txl/txlsetup.c +++ b/src/spicelib/devices/txl/txlsetup.c @@ -75,14 +75,10 @@ static double AA[3][4]; /* ARGSUSED */ int -TXLsetup(matrix,inModel,ckt,state) - register SMPmatrix *matrix; - GENmodel *inModel; - CKTcircuit*ckt; - int *state; +TXLsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state) { - register TXLmodel *model = (TXLmodel *)inModel; - register TXLinstance *here; + TXLmodel *model = (TXLmodel *)inModel; + TXLinstance *here; CKTnode *tmp; int error;