Without HAVE_SYS_TYPES_H or HAVE_SYS_WAIT_H, in connect_debugger we
[pspp] / src / language / stats / examine.q
index 9a55c9f3e5915787f5d28a4e45542ddfe9205870..abbf9fc3890aada913b5b771fb57353d2362dd4d 100644 (file)
@@ -1,7 +1,6 @@
 /* PSPP - EXAMINE data for normality . -*-c-*-
 
 Copyright (C) 2004 Free Software Foundation, Inc.
-Author: John Darrington 2004, 2006
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as
@@ -179,9 +178,8 @@ const char *factor_to_string_concise (const struct factor *fctr,
 
 
 
-/* Function to use for testing for missing values */
-static var_is_missing_func *value_is_missing;
-
+/* Categories of missing values to exclude. */
+static enum mv_class exclude_values;
 
 /* PERCENTILES */
 
@@ -207,10 +205,7 @@ cmd_examine (struct lexer *lexer, struct dataset *ds)
     }
 
   /* If /MISSING=INCLUDE is set, then user missing values are ignored */
-  if (cmd.incl == XMN_INCLUDE )
-    value_is_missing = var_is_value_system_missing;
-  else
-    value_is_missing = var_is_value_missing;
+  exclude_values = cmd.incl == XMN_INCLUDE ? MV_SYSTEM : MV_ANY;
 
   if ( cmd.st_n == SYSMIS )
     cmd.st_n = 5;
@@ -696,7 +691,7 @@ factor_calc (const struct ccase *c, int case_no, double weight,
                                        var_get_width (var)
                                        );
 
-         if ( value_is_missing (var, val) || case_missing )
+         if (case_missing || var_is_value_missing (var, val, exclude_values))
            {
              free (val);
              continue;
@@ -763,7 +758,7 @@ run_examine (const struct ccase *first, const struct casefile *cf,
                                                  var_get_width (var)
                                                  );
 
-             if ( value_is_missing (var, val))
+             if ( var_is_value_missing (var, val, exclude_values))
                case_missing = 1;
 
              free (val);
@@ -778,7 +773,8 @@ run_examine (const struct ccase *first, const struct casefile *cf,
                                        var_get_width (var)
                                        );
 
-         if ( value_is_missing (var, val) || case_missing )
+         if ( var_is_value_missing (var, val, exclude_values)
+               || case_missing )
            {
              free (val) ;
              continue ;