/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
len = read_int32 (r);
if (len >= sizeof label)
- sys_error (r, _("Variable %s has label of invalid length %d."),
- name, len);
+ sys_error (r, _("Variable %s has label of invalid length %u."),
+ name, (unsigned int) len);
read_string (r, label, len + 1);
var_set_label (var, label);
int expected_integer_format;
if (size != 4 || count != 8)
- sys_error (r, _("Bad size (%d) or count (%d) field on record type 7, "
+ sys_error (r, _("Bad size (%u) or count (%u) field on record type 7, "
"subtype 3."),
- size, count);
+ (unsigned int) size, (unsigned int) count);
/* Check floating point format. */
if (r->float_format == FLOAT_IEEE_DOUBLE_BE
double lowest = read_flt64 (r);
if (size != 8 || count != 3)
- sys_error (r, _("Bad size (%d) or count (%d) on extension 4."),
- size, count);
+ sys_error (r, _("Bad size (%u) or count (%u) on extension 4."),
+ (unsigned int) size, (unsigned int) count);
if (sysmis != SYSMIS)
sys_warn (r, _("File specifies unexpected value %g as SYSMIS."), sysmis);
int i;
if (count % 3 || n_vars != dict_get_var_cnt (dict))
- sys_error (r, _("Bad size (%d) or count (%d) on extension 11."),
- size, count);
+ sys_error (r, _("Bad size (%u) or count (%u) on extension 11."),
+ (unsigned int) size, (unsigned int) count);
for (i = 0; i < n_vars; ++i)
{
int align = read_int32 (r);
struct variable *v;
- if (!measure_is_valid (measure) || !alignment_is_valid (align))
+ if (measure < 1 || measure > 3 || align < 0 || align > 2)
{
if (!warned)
sys_warn (r, _("Invalid variable display parameters. "
}
v = dict_get_var (dict, i);
- var_set_measure (v, measure);
+ var_set_measure (v, (measure == 1 ? MEASURE_NOMINAL
+ : measure == 2 ? MEASURE_ORDINAL
+ : MEASURE_SCALE));
var_set_display_width (v, width);
- var_set_alignment (v, align);
+ var_set_alignment (v, (align == 0 ? ALIGN_LEFT
+ : align == 1 ? ALIGN_RIGHT
+ : ALIGN_CENTRE));
}
}
var_cnt = read_int32 (r);
if (var_cnt < 1 || var_cnt > dict_get_var_cnt (dict))
sys_error (r, _("Number of variables associated with a value label (%d) "
- "is not between 1 and the number of variables (%d)."),
- var_cnt, dict_get_var_cnt (dict));
+ "is not between 1 and the number of variables (%u)."),
+ var_cnt, (unsigned int) dict_get_var_cnt (dict));
/* Read the list of variables. */
var = pool_nalloc (subpool, var_cnt, sizeof *var);