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.c value.h


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src/data ChangeLog value.c value.h
Date: Mon, 23 Apr 2007 01:30:23 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 07/04/23 01:30:23

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

Log message:
        Patch #5886.
        
        (value_copy): New function.
        (value_set_missing): Ditto.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/ChangeLog?cvsroot=pspp&r1=1.112&r2=1.113
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/value.c?cvsroot=pspp&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/value.h?cvsroot=pspp&r1=1.7&r2=1.8

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/ChangeLog,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -b -r1.112 -r1.113
--- ChangeLog   22 Apr 2007 00:48:50 -0000      1.112
+++ ChangeLog   23 Apr 2007 01:30:22 -0000      1.113
@@ -1,3 +1,8 @@
+2007-04-22  Ben Pfaff  <address@hidden>
+
+       * value.c (value_copy): New function.
+       (value_set_missing): Ditto.
+
 2007-04-22 John Darrington <address@hidden>
 
        * Deleted existing category.h and moved cat-routines.h into 

Index: value.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/value.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- value.c     15 Dec 2006 00:16:02 -0000      1.2
+++ value.c     23 Apr 2007 01:30:22 -0000      1.3
@@ -53,3 +53,25 @@
           ? hsh_hash_double (v->f)
           : hsh_hash_bytes (v->s, MIN (MAX_SHORT_STRING, width)));
 }
+
+/* Copies SRC to DST, given that they both contain data of the
+   given WIDTH. */
+void
+value_copy (union value *dst, const union value *src, int width) 
+{
+  if (width == 0)
+    dst->f = src->f;
+  else
+    memcpy (dst->s, src->s, width);
+}
+
+/* Sets V to the system-missing value for data of the given
+   WIDTH. */
+void
+value_set_missing (union value *v, int width) 
+{
+  if (width == 0)
+    v->f = SYSMIS;
+  else
+    memset (v->s, ' ', width); 
+}

Index: value.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/value.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- value.h     23 Dec 2006 09:03:45 -0000      1.7
+++ value.h     23 Apr 2007 01:30:22 -0000      1.8
@@ -50,4 +50,7 @@
 int compare_values (const union value *, const union value *, int width);
 unsigned hash_value (const union value  *, int width);
 
+void value_copy (union value *, const union value *, int width);
+void value_set_missing (union value *, int width);
+
 #endif /* !value.h */




reply via email to

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