Remove "Written by Ben Pfaff <blp@gnu.org>" lines everywhere.
[pspp-builds.git] / src / data / case.c
index 9c42107de226dc76bc5c21e6f149ee35892f6db4..8c92bbe31d8d92958c5e2e19594fbb76687655cb 100644 (file)
@@ -1,6 +1,5 @@
 /* PSPP - computes sample statistics.
    Copyright (C) 2004 Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -255,7 +254,7 @@ case_from_values (struct ccase *c, const union value *input,
    element of C numbered IDX.
    The caller must not modify the returned data. */
 const union value *
-case_data (const struct ccase *c, size_t idx) 
+case_data_idx (const struct ccase *c, size_t idx) 
 {
   assert (c != NULL);
   assert (c->case_data != NULL);
@@ -270,7 +269,7 @@ case_data (const struct ccase *c, size_t idx)
 /* Returns the numeric value of the `union value' in C numbered
    IDX. */
 double
-case_num (const struct ccase *c, size_t idx) 
+case_num_idx (const struct ccase *c, size_t idx) 
 {
   assert (c != NULL);
   assert (c->case_data != NULL);
@@ -287,7 +286,7 @@ case_num (const struct ccase *c, size_t idx)
    (Note that the value is not null-terminated.)
    The caller must not modify the return value. */
 const char *
-case_str (const struct ccase *c, size_t idx) 
+case_str_idx (const struct ccase *c, size_t idx) 
 {
   assert (c != NULL);
   assert (c->case_data != NULL);
@@ -303,7 +302,7 @@ case_str (const struct ccase *c, size_t idx)
    element of C numbered IDX.
    The caller is allowed to modify the returned data. */
 union value *
-case_data_rw (struct ccase *c, size_t idx) 
+case_data_rw_idx (struct ccase *c, size_t idx) 
 {
   assert (c != NULL);
   assert (c->case_data != NULL);
@@ -338,22 +337,21 @@ case_compare_2dict (const struct ccase *ca, const struct ccase *cb,
       const struct variable *va = *vap;
       const struct variable *vb = *vbp;
 
-      assert (va->type == vb->type);
-      assert (va->width == vb->width);
+      assert (var_get_width (va) == var_get_width (vb));
       
-      if (va->width == 0) 
+      if (var_get_width (va) == 0) 
         {
-          double af = case_num (ca, va->fv);
-          double bf = case_num (cb, vb->fv);
+          double af = case_num (ca, va);
+          double bf = case_num (cb, vb);
 
           if (af != bf) 
             return af > bf ? 1 : -1;
         }
       else 
         {
-          const char *as = case_str (ca, va->fv);
-          const char *bs = case_str (cb, vb->fv);
-          int cmp = memcmp (as, bs, va->width);
+          const char *as = case_str (ca, va);
+          const char *bs = case_str (cb, vb);
+          int cmp = memcmp (as, bs, var_get_width (va));
 
           if (cmp != 0)
             return cmp;