From f70fd8ea1bc46220fb1510e98b9d52e41138796b Mon Sep 17 00:00:00 2001 From: rlar Date: Tue, 7 Feb 2012 17:43:07 +0000 Subject: [PATCH] use type `runDesc' --- ChangeLog | 16 ++++++++++++++++ src/frontend/outitf.c | 28 ++++++++++++++-------------- src/frontend/outitf.h | 18 +++++++++--------- src/include/ngspice/ifsim.h | 20 ++++++++++---------- src/include/ngspice/noisedef.h | 2 +- src/include/ngspice/trandefs.h | 2 +- src/main.c | 16 ++++++++-------- src/spicelib/analysis/acan.c | 4 ++-- src/spicelib/analysis/cktsens.c | 2 +- src/spicelib/analysis/dcop.c | 2 +- src/spicelib/analysis/dctrcurv.c | 2 +- src/spicelib/analysis/distoan.c | 2 +- src/spicelib/analysis/pzan.c | 4 ++-- src/spicelib/analysis/tfanal.c | 2 +- 14 files changed, 68 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39156115f..dbe66f79d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2012-02-07 Robert Larice + * src/main.c , + * src/frontend/outitf.c , + * src/frontend/outitf.h , + * src/include/ngspice/ifsim.h , + * src/include/ngspice/noisedef.h , + * src/include/ngspice/trandefs.h , + * src/spicelib/analysis/acan.c , + * src/spicelib/analysis/cktsens.c , + * src/spicelib/analysis/dcop.c , + * src/spicelib/analysis/dctrcurv.c , + * src/spicelib/analysis/distoan.c , + * src/spicelib/analysis/pzan.c , + * src/spicelib/analysis/tfanal.c : + use type `runDesc' + 2012-02-07 Robert Larice * src/frontend/outitf.h , * src/include/ngspice/typedefs.h : diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index 7f78d5127..7346617bb 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -90,7 +90,7 @@ int OUTpBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr, IFuid analName, IFuid refName, int refType, - int numNames, IFuid *dataNames, int dataType, void **plotPtr) + int numNames, IFuid *dataNames, int dataType, runDesc **plotPtr) { char *name; @@ -107,14 +107,14 @@ if (ARCHme != 0) return(OK); return (beginPlot(analysisPtr, circuitPtr, name, analName, refName, refType, numNames, dataNames, dataType, FALSE, - (runDesc **) plotPtr)); + plotPtr)); } int OUTwBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr, IFuid analName, IFuid refName, int refType, - int numNames, IFuid *dataNames, int dataType, void **plotPtr) + int numNames, IFuid *dataNames, int dataType, runDesc **plotPtr) { #ifdef PARALLEL_ARCH if (ARCHme != 0) return(OK); @@ -123,7 +123,7 @@ OUTwBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr, return (beginPlot(analysisPtr, circuitPtr, "circuit name", analName, refName, refType, numNames, dataNames, dataType, TRUE, - (runDesc **) plotPtr)); + plotPtr)); } static int @@ -447,9 +447,9 @@ addSpecialDesc(runDesc *run, char *name, char *devname, char *param, int depind) int -OUTpData(void *plotPtr, IFvalue *refValue, IFvalue *valuePtr) +OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr) { - runDesc *run = (runDesc *) plotPtr; + runDesc *run = plotPtr; // FIXME IFvalue val; int i; #ifdef PARALLEL_ARCH @@ -637,7 +637,7 @@ OUTwReference(void *plotPtr, IFvalue *valuePtr, void **refPtr) } /* ARGSUSED */ /* until some code gets written */ int -OUTwData(void *plotPtr, int dataIndex, IFvalue *valuePtr, void *refPtr) +OUTwData(runDesc *plotPtr, int dataIndex, IFvalue *valuePtr, void *refPtr) { NG_IGNORE(refPtr); NG_IGNORE(valuePtr); @@ -649,7 +649,7 @@ OUTwData(void *plotPtr, int dataIndex, IFvalue *valuePtr, void *refPtr) /* ARGSUSED */ /* until some code gets written */ int -OUTwEnd(void *plotPtr) +OUTwEnd(runDesc *plotPtr) { NG_IGNORE(plotPtr); return (OK); @@ -658,9 +658,9 @@ OUTwEnd(void *plotPtr) int -OUTendPlot(void *plotPtr) +OUTendPlot(runDesc *plotPtr) { - runDesc *run = (runDesc *) plotPtr; + runDesc *run = plotPtr; // FIXME #ifdef PARALLEL_ARCH if (ARCHme != 0) return(OK); @@ -682,7 +682,7 @@ OUTendPlot(void *plotPtr) /* ARGSUSED */ /* until some code gets written */ int -OUTbeginDomain(void *plotPtr, IFuid refName, int refType, IFvalue *outerRefValue) +OUTbeginDomain(runDesc *plotPtr, IFuid refName, int refType, IFvalue *outerRefValue) { NG_IGNORE(outerRefValue); NG_IGNORE(refType); @@ -694,7 +694,7 @@ OUTbeginDomain(void *plotPtr, IFuid refName, int refType, IFvalue *outerRefValue /* ARGSUSED */ /* until some code gets written */ int -OUTendDomain(void *plotPtr) +OUTendDomain(runDesc *plotPtr) { NG_IGNORE(plotPtr); return (OK); @@ -704,9 +704,9 @@ OUTendDomain(void *plotPtr) /* ARGSUSED */ /* until some code gets written */ int -OUTattributes(void *plotPtr, IFuid varName, int param, IFvalue *value) +OUTattributes(runDesc *plotPtr, IFuid varName, int param, IFvalue *value) { - runDesc *run = (runDesc *) plotPtr; + runDesc *run = plotPtr; // FIXME struct dvec *d; GRIDTYPE type; int i; diff --git a/src/frontend/outitf.h b/src/frontend/outitf.h index 207a31749..a4922b60d 100644 --- a/src/frontend/outitf.h +++ b/src/frontend/outitf.h @@ -46,19 +46,19 @@ struct runDesc { int OUTpBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr, IFuid analName, IFuid refName, int refType, - int numNames, IFuid *dataNames, int dataType, void **plotPtr); + int numNames, IFuid *dataNames, int dataType, runDesc **plotPtr); int OUTwBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr, IFuid analName, IFuid refName, int refType, - int numNames, IFuid *dataNames, int dataType, void **plotPtr); -int OUTpData(void *plotPtr, IFvalue *refValue, IFvalue *valuePtr); + int numNames, IFuid *dataNames, int dataType, runDesc **plotPtr); +int OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr); int OUTwReference(void *plotPtr, IFvalue *valuePtr, void **refPtr); -int OUTwData(void *plotPtr, int dataIndex, IFvalue *valuePtr, void *refPtr); -int OUTwEnd(void *plotPtr); -int OUTendPlot(void *plotPtr); -int OUTbeginDomain(void *plotPtr, IFuid refName, int refType, IFvalue *outerRefValue); -int OUTendDomain(void *plotPtr); -int OUTattributes(void *plotPtr, IFuid varName, int param, IFvalue *value); +int OUTwData(runDesc *plotPtr, int dataIndex, IFvalue *valuePtr, void *refPtr); +int OUTwEnd(runDesc *plotPtr); +int OUTendPlot(runDesc *plotPtr); +int OUTbeginDomain(runDesc *plotPtr, IFuid refName, int refType, IFvalue *outerRefValue); +int OUTendDomain(runDesc *plotPtr); +int OUTattributes(runDesc *plotPtr, IFuid varName, int param, IFvalue *value); int OUTstopnow(void); void OUTerror(int flags, char *format, IFuid *names); diff --git a/src/include/ngspice/ifsim.h b/src/include/ngspice/ifsim.h index 4ea035753..0719b70e3 100644 --- a/src/include/ngspice/ifsim.h +++ b/src/include/ngspice/ifsim.h @@ -442,28 +442,28 @@ struct IFfrontEnd { int (*OUTpBeginPlot) (CKTcircuit *, JOB *, IFuid, IFuid, int, - int, IFuid *, int, void **); + int, IFuid *, int, runDesc **); /* start pointwise output plot */ - int (*OUTpData) (void *, IFvalue *, IFvalue *); + int (*OUTpData) (runDesc *, IFvalue *, IFvalue *); /* data for pointwise plot */ int (*OUTwBeginPlot) (CKTcircuit *, JOB *, IFuid, IFuid, int, - int, IFuid *, int, void **); + int, IFuid *, int, runDesc **); /* start windowed output plot */ - int (*OUTwReference) (void *, IFvalue *, void **); + int (*OUTwReference) (runDesc *, IFvalue *, void **); /* independent vector for windowed plot */ - int (*OUTwData) (void *, int, IFvalue *, void *); + int (*OUTwData) (runDesc *, int, IFvalue *, void *); /* data for windowed plot */ - int (*OUTwEnd) (void *); + int (*OUTwEnd) (runDesc *); /* signal end of windows */ - int (*OUTendPlot) (void *); + int (*OUTendPlot) (runDesc *); /* end of plot */ - int (*OUTbeginDomain) (void *, IFuid, int, IFvalue *); + int (*OUTbeginDomain) (runDesc *, IFuid, int, IFvalue *); /* start nested domain */ - int (*OUTendDomain) (void *); + int (*OUTendDomain) (runDesc *); /* end nested domain */ - int (*OUTattributes) (void *, IFuid, int, IFvalue *); + int (*OUTattributes) (runDesc *, IFuid, int, IFvalue *); /* specify output attributes of node */ }; diff --git a/src/include/ngspice/noisedef.h b/src/include/ngspice/noisedef.h index 814c00ec2..3a828c489 100644 --- a/src/include/ngspice/noisedef.h +++ b/src/include/ngspice/noisedef.h @@ -49,7 +49,7 @@ typedef struct { /* a do loop. */ unsigned int prtSummary; double *outpVector; /* pointer to our array of noise outputs */ - void *NplotPtr; /* the plot pointer */ + runDesc *NplotPtr; /* the plot pointer */ IFuid *namelist; /* list of plot names */ } Ndata; diff --git a/src/include/ngspice/trandefs.h b/src/include/ngspice/trandefs.h index 46158f31c..34ed45059 100644 --- a/src/include/ngspice/trandefs.h +++ b/src/include/ngspice/trandefs.h @@ -24,7 +24,7 @@ typedef struct { double TRANmaxStep; double TRANinitTime; long TRANmode; - void * TRANplot; + runDesc *TRANplot; } TRANan; #define TRAN_TSTART 1 diff --git a/src/main.c b/src/main.c index db34c9090..a892e1981 100644 --- a/src/main.c +++ b/src/main.c @@ -201,14 +201,14 @@ const bool ft_nutmeg = FALSE; extern struct comm spcp_coms[ ]; struct comm *cp_coms = spcp_coms; -extern int OUTpBeginPlot(CKTcircuit *,JOB *,IFuid,IFuid,int,int,IFuid *,int,void **); -extern int OUTpData(void *,IFvalue *,IFvalue *); -extern int OUTwBeginPlot(CKTcircuit *,JOB *,IFuid,IFuid,int,int,IFuid *,int,void **); -extern int OUTwReference(void *,IFvalue *,void **); -extern int OUTwData(void *,int,IFvalue *,void *), OUTwEnd(void *), OUTendPlot(void *); -extern int OUTbeginDomain(void *,IFuid,int,IFvalue *); -extern int OUTendDomain(void *), OUTstopnow(void), OUTerror(int,char *,IFuid *); -extern int OUTattributes(void *,IFuid,int,IFvalue *); +extern int OUTpBeginPlot(CKTcircuit *,JOB *,IFuid,IFuid,int,int,IFuid *,int,runDesc **); +extern int OUTpData(runDesc *,IFvalue *,IFvalue *); +extern int OUTwBeginPlot(CKTcircuit *,JOB *,IFuid,IFuid,int,int,IFuid *,int,runDesc **); +extern int OUTwReference(runDesc *,IFvalue *,void **); +extern int OUTwData(runDesc *,int,IFvalue *,void *), OUTwEnd(runDesc *), OUTendPlot(runDesc *); +extern int OUTbeginDomain(runDesc *,IFuid,int,IFvalue *); +extern int OUTendDomain(runDesc *), OUTstopnow(void), OUTerror(int,char *,IFuid *); +extern int OUTattributes(runDesc *,IFuid,int,IFvalue *); extern void initw(void); diff --git a/src/spicelib/analysis/acan.c b/src/spicelib/analysis/acan.c index e21113ec2..b503cb1fd 100644 --- a/src/spicelib/analysis/acan.c +++ b/src/spicelib/analysis/acan.c @@ -62,8 +62,8 @@ ACan(CKTcircuit *ckt, int restart) int numNames; IFuid *nameList; /* va: tmalloc'ed list of names */ IFuid freqUid; - static void *acPlot = NULL; - void *plot = NULL; + static runDesc *acPlot = NULL; + runDesc *plot = NULL; #ifdef XSPICE diff --git a/src/spicelib/analysis/cktsens.c b/src/spicelib/analysis/cktsens.c index c2dde79ed..22417dd2e 100644 --- a/src/spicelib/analysis/cktsens.c +++ b/src/spicelib/analysis/cktsens.c @@ -81,7 +81,7 @@ int sens_sens(CKTcircuit *ckt, int restart) static int is_dc; int k, j, n; int num_vars, branch_eq=0; - void *sen_data = NULL; + runDesc *sen_data = NULL; char namebuf[513]; IFuid *output_names, freq_name; int bypass; diff --git a/src/spicelib/analysis/dcop.c b/src/spicelib/analysis/dcop.c index af78fceb2..791090a30 100644 --- a/src/spicelib/analysis/dcop.c +++ b/src/spicelib/analysis/dcop.c @@ -25,7 +25,7 @@ DCop(CKTcircuit *ckt, int notused) int error; IFuid *nameList; /* va: tmalloc'ed list */ int numNames; - void *plot = NULL; + runDesc *plot = NULL; NG_IGNORE(notused); diff --git a/src/spicelib/analysis/dctrcurv.c b/src/spicelib/analysis/dctrcurv.c index c303a7ba4..5b4cc12be 100644 --- a/src/spicelib/analysis/dctrcurv.c +++ b/src/spicelib/analysis/dctrcurv.c @@ -48,7 +48,7 @@ DCtrCurv(CKTcircuit *ckt, int restart) IFuid *nameList; int numNames; int firstTime=1; - static void *plot=NULL; + static runDesc *plot = NULL; #ifdef WANT_SENSE2 #ifdef SENSDEBUG diff --git a/src/spicelib/analysis/distoan.c b/src/spicelib/analysis/distoan.c index 2900026be..62dd6263b 100644 --- a/src/spicelib/analysis/distoan.c +++ b/src/spicelib/analysis/distoan.c @@ -49,7 +49,7 @@ DISTOan(CKTcircuit *ckt, int restart) int numNames; IFuid *nameList; IFuid freqUid; - void *acPlot=NULL; + runDesc *acPlot = NULL; DISTOAN *job = (DISTOAN *) ckt->CKTcurJob; static char *nof2src = "No source with f2 distortion input"; #ifdef DISTODEBUG diff --git a/src/spicelib/analysis/pzan.c b/src/spicelib/analysis/pzan.c index cfb9a3c36..6117f67df 100644 --- a/src/spicelib/analysis/pzan.c +++ b/src/spicelib/analysis/pzan.c @@ -22,7 +22,7 @@ PZan(CKTcircuit *ckt, int reset) int error; int numNames; IFuid *nameList; - void *plot = NULL; + runDesc *plot = NULL; NG_IGNORE(reset); @@ -127,7 +127,7 @@ int PZpost(CKTcircuit *ckt) { PZAN *job = (PZAN *) ckt->CKTcurJob; - void *pzPlotPtr = NULL; /* the plot pointer for front end */ + runDesc *pzPlotPtr = NULL; /* the plot pointer for front end */ IFcomplex *out_list; IFvalue outData; /* output variable (points to out_list) */ IFuid *namelist; diff --git a/src/spicelib/analysis/tfanal.c b/src/spicelib/analysis/tfanal.c index b4067ad74..aa7fa2439 100644 --- a/src/spicelib/analysis/tfanal.c +++ b/src/spicelib/analysis/tfanal.c @@ -30,7 +30,7 @@ TFanal(CKTcircuit *ckt, int restart) int error; int converged; int i; - void *plotptr = NULL; /* pointer to out plot */ + runDesc *plotptr = NULL; /* pointer to out plot */ GENinstance *ptr = NULL; IFuid uids[3]; int Itype;