X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fmeans.c;h=4138f48161625bdf688763a7dfea872c683d2e46;hb=53367c094a6bd7121fe12ee2e4d296a000ba70b8;hp=c30b66c31005a5e6f8b80c56f196d0604d10cabe;hpb=0379abd58b39391a678df2add2bd896503b37a41;p=pspp diff --git a/src/language/stats/means.c b/src/language/stats/means.c index c30b66c310..4138f48161 100644 --- a/src/language/stats/means.c +++ b/src/language/stats/means.c @@ -198,6 +198,8 @@ means_destroy_cells (const struct means *means, struct cell *cell, destroy_cell (means, table, cell); } +#if 0 + static void dump_cell (const struct cell *cell, const struct mtable *mt, int level) { @@ -258,6 +260,8 @@ dump_tree (const struct cell *cell, const struct mtable *table, } } +#endif + /* Generate a hash based on the values of the N variables in the array VARS which are taken from the case C. */ static unsigned int @@ -567,8 +571,14 @@ populate_table (const struct means *means, const struct mtable *mt, } int idx = s + v * means->n_statistics; - pivot_table_put (pt, indexes, pt->n_dimensions, - pivot_value_new_number (sg (cell->stat[idx]))); + struct pivot_value *pv + = pivot_value_new_number (sg (cell->stat[idx])); + if (NULL == cell_spec[stat].rc) + { + const struct variable *dv = mt->dep_vars[v]; + pv->numeric.format = * var_get_print_format (dv); + } + pivot_table_put (pt, indexes, pt->n_dimensions, pv); } } free (indexes); @@ -769,18 +779,17 @@ means_shipout_multivar (const struct mtable *mt, const struct means *means, ds_init_empty (&dss); for (int dv = 0; dv < mt->n_dep_vars; ++dv) { - ds_put_cstr (&dss, var_get_name (mt->dep_vars[dv])); - if (mt->n_layers > 0) + if (dv > 0) ds_put_cstr (&dss, " * "); + ds_put_cstr (&dss, var_get_name (mt->dep_vars[dv])); } for (int l = 0; l < mt->n_layers; ++l) { + ds_put_cstr (&dss, " * "); const struct layer *layer = mt->layers[l]; const struct variable *var = layer->factor_vars[ws->control_idx[l]]; ds_put_cstr (&dss, var_get_name (var)); - if (l < mt->n_layers - 1) - ds_put_cstr (&dss, " * "); } struct pivot_table *pt = pivot_table_create (ds_cstr (&dss));