X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Finpt-pgm.c;h=0cbf66f325569d54b828c98eac639c2124ac029b;hb=d2f8593a1f1d39a3264682af0da898a3d67b68cf;hp=ee2fd7cb1302c0a495a0ef26ed59a00a9e68314f;hpb=74a57f26f1458b28a0fddbb9f46004ac8f4d9c30;p=pspp diff --git a/src/inpt-pgm.c b/src/inpt-pgm.c index ee2fd7cb13..0cbf66f325 100644 --- a/src/inpt-pgm.c +++ b/src/inpt-pgm.c @@ -18,10 +18,11 @@ 02111-1307, USA. */ #include -#include +#include "error.h" #include #include #include "alloc.h" +#include "case.h" #include "command.h" #include "data-list.h" #include "dfm.h" @@ -130,14 +131,14 @@ init_case (const struct input_program_pgm *inp, struct ccase *c) switch (inp->init[i]) { case INP_NUMERIC | INP_INIT_ONCE: - c->data[i].f = 0.0; + case_data_rw (c, i)->f = 0.0; break; case INP_NUMERIC | INP_REINIT: - c->data[i].f = SYSMIS; + case_data_rw (c, i)->f = SYSMIS; break; case INP_STRING | INP_INIT_ONCE: case INP_STRING | INP_REINIT: - memset (c->data[i].s, ' ', sizeof c->data[i].s); + memset (case_data_rw (c, i)->s, ' ', sizeof case_data_rw (c, i)->s); break; default: assert (0); @@ -156,12 +157,12 @@ clear_case (const struct input_program_pgm *inp, struct ccase *c) case INP_NUMERIC | INP_INIT_ONCE: break; case INP_NUMERIC | INP_REINIT: - c->data[i].f = SYSMIS; + case_data_rw (c, i)->f = SYSMIS; break; case INP_STRING | INP_INIT_ONCE: break; case INP_STRING | INP_REINIT: - memset (c->data[i].s, ' ', sizeof c->data[i].s); + memset (case_data_rw (c, i)->s, ' ', sizeof case_data_rw (c, i)->s); break; default: assert (0); @@ -303,6 +304,7 @@ end_case_trns_proc (struct trns_header *t UNUSED, struct ccase * c UNUSED, int case_num UNUSED) { assert (0); + abort (); } /* REREAD transformation. */ @@ -342,7 +344,7 @@ cmd_reread (void) return CMD_FAILURE; } - e = expr_parse (PXP_NUMERIC); + e = expr_parse (EXPR_NUMERIC); if (!e) return CMD_FAILURE; } @@ -382,7 +384,7 @@ reread_trns_proc (struct trns_header * pt, struct ccase * c, struct reread_trns *t = (struct reread_trns *) pt; if (t->column == NULL) - dfm_bkwd_record (t->handle, 1); + dfm_reread_record (t->handle, 1); else { union value column; @@ -392,10 +394,10 @@ reread_trns_proc (struct trns_header * pt, struct ccase * c, { msg (SE, _("REREAD: Column numbers must be positive finite " "numbers. Column set to 1.")); - dfm_bkwd_record (t->handle, 1); + dfm_reread_record (t->handle, 1); } else - dfm_bkwd_record (t->handle, column.f); + dfm_reread_record (t->handle, column.f); } return -1; }