projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6dce32f
)
(case_compare) Implement as delegating to case_compare_2dict().
author
Ben Pfaff
<blp@gnu.org>
Sun, 31 Jul 2005 05:37:30 +0000
(
05:37
+0000)
committer
Ben Pfaff
<blp@gnu.org>
Sun, 31 Jul 2005 05:37:30 +0000
(
05:37
+0000)
src/ChangeLog
patch
|
blob
|
history
src/case.c
patch
|
blob
|
history
diff --git
a/src/ChangeLog
b/src/ChangeLog
index a790250a2fe8949bb85f3d35ad4cff0e8974467f..5c77f6e9be4470ae883840d0c0cc7faa29af0442 100644
(file)
--- a/
src/ChangeLog
+++ b/
src/ChangeLog
@@
-1,3
+1,8
@@
+Sat Jul 30 22:36:29 2005 Ben Pfaff <blp@gnu.org>
+
+ * case.c: (case_compare) Implement as delegating to
+ case_compare_2dict().
+
Sat Jul 30 22:34:18 2005 Ben Pfaff <blp@gnu.org>
* algorithm.c: Inclusion of <alloca.h> is unneeded.
Sat Jul 30 22:34:18 2005 Ben Pfaff <blp@gnu.org>
* algorithm.c: Inclusion of <alloca.h> is unneeded.
diff --git
a/src/case.c
b/src/case.c
index 3e35e973c33a0a4d9d350f5b88eb8a477bd95e95..fee69d4d2b24056d9f7351b97df88e9df0b6ae8f 100644
(file)
--- a/
src/case.c
+++ b/
src/case.c
@@
-356,32
+356,9
@@
int
case_compare (const struct ccase *a, const struct ccase *b,
struct variable *const *vp, size_t var_cnt)
{
case_compare (const struct ccase *a, const struct ccase *b,
struct variable *const *vp, size_t var_cnt)
{
- for (; var_cnt-- > 0; vp++)
- {
- struct variable *v = *vp;
-
- if (v->width == 0)
- {
- double af = case_num (a, v->fv);
- double bf = case_num (b, v->fv);
-
- if (af != bf)
- return af > bf ? 1 : -1;
- }
- else
- {
- const char *as = case_str (a, v->fv);
- const char *bs = case_str (b, v->fv);
- int cmp = memcmp (as, bs, v->width);
-
- if (cmp != 0)
- return cmp;
- }
- }
- return 0;
+ return case_compare_2dict (a, b, vp, vp, var_cnt);
}
}
-
/* Compares the values of the VAR_CNT variables in VAP in case CA
to the values of the VAR_CNT variables in VBP in CB
and returns a strcmp()-type result. */
/* Compares the values of the VAR_CNT variables in VAP in case CA
to the values of the VAR_CNT variables in VBP in CB
and returns a strcmp()-type result. */