frontend/interp.c, cleanup `lincopy()'

and set v_plot before the vec_new() invocation
This commit is contained in:
rlar 2016-05-29 11:05:30 +02:00
parent 5972de0bb1
commit 8617ee754d
3 changed files with 8 additions and 4 deletions

View File

@ -15,8 +15,11 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
void
lincopy(struct dvec *ov, double *newscale, int newlen, struct dvec *oldscale)
lincopy(struct plot *new, struct dvec *ov, struct dvec *oldscale)
{
int newlen = new->pl_scale->v_length;
double *newscale = new->pl_scale->v_realdata;
struct dvec *v;
double *nd;
@ -43,6 +46,7 @@ lincopy(struct dvec *ov, double *newscale, int newlen, struct dvec *oldscale)
return;
}
v->v_plot = new;
vec_new(v);
}

View File

@ -6,7 +6,7 @@
#ifndef ngspice_INTERP_H
#define ngspice_INTERP_H
void lincopy(struct dvec *ov, double *newscale, int newlen, struct dvec *oldscale);
void lincopy(struct plot *new, struct dvec *ov, struct dvec *oldscale);
#endif

View File

@ -81,14 +81,14 @@ com_linearize(wordlist *wl)
wl = wl->wl_next;
continue;
}
lincopy(v, newtime->v_realdata, len, oldtime);
lincopy(new, v, oldtime);
wl = wl->wl_next;
}
} else {
for (v = old->pl_dvecs; v; v = v->v_next) {
if (v == old->pl_scale)
continue;
lincopy(v, newtime->v_realdata, len, oldtime);
lincopy(new, v, oldtime);
}
}
}