: NULL);
}
-static void
+static struct ctables_cell *
ctables_cell_insert__ (struct ctables_table *t, const struct ccase *c,
size_t ix[PIVOT_N_AXES],
- const struct ctables_category *cats[PIVOT_N_AXES][10],
- double weight)
+ const struct ctables_category *cats[PIVOT_N_AXES][10])
{
const struct ctables_nest *ss = &t->stacks[t->summary_axis].nests[ix[t->summary_axis]];
goto not_equal;
}
- goto summarize;
+ return cell;
not_equal: ;
}
for (enum ctables_domain_type dt = 0; dt < N_CTDTS; dt++)
cell->domains[dt] = ctables_domain_insert (t, cell, dt);
hmap_insert (&t->cells, &cell->node, hash);
+ return cell;
+}
+
+static void
+ctables_cell_add__ (struct ctables_table *t, const struct ccase *c,
+ size_t ix[PIVOT_N_AXES],
+ const struct ctables_category *cats[PIVOT_N_AXES][10],
+ double weight)
+{
+ struct ctables_cell *cell = ctables_cell_insert__ (t, c, ix, cats);
+ const struct ctables_nest *ss = &t->stacks[t->summary_axis].nests[ix[t->summary_axis]];
-summarize: ;
const struct ctables_summary_spec_set *sss
= (cell->total ? &ss->total_sss : &ss->cell_sss);
for (size_t i = 0; i < sss->n; i++)
{
const struct ctables_category *save = cats[a][i];
cats[a][i] = total;
- ctables_cell_insert__ (t, c, ix, cats, weight);
+ ctables_cell_add__ (t, c, ix, cats, weight);
recurse_totals (t, c, ix, cats, weight, a, i + 1);
cats[a][i] = save;
}
}
}
- ctables_cell_insert__ (t, c, ix, cats, weight);
+ ctables_cell_add__ (t, c, ix, cats, weight);
recurse_totals (t, c, ix, cats, weight, 0, 0);
if (save->subtotal)
{
cats[a][i] = save->subtotal;
- ctables_cell_insert__ (t, c, ix, cats, weight);
+ ctables_cell_add__ (t, c, ix, cats, weight);
cats[a][i] = save;
}
}