X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Floop.c;h=ebe5ed2257a1f9eaff83b804b8a5b9933296281e;hb=a489451ddf22935fcbe115aa4aa5869b29f18103;hp=b2685cfa201639c87eb86e86fc679902de174363;hpb=97d6c6f6b1922621ca013668eba9a9a9f71d60fe;p=pspp diff --git a/src/loop.c b/src/loop.c index b2685cfa20..ebe5ed2257 100644 --- a/src/loop.c +++ b/src/loop.c @@ -20,7 +20,9 @@ #include #include "error.h" #include "alloc.h" +#include "case.h" #include "command.h" +#include "dictionary.h" #include "do-ifP.h" #include "error.h" #include "expr.h" @@ -259,15 +261,6 @@ internal_cmd_loop (void) add_transformation ((struct trns_header *) one); add_transformation ((struct trns_header *) two); -#if DEBUGGING - printf ("LOOP"); - if (two->flags & LPC_INDEX) - printf ("(INDEX)"); - if (two->flags & LPC_COND) - printf ("(IF)"); - printf ("\n"); -#endif - return 1; } @@ -328,13 +321,6 @@ internal_cmd_end_loop (void) /* Pop off the top of stack. */ ctl_stack = ctl_stack->down; -#if DEBUGGING - printf ("END LOOP"); - if (thr->cond) - printf ("(IF)"); - printf ("\n"); -#endif - return 1; } @@ -360,7 +346,7 @@ loop_1_trns_proc (struct trns_header * trns, struct ccase * c, /* Even if the loop is never entered, force the index variable to assume the initial value. */ - c->data[two->index->fv].f = t1.f; + case_data_rw (c, two->index->fv)->f = t1.f; /* Throw out various pathological cases. */ if (!finite (t1.f) || !finite (t2.f) || !finite (t3.f) || t2.f == 0.0) @@ -428,7 +414,7 @@ loop_2_trns_proc (struct trns_header * trns, struct ccase * c, return two->loop_term; /* Set the current value into the case. */ - c->data[two->index->fv].f = two->curr; + case_data_rw (c, two->index->fv)->f = two->curr; /* Decrement the current value. */ two->curr += two->incr; @@ -441,7 +427,7 @@ loop_2_trns_proc (struct trns_header * trns, struct ccase * c, return two->loop_term; /* Set the current value into the case. */ - c->data[two->index->fv].f = two->curr; + case_data_rw (c, two->index->fv)->f = two->curr; /* Increment the current value. */ two->curr += two->incr;