X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsel-if.c;h=1df8ed4a8509af10d11f05628b24454031c8b909;hb=a1887dd91b27990bba31adb888a4273379a4bf8c;hp=6f6f2d0279269083acb9e072e6648d9c9bf73285;hpb=97d6c6f6b1922621ca013668eba9a9a9f71d60fe;p=pspp-builds.git diff --git a/src/sel-if.c b/src/sel-if.c index 6f6f2d02..1df8ed4a 100644 --- a/src/sel-if.c +++ b/src/sel-if.c @@ -20,8 +20,9 @@ #include #include "alloc.h" #include "command.h" +#include "dictionary.h" #include "error.h" -#include "expr.h" +#include "expressions/public.h" #include "lexer.h" #include "str.h" #include "var.h" @@ -43,7 +44,7 @@ cmd_select_if (void) struct expression *e; struct select_if_trns *t; - e = expr_parse (EXPR_BOOLEAN); + e = expr_parse (default_dict, EXPR_BOOLEAN); if (!e) return CMD_FAILURE; @@ -65,11 +66,11 @@ cmd_select_if (void) /* Performs the SELECT IF transformation T on case C. */ static int -select_if_proc (struct trns_header * t, struct ccase * c, +select_if_proc (struct trns_header *t_, struct ccase *c, int case_num) { - return (expr_evaluate (((struct select_if_trns *) t)->e, c, - case_num, NULL) == 1.0) - 2; + struct select_if_trns *t = (struct select_if_trns *) t_; + return expr_evaluate_num (t->e, c, case_num) == 1.0 ? -1 : -2; } /* Frees SELECT IF transformation T. */ @@ -120,7 +121,7 @@ cmd_process_if (void) { struct expression *e; - e = expr_parse (EXPR_BOOLEAN); + e = expr_parse (default_dict, EXPR_BOOLEAN); if (!e) return CMD_FAILURE;