X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Ftable.c;h=a6e9f66f80e8b4e90d1e57fc94aeb4bafe2f6c91;hb=164d1274fcb70c54897f2a03fc7c27152ed4821a;hp=a7dc4817f0f946a46fc73ce0f2713490810bbc5b;hpb=5beffdda43634370653661d5a0f5e3c75aa28747;p=pspp-builds.git diff --git a/src/output/table.c b/src/output/table.c index a7dc4817..a6e9f66f 100644 --- a/src/output/table.c +++ b/src/output/table.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. - Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . + Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -18,27 +17,33 @@ 02110-1301, USA. */ #include + #include "table.h" + #include #include #include #include + +#include "output.h" +#include "manager.h" + +#include +#include +#include #include #include #include -#include #include #include -#include "minmax.h" -#include "output.h" #include -#include "manager.h" -#include + +#include "minmax.h" #include "gettext.h" #define _(msgid) gettext (msgid) -struct som_table_class tab_table_class; +const struct som_table_class tab_table_class; static char *command_name; /* Returns the font to use for a cell with the given OPTIONS. */ @@ -136,8 +141,8 @@ tab_realloc (struct tab_table *t, int nc, int nr) if (nc > t->cf) { - int mr1 = min (nr, t->nr); - int mc1 = min (nc, t->nc); + int mr1 = MIN (nr, t->nr); + int mc1 = MIN (nc, t->nc); struct substring *new_cc; unsigned char *new_ct; @@ -536,7 +541,7 @@ tab_value (struct tab_table *table, int c, int r, unsigned char opt, table->cc[c + r * table->cf] = ss_buffer (contents, f->w); table->ct[c + r * table->cf] = opt; - data_out (contents, f, v); + data_out (v, f, contents); } /* Sets cell (C,R) in TABLE, with options OPT, to have value VAL @@ -558,7 +563,7 @@ tab_float (struct tab_table *table, int c, int r, unsigned char opt, assert (r >= 0); assert (r < table->nr); - f = make_output_format (FMT_F, w, d); + f = fmt_for_output (FMT_F, w, d); #if DEBUGGING if (c + table->col_ofs < 0 || r + table->row_ofs < 0 @@ -575,7 +580,7 @@ tab_float (struct tab_table *table, int c, int r, unsigned char opt, #endif double_value.f = val; - data_out (buf, &f, &double_value); + data_out (&double_value, &f, buf); cp = buf; while (isspace ((unsigned char) *cp) && cp < &buf[w]) @@ -838,7 +843,7 @@ tab_next_row (struct tab_table *t) static struct tab_table *t; static struct outp_driver *d; -int tab_hit; +static int tab_hit; /* Set the current table to TABLE. */ static void @@ -1220,7 +1225,7 @@ tabi_render (int c0, int r0, int c1, int r1) y = render_rows (y, c0, c1, (t->nr - t->b) * 2, t->nr * 2 + 1); } -struct som_table_class tab_table_class = +const struct som_table_class tab_table_class = { tabi_table, tabi_driver,