X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcompute.c;h=6556e8becac0041d63303556817f6f203f4fd09d;hb=5156fa5a8323a16f6b4bbc8950221cdc1d0e023d;hp=4cc9a18797b4c8b7eea55c8d57fad1f3ff83e103;hpb=97d6c6f6b1922621ca013668eba9a9a9f71d60fe;p=pspp-builds.git diff --git a/src/compute.c b/src/compute.c index 4cc9a187..6556e8be 100644 --- a/src/compute.c +++ b/src/compute.c @@ -21,7 +21,9 @@ #include "error.h" #include #include "alloc.h" +#include "case.h" #include "command.h" +#include "dictionary.h" #include "error.h" #include "expr.h" #include "lexer.h" @@ -112,7 +114,8 @@ compute_num (struct trns_header *compute_, struct ccase *c, if (compute->test == NULL || expr_evaluate (compute->test, c, case_num, NULL) == 1.0) { - expr_evaluate (compute->rvalue, c, case_num, &c->data[compute->fv]); + expr_evaluate (compute->rvalue, c, case_num, + case_data_rw (c, compute->fv)); } return -1; @@ -149,7 +152,7 @@ compute_num_vec (struct trns_header *compute_, struct ccase *c, return -1; } expr_evaluate (compute->rvalue, c, case_num, - &c->data[compute->vector->var[rindx - 1]->fv]); + case_data_rw (c, compute->vector->var[rindx - 1]->fv)); } return -1; @@ -169,8 +172,8 @@ compute_str (struct trns_header *compute_, struct ccase *c, union value v; expr_evaluate (compute->rvalue, c, case_num, &v); - st_bare_pad_len_copy (c->data[compute->fv].s, &v.c[1], compute->width, - v.c[0]); + st_bare_pad_len_copy (case_data_rw (c, compute->fv)->s, + &v.c[1], compute->width, v.c[0]); } return -1; @@ -216,7 +219,8 @@ compute_str_vec (struct trns_header *compute_, struct ccase *c, expr_evaluate (compute->rvalue, c, case_num, &v); vr = compute->vector->var[rindx - 1]; - st_bare_pad_len_copy (c->data[vr->fv].s, &v.c[1], vr->width, v.c[0]); + st_bare_pad_len_copy (case_data_rw (c, vr->fv)->s, + &v.c[1], vr->width, v.c[0]); } return -1;