X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fsign.c;h=3848911313ed62721eff29b20d6fd9bdf14ca6e9;hb=1a91de115274ee41260b3d578962166b4c10fa6a;hp=a5a272126007c557a2c006b652d73cf7e9fe4436;hpb=b5c82cc9aabe7e641011130240ae1b2e84348e23;p=pspp-builds.git diff --git a/src/language/stats/sign.c b/src/language/stats/sign.c index a5a27212..38489113 100644 --- a/src/language/stats/sign.c +++ b/src/language/stats/sign.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include "npar.h" @@ -52,24 +52,22 @@ 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); - tab_title (table, _("Frequencies")); tab_headers (table, 2, 0, 1, 0); /* Vertical lines inside the box */ tab_box (table, 0, 0, -1, TAL_1, - 1, 0, table->nc - 1, tab_nr (table) - 1 ); + 1, 0, tab_nc (table) - 1, tab_nr (table) - 1 ); /* Box around entire table */ tab_box (table, TAL_2, TAL_2, -1, -1, - 0, 0, table->nc - 1, tab_nr (table) - 1 ); + 0, 0, tab_nc (table) - 1, tab_nr (table) - 1 ); tab_text (table, 2, 0, TAB_CENTER, _("N")); @@ -82,11 +80,12 @@ 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); - tab_hline (table, TAL_1, 0, table->nc - 1, 1 + i * 4); + tab_hline (table, TAL_1, 0, tab_nc (table) - 1, 1 + i * 4); tab_text (table, 1, 1 + i * 4, TAB_LEFT, _("Negative Differences")); tab_text (table, 1, 2 + i * 4, TAB_LEFT, _("Positive Differences")); @@ -108,26 +107,24 @@ 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); + struct tab_table *table = tab_create (1 + t2s->n_pairs, 4); tab_title (table, _("Test Statistics")); tab_headers (table, 0, 1, 0, 1); - tab_hline (table, TAL_2, 0, table->nc - 1, 1); - tab_vline (table, TAL_2, 1, 0, table->nr - 1); + tab_hline (table, TAL_2, 0, tab_nc (table) - 1, 1); + tab_vline (table, TAL_2, 1, 0, tab_nr (table) - 1); /* Vertical lines inside the box */ tab_box (table, -1, -1, -1, TAL_1, 0, 0, - table->nc - 1, tab_nr (table) - 1); + tab_nc (table) - 1, tab_nr (table) - 1); /* Box around entire table */ tab_box (table, TAL_2, TAL_2, -1, -1, - 0, 0, table->nc - 1, + 0, 0, tab_nc (table) - 1, tab_nr (table) - 1); tab_text (table, 0, 1, TAT_TITLE | TAB_LEFT, @@ -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);