X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Fstats%2Fmeans.c;h=8ebbca0f355f9babc1dcbb392755e9fa8ba01d65;hb=7c29c75d1317835e99863a6010c6b7a4b1aeecd1;hp=3c1c28973e3639e1238a2777d3d560fe3c586295;hpb=7919fa5fc1f94ad0097507d20e2deea52ed06df8;p=pspp diff --git a/src/language/stats/means.c b/src/language/stats/means.c index 3c1c28973e..8ebbca0f35 100644 --- a/src/language/stats/means.c +++ b/src/language/stats/means.c @@ -300,7 +300,7 @@ generate_cell (const struct means *means, const struct workspace *ws) { int n_vars = count_one_bits (not_wild); - struct cell *cell = xzalloc ((sizeof *cell)); + struct cell *cell = XZALLOC (struct cell); cell->values = xcalloc (n_vars, sizeof *cell->values); cell->vars = xcalloc (n_vars, sizeof *cell->vars); cell->not_wild = not_wild; @@ -751,7 +751,6 @@ means_shipout_single (const struct mtable *mt, const struct means *means, const struct workspace *ws) { struct pivot_table *pt = pivot_table_create (N_("Report")); - pt->omit_empty = true; struct pivot_dimension *dim_cells = pivot_dimension_create (pt, PIVOT_AXIS_COLUMN, N_("Statistics")); @@ -793,7 +792,6 @@ means_shipout_multivar (const struct mtable *mt, const struct means *means, } struct pivot_table *pt = pivot_table_create (ds_cstr (&dss)); - pt->omit_empty = true; ds_destroy (&dss); struct pivot_dimension *dim_cells = @@ -941,7 +939,7 @@ service_cell_map (const struct means *means, const struct mtable *mt, NULL); stat_update *su = cell_spec[means->statistics[stat]].su; su (cell->stat[stat + v * means->n_statistics], weight, - case_data (c, dep_var)->f); + case_num (c, dep_var)); } } } @@ -972,10 +970,8 @@ prepare_means (struct means *cmd) { struct workspace *ws = mt->ws + i; ws->root_cell = NULL; - ws->control_idx = xzalloc (mt->n_layers - * sizeof *ws->control_idx); - ws->instances = xzalloc (mt->n_layers - * sizeof *ws->instances); + ws->control_idx = xcalloc (mt->n_layers, sizeof *ws->control_idx); + ws->instances = xcalloc (mt->n_layers, sizeof *ws->instances); int cmb = i; for (int l = mt->n_layers - 1; l >= 0; --l) { @@ -1151,9 +1147,9 @@ cmd_means (struct lexer *lexer, struct dataset *ds) for (int t = 0; t < means.n_tables; ++t) { struct mtable *mt = means.table + t; - mt->summ = xzalloc (mt->n_combinations * mt->n_dep_vars - * sizeof (*mt->summ)); - mt->ws = xzalloc (mt->n_combinations * sizeof (*mt->ws)); + mt->summ = xcalloc (mt->n_combinations * mt->n_dep_vars, + sizeof (*mt->summ)); + mt->ws = xcalloc (mt->n_combinations, sizeof (*mt->ws)); } run_means (&means, group, ds); for (int t = 0; t < means.n_tables; ++t)