static const struct table_class tab_table_class;
+struct fmt_spec ugly [n_RC] =
+ {
+ {FMT_F, 8, 0}, /* INTEGER */
+ {FMT_F, 8, 3}, /* WEIGHT (ignored) */
+ {FMT_F, 8, 3}, /* PVALUE */
+ {FMT_F, 8, 3} /* OTHER (ignored) */
+ };
+
+
/* Creates and returns a new table with NC columns and NR rows and initially no
header rows or columns. The table's cells are initially empty. */
struct tab_table *
memset (t->rv, TAL_GAP, nr * (nc + 1));
- t->fmtmap[RC_PVALUE] = &F_4_3;
- t->fmtmap[RC_INTEGER] = &F_8_0;
- t->fmtmap[RC_OTHER] = settings_get_format ();
+ t->fmtmap[RC_PVALUE] = ugly[RC_PVALUE];
+ t->fmtmap[RC_INTEGER] = ugly[RC_INTEGER];
+ t->fmtmap[RC_OTHER] = *settings_get_format ();
t->col_ofs = t->row_ofs = 0;
void
tab_set_format (struct tab_table *t, enum result_class rc, const struct fmt_spec *fmt)
{
- t->fmtmap[rc] = fmt;
+ t->fmtmap[rc] = *fmt;
}
assert (r < tab_nr (table));
if (fmt == NULL)
- fmt = table->fmtmap[rc];
+ fmt = &table->fmtmap[rc];
fmt_check_output (fmt);