From 1cf53aeaa72f8cc613eb4d9b4dc2e1119df997e9 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 20 Dec 2003 00:47:56 +0000 Subject: [PATCH] Fri Dec 19 16:42:13 2003 Ben Pfaff * postscript.c: (int_2_compare) Rewrite. (compare_line) Rewrite. --- src/ChangeLog | 5 +++++ src/postscript.c | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 16b12205..16e58e94 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +Fri Dec 19 16:42:13 2003 Ben Pfaff + + * postscript.c: (int_2_compare) Rewrite. + (compare_line) Rewrite. + Fri Dec 19 16:38:35 2003 Ben Pfaff * matrix-data.c (compare_factors) Use lexicographical_compare() diff --git a/src/postscript.c b/src/postscript.c index 2123ed38..91904820 100644 --- a/src/postscript.c +++ b/src/postscript.c @@ -1732,16 +1732,22 @@ ps_close_page (struct outp_driver *this) /* qsort() comparison function for int tuples. */ static int -int_2_compare (const void *a, const void *b) +int_2_compare (const void *a_, const void *b_) { - return *((const int *) a) - *((const int *) b); + const int *a = a_; + const int *b = b_; + + return *a < *b ? -1 : *a > *b; } /* Hash table comparison function for cached lines. */ static int -compare_line (const void *a, const void *b, void *foo unused) +compare_line (const void *a_, const void *b_, void *foo unused) { - return ((struct line_form *) a)->ind - ((struct line_form *) b)->ind; + const struct line_form *a = a_; + const struct line_form *b = b_; + + return a->ind < b->ind ? -1 : a->ind > b->ind; } /* Hash table hash function for cached lines. */ -- 2.30.2