Browse Source

consolidate enum cp_types and enum vt_types .

use this enum for some function arguments and struct members .
  drop some include "variable.h" which are no longer needed ,
    propably many more could be droped .
  drop #define VT_* which have been used as workaround for the type mess .
pre-master-46
rlar 16 years ago
parent
commit
0aa1c09d73
  1. 34
      ChangeLog
  2. 1
      src/frontend/plotting/agraf.c
  3. 1
      src/frontend/plotting/gnuplot.c
  4. 1
      src/frontend/plotting/graf.c
  5. 1
      src/frontend/plotting/plotcurv.c
  6. 1
      src/frontend/plotting/plotit.c
  7. 1
      src/frontend/plotting/xgraph.c
  8. 4
      src/frontend/variable.c
  9. 16
      src/frontend/variable.h
  10. 4
      src/frontend/wdisp/windisp.c
  11. 19
      src/include/cpextern.h
  12. 1
      src/maths/cmaths/cmath4.c
  13. 1
      src/maths/misc/randnumb.c
  14. 2
      src/spicelib/devices/bsim3/b3par.c
  15. 4
      src/spicelib/devices/bsim3/b3set.c
  16. 3
      src/spicelib/devices/bsim3soi/b4soiset.c
  17. 2
      src/spicelib/devices/bsim3v0/b3v0par.c
  18. 2
      src/spicelib/devices/bsim3v1/b3v1par.c
  19. 2
      src/spicelib/devices/bsim3v1a/b3v1apar.c
  20. 2
      src/spicelib/devices/bsim3v1s/b3v1spar.c
  21. 2
      src/spicelib/devices/bsim3v32/b3v32par.c
  22. 2
      src/spicelib/devices/bsim4/b4par.c
  23. 3
      src/spicelib/devices/bsim4/b4set.c
  24. 2
      src/spicelib/devices/bsim4v2/b4v2par.c
  25. 2
      src/spicelib/devices/bsim4v3/b4v3par.c
  26. 2
      src/spicelib/devices/bsim4v4/b4v4par.c
  27. 2
      src/spicelib/devices/bsim4v5/b4v5par.c
  28. 2
      src/spicelib/parser/inpgmod.c

34
ChangeLog

@ -1,3 +1,37 @@
2010-07-17 Robert Larice
* src/frontend/variable.c ,
* src/frontend/variable.h ,
* src/frontend/plotting/agraf.c ,
* src/frontend/plotting/gnuplot.c ,
* src/frontend/plotting/graf.c ,
* src/frontend/plotting/plotcurv.c ,
* src/frontend/plotting/plotit.c ,
* src/frontend/plotting/xgraph.c ,
* src/frontend/wdisp/windisp.c ,
* src/include/cpextern.h ,
* src/maths/cmaths/cmath4.c ,
* src/maths/misc/randnumb.c ,
* src/spicelib/devices/bsim3/b3par.c ,
* src/spicelib/devices/bsim3/b3set.c ,
* src/spicelib/devices/bsim3soi/b4soiset.c ,
* src/spicelib/devices/bsim3v0/b3v0par.c ,
* src/spicelib/devices/bsim3v1/b3v1par.c ,
* src/spicelib/devices/bsim3v1a/b3v1apar.c ,
* src/spicelib/devices/bsim3v1s/b3v1spar.c ,
* src/spicelib/devices/bsim3v32/b3v32par.c ,
* src/spicelib/devices/bsim4/b4par.c ,
* src/spicelib/devices/bsim4/b4set.c ,
* src/spicelib/devices/bsim4v2/b4v2par.c ,
* src/spicelib/devices/bsim4v3/b4v3par.c ,
* src/spicelib/devices/bsim4v4/b4v4par.c ,
* src/spicelib/devices/bsim4v5/b4v5par.c ,
* src/spicelib/parser/inpgmod.c :
consolidate enum cp_types and enum vt_types .
use this enum for some function arguments and struct members .
drop some include "variable.h" which are no longer needed ,
propably many more could be droped .
drop #define VT_* which have been used as workaround for the type mess .
2010-07-17 Holger Vogt
* typesdef.c: correct the number of available types and plots

1
src/frontend/plotting/agraf.c

@ -14,7 +14,6 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "fteparse.h"
#include "agraf.h"
#include <variable.h>
#define FUDGE 7
#define MARGIN_BASE 11

1
src/frontend/plotting/gnuplot.c

@ -17,7 +17,6 @@
#include "fteparse.h"
#include "gnuplot.h"
#include "variable.h"
#define GP_MAXVECTORS 64

1
src/frontend/plotting/graf.c

@ -22,7 +22,6 @@ $Id$
#include "ftedbgra.h"
#include "ftedev.h"
#include <terminal.h>
#include <variable.h>
#include "graf.h"
#include "graphdb.h"
#include "grid.h"

1
src/frontend/plotting/plotcurv.c

@ -13,7 +13,6 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include <dvec.h>
#include <graph.h>
#include <ftedbgra.h>
#include <variable.h>
#include "plotcurv.h"

1
src/frontend/plotting/plotit.c

@ -10,7 +10,6 @@
#include <fteext.h>
#include <circuits.h>
#include <variable.h>
#include "plotit.h"
#include "agraf.h"

1
src/frontend/plotting/xgraph.c

@ -14,7 +14,6 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group
#include "fteparse.h"
#include "xgraph.h"
#include <variable.h>
#define XG_MAXVECTORS 64

4
src/frontend/variable.c

@ -85,7 +85,7 @@ cp_varwl(struct variable *var)
/* Set a variable. */
void
cp_vset(char *varname, char type, char *value)
cp_vset(char *varname, enum vt_types type, char *value)
{
struct variable *v, *u, *w;
int i;
@ -540,7 +540,7 @@ cp_remvar(char *varname)
/* Determine the value of a variable. Fail if the variable is unset,
* and if the type doesn't match, try and make it work... */
bool
cp_getvar(char *name, int type, void *retval)
cp_getvar(char *name, enum vt_types type, void *retval)
{
struct variable *v;
struct variable *uv1, *uv2;

16
src/frontend/variable.h

@ -6,11 +6,13 @@
#ifndef _VARIABLE_H
#define _VARIABLE_H
#include "cpextern.h"
/* Variables that are accessible to the parser via $varname
* expansions. If the type is VT_LIST the value is a pointer to a
* list of the elements. */
struct variable {
char va_type;
enum vt_types va_type;
char *va_name;
union {
bool vV_bool;
@ -28,14 +30,6 @@ struct variable {
#define va_string va_V.vV_string
#define va_vlist va_V.vV_list
enum vt_types {
VT_BOOL,
VT_NUM,
VT_REAL,
VT_STRING,
VT_LIST
};
struct xxx {
struct variable *x_v;
char x_char;
@ -51,10 +45,10 @@ extern bool cp_echo;
/* extern struct variable *variables; */
wordlist * cp_varwl(struct variable *var);
void cp_vset(char *varname, char type, char *value);
void cp_vset(char *varname, enum vt_types type, char *value);
struct variable * cp_setparse(wordlist *wl);
void cp_remvar(char *varname);
bool cp_getvar(char *name, int type, void *retval);
bool cp_getvar(char *name, enum vt_types type, void *retval);
wordlist * cp_variablesubst(wordlist *wlist);
wordlist * vareval(char *string);
void cp_vprint(void);

4
src/frontend/wdisp/windisp.c

@ -27,10 +27,6 @@
*/
#undef BOOLEAN
/* local definition, because inclusion of variable.h does not work under Windows */
#define VT_NUM 1
#define VT_STRING 3
#include <windows.h>
#include <windowsx.h>
#include "suffix.h"

19
src/include/cpextern.h

@ -160,6 +160,13 @@ void cp_rehash(char *pathlist, bool docc);
/* variable.c */
enum vt_types {
VT_BOOL,
VT_NUM,
VT_REAL,
VT_STRING,
VT_LIST
};
extern bool cp_ignoreeof;
extern bool cp_noclobber;
@ -167,24 +174,18 @@ extern bool cp_noglob;
extern bool cp_nonomatch;
extern char cp_dol;
extern void cp_remvar(char *varname);
extern void cp_vset(char *varname, char type, char *value);
extern void cp_vset(char *varname, enum vt_types type, char *value);
extern struct variable *cp_setparse(wordlist *wl);
extern wordlist *vareval(char *string);
/* var2.c */
enum cp_types {
CP_BOOL,
CP_NUM,
CP_REAL,
CP_STRING,
CP_LIST
};
extern void cp_vprint(void);
extern void com_set(wordlist *wl);
extern void com_option(wordlist *wl);
extern void com_state(wordlist *wl);
extern void com_unset(wordlist *wl);
extern void com_shift(wordlist *wl);
extern bool cp_getvar(char *name, int type, void *retval);
extern bool cp_getvar(char *name, enum vt_types type, void *retval);
/* cpinterface.c etc -- stuff CP needs from FTE */

1
src/maths/cmaths/cmath4.c

@ -30,7 +30,6 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "sim.h" /* To get SV_TIME */
#include "../../frontend/variable.h" /* for VT_NUM in cx_interpolate */
extern bool cx_degrees;
void *

1
src/maths/misc/randnumb.c

@ -9,7 +9,6 @@ Copyright 2008 Holger Vogt
#include "ngspice.h"
#include "cpdefs.h"
#include "ftedefs.h"
#include "../frontend/variable.h"
/* MINGW: random, srandom in libiberty.a, but not in libiberty.h */

2
src/spicelib/devices/bsim3/b3par.c

@ -26,7 +26,7 @@ IFvalue *select)
BSIM3instance *here = (BSIM3instance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM3_W:

4
src/spicelib/devices/bsim3/b3set.c

@ -16,10 +16,10 @@
#include "const.h"
#include "sperror.h"
#include "suffix.h"
#ifdef USE_OMP3
#include "cpextern.h"
int nthreads;
extern bool cp_getvar(char *name, int type, void *retval);
#define VT_NUM 1
#endif
#define MAX_EXP 5.834617425e14

3
src/spicelib/devices/bsim3soi/b4soiset.c

@ -26,9 +26,8 @@ static char rcsid[] = "$Id$";
#include "suffix.h"
#ifdef USE_OMP4SOI
#include "cpextern.h"
int nthreads;
extern bool cp_getvar(char *name, int type, void *retval);
#define VT_NUM 1
#endif
#define SMOOTHFACTOR 0.1

2
src/spicelib/devices/bsim3v0/b3v0par.c

@ -18,7 +18,7 @@ BSIM3v0param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
BSIM3v0instance *here = (BSIM3v0instance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM3v0_W:

2
src/spicelib/devices/bsim3v1/b3v1par.c

@ -24,7 +24,7 @@ BSIM3v1param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
BSIM3v1instance *here = (BSIM3v1instance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM3v1_W:

2
src/spicelib/devices/bsim3v1a/b3v1apar.c

@ -19,7 +19,7 @@ BSIM3v1Aparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
BSIM3v1Ainstance *here = (BSIM3v1Ainstance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM3v1A_W:

2
src/spicelib/devices/bsim3v1s/b3v1spar.c

@ -19,7 +19,7 @@ BSIM3v1Sparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
BSIM3v1Sinstance *here = (BSIM3v1Sinstance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM3v1S_W:

2
src/spicelib/devices/bsim3v32/b3v32par.c

@ -23,7 +23,7 @@ BSIM3v32param (int param, IFvalue *value, GENinstance *inst, IFvalue *select)
BSIM3v32instance *here = (BSIM3v32instance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM3v32_W:

2
src/spicelib/devices/bsim4/b4par.c

@ -32,7 +32,7 @@ IFvalue *select)
BSIM4instance *here = (BSIM4instance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM4_W:

3
src/spicelib/devices/bsim4/b4set.c

@ -32,9 +32,8 @@
#include "suffix.h"
#ifdef USE_OMP4
#include "cpextern.h"
int nthreads;
extern bool cp_getvar(char *name, int type, void *retval);
#define VT_NUM 1
#endif
#define MAX_EXP 5.834617425e14

2
src/spicelib/devices/bsim4v2/b4v2par.c

@ -25,7 +25,7 @@ IFvalue *select)
BSIM4v2instance *here = (BSIM4v2instance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM4v2_W:

2
src/spicelib/devices/bsim4v3/b4v3par.c

@ -28,7 +28,7 @@ IFvalue *select)
BSIM4v3instance *here = (BSIM4v3instance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM4v3_W:

2
src/spicelib/devices/bsim4v4/b4v4par.c

@ -29,7 +29,7 @@ IFvalue *select)
BSIM4v4instance *here = (BSIM4v4instance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM4v4_W:

2
src/spicelib/devices/bsim4v5/b4v5par.c

@ -30,7 +30,7 @@ IFvalue *select)
BSIM4v5instance *here = (BSIM4v5instance*)inst;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
switch(param)
{ case BSIM4v5_W:

2
src/spicelib/parser/inpgmod.c

@ -204,7 +204,7 @@ INPgetModBin( CKTcircuit* ckt, char* name, INPmodel** model, INPtables* tab, cha
int error;
double scale;
if ( !cp_getvar( "scale", CP_REAL, (double*) &scale ) ) scale = 1;
if ( !cp_getvar( "scale", VT_REAL, (double*) &scale ) ) scale = 1;
*model = NULL;

Loading…
Cancel
Save