X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmatrix-data.c;h=e0dfdcee4c2d036a5179926a0b5124aa9c59dee2;hb=7d9a47fdc83e4adda2a8b2ee1406f277c4ffe2b8;hp=29e923762049b554e7fcf03e0d0864141fa71812;hpb=7dc203206d3f3172474a4ec0f4dcab5364f4ce26;p=pspp-builds.git diff --git a/src/matrix-data.c b/src/matrix-data.c index 29e92376..e0dfdcee 100644 --- a/src/matrix-data.c +++ b/src/matrix-data.c @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include "error.h" @@ -38,6 +38,9 @@ #include "var.h" #include "vfm.h" +#include "gettext.h" +#define _(msgid) gettext (msgid) + #include "debug-print.h" /* FIXME: /N subcommand not implemented. It should be pretty simple, @@ -218,7 +221,7 @@ cmd_matrix_data (void) int i; for (i = 0; i < nv; i++) - if (!strcmp (v[i], "VARNAME_")) + if (!strcasecmp (v[i], "VARNAME_")) { msg (SE, _("VARNAME_ cannot be explicitly specified on " "VARIABLES.")); @@ -236,7 +239,7 @@ cmd_matrix_data (void) { struct variable *new_var; - if (strcmp (v[i], "ROWTYPE_")) + if (strcasecmp (v[i], "ROWTYPE_")) { new_var = dict_create_var_assert (default_dict, v[i], 0); attach_mxd_aux (new_var, MXD_CONTINUOUS, i); @@ -306,7 +309,8 @@ cmd_matrix_data (void) if (dict_lookup_var (default_dict, tokid) == NULL && (lex_look_ahead () == '.' || lex_look_ahead () == '/')) { - if (!strcmp (tokid, "ROWTYPE_") || !strcmp (tokid, "VARNAME_")) + if (!strcasecmp (tokid, "ROWTYPE_") + || !strcasecmp (tokid, "VARNAME_")) { msg (SE, _("Split variable may not be named ROWTYPE_ " "or VARNAME_.")); @@ -567,7 +571,7 @@ cmd_matrix_data (void) system file output. */ { struct variable **v; - size_t nv; + int nv; dict_get_vars (default_dict, &v, &nv, 0); qsort (v, nv, sizeof *v, compare_variables_by_mxd_var_type); @@ -668,7 +672,7 @@ string_to_content_type (char *s, int *collide) }; for (tp = tab; tp->value != -1; tp++) - if (!strcmp (s, tp->string)) + if (!strcasecmp (s, tp->string)) { if (collide) *collide = tp->collide; @@ -883,9 +887,7 @@ static int di.e = token->string + token->length; di.v = (union value *) &token->number; di.f1 = first_column; - di.format.type = FMT_F; - di.format.w = token->length; - di.format.d = 0; + di.format = make_output_format (FMT_F, token->length, 0); if (!data_in (&di)) return 0; @@ -1346,8 +1348,8 @@ dump_cell_content (struct matrix_data_pgm *mx, int content, double *cp, int type = content_type[content]; { - st_bare_pad_copy (case_data_rw (c, mx->rowtype_->fv)->s, - content_names[content], 8); + buf_copy_str_rpad (case_data_rw (c, mx->rowtype_->fv)->s, 8, + content_names[content]); if (type != 1) memset (case_data_rw (c, mx->varname_->fv)->s, ' ', 8); @@ -1368,10 +1370,9 @@ dump_cell_content (struct matrix_data_pgm *mx, int content, double *cp, cp++; } if (type == 1) - st_bare_pad_copy (case_data_rw (c, mx->varname_->fv)->s, - dict_get_var (default_dict, - mx->first_continuous + i)->name, - 8); + buf_copy_str_rpad (case_data_rw (c, mx->varname_->fv)->s, 8, + dict_get_var (default_dict, + mx->first_continuous + i)->name); write_case (wc_data); } } @@ -1666,11 +1667,8 @@ wr_output_data (struct wr_aux_data *wr, int factor; for (factor = 0; factor < mx->n_factors; factor++) - { - case_data_rw (c, mx->factors[factor]->fv)->f - = iter->factors[factor]; - debug_printf (("f:%s ", factors[factor]->name)); - } + case_data_rw (c, mx->factors[factor]->fv)->f + = iter->factors[factor]; } {