Change how checking for missing values works.
[pspp] / src / language / stats / examine.c
index 1b668c2b778a5ec49e40e59d85819f097f0aa93d..ad8a4126ffa4bef1f9ac70c8ff393e1d41556cad 100644 (file)
@@ -71,7 +71,7 @@ static void
 append_value_name (const struct variable *var, const union value *val, struct string *str)
 {
   var_append_value_name (var, val, str);
-  if (var_is_value_missing (var, val, MV_ANY))
+  if (var_is_value_missing (var, val))
     ds_put_cstr (str, _(" (missing)"));
 }
 
@@ -551,7 +551,7 @@ new_value_with_missing_footnote (const struct variable *var,
                                  struct pivot_footnote *missing_footnote)
 {
   struct pivot_value *pv = pivot_value_new_var_value (var, value);
-  if (var_is_value_missing (var, value, MV_USER))
+  if (var_is_value_missing (var, value) == MV_USER)
     pivot_value_add_footnote (pv, missing_footnote);
   return pv;
 }
@@ -1053,7 +1053,8 @@ update_n (const void *aux1, void *aux2 UNUSED, void *user_data,
        {
          const struct variable *var = examine->dep_vars[v];
 
-         if (var_is_value_missing (var, case_data (c, var), examine->dep_excl))
+         if (var_is_value_missing (var, case_data (c, var))
+              & examine->dep_excl)
            {
              es[v].missing += weight;
              this_case_is_missing = true;
@@ -1070,7 +1071,7 @@ update_n (const void *aux1, void *aux2 UNUSED, void *user_data,
       const struct variable *var = examine->dep_vars[v];
       const double x = case_num (c, var);
 
-      if (var_is_value_missing (var, case_data (c, var), examine->dep_excl))
+      if (var_is_value_missing (var, case_data (c, var)) & examine->dep_excl)
         {
           es[v].missing += weight;
           continue;
@@ -1134,7 +1135,7 @@ calculate_n (const void *aux1, void *aux2 UNUSED, void *user_data)
       es[v].sorted_reader = casewriter_make_reader (es[v].sorted_writer);
       es[v].sorted_writer = NULL;
 
-      imax = casereader_get_case_cnt (es[v].sorted_reader);
+      imax = casereader_get_n_cases (es[v].sorted_reader);
 
       es[v].maxima = pool_calloc (examine->pool, examine->calc_extremes, sizeof (*es[v].maxima));
       es[v].minima = pool_calloc (examine->pool, examine->calc_extremes, sizeof (*es[v].minima));
@@ -1371,7 +1372,7 @@ run_examine (struct examine *cmd, struct casereader *input)
     {
       struct ccase *c = casereader_peek (input,  0);
 
-      cmd->id_idx = case_get_value_cnt (c);
+      cmd->id_idx = case_get_n_values (c);
       input = casereader_create_arithmetic_sequence (input, 1.0, 1.0);
 
       case_unref (c);
@@ -1660,7 +1661,7 @@ cmd_examine (struct lexer *lexer, struct dataset *ds)
                 }
               else if (lex_match_id (lexer, "REPORT"))
                 {
-                  examine.fctr_excl = MV_NEVER;
+                  examine.fctr_excl = 0;
                 }
               else if (lex_match_id (lexer, "NOREPORT"))
                 {