type = val_type_from_width (width);
v->alignment = var_default_alignment (type);
v->measure = var_default_measure (type);
- v->role = ROLE_NONE;
+ v->role = ROLE_INPUT;
v->display_width = var_default_display_width (width);
v->print = v->write = var_default_formats (width);
attrset_init (&v->attributes);
if (fmt_resize (&v->write, new_width))
traits |= VAR_TRAIT_WRITE_FORMAT;
- v->width = new_width;
- traits |= VAR_TRAIT_WIDTH;
+ if (v->width != new_width)
+ {
+ v->width = new_width;
+ traits |= VAR_TRAIT_WIDTH;
+ }
if (print)
{
traits |= VAR_TRAIT_WRITE_FORMAT;
}
- dict_var_changed (v, traits, ov);
+ if (traits != 0)
+ dict_var_changed (v, traits, ov);
}
/* Changes the width of V to NEW_WIDTH.
{
case ROLE_NONE:
case ROLE_INPUT:
- case ROLE_OUTPUT:
+ case ROLE_TARGET:
case ROLE_BOTH:
case ROLE_PARTITION:
case ROLE_SPLIT:
{
switch (role)
{
- case ROLE_NONE:
- return _("None");
-
case ROLE_INPUT:
return _("Input");
- case ROLE_OUTPUT:
+ case ROLE_TARGET:
return _("Output");
case ROLE_BOTH:
return _("Both");
+ case ROLE_NONE:
+ return _("None");
+
case ROLE_PARTITION:
return _("Partition");
{
switch (role)
{
- case ROLE_NONE:
- return "NONE";
-
case ROLE_INPUT:
return "INPUT";
- case ROLE_OUTPUT:
+ case ROLE_TARGET:
return "TARGET";
case ROLE_BOTH:
return "BOTH";
+ case ROLE_NONE:
+ return "NONE";
+
case ROLE_PARTITION:
return "PARTITION";