X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fpivot-output.c;h=c3751d04d888dff563b28a1155c18143c64f8b80;hb=fb5ee794ece0f21f0b52ee41e66a8b79c159bcf2;hp=2fa664bffadd6f1616be3716802d85ea9e00cc1b;hpb=29917c4f5908454803e663d2ad78bca4bc35e805;p=pspp diff --git a/src/output/pivot-output.c b/src/output/pivot-output.c index 2fa664bffa..c3751d04d8 100644 --- a/src/output/pivot-output.c +++ b/src/output/pivot-output.c @@ -233,7 +233,7 @@ compose_headings (struct table *t, |aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3|aaaa1|aaaa2|aaaa3| +-----+-----+-----+-----+-----+-----+-----+-----+-----+ */ - bool *vrules = xzalloc (n_columns + 1); + bool *vrules = XCALLOC (n_columns + 1, bool); vrules[0] = vrules[n_columns] = true; for (int dim_index = h_axis->n_dimensions; --dim_index >= 0; ) { @@ -394,9 +394,10 @@ add_references (const struct pivot_table *pt, const struct table *table, if (x == cell.d[H][0] && y == cell.d[V][0]) { - for (size_t i = 0; i < cell.value->n_footnotes; i++) + const struct pivot_value_ex *ex = pivot_value_ex (cell.value); + for (size_t i = 0; i < ex->n_footnotes; i++) { - size_t idx = cell.value->footnote_indexes[i]; + size_t idx = ex->footnote_indexes[i]; assert (idx < pt->n_footnotes); if (!refs[idx] && pt->footnotes[idx]->show) @@ -425,7 +426,7 @@ collect_footnotes (const struct pivot_table *pt, return NULL; } - bool *refs = xzalloc (pt->n_footnotes); + bool *refs = XCALLOC (pt->n_footnotes, bool); size_t n_refs = 0; add_references (pt, title, refs, &n_refs); add_references (pt, layers, refs, &n_refs);