fix the type signature of the if_*() function family.
This commit is contained in:
parent
a57a381ea7
commit
d6ad853ecb
13
ChangeLog
13
ChangeLog
|
|
@ -1,3 +1,16 @@
|
|||
2010-07-06 Robert Larice
|
||||
* src/main.c ,
|
||||
* src/frontend/nutmegif.c ,
|
||||
* src/frontend/nutmegif.h ,
|
||||
* src/frontend/shyu.c ,
|
||||
* src/frontend/shyu.h ,
|
||||
* src/frontend/spiceif.c ,
|
||||
* src/frontend/spiceif.h ,
|
||||
* src/include/fteext.h :
|
||||
fix the type signature of the if_*() family of functions.
|
||||
some incompatible pointer passing warnings will pop up,
|
||||
and will be fixed later.
|
||||
|
||||
2010-07-06 Robert Larice
|
||||
* src/include/typedefs.h :
|
||||
new include file for struct forward declarations and for typedefs
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include "nutmegif.h"
|
||||
|
||||
|
||||
struct variable * nutif_getparam(char *ckt, char **name, char *param, int ind, int do_model)
|
||||
struct variable * nutif_getparam(CKTcircuit *ckt, char **name, char *param, int ind, int do_model)
|
||||
{ return ((struct variable *) NULL); }
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#ifndef NUTMEGIF_H_INCLUDED
|
||||
#define NUTMEGIF_H_INCLUDED
|
||||
|
||||
struct variable * nutif_getparam(char *ckt, char **name, char *param, int ind, int do_model);
|
||||
struct variable * nutif_getparam(CKTcircuit *ckt, char **name, char *param, int ind, int do_model);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ Copyright 1990 Regents of the University of California. All rights reserved.
|
|||
|
||||
|
||||
int
|
||||
if_sens_run(char *t, wordlist *args, INPtables *tab)
|
||||
if_sens_run(CKTcircuit *t, wordlist *args, INPtables *tab)
|
||||
{
|
||||
void *ckt = (void *) t;
|
||||
void *senseJob;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#ifndef SHYU_H_INCLUDED
|
||||
#define SHYU_H_INCLUDED
|
||||
|
||||
int if_sens_run(char *t, wordlist *args, INPtables *tab);
|
||||
int if_sens_run(CKTcircuit *t, wordlist *args, INPtables *tab);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -75,18 +75,18 @@ CDHW*/
|
|||
static struct variable * parmtovar(IFvalue *pv, IFparm *opt);
|
||||
static IFparm * parmlookup(IFdevice *dev, GENinstance **inptr, char *param,
|
||||
int do_model, int inout);
|
||||
static IFvalue * doask(void *ckt, int typecode, GENinstance *dev, GENmodel *mod,
|
||||
static IFvalue * doask(CKTcircuit *ckt, int typecode, GENinstance *dev, GENmodel *mod,
|
||||
IFparm *opt, int ind);
|
||||
static int doset(void *ckt, int typecode, GENinstance *dev, GENmodel *mod,
|
||||
static int doset(CKTcircuit *ckt, int typecode, GENinstance *dev, GENmodel *mod,
|
||||
IFparm *opt, struct dvec *val);
|
||||
static int finddev(void *ck, char *name, void **devptr, void **modptr);
|
||||
static int finddev(CKTcircuit *ck, char *name, GENinstance **devptr, GENmodel **modptr);
|
||||
|
||||
/*espice fix integration */
|
||||
static int finddev_special(char *ck, char *name, void **devptr, void **modptr, int *device_or_model);
|
||||
static int finddev_special(CKTcircuit *ck, char *name, GENinstance **devptr, GENmodel **modptr, int *device_or_model);
|
||||
|
||||
/* Input a single deck, and return a pointer to the circuit. */
|
||||
|
||||
char *
|
||||
CKTcircuit *
|
||||
if_inpdeck(struct line *deck, INPtables **tab)
|
||||
{
|
||||
void *ckt;
|
||||
|
|
@ -195,7 +195,7 @@ if_inpdeck(struct line *deck, INPtables **tab)
|
|||
* typed at the keyboard, error in the simulation, etc). args should
|
||||
* be the entire command line, e.g. "tran 1 10 20 uic" */
|
||||
int
|
||||
if_run(char *t, char *what, wordlist *args, char *tab)
|
||||
if_run(CKTcircuit *t, char *what, wordlist *args, INPtables *tab)
|
||||
{
|
||||
void *ckt = (void *) t;
|
||||
int err;
|
||||
|
|
@ -382,7 +382,7 @@ static char *obsolete[] = {
|
|||
} ;
|
||||
|
||||
int
|
||||
if_option(void *ckt, char *name, int type, char *value)
|
||||
if_option(CKTcircuit *ckt, char *name, int type, char *value)
|
||||
{
|
||||
IFvalue pval;
|
||||
int err, i;
|
||||
|
|
@ -529,7 +529,7 @@ fputs("\t(Note that you must use an = to separate option name and value.)\n",
|
|||
|
||||
|
||||
void
|
||||
if_dump(void *ckt, FILE *file)
|
||||
if_dump(CKTcircuit *ckt, FILE *file)
|
||||
{
|
||||
/*void *cc = (void *) ckt;*/
|
||||
|
||||
|
|
@ -538,7 +538,7 @@ if_dump(void *ckt, FILE *file)
|
|||
}
|
||||
|
||||
void
|
||||
if_cktfree(void *ckt, char *tab)
|
||||
if_cktfree(CKTcircuit *ckt, INPtables *tab)
|
||||
{
|
||||
void *cc = (void *) ckt;
|
||||
|
||||
|
|
@ -569,10 +569,10 @@ if_errstring(int code)
|
|||
*/
|
||||
static int
|
||||
finddev_special(
|
||||
char *ck,
|
||||
CKTcircuit *ck,
|
||||
char *name,
|
||||
void **devptr,
|
||||
void **modptr,
|
||||
GENinstance **devptr,
|
||||
GENmodel **modptr,
|
||||
int *device_or_model)
|
||||
{
|
||||
int err;
|
||||
|
|
@ -603,7 +603,7 @@ finddev_special(
|
|||
* A.Roldan (espice)
|
||||
*/
|
||||
struct variable *
|
||||
spif_getparam_special(void *ckt,char **name,char *param,int ind,int do_model)
|
||||
spif_getparam_special(CKTcircuit *ckt,char **name,char *param,int ind,int do_model)
|
||||
{
|
||||
struct variable *vv = NULL, *tv;
|
||||
IFvalue *pv;
|
||||
|
|
@ -739,7 +739,7 @@ spif_getparam_special(void *ckt,char **name,char *param,int ind,int do_model)
|
|||
*/
|
||||
|
||||
struct variable *
|
||||
spif_getparam(void *ckt, char **name, char *param, int ind, int do_model)
|
||||
spif_getparam(CKTcircuit *ckt, char **name, char *param, int ind, int do_model)
|
||||
{
|
||||
struct variable *vv = NULL, *tv;
|
||||
IFvalue *pv;
|
||||
|
|
@ -810,7 +810,7 @@ spif_getparam(void *ckt, char **name, char *param, int ind, int do_model)
|
|||
|
||||
/* 9/26/03 PJB : function to allow setting model of device */
|
||||
void
|
||||
if_setparam_model( void *ckt, char **name, char *val )
|
||||
if_setparam_model(CKTcircuit *ckt, char **name, char *val )
|
||||
{
|
||||
GENinstance *dev = (GENinstance *)NULL;
|
||||
GENinstance *prevDev = (GENinstance *)NULL;
|
||||
|
|
@ -890,7 +890,7 @@ if_setparam_model( void *ckt, char **name, char *val )
|
|||
}
|
||||
|
||||
void
|
||||
if_setparam(void *ckt, char **name, char *param, struct dvec *val, int do_model)
|
||||
if_setparam(CKTcircuit *ckt, char **name, char *param, struct dvec *val, int do_model)
|
||||
{
|
||||
IFparm *opt;
|
||||
IFdevice *device;
|
||||
|
|
@ -1042,7 +1042,7 @@ parmlookup(IFdevice *dev, GENinstance **inptr, char *param, int do_model, int in
|
|||
|
||||
|
||||
static IFvalue *
|
||||
doask(void *ckt, int typecode, GENinstance *dev, GENmodel *mod, IFparm *opt, int ind)
|
||||
doask(CKTcircuit *ckt, int typecode, GENinstance *dev, GENmodel *mod, IFparm *opt, int ind)
|
||||
{
|
||||
static IFvalue pv;
|
||||
int err;
|
||||
|
|
@ -1071,7 +1071,7 @@ doask(void *ckt, int typecode, GENinstance *dev, GENmodel *mod, IFparm *opt, int
|
|||
|
||||
|
||||
static int
|
||||
doset(void *ckt, int typecode, GENinstance *dev, GENmodel *mod, IFparm *opt, struct dvec *val)
|
||||
doset(CKTcircuit *ckt, int typecode, GENinstance *dev, GENmodel *mod, IFparm *opt, struct dvec *val)
|
||||
{
|
||||
IFvalue nval;
|
||||
int err;
|
||||
|
|
@ -1151,7 +1151,7 @@ doset(void *ckt, int typecode, GENinstance *dev, GENmodel *mod, IFparm *opt, str
|
|||
*/
|
||||
|
||||
static int
|
||||
finddev(void *ck, char *name, void **devptr, void **modptr)
|
||||
finddev(CKTcircuit *ck, char *name, GENinstance **devptr, GENmodel **modptr)
|
||||
{
|
||||
int err;
|
||||
int type = -1;
|
||||
|
|
@ -1169,7 +1169,7 @@ finddev(void *ck, char *name, void **devptr, void **modptr)
|
|||
/* get an analysis parameter by name instead of id */
|
||||
|
||||
int
|
||||
if_analQbyName(void *ckt, int which, void *anal, char *name, IFvalue *parm)
|
||||
if_analQbyName(CKTcircuit *ckt, int which, void *anal, char *name, IFvalue *parm)
|
||||
{
|
||||
int i;
|
||||
for(i=0;i<ft_sim->analyses[which]->numParms;i++) {
|
||||
|
|
@ -1228,7 +1228,7 @@ if_tranparams(struct circ *ci, double *start, double *stop, double *step)
|
|||
*/
|
||||
|
||||
struct variable *
|
||||
if_getstat(void *ckt, char *name)
|
||||
if_getstat(CKTcircuit *ckt, char *name)
|
||||
{
|
||||
int i;
|
||||
struct variable *v, *vars;
|
||||
|
|
|
|||
|
|
@ -7,19 +7,19 @@
|
|||
#ifndef SPICEIF_H_INCLUDED
|
||||
#define SPICEIF_H_INCLUDED
|
||||
|
||||
char * if_inpdeck(struct line *deck, INPtables **tab);
|
||||
int if_run(char *t, char *what, wordlist *args, char *tab);
|
||||
int if_option(void *ckt, char *name, int type, char *value);
|
||||
void if_dump(void *ckt, FILE *file);
|
||||
void if_cktfree(void *ckt, char *tab);
|
||||
CKTcircuit * if_inpdeck(struct line *deck, INPtables **tab);
|
||||
int if_run(CKTcircuit *t, char *what, wordlist *args, INPtables *tab);
|
||||
int if_option(CKTcircuit *ckt, char *name, int type, char *value);
|
||||
void if_dump(CKTcircuit *ckt, FILE *file);
|
||||
void if_cktfree(CKTcircuit *ckt, INPtables *tab);
|
||||
char * if_errstring(int code);
|
||||
struct variable * spif_getparam(void *ckt, char **name, char *param, int ind, int do_model);
|
||||
struct variable * spif_getparam_special(void *ckt,char **name,char *param,int ind,int do_model);
|
||||
void if_setparam_model(void *ckt, char **name, char *val);
|
||||
void if_setparam(void *ckt, char **name, char *param, struct dvec *val, int do_model);
|
||||
int if_analQbyName(void *ckt, int which, void *anal, char *name, IFvalue *parm);
|
||||
struct variable * spif_getparam(CKTcircuit *ckt, char **name, char *param, int ind, int do_model);
|
||||
struct variable * spif_getparam_special(CKTcircuit *ckt,char **name,char *param,int ind,int do_model);
|
||||
void if_setparam_model(CKTcircuit *ckt, char **name, char *val);
|
||||
void if_setparam(CKTcircuit *ckt, char **name, char *param, struct dvec *val, int do_model);
|
||||
int if_analQbyName(CKTcircuit *ckt, int which, void *anal, char *name, IFvalue *parm);
|
||||
bool if_tranparams(struct circ *ci, double *start, double *stop, double *step);
|
||||
struct variable * if_getstat(void *ckt, char *name);
|
||||
struct variable * if_getstat(CKTcircuit *ckt, char *name);
|
||||
|
||||
#ifdef EXPERIMENTAL_CODE
|
||||
void com_loadsnap(wordlist *wl);
|
||||
|
|
|
|||
|
|
@ -420,22 +420,22 @@ extern int main(int argc, char **argv);
|
|||
|
||||
/* spiceif.c & nutmegif.c */
|
||||
|
||||
extern bool if_tranparams();
|
||||
extern bool if_tranparams(struct circ *ci, double *start, double *stop, double *step);
|
||||
extern char *if_errstring(int code);
|
||||
extern char *if_inpdeck();
|
||||
extern int if_run();
|
||||
extern int if_sens_run();
|
||||
extern struct variable *(*if_getparam)();
|
||||
extern struct variable *nutif_getparam();
|
||||
extern struct variable *spif_getparam(void *ckt, char **name, char *param, int ind, int do_model);
|
||||
extern struct variable *spif_getparam_special();
|
||||
extern void if_cktfree();
|
||||
extern void if_dump();
|
||||
extern int if_option();
|
||||
extern void if_setndnames();
|
||||
extern void if_setparam_model();
|
||||
extern void if_setparam();
|
||||
extern struct variable *if_getstat();
|
||||
extern CKTcircuit *if_inpdeck(struct line *deck, INPtables **tab);
|
||||
extern int if_run(CKTcircuit *t, char *what, wordlist *args, INPtables *tab);
|
||||
extern int if_sens_run(CKTcircuit *t, wordlist *args, INPtables *tab);
|
||||
extern struct variable *(*if_getparam)(CKTcircuit *ckt, char** name, char* param, int ind, int do_model);
|
||||
extern struct variable * nutif_getparam(CKTcircuit *ckt, char **name, char *param, int ind, int do_model);
|
||||
extern struct variable *spif_getparam(CKTcircuit *ckt, char **name, char *param, int ind, int do_model);
|
||||
extern struct variable *spif_getparam_special(CKTcircuit *ckt, char **name, char *param, int ind, int do_model);
|
||||
extern void if_cktfree(CKTcircuit *ckt, INPtables *tab);
|
||||
extern void if_dump(CKTcircuit *ckt, FILE *file);
|
||||
extern int if_option(CKTcircuit *ckt, char *name, int type, char *value);
|
||||
extern void if_setndnames(char *line);
|
||||
extern void if_setparam_model(CKTcircuit *ckt, char **name, char *val );
|
||||
extern void if_setparam(CKTcircuit *ckt, char **name, char *param, struct dvec *val, int do_model);
|
||||
extern struct variable *if_getstat(CKTcircuit *ckt, char *name);
|
||||
|
||||
/* subckt.c */
|
||||
|
||||
|
|
|
|||
24
src/main.c
24
src/main.c
|
|
@ -148,7 +148,7 @@ double EpsNorm, VNorm, NNorm, LNorm, TNorm, JNorm, GNorm, ENorm;
|
|||
/* end cider globals */
|
||||
#endif /* CIDER */
|
||||
|
||||
struct variable *(*if_getparam)( );
|
||||
struct variable *(*if_getparam)(CKTcircuit *ckt, char** name, char* param, int ind, int do_model);
|
||||
|
||||
static int started = FALSE;
|
||||
|
||||
|
|
@ -226,39 +226,39 @@ IFfrontEnd nutmeginfo;
|
|||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int
|
||||
if_run(char *t, char *w, wordlist *s, char *b)
|
||||
if_run(CKTcircuit *t, char *w, wordlist *s, INPtables *b)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int
|
||||
if_sens_run(char *t, char *w, wordlist *s, char *b)
|
||||
if_sens_run(CKTcircuit *t, wordlist *args, INPtables *tab)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
void
|
||||
if_dump(char *ckt, FILE *fp)
|
||||
if_dump(CKTcircuit *ckt, FILE *fp)
|
||||
{}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
char *
|
||||
if_inpdeck(struct line *deck, char **tab)
|
||||
CKTcircuit *
|
||||
if_inpdeck(struct line *deck, INPtables **tab)
|
||||
{
|
||||
return ((char *) 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int
|
||||
if_option(char *ckt, char *name, int type, char *value)
|
||||
if_option(CKTcircuit *ckt, char *name, int type, char *value)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
void if_cktfree(char *ckt, char *tab)
|
||||
void if_cktfree(CKTcircuit *ckt, INPtables *tab)
|
||||
{}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
|
@ -274,11 +274,11 @@ if_errstring(int code)
|
|||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
void
|
||||
if_setparam_model(char *ckt, char *name, struct variable *val)
|
||||
if_setparam_model(CKTcircuit *ckt, char **name, char *val)
|
||||
{}
|
||||
|
||||
void
|
||||
if_setparam(char *ckt, char *name, char *param, struct variable *val)
|
||||
if_setparam(CKTcircuit *ckt, char **name, char *param, struct dvec *val, int do_model)
|
||||
{}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
|
@ -290,7 +290,7 @@ if_tranparams(struct circ *ckt, double *start, double *stop, double *step)
|
|||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
struct variable *
|
||||
if_getstat(char *n, char *c)
|
||||
if_getstat(CKTcircuit *ckt, char *name)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue