* variable.c (var_get_value_cnt): Use new function.
+2007-06-06 Ben Pfaff <blp@gnu.org>
+
+ * value.h (value_cnt_from_width): New function.
+
+ * variable.c (var_get_value_cnt): Use new function.
+
2007-06-06 Ben Pfaff <blp@gnu.org>
Add casegrouper, to allow cases read from a given casereader to be
#define LOWEST second_lowest_value
#define HIGHEST DBL_MAX
+/* Number of "union value"s required for a variable of the given
+ WIDTH. */
+static inline size_t
+value_cnt_from_width (int width)
+{
+ return width == 0 ? 1 : DIV_RND_UP (width, MAX_SHORT_STRING);
+}
+
/* A numeric or short string value.
Multiple consecutive values represent a long string. */
union value
size_t
var_get_value_cnt (const struct variable *v)
{
- return v->width == 0 ? 1 : DIV_RND_UP (v->width, MAX_SHORT_STRING);
+ return value_cnt_from_width (v->width);
}
\f
/* Returns variable V's missing values. */