X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdo-if.c;h=1acf84936c0b8b96c1bb16501a7b8dc882b2fa0a;hb=d7b5d9144738a5a8989d45a01f4e458a78b68c0b;hp=73fc057c037ac6ad15f383bb3ed432adf7622957;hpb=06f9ee45954e5e71fa7f6262dbf37defa1dbf996;p=pspp diff --git a/src/do-if.c b/src/do-if.c index 73fc057c03..1acf84936c 100644 --- a/src/do-if.c +++ b/src/do-if.c @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include "do-ifP.h" @@ -24,11 +24,14 @@ #include "alloc.h" #include "command.h" #include "error.h" -#include "expr.h" +#include "expressions/public.h" #include "lexer.h" #include "str.h" #include "var.h" +#include "gettext.h" +#define _(msgid) gettext (msgid) + #include "debug-print.h" /* *INDENT-OFF* */ @@ -244,7 +247,7 @@ parse_do_if (void) struct do_if_trns *t; struct expression *e; - e = expr_parse (EXPR_BOOLEAN); + e = expr_parse (default_dict, EXPR_BOOLEAN); if (!e) return NULL; if (token != '.') @@ -276,15 +279,15 @@ do_if_trns_proc (struct trns_header * trns, struct ccase * c, int case_num UNUSED) { struct do_if_trns *t = (struct do_if_trns *) trns; - union value bool; + double boolean; - expr_evaluate (t->cond, c, case_num, &bool); - if (bool.f == 1.0) + boolean = expr_evaluate_num (t->cond, c, case_num); + if (boolean == 1.0) { debug_printf ((_("DO IF %d: true\n"), t->h.index)); return -1; } - else if (bool.f == 0.0) + else if (boolean == 0.0) { debug_printf ((_("DO IF %d: false\n"), t->h.index)); return t->false_jump;