X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fformat.c;h=3a380bda45c0d960758739531289436da37f7af9;hb=b20b80bfeb88eca603cb5c10b5a7188387fd23fd;hp=21162a05ae4f4ab21aff8012def2fdcd83d30123;hpb=6c99748d153d74b325a50f79bc8e59f1f9521f98;p=pspp diff --git a/src/data/format.c b/src/data/format.c index 21162a05ae..3a380bda45 100644 --- a/src/data/format.c +++ b/src/data/format.c @@ -475,8 +475,10 @@ fmt_equal (const struct fmt_spec *a, const struct fmt_spec *b) return a->type == b->type && a->w == b->w && a->d == b->d; } -/* Adjusts FMT to be valid for a value of the given WIDTH. */ -void +/* Adjusts FMT to be valid for a value of the given WIDTH if necessary. + If nothing needed to be changed the return value is false + */ +bool fmt_resize (struct fmt_spec *fmt, int width) { if ((width > 0) != fmt_is_string (fmt->type)) @@ -494,7 +496,9 @@ fmt_resize (struct fmt_spec *fmt, int width) else { /* Still numeric. */ + return false; } + return true; } /* Adjusts FMT's width and decimal places to be valid for USE. */