projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update.
[pspp-builds.git]
/
src
/
sel-if.c
diff --git
a/src/sel-if.c
b/src/sel-if.c
index 514c44711a78bd5df5af762d74054876ab29edfd..1df8ed4a8509af10d11f05628b24454031c8b909 100644
(file)
--- a/
src/sel-if.c
+++ b/
src/sel-if.c
@@
-20,8
+20,9
@@
#include <config.h>
#include "alloc.h"
#include "command.h"
#include <config.h>
#include "alloc.h"
#include "command.h"
+#include "dictionary.h"
#include "error.h"
#include "error.h"
-#include "expr.h"
+#include "expr
essions/public
.h"
#include "lexer.h"
#include "str.h"
#include "var.h"
#include "lexer.h"
#include "str.h"
#include "var.h"
@@
-43,10
+44,7
@@
cmd_select_if (void)
struct expression *e;
struct select_if_trns *t;
struct expression *e;
struct select_if_trns *t;
- lex_match_id ("SELECT");
- lex_match_id ("IF");
-
- e = expr_parse (PXP_BOOLEAN);
+ e = expr_parse (default_dict, EXPR_BOOLEAN);
if (!e)
return CMD_FAILURE;
if (!e)
return CMD_FAILURE;
@@
-68,11
+66,11
@@
cmd_select_if (void)
/* Performs the SELECT IF transformation T on case C. */
static int
/* 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)
{
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. */
}
/* Frees SELECT IF transformation T. */
@@
-86,8
+84,6
@@
select_if_free (struct trns_header * t)
int
cmd_filter (void)
{
int
cmd_filter (void)
{
- lex_match_id ("FILTER");
-
if (lex_match_id ("OFF"))
dict_set_filter (default_dict, NULL);
else
if (lex_match_id ("OFF"))
dict_set_filter (default_dict, NULL);
else
@@
-105,7
+101,7
@@
cmd_filter (void)
return CMD_FAILURE;
}
return CMD_FAILURE;
}
- if (
v->name[0] == '#'
)
+ if (
dict_class_from_id (v->name) == DC_SCRATCH
)
{
msg (SE, _("The filter variable may not be scratch."));
return CMD_FAILURE;
{
msg (SE, _("The filter variable may not be scratch."));
return CMD_FAILURE;
@@
-125,10
+121,7
@@
cmd_process_if (void)
{
struct expression *e;
{
struct expression *e;
- lex_match_id ("PROCESS");
- lex_match_id ("IF");
-
- e = expr_parse (PXP_BOOLEAN);
+ e = expr_parse (default_dict, EXPR_BOOLEAN);
if (!e)
return CMD_FAILURE;
if (!e)
return CMD_FAILURE;