Browse Source

variable rename, unify the source

checked for object file invariance
rlar 14 years ago
parent
commit
26bbb39a68
  1. 28
      src/frontend/com_fft.c
  2. 30
      src/frontend/com_let.c

28
src/frontend/com_fft.c

@ -33,7 +33,7 @@ com_fft(wordlist *wl)
double delta_t, span;
int fpts, i, j, tlen, ngood;
struct dvec *f, *vlist, *lv = NULL, *vec;
struct pnode *names, *first_name;
struct pnode *pn, *names;
#ifdef GREEN
int mm;
@ -155,13 +155,13 @@ com_fft(wordlist *wl)
}
}
names = ft_getpnames(wl, TRUE);
first_name = names;
pn = ft_getpnames(wl, TRUE);
names = pn;
vlist = NULL;
ngood = 0;
while (names) {
vec = ft_evaluate(names);
names = names->pn_next;
while (pn) {
vec = ft_evaluate(pn);
pn = pn->pn_next;
while (vec) {
if (vec->v_length != tlen) {
fprintf(cp_err, "Error: lengths of %s vectors don't match: %d, %d\n",
@ -187,7 +187,7 @@ com_fft(wordlist *wl)
ngood++;
}
}
free_pnode_o(first_name);
free_pnode_o(names);
if (!ngood) {
tfree(win);
return;
@ -288,7 +288,7 @@ com_psd(wordlist *wl)
unsigned long size, ngood, fpts, i, j, tlen, jj, smooth, hsmooth;
char *s;
struct dvec *f, *vlist, *lv = NULL, *vec;
struct pnode *names, *first_name;
struct pnode *pn, *names;
double *reald, *imagd;
int sign, isreal;
@ -425,13 +425,13 @@ com_psd(wordlist *wl)
}
}
names = ft_getpnames(wl, TRUE);
first_name = names;
pn = ft_getpnames(wl, TRUE);
names = pn;
vlist = NULL;
ngood = 0;
while (names) {
vec = ft_evaluate(names);
names = names->pn_next;
while (pn) {
vec = ft_evaluate(pn);
pn = pn->pn_next;
while (vec) {
if (vec->v_length != (int)tlen) {
fprintf(cp_err, "Error: lengths of %s vectors don't match: %d, %lu\n",
@ -457,7 +457,7 @@ com_psd(wordlist *wl)
ngood++;
}
}
free_pnode_o(first_name);
free_pnode_o(names);
if (!ngood)
return;

30
src/frontend/com_let.c

@ -19,7 +19,7 @@ com_let(wordlist *wl)
wordlist fake_wl;
int need_open;
int offset, length;
struct pnode *nn;
struct pnode *names;
struct dvec *n, *t;
int i, cube;
int j, depth;
@ -80,16 +80,16 @@ com_let(wordlist *wl)
/* evaluate expression between s and q */
/* va, indexing */
fake_wl.wl_word = s;
nn = ft_getpnames(&fake_wl, TRUE);
if (!nn) {
names = ft_getpnames(&fake_wl, TRUE);
if (!names) {
/* XXX error message */
tfree(p);
return;
}
t = ft_evaluate(nn);
t = ft_evaluate(names);
if (!t) {
fprintf(cp_err, "Error: Can't evaluate %s\n", s);
free_pnode(nn);
free_pnode(names);
tfree(p);
return;
}
@ -106,10 +106,10 @@ com_let(wordlist *wl)
indices[numdims++] = j;
/* va: garbage collection for t, if pnode nn is no simple value */
if (nn != NULL && nn->pn_value == NULL && t != NULL)
/* va: garbage collection for t, if pnode `names' is no simple value */
if (names != NULL && names->pn_value == NULL && t != NULL)
vec_free(t);
free_pnode(nn); /* frees also t, if pnode nn is simple value */
free_pnode(names); /* frees also t, if pnode `names' is simple value */
for (s = q; *s && isspace(*s); s++)
;
@ -131,16 +131,16 @@ com_let(wordlist *wl)
/* evaluate rhs */
fake_wl.wl_word = rhs;
nn = ft_getpnames(&fake_wl, TRUE);
if (nn == NULL) {
names = ft_getpnames(&fake_wl, TRUE);
if (names == NULL) {
/* XXX error message */
tfree(p);
return;
}
t = ft_evaluate(nn);
t = ft_evaluate(names);
if (!t) {
fprintf(cp_err, "Error: Can't evaluate %s\n", rhs);
free_pnode(nn);
free_pnode(names);
tfree(p);
return;
}
@ -240,9 +240,9 @@ com_let(wordlist *wl)
cp_addkword(CT_VECTOR, n->v_name);
quit:
/* va: garbage collection for t, if pnode nn is no simple value */
if (nn != NULL && nn->pn_value == NULL && t != NULL)
/* va: garbage collection for t, if pnode `names' is no simple value */
if (names != NULL && names->pn_value == NULL && t != NULL)
vec_free(t);
free_pnode(nn); /* frees also t, if pnode nn is simple value */
free_pnode(names); /* frees also t, if pnode `names' is simple value */
tfree(p);
}
Loading…
Cancel
Save