Browse Source

variables, cp_usrvars(), be more explicit

lift uv2 return value up to the invoker of cp_usrvars()
pre-master-46
rlar 10 years ago
parent
commit
97cdaae19f
  1. 7
      src/frontend/options.c
  2. 9
      src/frontend/variable.c
  3. 2
      src/include/ngspice/cpextern.h
  4. 2
      src/ngsconvert.c

7
src/frontend/options.c

@ -102,8 +102,8 @@ cp_enqvar(char *word)
/* Return the plot and ckt env vars, $plots, and $curplot{name,title,date,} */
void
cp_usrvars(struct variable **v1, struct variable **v2)
struct variable *
cp_usrvars(void)
{
struct variable *v, *tv;
@ -130,8 +130,7 @@ cp_usrvars(struct variable **v1, struct variable **v2)
v = tv;
}
*v1 = v;
*v2 = ft_curckt ? ft_curckt->ci_vars : NULL;
return v;
}

9
src/frontend/variable.c

@ -404,7 +404,8 @@ cp_remvar(char *varname)
bool found = TRUE;
int i, var_index = 0;
cp_usrvars(&uv1, &uv2);
uv1 = cp_usrvars();
uv2 = ft_curckt ? ft_curckt->ci_vars : NULL;
for (v = variables; v; v = v->va_next) {
var_index = 0;
@ -526,7 +527,8 @@ cp_getvar(char *name, enum cp_types type, void *retval)
struct variable *v;
struct variable *uv1, *uv2;
cp_usrvars(&uv1, &uv2);
uv1 = cp_usrvars();
uv2 = ft_curckt ? ft_curckt->ci_vars : NULL;
#ifdef TRACE
/* SDB debug statement */
@ -907,7 +909,8 @@ cp_vprint(void)
char *s;
struct xxx *vars;
cp_usrvars(&uv1, &uv2);
uv1 = cp_usrvars();
uv2 = ft_curckt ? ft_curckt->ci_vars : NULL;
for (v = uv1, i = 0; v; v = v->va_next)
i++;

2
src/include/ngspice/cpextern.h

@ -182,7 +182,7 @@ extern void ft_cpinit(void);
extern struct comm *cp_coms;
extern char *cp_program;
extern struct variable *cp_enqvar(char *word);
extern void cp_usrvars(struct variable **v1, struct variable **v2);
extern struct variable *cp_usrvars(void);
int cp_usrset(struct variable *var, bool isset);
extern void fatal(void);

2
src/ngsconvert.c

@ -429,7 +429,7 @@ void cp_pushcontrol(void) { }
void cp_popcontrol(void) { }
void out_init(void) { }
void cp_doquit(void) { exit(0); }
void cp_usrvars(struct variable **v1, struct variable **v2) { *v1 = NULL; *v2 = NULL; return; }
struct variable *cp_usrvars(void) { return NULL; }
int cp_evloop(char *s) { NG_IGNORE(s); return (0); }
void cp_ccon(bool o) { NG_IGNORE(o); }
char*if_errstring(int c) { NG_IGNORE(c); return copy("error"); }

Loading…
Cancel
Save