Make vfm.c slightly less grotesque.
[pspp] / src / crosstabs.q
index bf89d377cab49efdd3607d9eb9a2738b26b8130b..11f3832dd7ef2fe2c20c72271976768ff8636feb 100644 (file)
 
 */
 
-/* AIX requires this to be the first thing in the file.  */
 #include <config.h>
-#if __GNUC__
-#define alloca __builtin_alloca
-#else
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#else
-#ifdef _AIX
-#pragma alloca
-#else
-#ifndef alloca                 /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#endif
-#endif
-#endif
-#endif
-
 #include <assert.h>
 #include <ctype.h>
 #include <stdlib.h>
@@ -55,7 +38,6 @@ char *alloca ();
 #include "alloc.h"
 #include "hash.h"
 #include "pool.h"
-#include "dcdflib/cdflib.h"
 #include "command.h"
 #include "lexer.h"
 #include "error.h"
@@ -166,10 +148,10 @@ static struct pool *pl_tc;        /* For table cells. */
 static struct pool *pl_col;    /* For column data. */
 
 static int internal_cmd_crosstabs (void);
-static void precalc (void);
-static int calc_general (struct ccase *);
-static int calc_integer (struct ccase *);
-static void postcalc (void);
+static void precalc (void *);
+static int calc_general (struct ccase *, void *);
+static int calc_integer (struct ccase *, void *);
+static void postcalc (void *);
 static void submit (struct tab_table *);
 
 #if DEBUGGING
@@ -295,14 +277,15 @@ internal_cmd_crosstabs (void)
   else
     write = CRS_WR_NONE;
 
-  procedure (precalc, mode == GENERAL ? calc_general : calc_integer, postcalc);
+  procedure (precalc, mode == GENERAL ? calc_general : calc_integer, postcalc,
+             NULL);
 
   return CMD_SUCCESS;
 }
 
 /* Parses the TABLES subcommand. */
 static int
-crs_custom_tables (struct cmd_crosstabs *cmd unused)
+crs_custom_tables (struct cmd_crosstabs *cmd UNUSED)
 {
   struct var_set *var_set;
   int n_by;
@@ -401,7 +384,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)
 {
   if (nxtab)
     {
@@ -533,7 +516,7 @@ static unsigned hash_table_entry (const void *, void *);
 
 /* Set up the crosstabulation tables for processing. */
 static void
-precalc (void)
+precalc (void *aux UNUSED)
 {
   if (mode == GENERAL)
     {
@@ -602,7 +585,7 @@ precalc (void)
 
 /* Form crosstabulations for general mode. */
 static int
-calc_general (struct ccase *c)
+calc_general (struct ccase *c, void *aux UNUSED)
 {
   /* Case weight. */
   double weight = dict_get_case_weight (default_dict, c);
@@ -672,7 +655,7 @@ calc_general (struct ccase *c)
 }
 
 static int
-calc_integer (struct ccase *c)
+calc_integer (struct ccase *c, void *aux UNUSED)
 {
   /* Case weight. */
   double weight = dict_get_case_weight (default_dict, c);
@@ -754,7 +737,7 @@ print_table_entries (struct table_entry **tab)
 /* Compare the table_entry's at A and B and return a strcmp()-type
    result. */
 static int 
-compare_table_entry (const void *a_, const void *b_, void *foo unused)
+compare_table_entry (const void *a_, const void *b_, void *foo UNUSED)
 {
   const struct table_entry *a = a_;
   const struct table_entry *b = b_;
@@ -793,7 +776,7 @@ compare_table_entry (const void *a_, const void *b_, void *foo unused)
 
 /* Calculate a hash value from table_entry PA. */
 static unsigned
-hash_table_entry (const void *pa, void *foo unused)
+hash_table_entry (const void *pa, void *foo UNUSED)
 {
   const struct table_entry *a = pa;
   unsigned long hash = a->table;
@@ -825,7 +808,7 @@ static void output_pivot_table (struct table_entry **, struct table_entry **,
 static void make_summary_table (void);
 
 static void
-postcalc (void)
+postcalc (void *aux UNUSED)
 {
   if (mode == GENERAL)
     {