X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Ftable.c;h=a7dc4817f0f946a46fc73ce0f2713490810bbc5b;hb=5beffdda43634370653661d5a0f5e3c75aa28747;hp=1b120124a4ce8022893d153e2b0d91117070ee41;hpb=b0cc7c3cbaf7a25a0e57129ab092be124f0ff529;p=pspp diff --git a/src/output/table.c b/src/output/table.c index 1b120124a4..a7dc4817f0 100644 --- a/src/output/table.c +++ b/src/output/table.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +87,7 @@ void tab_destroy (struct tab_table *t) { assert (t != NULL); + free (t->title); pool_destroy (t->container); } @@ -305,7 +307,7 @@ tab_box (struct tab_table *t, int f_h, int f_v, int i_h, int i_v, x2, t->col_ofs, x2 + t->col_ofs, y2, t->row_ofs, y2 + t->row_ofs, t->nc, t->nr); - abort (); + NOT_REACHED (); } #endif @@ -434,10 +436,10 @@ tab_natural_width (struct tab_table *t, struct outp_driver *d, int c) if (width == 0) { - width = d->prop_em_width * 8; -#if DEBUGGING - printf ("warning: table column %d contains no data.\n", c); -#endif + /* FIXME: This is an ugly kluge to compensate for the fact + that we don't let joined cells contribute to column + widths. */ + width = d->prop_em_width * 8; } { @@ -801,15 +803,15 @@ tab_offset (struct tab_table *t, int col, int row) assert (t != NULL); #if DEBUGGING - if (row < -1 || row >= t->nr) + if (row < -1 || row > t->nr) { printf ("tab_offset(): row=%d in %d-row table\n", row, t->nr); - abort (); + NOT_REACHED (); } - if (col < -1 || col >= t->nc) + if (col < -1 || col > t->nc) { printf ("tab_offset(): col=%d in %d-column table\n", col, t->nc); - abort (); + NOT_REACHED (); } #endif @@ -870,7 +872,7 @@ rule_to_spacing_type (unsigned char type) case TAL_2: return OUTP_L_DOUBLE; default: - abort (); + NOT_REACHED (); } } @@ -1256,7 +1258,7 @@ translate_justification (unsigned int opt) case TAB_CENTER: return OUTP_CENTER; default: - abort (); + NOT_REACHED (); } } @@ -1275,7 +1277,7 @@ rule_to_draw_type (unsigned char type) case TAL_2: return OUTP_L_DOUBLE; default: - abort (); + NOT_REACHED (); } }