fmt->d = decimals;
fmt_fix (fmt, use);
}
+
+unsigned int
+fmt_to_uint (const struct fmt_spec *fmt)
+{
+ return (fmt_to_io (fmt->type) << 24) | (fmt->w << 8) | fmt->d;
+}
+
+bool
+fmt_from_uint (struct fmt_spec *fmt, unsigned int uint)
+{
+ if (!fmt_from_io (uint >> 24, &fmt->type))
+ return false;
+ fmt->w = (uint >> 8) & 0xffff;
+ fmt->d = uint & 0xff;
+ return true;
+}
\f
/* Describes a display format. */
struct fmt_desc
}
const struct fmt_spec F_8_0 = {FMT_F, 8, 0};
+const struct fmt_spec F_8_2 = {FMT_F, 8, 2};
+const struct fmt_spec F_4_3 = {FMT_F, 4, 3};
+const struct fmt_spec F_5_1 = {FMT_F, 5, 1};