X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Fdata-io%2Fmatrix-data.c;h=4898e16ff250040855eb7aef1d68ce3e6e99a2d2;hb=77555681fa75d9b790bf8ba5f8e2aafa853cc183;hp=a1e5d2184ec6adeccd79d43d4cd99cd7137d15bc;hpb=3816248a008a4af75aac6319d0c9929cb7ff679e;p=pspp-builds.git diff --git a/src/language/data-io/matrix-data.c b/src/language/data-io/matrix-data.c index a1e5d218..4898e16f 100644 --- a/src/language/data-io/matrix-data.c +++ b/src/language/data-io/matrix-data.c @@ -44,6 +44,7 @@ #include #include +#include "minmax.h" #include "size_max.h" #include "gettext.h" @@ -609,7 +610,7 @@ cmd_matrix_data (struct lexer *lexer, struct dataset *ds) int type = mv->var_type; assert (type >= 0 && type < MXD_COUNT); - v->print = v->write = fmt_tab[type]; + var_set_both_formats (v, &fmt_tab[type]); if (type == MXD_CONTINUOUS) mx->n_continuous++; @@ -865,17 +866,9 @@ static int s = ss_buffer (start, ss_data (p) - start); if (is_num) - { - struct data_in di; - - di.s = ss_data (s); - di.e = ss_end (s); - di.v = (union value *) &token->number; - di.f1 = dfm_get_column (reader, di.s); - di.format = fmt_for_output (FMT_F, token->length, 0); - - data_in (&di); - } + data_in (s, FMT_F, 0, + dfm_get_column (reader, ss_data (s)), + (union value *) &token->number, 0); else token->type = MSTR; } @@ -1092,7 +1085,7 @@ nr_read_data_lines (struct nr_aux_data *nr, if (token.type != MNUM) { msg (SE, _("expecting value for %s %s"), - dict_get_var (nr->dict, j)->name, + var_get_name (dict_get_var (nr->dict, j)), context (mx->reader)); return 0; } @@ -1267,7 +1260,7 @@ nr_read_splits (struct nr_aux_data *nr, int compare) { msg (SE, _("Expecting value %g for %s."), nr->split_values[i], - dict_get_split_vars (nr->dict)[i]->name); + var_get_name (dict_get_split_vars (nr->dict)[i])); return false; } } @@ -1317,7 +1310,7 @@ nr_read_factors (struct nr_aux_data *nr, int cell) { msg (SE, _("Syntax error expecting value %g for %s %s."), nr->factor_values[i + mx->n_factors * cell], - mx->factors[i]->name, context (mx->reader)); + var_get_name (mx->factors[i]), context (mx->reader)); return false; } } @@ -1361,8 +1354,8 @@ dump_cell_content (const struct dictionary *dict, } if (type == 1) buf_copy_str_rpad (case_data_rw (c, mx->varname_->fv)->s, 8, - dict_get_var (dict, - mx->first_continuous + i)->name); + var_get_name ( + dict_get_var (dict, mx->first_continuous + i))); if (!write_case (wc_data)) return false; } @@ -1745,8 +1738,8 @@ wr_read_rowtype (struct wr_aux_data *wr, char s[16]; char *cp; - memcpy (s, token->string, min (15, token->length)); - s[min (15, token->length)] = 0; + memcpy (s, token->string, MIN (15, token->length)); + s[MIN (15, token->length)] = 0; for (cp = s; *cp; cp++) *cp = toupper ((unsigned char) *cp); @@ -1964,7 +1957,8 @@ wr_read_indeps (struct wr_aux_data *wr) if (token.type != MNUM) { msg (SE, _("Syntax error expecting value for %s %s."), - dict_get_var (wr->dict, mx->first_continuous + j)->name, + var_get_name (dict_get_var (wr->dict, + mx->first_continuous + j)), context (mx->reader)); return false; }