[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch 10/19] new function value_cnt_from_width
From: |
blp |
Subject: |
[patch 10/19] new function value_cnt_from_width |
Date: |
Tue, 05 Jun 2007 23:27:37 -0700 |
User-agent: |
quilt/0.45-1 |
Index: merge/src/data/value.h
===================================================================
--- merge.orig/src/data/value.h 2007-06-03 18:44:51.000000000 -0700
+++ merge/src/data/value.h 2007-06-04 21:31:31.000000000 -0700
@@ -38,6 +38,14 @@
#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
Index: merge/src/data/variable.c
===================================================================
--- merge.orig/src/data/variable.c 2007-06-03 18:44:51.000000000 -0700
+++ merge/src/data/variable.c 2007-06-04 21:31:31.000000000 -0700
@@ -423,7 +423,7 @@
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);
}
/* Returns variable V's missing values. */
--
- Re: [patch 05/19] sparse array of cases, (continued)
- [patch 12/19] make aux_data static in libpspp tests, blp, 2007/06/06
- [patch 19/19] i18n changes to Smake, configure.ac, blp, 2007/06/06
- [patch 08/19] case_ordering implementation, blp, 2007/06/06
- [patch 11/19] fix assertion in binary_search, blp, 2007/06/06
- [patch 18/19] fairly experimental changes based on what seemed to make sense, blp, 2007/06/06
- [patch 10/19] new function value_cnt_from_width,
blp <=
- [patch 02/19] new function get_workspace_cases, blp, 2007/06/06
- [patch 06/19] sliding window of cases, blp, 2007/06/06
- [patch 04/19] temporary file for array of cases, blp, 2007/06/06
- [patch 09/19] casegrouper implementation, blp, 2007/06/06