/[pspp]/pspp/src/sel-if.c
ViewVC logotype

Diff of /pspp/src/sel-if.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by blp, Mon Nov 15 09:51:22 2004 UTC revision 1.8 by blp, Tue Mar 1 08:16:16 2005 UTC
# Line 22  Line 22 
22  #include "command.h"  #include "command.h"
23  #include "dictionary.h"  #include "dictionary.h"
24  #include "error.h"  #include "error.h"
25  #include "expr.h"  #include "expressions/public.h"
26  #include "lexer.h"  #include "lexer.h"
27  #include "str.h"  #include "str.h"
28  #include "var.h"  #include "var.h"
# Line 44  cmd_select_if (void) Line 44  cmd_select_if (void)
44    struct expression *e;    struct expression *e;
45    struct select_if_trns *t;    struct select_if_trns *t;
46    
47    e = expr_parse (EXPR_BOOLEAN);    e = expr_parse (default_dict, EXPR_BOOLEAN);
48    if (!e)    if (!e)
49      return CMD_FAILURE;      return CMD_FAILURE;
50    
# Line 66  cmd_select_if (void) Line 66  cmd_select_if (void)
66    
67  /* Performs the SELECT IF transformation T on case C. */  /* Performs the SELECT IF transformation T on case C. */
68  static int  static int
69  select_if_proc (struct trns_header * t, struct ccase * c,  select_if_proc (struct trns_header *t_, struct ccase *c,
70                  int case_num)                  int case_num)
71  {  {
72    return (expr_evaluate (((struct select_if_trns *) t)->e, c,    struct select_if_trns *t = (struct select_if_trns *) t_;
73                           case_num, NULL) == 1.0) - 2;    return expr_evaluate_num (t->e, c, case_num) == 1.0 ? -1 : -2;
74  }  }
75    
76  /* Frees SELECT IF transformation T. */  /* Frees SELECT IF transformation T. */
# Line 121  cmd_process_if (void) Line 121  cmd_process_if (void)
121  {  {
122    struct expression *e;    struct expression *e;
123    
124    e = expr_parse (EXPR_BOOLEAN);    e = expr_parse (default_dict, EXPR_BOOLEAN);
125    if (!e)    if (!e)
126      return CMD_FAILURE;      return CMD_FAILURE;
127    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26