Eleminate unnecessary variables
[pspp-builds.git] / src / language / stats / npar.c
index 1b4af1a0488ba66fc151fd0b5def57a5d0278401..8a507789b61a8b2928d5acfb59a0008102994a66 100644 (file)
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
-struct dataset;
 /* Settings for subcommand specifiers. */
-enum
-  {
-    NPAR_ANALYSIS,
-    NPAR_LISTWISE,
-  };
-
-enum
+enum missing_type
   {
-    NPAR_INCLUDE,
-    NPAR_EXCLUDE
+    MISS_ANALYSIS,
+    MISS_LISTWISE,
   };
 
 /* Array indices for STATISTICS subcommand. */
@@ -90,7 +83,6 @@ struct cmd_npar_tests
     /* MISSING subcommand. */
     int missing;
     long miss;
-    long incl;
 
     /* METHOD subcommand. */
     int method;
@@ -141,8 +133,7 @@ parse_npar_tests (struct lexer *lexer, struct dataset *ds, struct cmd_npar_tests
   npt->wilcoxon = 0;
   npt->sign = 0;
   npt->missing = 0;
-  npt->miss = NPAR_ANALYSIS;
-  npt->incl = NPAR_EXCLUDE;
+  npt->miss = MISS_ANALYSIS;
   npt->method = 0;
   npt->statistics = 0;
   memset (npt->a_statistics, 0, sizeof npt->a_statistics);
@@ -222,19 +213,19 @@ parse_npar_tests (struct lexer *lexer, struct dataset *ds, struct cmd_npar_tests
           npt->missing++;
           if (npt->missing > 1)
             {
-              msg (SE, _ ("MISSING subcommand may be given only once."));
+              msg (SE, _ ("The %s subcommand may be given only once."), "MISSING");
               goto lossage;
             }
           while (lex_token (lexer) != '/' && lex_token (lexer) != '.')
             {
               if (lex_match_hyphenated_word (lexer, "ANALYSIS"))
-                npt->miss = NPAR_ANALYSIS;
+                npt->miss = MISS_ANALYSIS;
               else if (lex_match_hyphenated_word (lexer, "LISTWISE"))
-                npt->miss = NPAR_LISTWISE;
+                npt->miss = MISS_LISTWISE;
               else if (lex_match_hyphenated_word (lexer, "INCLUDE"))
-                npt->incl = NPAR_INCLUDE;
+                nps->filter = MV_SYSTEM;
               else if (lex_match_hyphenated_word (lexer, "EXCLUDE"))
-                npt->incl = NPAR_EXCLUDE;
+                nps->filter = MV_ANY;
               else
                 {
                   lex_error (lexer, NULL);
@@ -249,7 +240,7 @@ parse_npar_tests (struct lexer *lexer, struct dataset *ds, struct cmd_npar_tests
           npt->method++;
           if (npt->method > 1)
             {
-              msg (SE, _ ("METHOD subcommand may be given only once."));
+              msg (SE, _ ("The %s subcommand may be given only once."), "METHOD");
               goto lossage;
             }
           switch (npar_method (lexer, nps))
@@ -371,6 +362,7 @@ cmd_npar_tests (struct lexer *lexer, struct dataset *ds)
   struct casereader *input, *group;
 
   npar_specs.pool = pool_create ();
+  npar_specs.filter = MV_ANY;
 
   var_hash = const_hsh_create_pool (npar_specs.pool, 0,
                                    compare_vars_by_name, hash_var_by_name,
@@ -418,10 +410,8 @@ cmd_npar_tests (struct lexer *lexer, struct dataset *ds)
        }
     }
 
-  npar_specs.filter = cmd.incl == NPAR_EXCLUDE ? MV_ANY : MV_SYSTEM;
-
   input = proc_open (ds);
-  if ( cmd.miss == NPAR_LISTWISE )
+  if ( cmd.miss == MISS_LISTWISE )
     {
       input = casereader_create_filter_missing (input,
                                                npar_specs.vv,