X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvariable.c;h=72d9ade6759cfd33e1ed855e5deac987fd18d3f5;hb=811c669032a18cfff53291a98e5803afdf39db36;hp=cc606cc9e77131911727c1e2df85ee8b217189bc;hpb=f863b6025897457e1b61d043833e25a35a4c246e;p=pspp diff --git a/src/data/variable.c b/src/data/variable.c index cc606cc9e7..72d9ade675 100644 --- a/src/data/variable.c +++ b/src/data/variable.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -535,9 +535,12 @@ var_get_print_format (const struct variable *v) void var_set_print_format (struct variable *v, const struct fmt_spec *print) { - assert (fmt_check_width_compat (print, v->width)); - v->print = *print; - dict_var_changed (v); + if (!fmt_equal (&v->print, print)) + { + assert (fmt_check_width_compat (print, v->width)); + v->print = *print; + dict_var_changed (v); + } } /* Returns V's write format specification. */ @@ -554,9 +557,12 @@ var_get_write_format (const struct variable *v) void var_set_write_format (struct variable *v, const struct fmt_spec *write) { - assert (fmt_check_width_compat (write, v->width)); - v->write = *write; - dict_var_changed (v); + if (!fmt_equal (&v->write, write)) + { + assert (fmt_check_width_compat (write, v->width)); + v->write = *write; + dict_var_changed (v); + } } /* Sets V's print and write format specifications to FORMAT,