struct variable, #18/18, clean
This commit is contained in:
parent
a6cd5eea45
commit
ac726f0cf4
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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…
Reference in New Issue