From f4491cda2715c59495d963d0a3d8ae4518c1c13d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 30 Dec 2021 13:58:12 -0800 Subject: [PATCH] Change how checking for missing values works. 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. --- perl-module/PSPP.xs | 4 +- src/data/casereader-filter.c | 6 +- src/data/csv-file-writer.c | 2 +- src/data/dataset.c | 2 +- src/data/mdd-writer.c | 7 +- src/data/missing-values.c | 68 +++++++++---------- src/data/missing-values.h | 28 ++++---- src/data/variable.c | 36 +++++----- src/data/variable.h | 7 +- src/language/data-io/combine-files.c | 2 +- src/language/dictionary/sys-file-info.c | 2 +- src/language/expressions/operations.def | 8 +-- src/language/stats/aggregate.c | 2 +- src/language/stats/autorecode.c | 4 +- src/language/stats/binomial.c | 2 +- src/language/stats/cochran.c | 2 +- src/language/stats/crosstabs.c | 14 ++-- src/language/stats/descriptives.c | 16 ++--- src/language/stats/examine.c | 11 +-- src/language/stats/frequencies.c | 4 +- src/language/stats/graph.c | 8 +-- src/language/stats/ks-one-sample.c | 4 +- src/language/stats/logistic.c | 4 +- src/language/stats/matrix.c | 4 +- src/language/stats/mcnemar.c | 4 +- src/language/stats/means.c | 8 +-- src/language/stats/median.c | 4 +- src/language/stats/oneway.c | 6 +- src/language/stats/quick-cluster.c | 12 ++-- src/language/stats/roc.c | 3 +- src/language/stats/runs.c | 8 +-- src/language/stats/sign.c | 4 +- src/language/stats/t-test-indep.c | 6 +- src/language/stats/t-test-one-sample.c | 4 +- src/language/stats/t-test-paired.c | 8 +-- src/language/xforms/count.c | 2 +- src/language/xforms/recode.c | 4 +- src/math/covariance.c | 2 +- src/math/interaction.c | 4 +- src/output/charts/piechart.c | 2 +- src/output/charts/scatterplot-cairo.c | 2 +- src/ui/gui/psppire-data-store.c | 2 +- .../gui/psppire-dialog-action-indep-samps.c | 2 +- src/ui/gui/psppire-dialog-action-roc.c | 2 +- 44 files changed, 165 insertions(+), 171 deletions(-) diff --git a/perl-module/PSPP.xs b/perl-module/PSPP.xs index 0b7dce1ddf..077bf581f0 100644 --- a/perl-module/PSPP.xs +++ b/perl-module/PSPP.xs @@ -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: diff --git a/src/data/casereader-filter.c b/src/data/casereader-filter.c index 08151fadd2..f4ad7e625a 100644 --- a/src/data/casereader-filter.c +++ b/src/data/casereader-filter.c @@ -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)++; diff --git a/src/data/csv-file-writer.c b/src/data/csv-file-writer.c index 77224945bc..c00a2cffed 100644 --- a/src/data/csv-file-writer.c +++ b/src/data/csv-file-writer.c @@ -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; diff --git a/src/data/dataset.c b/src/data/dataset.c index e11f173948..cbff74088b 100644 --- a/src/data/dataset.c +++ b/src/data/dataset.c @@ -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); } diff --git a/src/data/mdd-writer.c b/src/data/mdd-writer.c index 3fd651eb01..b025e693b4 100644 --- a/src/data/mdd-writer.c +++ b/src/data/mdd-writer.c @@ -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"); /* */ xmlTextWriterStartElement (writer, _xml ("properties")); diff --git a/src/data/missing-values.c b/src/data/missing-values.c index 267d34fb91..44d0bf9ee6 100644 --- a/src/data/missing-values.c +++ b/src/data/missing-values.c @@ -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 * diff --git a/src/data/missing-values.h b/src/data/missing-values.h index 9d9a884d08..8123beeda1 100644 --- a/src/data/missing-values.h +++ b/src/data/missing-values.h @@ -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); diff --git a/src/data/variable.c b/src/data/variable.c index 5115d4a6e4..8acac77fb2 100644 --- a/src/data/variable.c +++ b/src/data/variable.c @@ -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); } /* 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) diff --git a/src/data/variable.h b/src/data/variable.h index d5056f3165..2fa6866786 100644 --- a/src/data/variable.h +++ b/src/data/variable.h @@ -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 *, diff --git a/src/language/data-io/combine-files.c b/src/language/data-io/combine-files.c index 490a984a7d..8322f5c033 100644 --- a/src/language/data-io/combine-files.c +++ b/src/language/data-io/combine-files.c @@ -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); diff --git a/src/language/dictionary/sys-file-info.c b/src/language/dictionary/sys-file-info.c index e871dfd59b..3ab4c04099 100644 --- a/src/language/dictionary/sys-file-info.c +++ b/src/language/dictionary/sys-file-info.c @@ -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); diff --git a/src/language/expressions/operations.def b/src/language/expressions/operations.def index d3a31a7460..4f1e515026 100644 --- a/src/language/expressions/operations.def +++ b/src/language/expressions/operations.def @@ -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; diff --git a/src/language/stats/aggregate.c b/src/language/stats/aggregate.c index 9815f1e25a..721dba73d3 100644 --- a/src/language/stats/aggregate.c +++ b/src/language/stats/aggregate.c @@ -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) { diff --git a/src/language/stats/autorecode.c b/src/language/stats/autorecode.c index 2d569a0436..499f149d22 100644 --- a/src/language/stats/autorecode.c +++ b/src/language/stats/autorecode.c @@ -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); diff --git a/src/language/stats/binomial.c b/src/language/stats/binomial.c index e799d16884..f2ae51513e 100644 --- a/src/language/stats/binomial.c +++ b/src/language/stats/binomial.c @@ -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) diff --git a/src/language/stats/cochran.c b/src/language/stats/cochran.c index 935d612b5e..9b03296f19 100644 --- a/src/language/stats/cochran.c +++ b/src/language/stats/cochran.c @@ -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) diff --git a/src/language/stats/crosstabs.c b/src/language/stats/crosstabs.c index 465bdcc278..9e77c666a5 100644 --- a/src/language/stats/crosstabs.c +++ b/src/language/stats/crosstabs.c @@ -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.; diff --git a/src/language/stats/descriptives.c b/src/language/stats/descriptives.c index 95c57740b2..fdb454c260 100644 --- a/src/language/stats/descriptives.c +++ b/src/language/stats/descriptives.c @@ -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; diff --git a/src/language/stats/examine.c b/src/language/stats/examine.c index bb77e9010a..ad8a4126ff 100644 --- a/src/language/stats/examine.c +++ b/src/language/stats/examine.c @@ -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")) { diff --git a/src/language/stats/frequencies.c b/src/language/stats/frequencies.c index e5462d083d..81fe9da2df 100644 --- a/src/language/stats/frequencies.c +++ b/src/language/stats/frequencies.c @@ -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) diff --git a/src/language/stats/graph.c b/src/language/stats/graph.c index 2dd98e3db2..7496b0f0dd 100644 --- a/src/language/stats/graph.c +++ b/src/language/stats/graph.c @@ -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")) { diff --git a/src/language/stats/ks-one-sample.c b/src/language/stats/ks-one-sample.c index d9f5ff54fb..d959ad753e 100644 --- a/src/language/stats/ks-one-sample.c +++ b/src/language/stats/ks-one-sample.c @@ -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; diff --git a/src/language/stats/logistic.c b/src/language/stats/logistic.c index d62390644d..556b060841 100644 --- a/src/language/stats/logistic.c +++ b/src/language/stats/logistic.c @@ -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; diff --git a/src/language/stats/matrix.c b/src/language/stats/matrix.c index 8a08740183..9bbc37f9a2 100644 --- a/src/language/stats/matrix.c +++ b/src/language/stats/matrix.c @@ -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; diff --git a/src/language/stats/mcnemar.c b/src/language/stats/mcnemar.c index b05f144a74..a12800726d 100644 --- a/src/language/stats/mcnemar.c +++ b/src/language/stats/mcnemar.c @@ -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; diff --git a/src/language/stats/means.c b/src/language/stats/means.c index 8ebbca0f35..4ebd60d83a 100644 --- a/src/language/stats/means.c +++ b/src/language/stats/means.c @@ -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; diff --git a/src/language/stats/median.c b/src/language/stats/median.c index a27375a802..93ba08e210 100644 --- a/src/language/stats/median.c +++ b/src/language/stats/median.c @@ -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; } diff --git a/src/language/stats/oneway.c b/src/language/stats/oneway.c index e20d55198b..6ad71f14c8 100644 --- a/src/language/stats/oneway.c +++ b/src/language/stats/oneway.c @@ -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; } diff --git a/src/language/stats/quick-cluster.c b/src/language/stats/quick-cluster.c index be04af929f..9dd07f591b 100644 --- a/src/language/stats/quick-cluster.c +++ b/src/language/stats/quick-cluster.c @@ -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); diff --git a/src/language/stats/roc.c b/src/language/stats/roc.c index 5a891dacd8..031110a046 100644 --- a/src/language/stats/roc.c +++ b/src/language/stats/roc.c @@ -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); diff --git a/src/language/stats/runs.c b/src/language/stats/runs.c index 9ef4c64add..b42eeafcec 100644 --- a/src/language/stats/runs.c +++ b/src/language/stats/runs.c @@ -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) diff --git a/src/language/stats/sign.c b/src/language/stats/sign.c index 52fb4870c3..32a74b20e0 100644 --- a/src/language/stats/sign.c +++ b/src/language/stats/sign.c @@ -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) diff --git a/src/language/stats/t-test-indep.c b/src/language/stats/t-test-indep.c index 3076ec03a0..3bfc7775cc 100644 --- a/src/language/stats/t-test-indep.c +++ b/src/language/stats/t-test-indep.c @@ -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); diff --git a/src/language/stats/t-test-one-sample.c b/src/language/stats/t-test-one-sample.c index b946566212..14eca1b11c 100644 --- a/src/language/stats/t-test-one-sample.c +++ b/src/language/stats/t-test-one-sample.c @@ -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); diff --git a/src/language/stats/t-test-paired.c b/src/language/stats/t-test-paired.c index bf6545e3bb..9ec459eead 100644 --- a/src/language/stats/t-test-paired.c +++ b/src/language/stats/t-test-paired.c @@ -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); diff --git a/src/language/xforms/count.c b/src/language/xforms/count.c index 1a1422b31f..9db76f6c65 100644 --- a/src/language/xforms/count.c +++ b/src/language/xforms/count.c @@ -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)) diff --git a/src/language/xforms/recode.c b/src/language/xforms/recode.c index 4d491dd9be..467a18652d 100644 --- a/src/language/xforms/recode.c +++ b/src/language/xforms/recode.c @@ -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 (); diff --git a/src/math/covariance.c b/src/math/covariance.c index 67a9fe9f21..79fce25cef 100644 --- a/src/math/covariance.c +++ b/src/math/covariance.c @@ -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; } diff --git a/src/math/interaction.c b/src/math/interaction.c index c39a0b4846..e61ab14e91 100644 --- a/src/math/interaction.c +++ b/src/math/interaction.c @@ -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; diff --git a/src/output/charts/piechart.c b/src/output/charts/piechart.c index 678578fcbd..ad3b2eafd7 100644 --- a/src/output/charts/piechart.c +++ b/src/output/charts/piechart.c @@ -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); diff --git a/src/output/charts/scatterplot-cairo.c b/src/output/charts/scatterplot-cairo.c index f03d33bc16..a6a499b868 100644 --- a/src/output/charts/scatterplot-cairo.c +++ b/src/output/charts/scatterplot-cairo.c @@ -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); diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index d9ae1418e2..2a3efe6395 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -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); diff --git a/src/ui/gui/psppire-dialog-action-indep-samps.c b/src/ui/gui/psppire-dialog-action-indep-samps.c index f0995e92e8..31b8cc78c9 100644 --- a/src/ui/gui/psppire-dialog-action-indep-samps.c +++ b/src/ui/gui/psppire-dialog-action-indep-samps.c @@ -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; } diff --git a/src/ui/gui/psppire-dialog-action-roc.c b/src/ui/gui/psppire-dialog-action-roc.c index 16f03da1ab..23c6cae24c 100644 --- a/src/ui/gui/psppire-dialog-action-roc.c +++ b/src/ui/gui/psppire-dialog-action-roc.c @@ -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); -- 2.30.2