Change how checking for missing values works.
[pspp] / src / language / stats / oneway.c
index 2f1f299839c64536afa87d590516168d7bcbf03c..6ad71f14c829fc75a91b63e89854f18d9fc3b179 100644 (file)
@@ -526,7 +526,7 @@ cmd_oneway (struct lexer *lexer, struct dataset *ds)
        }
       else if (lex_match_id (lexer, "CONTRAST"))
        {
-         struct contrasts_node *cl = xzalloc (sizeof *cl);
+         struct contrasts_node *cl = XZALLOC (struct contrasts_node);
 
          struct ll_list *coefficient_list = &cl->coefficient_list;
           lex_match (lexer, T_EQUALS);
@@ -709,8 +709,8 @@ run_oneway (const struct oneway_spec *cmd,
   struct oneway_workspace ws;
 
   ws.actual_number_of_groups = 0;
-  ws.vws = xzalloc (cmd->n_vars * sizeof (*ws.vws));
-  ws.dd_total = xmalloc (sizeof (struct descriptive_data) * cmd->n_vars);
+  ws.vws = xcalloc (cmd->n_vars, sizeof (*ws.vws));
+  ws.dd_total = XCALLOC (cmd->n_vars, struct descriptive_data*);
 
   for (v = 0 ; v < cmd->n_vars; ++v)
     ws.dd_total[v] = dd_create (cmd->vars[v]);
@@ -772,7 +772,7 @@ run_oneway (const struct oneway_spec *cmd,
 
          if (MISS_ANALYSIS == cmd->missing_type)
            {
-             if (var_is_value_missing (v, val, cmd->exclude))
+             if (var_is_value_missing (v, val) & cmd->exclude)
                continue;
            }
 
@@ -795,7 +795,7 @@ run_oneway (const struct oneway_spec *cmd,
 
          if (MISS_ANALYSIS == cmd->missing_type)
            {
-             if (var_is_value_missing (v, val, cmd->exclude))
+             if (var_is_value_missing (v, val) & cmd->exclude)
                continue;
            }
 
@@ -819,7 +819,7 @@ run_oneway (const struct oneway_spec *cmd,
 
          if (MISS_ANALYSIS == cmd->missing_type)
            {
-             if (var_is_value_missing (v, val, cmd->exclude))
+             if (var_is_value_missing (v, val) & cmd->exclude)
                continue;
            }