Browse Source

struct variable, #18/18, clean

pre-master-46
rlar 10 years ago
parent
commit
ac726f0cf4
  1. 3
      src/frontend/options.c
  2. 3
      src/frontend/spiceif.c
  3. 5
      src/frontend/variable.c

3
src/frontend/options.c

@ -85,9 +85,8 @@ cp_enqvar(char *word)
if (eq(word, "plots")) {
struct variable *list = NULL;
struct plot *pl;
for (pl = plot_list; pl; pl = pl->pl_next) {
for (pl = plot_list; pl; pl = pl->pl_next)
list = var_alloc_string(NULL, copy(pl->pl_typename), list);
}
return var_alloc_vlist(copy(word), list, NULL);
}
}

3
src/frontend/spiceif.c

@ -974,9 +974,8 @@ parmtovar(IFvalue *pv, IFparm *opt)
case IF_REALVEC: {
struct variable *list = NULL;
int i;
for (i = pv->v.numValue; --i >= 0;) {
for (i = pv->v.numValue; --i >= 0;)
list = var_alloc_real(NULL, pv->v.vec.rVec[i], list);
}
return var_alloc_vlist(copy(opt->description), list, NULL);
/* It is a linked list where the first node is a variable
* pointing to the different values of the variables.

5
src/frontend/variable.c

@ -339,11 +339,10 @@ cp_setparse(wordlist *wl)
}
copyval = ss = cp_unquote(wl->wl_word);
td = ft_numparse(&ss, FALSE);
if (td) {
if (td)
vv = var_alloc_real(NULL, *td, NULL);
} else {
else
vv = var_alloc_string(NULL, copy(ss), NULL);
}
tfree(copyval); /*DG: must free ss any way to avoid cp_unquote memory leak*/
if (listv) {
lv->va_next = vv;

Loading…
Cancel
Save