pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/data ChangeLog value.h variable.c


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src/data ChangeLog value.h variable.c
Date: Thu, 07 Jun 2007 05:45:30 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 07/06/07 05:45:30

Modified files:
        src/data       : ChangeLog value.h variable.c 

Log message:
        * value.h (value_cnt_from_width): New function.
        
        * variable.c (var_get_value_cnt): Use new function.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/ChangeLog?cvsroot=pspp&r1=1.127&r2=1.128
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/value.h?cvsroot=pspp&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/variable.c?cvsroot=pspp&r1=1.23&r2=1.24

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/ChangeLog,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -b -r1.127 -r1.128
--- ChangeLog   7 Jun 2007 05:42:01 -0000       1.127
+++ ChangeLog   7 Jun 2007 05:45:30 -0000       1.128
@@ -1,5 +1,11 @@
 2007-06-06  Ben Pfaff  <address@hidden>
 
+       * value.h (value_cnt_from_width): New function.
+
+       * variable.c (var_get_value_cnt): Use new function.
+
+2007-06-06  Ben Pfaff  <address@hidden>
+
        Add casegrouper, to allow cases read from a given casereader to be
        broken into groups, each of which has its own casereader.
        Generally cases are grouped based on having equal values for some

Index: value.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/value.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- value.h     23 Apr 2007 01:30:22 -0000      1.8
+++ value.h     7 Jun 2007 05:45:30 -0000       1.9
@@ -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: variable.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/variable.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- variable.c  22 Apr 2007 00:48:50 -0000      1.23
+++ variable.c  7 Jun 2007 05:45:30 -0000       1.24
@@ -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. */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]