Change how checking for missing values works.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 30 Dec 2021 21:58:12 +0000 (13:58 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 30 Dec 2021 22:08:48 +0000 (14:08 -0800)
It's more flexible to have the functions that check for missing values
return what kind of missing value was found (or 0 if none), than to have
to pass in the kind of missing values to check for.

44 files changed:
perl-module/PSPP.xs
src/data/casereader-filter.c
src/data/csv-file-writer.c
src/data/dataset.c
src/data/mdd-writer.c
src/data/missing-values.c
src/data/missing-values.h
src/data/variable.c
src/data/variable.h
src/language/data-io/combine-files.c
src/language/dictionary/sys-file-info.c
src/language/expressions/operations.def
src/language/stats/aggregate.c
src/language/stats/autorecode.c
src/language/stats/binomial.c
src/language/stats/cochran.c
src/language/stats/crosstabs.c
src/language/stats/descriptives.c
src/language/stats/examine.c
src/language/stats/frequencies.c
src/language/stats/graph.c
src/language/stats/ks-one-sample.c
src/language/stats/logistic.c
src/language/stats/matrix.c
src/language/stats/mcnemar.c
src/language/stats/means.c
src/language/stats/median.c
src/language/stats/oneway.c
src/language/stats/quick-cluster.c
src/language/stats/roc.c
src/language/stats/runs.c
src/language/stats/sign.c
src/language/stats/t-test-indep.c
src/language/stats/t-test-one-sample.c
src/language/stats/t-test-paired.c
src/language/xforms/count.c
src/language/xforms/recode.c
src/math/covariance.c
src/math/interaction.c
src/output/charts/piechart.c
src/output/charts/scatterplot-cairo.c
src/ui/gui/psppire-data-store.c
src/ui/gui/psppire-dialog-action-indep-samps.c
src/ui/gui/psppire-dialog-action-roc.c

index 0b7dce1ddf04e4e553b26c248ac1b97c7992ce3e..077bf581f0031cfe27332efbbf54c2dbec6e04a3 100644 (file)
@@ -149,7 +149,7 @@ value_to_scalar (const union value *val, const struct variable *var)
 {
   if ( var_is_numeric (var))
     {
-      if ( var_is_value_missing (var, val, MV_SYSTEM))
+      if (var_is_value_missing (var, val) == MV_SYSTEM)
        return newSVpvn ("", 0);
 
       return newSVnv (val->f);
@@ -240,7 +240,7 @@ CODE:
  union value uv;
  int ret;
  make_value_from_scalar (&uv, val, var);
- ret = var_is_value_missing (var, &uv, MV_ANY);
+ ret = var_is_value_missing (var, &uv) != 0;
  value_destroy (&uv, var_get_width (var));
  RETVAL = ret;
  OUTPUT:
index 08151fadd2a5475115f0a1523252399f425b3f68..f4ad7e625a3e7ea79dfc91c4e93864eac78394d1 100644 (file)
@@ -212,7 +212,7 @@ casereader_filter_weight_include (const struct ccase *c, void *cfw_)
 {
   struct casereader_filter_weight *cfw = cfw_;
   double value = case_num (c, cfw->weight_var);
-  if (value >= 0.0 && !var_is_num_missing (cfw->weight_var, value, MV_ANY))
+  if (value >= 0.0 && !var_is_num_missing (cfw->weight_var, value))
     return true;
   else
     {
@@ -278,7 +278,7 @@ casereader_create_filter_missing (struct casereader *reader,
                                  casenumber *n_missing,
                                   struct casewriter *exclude)
 {
-  if (n_vars > 0 && class != MV_NEVER)
+  if (n_vars > 0 && class)
     {
       struct casereader_filter_missing *cfm = xmalloc (sizeof *cfm);
       cfm->vars = xmemdup (vars, sizeof *vars * n_vars);
@@ -308,7 +308,7 @@ casereader_filter_missing_include (const struct ccase *c, void *cfm_)
     {
       struct variable *var = cfm->vars[i];
       const union value *value = case_data (c, var);
-      if (var_is_value_missing (var, value, cfm->class))
+      if (var_is_value_missing (var, value) & cfm->class)
        {
          if (cfm->n_missing)
            (*cfm->n_missing)++;
index 77224945bc9959aca8b18b2a64046bcd3f2031c6..c00a2cffed4df0a5a91e87b21f05ed8780d07fbe 100644 (file)
@@ -368,7 +368,7 @@ static void
 csv_write_var (struct csv_writer *w, const struct csv_var *cv,
                const union value *value)
 {
-  if (mv_is_value_missing (&cv->missing, value, MV_USER))
+  if (mv_is_value_missing (&cv->missing, value) == MV_USER)
     {
       union value missing;
 
index e11f173948cc0ec1293ffa5f6800a8702e69e074..cbff74088b62d470c924d27e9e5f3c6f6a9dceff 100644 (file)
@@ -910,7 +910,7 @@ filter_trns_proc (void *filter_var_,
 {
   struct variable *filter_var = filter_var_;
   double f = case_num (*c, filter_var);
-  return (f != 0.0 && !var_is_num_missing (filter_var, f, MV_ANY)
+  return (f != 0.0 && !var_is_num_missing (filter_var, f)
           ? TRNS_CONTINUE : TRNS_DROP_CASE);
 }
 
index 3fd651eb01afb2aafbdadf1754e9a1edc8a9f0f7..b025e693b4625c572ac08beda09d691206ade99c 100644 (file)
@@ -405,10 +405,9 @@ write_variable_section (xmlTextWriter *writer, const struct variable *var, int i
 
              XXX only checking "user" here because not sure of correct other
              cases. */
-          if (var_is_value_missing (var, value, MV_USER))
-            write_attr (writer, "missing", "user");
-          else if (var_is_value_missing (var, value, MV_SYSTEM))
-            write_attr (writer, "missing", "system");
+          enum mv_class miss = var_is_value_missing (var, value);
+          if (miss)
+            write_attr (writer, "missing", miss == MV_USER ? "user" : "system");
 
           /* <properties/> */
           xmlTextWriterStartElement (writer, _xml ("properties"));
index 267d34fb9102247bec8d5e02d139640297935716..44d0bf9ee67315148224715f3ae4f083019c3636 100644 (file)
@@ -439,67 +439,63 @@ is_str_user_missing (const struct missing_values *mv, const uint8_t s[])
   NOT_REACHED ();
 }
 
-/* Returns true if V is a missing value in the given CLASS in MV,
-   false otherwise. */
-bool
-mv_is_value_missing (const struct missing_values *mv, const union value *v,
-                     enum mv_class class)
+/* Returns MV_USER if V is a user-missing value in MV, MV_SYSTEM if V is
+   system-missing (and MV is numeric), or 0 if V is not missing. */
+enum mv_class
+mv_is_value_missing (const struct missing_values *mv, const union value *v)
 {
   return (mv->width == 0
-          ? mv_is_num_missing (mv, v->f, class)
-          : mv_is_str_missing (mv, v->s, class));
+          ? mv_is_num_missing (mv, v->f)
+          : mv_is_str_missing (mv, v->s));
 }
 
-/* Returns true if D is a missing value in the given CLASS in MV,
-   false otherwise.
-   MV must be a set of numeric missing values. */
-bool
-mv_is_num_missing (const struct missing_values *mv, double d,
-                   enum mv_class class)
+/* Returns MV_USER if V is a user-missing value in MV, MV_SYSTEM if V is
+   system-missing, or 0 if V is not missing.  MV must be a set of numeric
+   missing values. */
+enum mv_class
+mv_is_num_missing (const struct missing_values *mv, double d)
 {
   assert (mv->width == 0);
-  return ((class & MV_SYSTEM && d == SYSMIS)
-          || (class & MV_USER && is_num_user_missing (mv, d)));
+  return (d == SYSMIS ? MV_SYSTEM
+          : is_num_user_missing (mv, d) ? MV_USER
+          : 0);
 }
 
-/* Returns true if S[] is a missing value in the given CLASS in
-   MV, false otherwise.
-   MV must be a set of string missing values.
-   S[] must contain exactly as many characters as MV's width. */
-bool
-mv_is_str_missing (const struct missing_values *mv, const uint8_t s[],
-                   enum mv_class class)
+/* Returns MV_USER if S[] is a user-missing value in MV, or 0 if V is not
+   missing.  MV must be a set of string missing values.  S[] must contain
+   exactly as many characters as MV's width. */
+enum mv_class
+mv_is_str_missing (const struct missing_values *mv, const uint8_t s[])
 {
   assert (mv->width > 0);
-  return class & MV_USER && is_str_user_missing (mv, s);
+  return is_str_user_missing (mv, s) ? MV_USER : 0;
 }
 
-/* Like mv_is_value_missing(), this tests whether V is a missing value
-   in the given CLASS in MV.  It supports the uncommon case where V
-   and MV might have different widths: the caller must specify VW, the
-   width of V.  MV and VW must be both numeric or both string.
+/* Like mv_is_value_missing(), this tests whether V is a missing value in MV.
+   It supports the uncommon case where V and MV might have different widths:
+   the caller must specify VW, the width of V.  MV and VW must be both numeric
+   or both string.
 
-   Comparison of strings of different width is done by conceptually
-   extending both strings to infinite width by appending spaces. */
-bool
+   Comparison of strings of different width is done by conceptually extending
+   both strings to infinite width by appending spaces. */
+enum mv_class
 mv_is_value_missing_varwidth (const struct missing_values *mv,
-                              const union value *v, int vw,
-                              enum mv_class class)
+                              const union value *v, int vw)
 {
   int mvw = mv->width;
   if (mvw == vw)
-    return mv_is_value_missing (mv, v, class);
+    return mv_is_value_missing (mv, v);
 
   /* Make sure they're both strings. */
   assert (mvw && vw);
-  if (!(class & MV_USER) || mv->type == MVT_NONE)
+  if (mv->type == MVT_NONE)
     return false;
 
   for (int i = 0; i < mv->type; i++)
     if (!buf_compare_rpad (CHAR_CAST_BUG (const char *, mv->values[i].s), mvw,
                            CHAR_CAST_BUG (const char *, v->s), vw))
-      return true;
-  return false;
+      return MV_USER;
+  return 0;
 }
 
 char *
index 9d9a884d08a798e57473061016e38be35a2d112b..8123beeda158cb8a5ab0d0b6a009155843cdd5ca 100644 (file)
@@ -51,24 +51,26 @@ struct missing_values
     union value values[3];      /* Missing values.  [1], [2] are the range. */
   };
 
-/* Classes of missing values. */
+/* Classes of missing values.
+
+   These are useful as individual values and as masks, and they are used both
+   ways. */
 enum mv_class
   {
-    MV_NEVER = 0,               /* Never considered missing. */
-    MV_USER = 1,                /* Missing if value is user-missing. */
-    MV_SYSTEM = 2,              /* Missing if value is system-missing. */
-    MV_ANY = MV_USER | MV_SYSTEM /* Missing if it is user or system-missing. */
+    MV_USER = 1,                /* User-missing. */
+    MV_SYSTEM = 2               /* System-missing. */
+#define MV_ANY (MV_USER | MV_SYSTEM)
   };
 
 /* Is a value missing? */
-bool mv_is_value_missing (const struct missing_values *, const union value *,
-                          enum mv_class);
-bool mv_is_num_missing (const struct missing_values *, double, enum mv_class);
-bool mv_is_str_missing (const struct missing_values *, const uint8_t[],
-                        enum mv_class);
-bool mv_is_value_missing_varwidth (const struct missing_values *,
-                                   const union value *, int value_width,
-                                   enum mv_class);
+enum mv_class mv_is_value_missing (const struct missing_values *,
+                                   const union value *);
+enum mv_class mv_is_num_missing (const struct missing_values *, double);
+enum mv_class mv_is_str_missing (const struct missing_values *,
+                                 const uint8_t[]);
+enum mv_class mv_is_value_missing_varwidth (const struct missing_values *,
+                                            const union value *,
+                                            int value_width);
 
 /* Initializing missing value sets. */
 void mv_init (struct missing_values *, int width);
index 5115d4a6e4b44fb4fb6371c4f13b2772759a1a68..8acac77fb2072a937207f627d92b4b1fd584c4c6 100644 (file)
@@ -439,32 +439,28 @@ var_has_missing_values (const struct variable *v)
   return !mv_is_empty (&v->miss);
 }
 
-/* Returns true if VALUE is in the given CLASS of missing values
-   in V, false otherwise. */
-bool
-var_is_value_missing (const struct variable *v, const union value *value,
-                      enum mv_class class)
+/* Returns MV_SYSTEM if VALUE is system-missing, MV_USER if VALUE is
+   user-missing for V, and otherwise 0. */
+enum mv_class
+var_is_value_missing (const struct variable *v, const union value *value)
 {
-  return mv_is_value_missing (&v->miss, value, class);
+  return mv_is_value_missing (&v->miss, value);
 }
 
-/* Returns true if D is in the given CLASS of missing values in
-   V, false otherwise.
-   V must be a numeric variable. */
-bool
-var_is_num_missing (const struct variable *v, double d, enum mv_class class)
+/* Returns MV_SYSTEM if VALUE is system-missing, MV_USER if VALUE is
+   user-missing for V, and otherwise 0.  V must be a numeric variable. */
+enum mv_class
+var_is_num_missing (const struct variable *v, double d)
 {
-  return mv_is_num_missing (&v->miss, d, class);
+  return mv_is_num_missing (&v->miss, d);
 }
 
-/* Returns true if S[] is a missing value for V, false otherwise.
-   S[] must contain exactly as many characters as V's width.
-   V must be a string variable. */
-bool
-var_is_str_missing (const struct variable *v, const uint8_t s[],
-                    enum mv_class class)
+/* Returns MV_USER if VALUE is user-missing for V and otherwise 0.  V must be
+   a string variable. */
+enum mv_class
+var_is_str_missing (const struct variable *v, const uint8_t s[])
 {
-  return mv_is_str_missing (&v->miss, s, class);
+  return mv_is_str_missing (&v->miss, s);
 }
 \f
 /* Returns variable V's value labels,
@@ -1330,7 +1326,7 @@ var_clear_vardict (struct variable *v)
 double
 var_force_valid_weight (const struct variable *wv, double w, bool *warn_on_invalid)
 {
-  if (w < 0.0 || (wv && var_is_num_missing (wv, w, MV_ANY)))
+  if (w < 0.0 || (wv && var_is_num_missing (wv, w)))
     w = 0.0;
 
   if (w == 0.0 && warn_on_invalid != NULL && *warn_on_invalid)
index d5056f316511acc98b836e925c5b271358bb31a5..2fa68667869d23c2f479c46b51d4b2b1e6954693 100644 (file)
@@ -85,10 +85,9 @@ void var_set_missing_values (struct variable *, const struct missing_values *);
 void var_clear_missing_values (struct variable *);
 bool var_has_missing_values (const struct variable *);
 
-bool var_is_value_missing (const struct variable *, const union value *,
-                           enum mv_class);
-bool var_is_num_missing (const struct variable *, double, enum mv_class);
-bool var_is_str_missing (const struct variable *, const uint8_t[], enum mv_class);
+enum mv_class var_is_value_missing (const struct variable *, const union value *);
+enum mv_class var_is_num_missing (const struct variable *, double);
+enum mv_class var_is_str_missing (const struct variable *, const uint8_t[]);
 
 /* Value labels. */
 const char *var_lookup_value_label (const struct variable *,
index 490a984a7dc98370b346a237314de63dd147dac0..8322f5c03307f7e82597bcc5975a90621c0c7186 100644 (file)
@@ -873,7 +873,7 @@ apply_nonmissing_case (const struct comb_file *file, struct ccase *output)
         = case_data_idx (file->data, src_field->case_index);
       int width = src_field->width;
 
-      if (!mv_is_value_missing (file->mv[i], src_value, MV_ANY)
+      if (!mv_is_value_missing (file->mv[i], src_value)
           && !(width > 0 && value_is_spaces (src_value, width)))
         value_copy (case_data_rw_idx (output, dst_field->case_index),
                     src_value, width);
index e871dfd59bf0a23f2513d64195db6256e2ec664d..3ab4c040991d74c126d74501ac799ae6853ef829 100644 (file)
@@ -596,7 +596,7 @@ display_value_labels (const struct variable **vars, size_t n_vars)
             value->numeric.show = SETTINGS_VALUE_SHOW_VALUE;
           else
             value->string.show = SETTINGS_VALUE_SHOW_VALUE;
-          if (var_is_value_missing (vars[i], &vl->value, MV_USER))
+          if (var_is_value_missing (vars[i], &vl->value) == MV_USER)
             pivot_value_add_footnote (value, missing_footnote);
           int row = pivot_category_create_leaf (group, value);
 
index d3a31a746011e5fb3b22574ee1a9d3daea9736cb..4f1e515026f7a54cd62bbf08fa7471dad481f009 100644 (file)
@@ -1186,7 +1186,7 @@ absorb_miss no_opt operator VEC_ELEM_NUM (idx)
   if (var)
     {
       double d = case_num (c, var);
-      if (!var_is_num_missing (var, d, MV_USER))
+      if (var_is_num_missing (var, d) != MV_USER)
         return d;
     }
   return SYSMIS;
@@ -1227,7 +1227,7 @@ no_opt operator NUM_VAR ()
      num_var v;
 {
   double d = case_num (c, v);
-  return !var_is_num_missing (v, d, MV_USER) ? d : SYSMIS;
+  return var_is_num_missing (v, d) ? SYSMIS : d;
 }
 
 no_opt string operator STR_VAR ()
@@ -1247,7 +1247,7 @@ no_opt perm_only function LAG (num_var v, pos_int n_before)
   if (c != NULL)
     {
       double x = case_num (c, v);
-      return !var_is_num_missing (v, x, MV_USER) ? x : SYSMIS;
+      return var_is_num_missing (v, x) ? SYSMIS : x;
     }
   else
     return SYSMIS;
@@ -1260,7 +1260,7 @@ no_opt perm_only function LAG (num_var v)
   if (c != NULL)
     {
       double x = case_num (c, v);
-      return !var_is_num_missing (v, x, MV_USER) ? x : SYSMIS;
+      return var_is_num_missing (v, x) ? SYSMIS : x;
     }
   else
     return SYSMIS;
index 9815f1e25adb1062dacd2c0e1220087abf245762..721dba73d3e7ad598a1c7f0839ff2c046b5fc1ab 100644 (file)
@@ -754,7 +754,7 @@ accumulate_aggregate_info (struct agr_proc *agr, const struct ccase *input)
        const union value *v = case_data (input, iter->src);
         int src_width = var_get_width (iter->src);
 
-        if (var_is_value_missing (iter->src, v, iter->exclude))
+        if (var_is_value_missing (iter->src, v) & iter->exclude)
          {
            switch (iter->function)
              {
index 2d569a0436eed60105da88150650cc1ae23e9811..499f149d22a14c4003f2d2ae1a9a42d368202798 100644 (file)
@@ -311,8 +311,8 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds)
         struct arc_item *item = xmalloc (sizeof *item);
         item->width = width;
         value_clone (&item->from, value, width);
-        item->missing = mv_is_value_missing_varwidth (&spec->mv, value, spec->width,
-                                                      MV_ANY);
+        item->missing = mv_is_value_missing_varwidth (&spec->mv, value,
+                                                      spec->width);
         item->value_label = ds_steal_cstr (&value_label);
         hmap_insert (&spec->items->ht, &item->hmap_node, hash);
 
index e799d16884a55d44c5c6f48ea2b6a4171211d41c..f2ae51513eb7c4366c993d0875eb87fa10eef936 100644 (file)
@@ -108,7 +108,7 @@ do_binomial (const struct dictionary *dict,
          const struct variable *var = ost->vars[v];
          double value = case_num (c, var);
 
-         if (var_is_num_missing (var, value, exclude))
+         if (var_is_num_missing (var, value) & exclude)
            continue;
 
          if (bst->cutpoint != SYSMIS)
index 935d612b5e94e7e7d18b9572ce7a2814fb09c1f0..9b03296f19a730e0d45b0c86754302d4a25894de 100644 (file)
@@ -86,7 +86,7 @@ cochran_execute (const struct dataset *ds,
          const struct variable *var = ct->vars[v];
          const union value *val = case_data (c, var);
 
-         if (var_is_value_missing (var, val, exclude))
+         if (var_is_value_missing (var, val) & exclude)
            continue;
 
          if (ch.success == SYSMIS)
index 465bdcc278fcab0d806164bad81ad91a23dd12bd..9e77c666a5c19dc9a3c3fb9ac43f72059b2a83fe 100644 (file)
@@ -321,7 +321,7 @@ cmd_crosstabs (struct lexer *lexer, struct dataset *ds)
           else if (lex_match_id (lexer, "INCLUDE"))
             proc.exclude = MV_SYSTEM;
           else if (lex_match_id (lexer, "REPORT"))
-            proc.exclude = MV_NEVER;
+            proc.exclude = 0;
           else
             {
               lex_error (lexer, NULL);
@@ -470,7 +470,7 @@ cmd_crosstabs (struct lexer *lexer, struct dataset *ds)
   assert (proc.n_cells < CRS_N_CELLS);
 
   /* Missing values. */
-  if (proc.mode == GENERAL && proc.exclude == MV_NEVER)
+  if (proc.mode == GENERAL && !proc.exclude)
     {
       msg (SE, _("Missing mode %s not allowed in general mode.  "
                 "Assuming %s."), "REPORT", "MISSING=TABLE");
@@ -745,7 +745,7 @@ should_tabulate_case (const struct crosstabulation *xt, const struct ccase *c,
       const struct variable *var = xt->vars[j].var;
       const struct var_range *range = get_var_range (xt->proc, var);
 
-      if (var_is_value_missing (var, case_data (c, var), exclude))
+      if (var_is_value_missing (var, case_data (c, var)) & exclude)
         return false;
 
       if (range != NULL)
@@ -1191,7 +1191,7 @@ output_crosstabulation (struct crosstabs_proc *proc, struct crosstabulation *xt)
       if (table)
         display_crosstabulation (proc, &x, table, crs_leaves);
 
-      if (proc->exclude == MV_NEVER)
+      if (proc->exclude == 0)
        delete_missing (&x);
 
       if (chisq)
@@ -1335,7 +1335,7 @@ add_var_dimension (struct pivot_table *table, const struct xtab_var *var,
     {
       struct pivot_value *value = pivot_value_new_var_value (
         var->var, &var->values[j]);
-      if (var_is_value_missing (var->var, &var->values[j], MV_ANY))
+      if (var_is_value_missing (var->var, &var->values[j]))
         pivot_value_add_footnote (value, missing_footnote);
       pivot_category_create_leaf (group, value);
     }
@@ -1562,7 +1562,7 @@ delete_missing (struct crosstabulation *xt)
 
   for (r = 0; r < n_rows; r++)
     if (var_is_num_missing (xt->vars[ROW_VAR].var,
-                            xt->vars[ROW_VAR].values[r].f, MV_USER))
+                            xt->vars[ROW_VAR].values[r].f) == MV_USER)
       {
         for (c = 0; c < n_cols; c++)
           xt->mat[c + r * n_cols] = 0.;
@@ -1572,7 +1572,7 @@ delete_missing (struct crosstabulation *xt)
 
   for (c = 0; c < n_cols; c++)
     if (var_is_num_missing (xt->vars[COL_VAR].var,
-                            xt->vars[COL_VAR].values[c].f, MV_USER))
+                            xt->vars[COL_VAR].values[c].f) == MV_USER)
       {
         for (r = 0; r < n_rows; r++)
           xt->mat[c + r * n_cols] = 0.;
index 95c57740b2a25110c2d3ed3084b77634a692eda0..fdb454c2600af97bbffdb0a609d698d20885776c 100644 (file)
@@ -628,7 +628,7 @@ descriptives_trns_proc (void *trns_, struct ccase **c,
   if (t->filter)
     {
       double f = case_num (*c, t->filter);
-      if (f == 0.0 || var_is_num_missing (t->filter, f, MV_ANY))
+      if (f == 0.0 || var_is_num_missing (t->filter, f))
         {
           descriptives_set_all_sysmis_zscores (t, *c);
           return TRNS_CONTINUE;
@@ -673,7 +673,7 @@ descriptives_trns_proc (void *trns_, struct ccase **c,
       for (vars = t->vars; vars < t->vars + t->n_vars; vars++)
        {
          double score = case_num (*c, *vars);
-         if (var_is_num_missing (*vars, score, t->exclude))
+         if (var_is_num_missing (*vars, score) & t->exclude)
            {
               descriptives_set_all_sysmis_zscores (t, *c);
              return TRNS_CONTINUE;
@@ -687,7 +687,7 @@ descriptives_trns_proc (void *trns_, struct ccase **c,
       double *output = case_num_rw (*c, z->z_var);
 
       if (z->mean == SYSMIS || z->std_dev == SYSMIS
-          || var_is_num_missing (z->src_var, input, t->exclude))
+          || var_is_num_missing (z->src_var, input) & t->exclude)
        *output = SYSMIS;
       else
        *output = (input - z->mean) / z->std_dev;
@@ -829,7 +829,7 @@ calc_descriptives (struct dsc_proc *dsc, struct casereader *group,
       if (filter)
         {
           double f = case_num (c, filter);
-          if (f == 0.0 || var_is_num_missing (filter, f, MV_ANY))
+          if (f == 0.0 || var_is_num_missing (filter, f))
             continue;
         }
 
@@ -847,7 +847,7 @@ calc_descriptives (struct dsc_proc *dsc, struct casereader *group,
           struct dsc_var *dv = &dsc->vars[i];
           double x = case_num (c, dv->v);
 
-          if (var_is_num_missing (dv->v, x, dsc->exclude))
+          if (var_is_num_missing (dv->v, x) & dsc->exclude)
             {
               dv->missing += weight;
               continue;
@@ -880,7 +880,7 @@ calc_descriptives (struct dsc_proc *dsc, struct casereader *group,
           if (filter)
             {
               double f = case_num (c, filter);
-              if (f == 0.0 || var_is_num_missing (filter, f, MV_ANY))
+              if (f == 0.0 || var_is_num_missing (filter, f))
                 continue;
             }
 
@@ -893,7 +893,7 @@ calc_descriptives (struct dsc_proc *dsc, struct casereader *group,
               struct dsc_var *dv = &dsc->vars[i];
               double x = case_num (c, dv->v);
 
-              if (var_is_num_missing (dv->v, x, dsc->exclude))
+              if (var_is_num_missing (dv->v, x) & dsc->exclude)
                 continue;
 
               if (dv->moments != NULL)
@@ -974,7 +974,7 @@ listwise_missing (struct dsc_proc *dsc, const struct ccase *c)
       struct dsc_var *dv = &dsc->vars[i];
       double x = case_num (c, dv->v);
 
-      if (var_is_num_missing (dv->v, x, dsc->exclude))
+      if (var_is_num_missing (dv->v, x) & dsc->exclude)
         return true;
     }
   return false;
index bb77e9010a3564dfa0982ac129558b1606607db9..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;
@@ -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"))
                 {
index e5462d083d2fd44d6e24e2e23960d360c6ad8f6f..81fe9da2df2dad421bf566ae4480d536003ac70d 100644 (file)
@@ -408,7 +408,7 @@ not_missing (const void *f_, const void *v_)
   const struct freq *f = f_;
   const struct variable *v = v_;
 
-  return !var_is_value_missing (v, f->values, MV_ANY);
+  return !var_is_value_missing (v, f->values);
 }
 
 
@@ -1288,7 +1288,7 @@ chart_includes_value (const struct frq_chart *chart,
                       const struct variable *var,
                       const union value *value)
 {
-  if (!chart->include_missing && var_is_value_missing (var, value, MV_ANY))
+  if (!chart->include_missing && var_is_value_missing (var, value))
     return false;
 
   if (var_is_numeric (var)
index 2dd98e3db27bbee33f315a0753897280e8797e52..7496b0f0dd7dee0ba80b37c7a4e502b6edda7648 100644 (file)
@@ -430,8 +430,8 @@ run_barchart (struct graph *cmd, struct casereader *input)
       for (v = 0; v < cmd->n_by_vars; ++v)
        {
          if (var_is_value_missing (cmd->by_var[v],
-                                   case_data (c, cmd->by_var[v]),
-                                   cmd->fctr_excl))
+                                   case_data (c, cmd->by_var[v]))
+              & cmd->fctr_excl)
            break;
        }
 
@@ -619,7 +619,7 @@ run_graph (struct graph *cmd, struct casereader *input)
          const struct variable *var = cmd->dep_vars[v];
          const double x = case_num (c, var);
 
-         if (var_is_value_missing (var, case_data (c, var), cmd->dep_excl))
+         if (var_is_value_missing (var, case_data (c, var)) & cmd->dep_excl)
            {
              cmd->es[v].missing += weight;
              continue;
@@ -908,7 +908,7 @@ cmd_graph (struct lexer *lexer, struct dataset *ds)
                 }
               else if (lex_match_id (lexer, "REPORT"))
                 {
-                  graph.fctr_excl = MV_NEVER;
+                  graph.fctr_excl = 0;
                 }
               else if (lex_match_id (lexer, "NOREPORT"))
                 {
index d9f5ff54fb8974361b239463f70f41394a1e20e5..d959ad753e3d700718a3cab223e076dca814fd9a 100644 (file)
@@ -167,7 +167,7 @@ ks_one_sample_execute (const struct dataset *ds,
          const struct variable *var = ost->vars[v];
          const union value *val = case_data (c, var);
 
-         if (var_is_value_missing (var, val, exclude))
+         if (var_is_value_missing (var, val) & exclude)
            continue;
 
          minimize (&ks[v].test_min, val->f);
@@ -230,7 +230,7 @@ ks_one_sample_execute (const struct dataset *ds,
          const double weight = dict_get_case_weight (dict, c, &warn);
          const union value *val = case_data (c, var);
 
-         if (var_is_value_missing (var, val, exclude))
+         if (var_is_value_missing (var, val) & exclude)
            continue;
 
          cc += weight;
index d62390644da7264925cd5bd44a140c411f1731f6..556b06084146cacab363c33ac6eab9cbdc87c54e 100644 (file)
@@ -478,7 +478,7 @@ initial_pass (const struct lr_spec *cmd, struct lr_result *res, struct casereade
       double weight = dict_get_case_weight (cmd->dict, c, &res->warn_bad_weight);
       const union value *depval = case_data (c, cmd->dep_var);
 
-      if (var_is_value_missing (cmd->dep_var, depval, cmd->exclude))
+      if (var_is_value_missing (cmd->dep_var, depval) & cmd->exclude)
        {
          missing = true;
        }
@@ -486,7 +486,7 @@ initial_pass (const struct lr_spec *cmd, struct lr_result *res, struct casereade
       for (v = 0; v < cmd->n_indep_vars; ++v)
        {
          const union value *val = case_data (c, cmd->indep_vars[v]);
-         if (var_is_value_missing (cmd->indep_vars[v], val, cmd->exclude))
+         if (var_is_value_missing (cmd->indep_vars[v], val) & cmd->exclude)
            {
              missing = true;
              break;
index 8a08740183a54f72dba21798abae29d9fa42d6c1..9bbc37f9a23e4c09ef72f052b46365b369648943 100644 (file)
@@ -7505,7 +7505,7 @@ matrix_get_execute__ (struct matrix_command *cmd, struct casereader *reader,
                   error = true;
                 }
             }
-          else if (var_is_num_missing (var, d, MV_USER))
+          else if (var_is_num_missing (var, d) == MV_USER)
             {
               if (get->user.treatment == MGET_RECODE)
                 d = get->user.substitute;
@@ -8228,7 +8228,7 @@ matrix_mget_commit_var (struct ccase **rows, size_t n_rows,
         {
           struct variable *var = dict_get_var (d, cs + x);
           double value = case_num (rows[y], var);
-          if (var_is_num_missing (var, value, MV_ANY))
+          if (var_is_num_missing (var, value))
             {
               n_missing++;
               value = 0.0;
index b05f144a74bae96a3c5a6da2b0c9fc38ecfb5205..a12800726dfec6ae94af4b0ff724e7785f6c021d 100644 (file)
@@ -100,10 +100,10 @@ mcnemar_execute (const struct dataset *ds,
          const union value *value0 = case_data (c, (*vp)[0]);
          const union value *value1 = case_data (c, (*vp)[1]);
 
-         if (var_is_value_missing ((*vp)[0], value0, exclude))
+         if (var_is_value_missing ((*vp)[0], value0) & exclude)
            continue;
 
-         if (var_is_value_missing ((*vp)[1], value1, exclude))
+         if (var_is_value_missing ((*vp)[1], value1) & exclude)
            continue;
 
 
index 8ebbca0f355f9babc1dcbb392755e9fa8ba01d65..4ebd60d83ab496239d21ef1a556e44ebeefd75c4 100644 (file)
@@ -868,7 +868,7 @@ control_var_missing (const struct means *means,
       const struct variable *var = layer->factor_vars[ws->control_idx[l]];
       const union value *vv = case_data (c, var);
 
-      miss = var_is_value_missing (var, vv, means->ctrl_exclude);
+      miss = (var_is_value_missing (var, vv) & means->ctrl_exclude) != 0;
       if (miss)
        break;
     }
@@ -930,7 +930,7 @@ service_cell_map (const struct means *means, const struct mtable *mt,
             {
               const struct variable *dep_var = mt->dep_vars[v];
              const union value *vv = case_data (c, dep_var);
-             if (var_is_value_missing (dep_var, vv, means->dep_exclude))
+             if (var_is_value_missing (dep_var, vv) & means->dep_exclude)
                continue;
 
               for (int stat = 0; stat < means->n_statistics; ++stat)
@@ -1047,7 +1047,7 @@ update_summaries (const struct means *means, struct mtable *mt,
          const struct variable *var = mt->dep_vars[dv];
          const union value *vv = case_data (c, var);
          /* First check if the dependent variable is missing.  */
-         if (var_is_value_missing (var, vv, means->dep_exclude))
+         if (var_is_value_missing (var, vv) & means->dep_exclude)
            summ->n_missing += weight;
          /* If the dep var is not missing, then check each
             control variable.  */
@@ -1058,7 +1058,7 @@ update_summaries (const struct means *means, struct mtable *mt,
                const struct variable *var
                  = layer->factor_vars[ws->control_idx[l]];
                const union value *vv = case_data (c, var);
-               if (var_is_value_missing (var, vv, means->ctrl_exclude))
+               if (var_is_value_missing (var, vv) & means->ctrl_exclude)
                  {
                    summ->n_missing += weight;
                    break;
index a27375a802a464597472521b64505fe0aaad3736..93ba08e21033ab35a2a81a6adb6938bf56e35dae 100644 (file)
@@ -159,7 +159,7 @@ median_execute (const struct dataset *ds,
 
          for (; (c = casereader_read (rr)) != NULL;)
            {
-             if (var_is_value_missing (var, case_data (c, var), exclude))
+             if (var_is_value_missing (var, case_data (c, var)) & exclude)
                {
                  case_unref (c);
                  continue;
@@ -196,7 +196,7 @@ median_execute (const struct dataset *ds,
          const union value *val = case_data (c, var);
          const union value *indep_val = case_data (c, nst->indep_var);
 
-         if (var_is_value_missing (var, case_data (c, var), exclude))
+         if (var_is_value_missing (var, case_data (c, var)) & exclude)
            {
              continue;
            }
index e20d55198bc1568bdf2432d0a27b5677cc8dcfc9..6ad71f14c829fc75a91b63e89854f18d9fc3b179 100644 (file)
@@ -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;
            }
 
index be04af929fb1dc435a090f481965d359b054ab20..9dd07f591b33bdef5635ec62e408d809c98a12db 100644 (file)
@@ -247,7 +247,7 @@ dist_from_case (const struct Kmeans *kmeans, const struct ccase *c,
   for (j = 0; j < qc->n_vars; j++)
     {
       const union value *val = case_data (c, qc->vars[j]);
-      if (var_is_value_missing (qc->vars[j], val, qc->exclude))
+      if (var_is_value_missing (qc->vars[j], val) & qc->exclude)
        NOT_REACHED ();
 
       dist += pow2 (gsl_matrix_get (kmeans->centers, which, j) - val->f);
@@ -302,7 +302,7 @@ kmeans_initial_centers (struct Kmeans *kmeans,
       for (j = 0; j < qc->n_vars; ++j)
        {
          const union value *val = case_data (c, qc->vars[j]);
-         if (var_is_value_missing (qc->vars[j], val, qc->exclude))
+         if (var_is_value_missing (qc->vars[j], val) & qc->exclude)
            {
              missing = true;
              break;
@@ -385,7 +385,7 @@ kmeans_get_nearest_group (const struct Kmeans *kmeans, struct ccase *c,
       for (j = 0; j < qc->n_vars; j++)
        {
          const union value *val = case_data (c, qc->vars[j]);
-         if (var_is_value_missing (qc->vars[j], val, qc->exclude))
+         if (var_is_value_missing (qc->vars[j], val) & qc->exclude)
            continue;
 
          dist += pow2 (gsl_matrix_get (kmeans->centers, i, j) - val->f);
@@ -462,7 +462,7 @@ kmeans_cluster (struct Kmeans *kmeans, struct casereader *reader,
              for (j = 0; j < qc->n_vars; j++)
                {
                  const union value *val = case_data (c, qc->vars[j]);
-                 if (var_is_value_missing (qc->vars[j], val, qc->exclude))
+                 if (var_is_value_missing (qc->vars[j], val) & qc->exclude)
                    missing = true;
                }
 
@@ -488,7 +488,7 @@ kmeans_cluster (struct Kmeans *kmeans, struct casereader *reader,
              for (j = 0; j < qc->n_vars; ++j)
                {
                  const union value *val = case_data (c, qc->vars[j]);
-                 if (var_is_value_missing (qc->vars[j], val, qc->exclude))
+                 if (var_is_value_missing (qc->vars[j], val) & qc->exclude)
                    continue;
                  double *x = gsl_matrix_ptr (kmeans->updated_centers, group, j);
                  *x += val->f * (qc->wv ? case_num (c, qc->wv) : 1.0);
@@ -529,7 +529,7 @@ kmeans_cluster (struct Kmeans *kmeans, struct casereader *reader,
            for (j = 0; j < qc->n_vars; ++j)
              {
                const union value *val = case_data (c, qc->vars[j]);
-               if (var_is_value_missing (qc->vars[j], val, qc->exclude))
+               if (var_is_value_missing (qc->vars[j], val) & qc->exclude)
                  continue;
 
                double *x = gsl_matrix_ptr (kmeans->updated_centers, group, j);
index 5a891dacd82c7f86c51cb582a080be156c7197da..031110a046a235f5ab0e72df4837f83a2a3cf636 100644 (file)
@@ -674,7 +674,8 @@ prepare_cutpoints (struct cmd_roc *roc, struct roc_state *rs, struct casereader
          const union value *v = case_data (c, roc->vars[i]);
          const double result = v->f;
 
-         if (mv_is_value_missing (var_get_missing_values (roc->vars[i]), v, roc->exclude))
+         if (mv_is_value_missing (var_get_missing_values (roc->vars[i]), v)
+              & roc->exclude)
            continue;
 
          minimize (&rs[i].min, result);
index 9ef4c64add1f601303ce894a6c2805d63293db39..b42eeafcecd38f2ce3486bfc9bd9e24f16dfb736 100644 (file)
@@ -145,7 +145,7 @@ runs_execute (const struct dataset *ds,
                  {
                    const double w = weight ? case_num (c, weight) : 1.0;
                    const union value *val = case_data (c, var);
-                   if (var_is_value_missing (var, val, exclude))
+                   if (var_is_value_missing (var, val) & exclude)
                      continue;
                    x = val->f;
                    cc += w;
@@ -192,7 +192,7 @@ runs_execute (const struct dataset *ds,
              {
                const union value *val = case_data (c, var);
                const double w = weight ? case_num (c, weight) : 1.0;
-               if (var_is_value_missing (var, val, exclude))
+               if (var_is_value_missing (var, val) & exclude)
                  {
                    case_unref (c);
                    continue;
@@ -232,7 +232,7 @@ runs_execute (const struct dataset *ds,
                const double x = val->f;
                struct run_state *run = &rs[v];
 
-               if (var_is_value_missing (var, val, exclude))
+               if (var_is_value_missing (var, val) & exclude)
                  continue;
 
                run->cutpoint += x * w;
@@ -271,7 +271,7 @@ runs_execute (const struct dataset *ds,
          double d = x - run->cutpoint;
          short sign = 0;
 
-         if (var_is_value_missing (var, val, exclude))
+         if (var_is_value_missing (var, val) & exclude)
            continue;
 
          if (d >= 0)
index 52fb4870c39f826e12953a2ab6430ba37d8a62c4..32a74b20e07cc60004ac55923718181cace2eee6 100644 (file)
@@ -153,10 +153,10 @@ sign_execute (const struct dataset *ds,
          const union value *value1 = case_data (c, (*vp)[1]);
          const double diff = value0->f - value1->f;
 
-         if (var_is_value_missing ((*vp)[0], value0, exclude))
+         if (var_is_value_missing ((*vp)[0], value0) & exclude)
            continue;
 
-         if (var_is_value_missing ((*vp)[1], value1, exclude))
+         if (var_is_value_missing ((*vp)[1], value1) & exclude)
            continue;
 
          if (diff > 0)
index 3076ec03a0d3ef2b1384ee3a7fe6a77c0785bc22..3bfc7775cc5698dcd3bb95090c59705561817368 100644 (file)
@@ -112,7 +112,7 @@ indep_run (struct tt *tt, const struct variable *gvar,
       for (v = 0; v < tt->n_vars; ++v)
        {
          const union value *val = case_data (c, tt->vars[v]);
-         if (var_is_value_missing (tt->vars[v], val, tt->exclude))
+         if (var_is_value_missing (tt->vars[v], val) & tt->exclude)
            continue;
 
          moments_pass_one (ps[v].mom[grp], val->f, w);
@@ -135,7 +135,7 @@ indep_run (struct tt *tt, const struct variable *gvar,
       for (v = 0; v < tt->n_vars; ++v)
        {
          const union value *val = case_data (c, tt->vars[v]);
-         if (var_is_value_missing (tt->vars[v], val, tt->exclude))
+         if (var_is_value_missing (tt->vars[v], val) & tt->exclude)
            continue;
 
          moments_pass_two (ps[v].mom[grp], val->f, w);
@@ -158,7 +158,7 @@ indep_run (struct tt *tt, const struct variable *gvar,
       for (v = 0; v < tt->n_vars; ++v)
        {
          const union value *val = case_data (c, tt->vars[v]);
-         if (var_is_value_missing (tt->vars[v], val, tt->exclude))
+         if (var_is_value_missing (tt->vars[v], val) & tt->exclude)
            continue;
 
          levene_pass_three (ps[v].nl, val->f, w, gv);
index b9465662125247ae707a97a817d8fdf8dee54428..14eca1b11cd628f9bf4d69ea1634c5c987ecd7d9 100644 (file)
@@ -175,7 +175,7 @@ one_sample_run (const struct tt *tt, double testval, struct casereader *reader)
           const struct per_var_stats *per_var_stats = &os.stats[i];
          const struct variable *var = per_var_stats->var;
          const union value *val = case_data (c, var);
-         if (var_is_value_missing (var, val, tt->exclude))
+         if (var_is_value_missing (var, val) & tt->exclude)
            continue;
 
          moments_pass_one (per_var_stats->mom, val->f, w);
@@ -192,7 +192,7 @@ one_sample_run (const struct tt *tt, double testval, struct casereader *reader)
           struct per_var_stats *per_var_stats = &os.stats[i];
          const struct variable *var = per_var_stats->var;
          const union value *val = case_data (c, var);
-         if (var_is_value_missing (var, val, tt->exclude))
+         if (var_is_value_missing (var, val) & tt->exclude)
            continue;
 
          moments_pass_two (per_var_stats->mom, val->f, w);
index bf6545e3bb94f7221d494a07a870483a9dd3e09b..9ec459eead84a03f252819fac9eb78ff33449a61 100644 (file)
@@ -87,10 +87,10 @@ paired_run (const struct tt *tt, size_t n_pairs, vp *pairs, struct casereader *r
           struct pair_stats *pp = &ps.ps[i];
          const union value *val0 = case_data (c, pp->var0);
          const union value *val1 = case_data (c, pp->var1);
-          if (var_is_value_missing (pp->var0, val0, tt->exclude))
+          if (var_is_value_missing (pp->var0, val0) & tt->exclude)
            continue;
 
-          if (var_is_value_missing (pp->var1, val1, tt->exclude))
+          if (var_is_value_missing (pp->var1, val1) & tt->exclude)
            continue;
 
          moments_pass_one (pp->mom0, val0->f, w);
@@ -110,10 +110,10 @@ paired_run (const struct tt *tt, size_t n_pairs, vp *pairs, struct casereader *r
           struct pair_stats *pp = &ps.ps[i];
          const union value *val0 = case_data (c, pp->var0);
          const union value *val1 = case_data (c, pp->var1);
-          if (var_is_value_missing (pp->var0, val0, tt->exclude))
+          if (var_is_value_missing (pp->var0, val0) & tt->exclude)
            continue;
 
-          if (var_is_value_missing (pp->var1, val1, tt->exclude))
+          if (var_is_value_missing (pp->var1, val1) & tt->exclude)
            continue;
 
          moments_pass_two (pp->mom0, val0->f, w);
index 1a1422b31f0a69ff695abe4cc7e76888957d0ce4..9db76f6c652b11e5a12586208eb83102faa1fd51 100644 (file)
@@ -300,7 +300,7 @@ count_numeric (struct criteria *crit, const struct ccase *c)
             break;
           }
 
-      if (var_is_num_missing (crit->vars[i], x, MV_ANY)
+      if (var_is_num_missing (crit->vars[i], x)
           && (x == SYSMIS
               ? crit->count_system_missing
               : crit->count_user_missing))
index 4d491dd9be1462f49d46a0f0054d50e1f255d2d7..467a18652db46384e5b045a174f29d310f3fdee8 100644 (file)
@@ -615,7 +615,7 @@ find_src_numeric (struct recode_trns *trns, double value, const struct variable
           match = value == in->x.f;
           break;
         case MAP_MISSING:
-          match = var_is_num_missing (v, value, MV_ANY);
+          match = var_is_num_missing (v, value) != 0;
           break;
         case MAP_RANGE:
           match = value >= in->x.f && value <= in->y.f;
@@ -676,7 +676,7 @@ find_src_string (struct recode_trns *trns, const uint8_t *value,
             break;
           }
        case MAP_MISSING:
-         match = var_is_str_missing (src_var, value, MV_ANY);
+         match = var_is_str_missing (src_var, value) != 0;
          break;
         default:
           NOT_REACHED ();
index 67a9fe9f219bf843d7f7ad7ea484851cbf8350b0..79fce25cef28362dbe7b404377d436e92727111c 100644 (file)
@@ -262,7 +262,7 @@ is_missing (const struct covariance *cov, int i, const struct ccase *c)
 
   const union value *val = case_data (c, var);
 
-  return var_is_value_missing (var, val, cov->exclude);
+  return (var_is_value_missing (var, val) & cov->exclude) != 0;
 }
 
 
index c39a0b4846f9233a36188fd7ed50a13c18788829..e61ab14e915565c284564e3359c6d15f09c13581 100644 (file)
@@ -199,8 +199,8 @@ interaction_case_is_missing (const struct interaction *iact,
                              const struct ccase *c, enum mv_class exclude)
 {
   for (size_t i = 0; i < iact->n_vars; ++i)
-    if (var_is_value_missing (iact->vars[i], case_data (c, iact->vars[i]),
-                              exclude))
+    if (var_is_value_missing (iact->vars[i], case_data (c, iact->vars[i]))
+        & exclude)
       return true;
 
   return false;
index 678578fcbd65a1cd3b3d41368eed5323cb57d1fc..ad3b2eafd7926e88dfa56f3ba16362f92ea0d60d 100644 (file)
@@ -50,7 +50,7 @@ piechart_create (const struct variable *var, const struct freq *slices, int n_sl
 
       ds_init_empty (&dst->label);
 
-      if (var_is_value_missing (var, &src->values[0], MV_ANY))
+      if (var_is_value_missing (var, &src->values[0]))
        ds_assign_cstr (&dst->label, _("*MISSING*"));
       else
        var_append_value_name (var, &src->values[0], &dst->label);
index f03d33bc169101174934598f1c56833b3c458a58..a6a499b868c2144dce9145ca46958970858b1b32 100644 (file)
@@ -72,7 +72,7 @@ xrchart_draw_scatterplot (const struct chart *chart, cairo_t *cr,
                {
                  struct string label;
                  ds_init_empty (&label);
-                 if (var_is_value_missing (spc->byvar,val,MV_ANY))
+                 if (var_is_value_missing (spc->byvar,val))
                    ds_put_cstr (&label,"missing");
                  else
                    var_append_value_name (spc->byvar,val,&label);
index d9ae1418e2927585e486f6d19d24ee3628ddd805..2a3efe639522ea320a515914eeb3a734df4db6f6 100644 (file)
@@ -181,7 +181,7 @@ static char *
 unlabeled_value (PsppireDataStore *store, const struct variable *variable, const union value *val)
 {
   if (var_is_numeric (variable) &&
-      var_is_value_missing (variable, val, MV_SYSTEM))
+      var_is_value_missing (variable, val) == MV_SYSTEM)
     return g_strdup ("");
 
   const struct fmt_spec *fmt = var_get_print_format (variable);
index f0995e92e85befe5918b06db37371519a08812d7..31b8cc78c98ede6dc62ccb3f75bc7e57ca243e98 100644 (file)
@@ -105,7 +105,7 @@ value_entry_contains_invalid (PsppireValueEntry *ve, const struct variable *var)
 
       if (psppire_value_entry_get_value (ve, &val, width))
        {
-         if (var_is_value_missing (var, &val, MV_SYSTEM))
+         if (var_is_value_missing (var, &val) == MV_SYSTEM)
            {
              result = TRUE;
            }
index 16f03da1ab623edb7642e237d0772aac6697b61f..23c6cae24ce1bab8eed7c38391a7837809c128ef 100644 (file)
@@ -63,7 +63,7 @@ dialog_state_valid (gpointer data)
 
   result = psppire_value_entry_get_value (PSPPIRE_VALUE_ENTRY (rd->state_value), &val, width);
 
-  if (var_is_value_missing (var, &val, MV_SYSTEM))
+  if (var_is_value_missing (var, &val) == MV_SYSTEM)
       result = FALSE;
 
   value_destroy (&val, width);