Apply patch #5225, assertions.
[pspp-builds.git] / src / language / stats / crosstabs.q
index ee7299200fb21d3656aaa7adfbb2cfaecd64f357..a2115cef8aaac660d337e03e05f5b5a1336cb7be 100644 (file)
 #include <language/command.h>
 #include <language/dictionary/split-file.h>
 #include <language/lexer/lexer.h>
+#include <language/lexer/variable-parser.h>
 #include <libpspp/alloc.h>
 #include <libpspp/array.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
 #include <libpspp/magic.h>
@@ -67,7 +69,7 @@
    crosstabs (crs_):
      *^tables=custom;
      +variables=custom;
-     +missing=miss:!table/include/report;
+     missing=miss:!table/include/report;
      +write[wr_]=none,cells,all;
      +format=fmt:!labels/nolabels/novallabs,
             val:!avalue/dvalue,
@@ -210,7 +212,7 @@ internal_cmd_crosstabs (void)
   pl_tc = pool_create ();
   pl_col = pool_create ();
 
-  if (!parse_crosstabs (&cmd))
+  if (!parse_crosstabs (&cmd, NULL))
     return CMD_FAILURE;
 
   mode = variables ? INTEGER : GENERAL;
@@ -300,7 +302,7 @@ internal_cmd_crosstabs (void)
 
 /* Parses the TABLES subcommand. */
 static int
-crs_custom_tables (struct cmd_crosstabs *cmd UNUSED)
+crs_custom_tables (struct cmd_crosstabs *cmd UNUSED, void *aux UNUSED)
 {
   struct var_set *var_set;
   int n_by;
@@ -404,7 +406,7 @@ crs_custom_tables (struct cmd_crosstabs *cmd UNUSED)
 
 /* Parses the VARIABLES subcommand. */
 static int
-crs_custom_variables (struct cmd_crosstabs *cmd UNUSED)
+crs_custom_variables (struct cmd_crosstabs *cmd UNUSED, void *aux UNUSED)
 {
   if (nxtab)
     {
@@ -1798,8 +1800,7 @@ display_crosstabulation (void)
                                 * (1. - col_tot[c] / W)));
                    break;
                  default:
-                   assert (0);
-                    abort ();
+                    NOT_REACHED ();
                  }
 
                 format_cell_entry (table, c, i, v, suffix, mark_missing);
@@ -1854,8 +1855,7 @@ display_crosstabulation (void)
                 v = 0.;
                 break;
               default:
-                assert (0);
-                abort ();
+                NOT_REACHED ();
               }
 
             format_cell_entry (table, n_cols, 0, v, suffix, mark_missing);
@@ -1910,8 +1910,7 @@ display_crosstabulation (void)
              case CRS_CL_ASRESIDUAL:
                continue;
              default:
-               assert (0);
-                abort ();
+                NOT_REACHED ();
              }
 
             format_cell_entry (table, c, i, v, suffix, mark_missing);