#include <libpspp/pool.h>
#include <libpspp/str.h>
+#include "minmax.h"
#include "size_max.h"
#include "gettext.h"
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++;
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;
}
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;
}
{
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;
}
}
{
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;
}
}
}
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;
}
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);
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;
}