X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fspv%2Fspv-light-decoder.c;h=ebac2a56355b4f86eefbafffda7be516c7997aba;hb=3fa740d165a0c2ef7c03b11633f65c421f07f0a2;hp=be58d416eb8c7a89ba5fe01b58bf62bdefdf737d;hpb=50f6ea7d66d03895020891215fb4f55bbf061003;p=pspp diff --git a/src/output/spv/spv-light-decoder.c b/src/output/spv/spv-light-decoder.c index be58d416eb..ebac2a5635 100644 --- a/src/output/spv/spv-light-decoder.c +++ b/src/output/spv/spv-light-decoder.c @@ -185,6 +185,7 @@ decode_spvlb_valign (uint32_t in, enum table_valign *valignp) return NULL; default: + *valignp = 0; return xasprintf ("bad cell style valign %"PRIu32, in); } } @@ -376,7 +377,7 @@ decode_spvlb_value (const struct pivot_table *table, break; default: - assert (0); + abort (); } if (vm) @@ -565,7 +566,7 @@ decode_spvlb_group (const struct pivot_table *table, struct pivot_dimension *dimension, const char *encoding) { - category->subs = xcalloc (n_categories, sizeof *category->subs); + category->subs = XCALLOC (n_categories, struct pivot_category *); category->n_subs = 0; category->allocated_subs = 0; category->show_label = show_label; @@ -633,9 +634,8 @@ decode_spvlb_dimension (const struct pivot_table *table, /* Allocate and fill the array of leaves now that we know how many there are. */ - out->data_leaves = xcalloc (out->n_leaves, sizeof *out->data_leaves); - out->presentation_leaves = xcalloc (out->n_leaves, - sizeof *out->presentation_leaves); + out->data_leaves = XCALLOC (out->n_leaves, struct pivot_category *); + out->presentation_leaves = XCALLOC (out->n_leaves, struct pivot_category *); out->allocated_leaves = out->n_leaves; error = fill_leaves (out->root, out); if (error) @@ -689,7 +689,7 @@ decode_spvlb_axis (const uint32_t *dimension_indexes, size_t n_dimensions, enum pivot_axis_type axis_type, struct pivot_table *table) { struct pivot_axis *axis = &table->axes[axis_type]; - axis->dimensions = xcalloc (n_dimensions, sizeof *axis->dimensions); + axis->dimensions = XCALLOC (n_dimensions, struct pivot_dimension *); axis->n_dimensions = n_dimensions; axis->extent = 1; for (size_t i = 0; i < n_dimensions; i++) @@ -1004,7 +1004,7 @@ decode_spvlb_table (const struct spvlb_table *in, struct pivot_table **outp) /* Dimensions. */ out->n_dimensions = in->dimensions->n_dims; - out->dimensions = xcalloc (out->n_dimensions, sizeof *out->dimensions); + out->dimensions = XCALLOC (out->n_dimensions, struct pivot_dimension *); for (size_t i = 0; i < out->n_dimensions; i++) { error = decode_spvlb_dimension (out, in->dimensions->dims[i],