Use cast macros
[pspp-builds.git] / src / language / stats / sign.c
index 07a2499e9f70ab2b850a8d7a7db1727d1b5a4bf5..3848911313ed62721eff29b20d6fd9bdf14ca6e9 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <data/variable.h>
 #include <libpspp/str.h>
-#include <output/table.h>
+#include <output/tab.h>
 #include <gsl/gsl_cdf.h>
 #include <gsl/gsl_randist.h>
 #include "npar.h"
@@ -52,13 +52,11 @@ output_frequency_table (const struct two_sample_test *t2s,
                        const struct dictionary *dict)
 {
   int i;
-  struct tab_table *table = tab_create (3, 1 + 4 * t2s->n_pairs, 0);
+  struct tab_table *table = tab_create (3, 1 + 4 * t2s->n_pairs);
 
   const struct variable *wv = dict_get_weight (dict);
   const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
 
-  tab_dim (table, tab_natural_dimensions, NULL, NULL);
-
   tab_title (table, _("Frequencies"));
 
   tab_headers (table, 2, 0, 1, 0);
@@ -82,6 +80,7 @@ output_frequency_table (const struct two_sample_test *t2s,
       ds_put_cstr (&pair_name, " - ");
       ds_put_cstr (&pair_name, var_to_string ((*vp)[1]));
 
+
       tab_text (table, 0, 1 + i * 4, TAB_LEFT, ds_cstr (&pair_name));
 
       ds_destroy (&pair_name);
@@ -108,9 +107,7 @@ output_statistics_table (const struct two_sample_test *t2s,
                         const struct sign_test_params *param)
 {
   int i;
-  struct tab_table *table = tab_create (1 + t2s->n_pairs, 4, 0);
-
-  tab_dim (table, tab_natural_dimensions, NULL, NULL);
+  struct tab_table *table = tab_create (1 + t2s->n_pairs, 4);
 
   tab_title (table, _("Test Statistics"));
 
@@ -172,7 +169,7 @@ sign_execute (const struct dataset *ds,
   int i;
   bool warn = true;
   const struct dictionary *dict = dataset_dict (ds);
-  const struct two_sample_test *t2s = (const struct two_sample_test *) test;
+  const struct two_sample_test *t2s = UP_CAST (test, const struct two_sample_test, parent);
   struct ccase *c;
 
   struct sign_test_params *stp = xcalloc (sizeof *stp, t2s->n_pairs);