+Fri Dec 19 16:23:45 2003 Ben Pfaff <blp@gnu.org>
+
+ * matrix-data.c (compare_variables_by_mxd_vartype): Rewrite.
+
Fri Dec 19 15:54:45 2003 Ben Pfaff <blp@gnu.org>
* expr-prs.c: (cmp_func) Removed.
/* Compare two variables using p.mxd.vartype and p.mxd.subtype
fields. */
static int
-compare_variables_by_mxd_vartype (const void *pa, const void *pb)
+compare_variables_by_mxd_vartype (const void *a_, const void *b_)
{
- struct matrix_data_proc *a = &(*((struct variable **) pa))->p.mxd;
- struct matrix_data_proc *b = &(*((struct variable **) pb))->p.mxd;
-
- return (a->vartype != b->vartype
- ? a->vartype - b->vartype
- : a->subtype - b->subtype);
+ struct variable *const *pa = a_;
+ struct variable *const *pb = b_;
+ const struct matrix_data_proc *a = &(*pa)->p.mxd;
+ const struct matrix_data_proc *b = &(*pb)->p.mxd;
+
+ if (a->vartype != b->vartype)
+ return a->vartype > b->vartype ? 1 : -1;
+ else
+ return a->subtype < b->subtype ? -1 : a->subtype > b->subtype;
}
#if DEBUGGING