diff options
author | Richard Henderson <rth@redhat.com> | 2001-10-10 12:53:29 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-10-10 12:53:29 -0700 |
commit | bde257ff591d390fea6af968dfc7935004c95a84 (patch) | |
tree | f58716b402df61329744a155ca95c292f0a42a40 /gcc | |
parent | e10f3d36e5df9436d0627c424d8a4a6c194aede9 (diff) | |
download | gcc-bde257ff591d390fea6af968dfc7935004c95a84.zip gcc-bde257ff591d390fea6af968dfc7935004c95a84.tar.gz gcc-bde257ff591d390fea6af968dfc7935004c95a84.tar.bz2 |
unwind-dw2-fde.c (fde_compare_t): Change return type to int.
* unwind-dw2-fde.c (fde_compare_t): Change return type to int.
(fde_unencoded_compare): Likewise. Don't use subtraction to get
a tristate comparison value.
(fde_single_encoding_compare, fde_mixed_encoding_compare): Likewise.
From-SVN: r46157
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/unwind-dw2-fde.c | 26 |
2 files changed, 26 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a8e2324..29db45c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2001-10-10 Richard Henderson <rth@redhat.com> + + * unwind-dw2-fde.c (fde_compare_t): Change return type to int. + (fde_unencoded_compare): Likewise. Don't use subtraction to get + a tristate comparison value. + (fde_single_encoding_compare, fde_mixed_encoding_compare): Likewise. + 2001-10-10 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> PR c++/4512 diff --git a/gcc/unwind-dw2-fde.c b/gcc/unwind-dw2-fde.c index f2c3425..729adbb 100644 --- a/gcc/unwind-dw2-fde.c +++ b/gcc/unwind-dw2-fde.c @@ -293,14 +293,18 @@ get_fde_encoding (struct dwarf_fde *f) /* Comparison routines. Three variants of increasing complexity. */ -static saddr +static int fde_unencoded_compare (struct object *ob __attribute__((unused)), fde *x, fde *y) { - return *(saddr *)x->pc_begin - *(saddr *)y->pc_begin; + if (x->pc_begin > y->pc_begin) + return 1; + if (x->pc_begin < y->pc_begin) + return -1; + return 0; } -static saddr +static int fde_single_encoding_compare (struct object *ob, fde *x, fde *y) { _Unwind_Ptr base, x_ptr, y_ptr; @@ -309,10 +313,14 @@ fde_single_encoding_compare (struct object *ob, fde *x, fde *y) read_encoded_value_with_base (ob->s.b.encoding, base, x->pc_begin, &x_ptr); read_encoded_value_with_base (ob->s.b.encoding, base, y->pc_begin, &y_ptr); - return x_ptr - y_ptr; + if (x_ptr > y_ptr) + return 1; + if (x_ptr < y_ptr) + return -1; + return 0; } -static saddr +static int fde_mixed_encoding_compare (struct object *ob, fde *x, fde *y) { int x_encoding, y_encoding; @@ -326,10 +334,14 @@ fde_mixed_encoding_compare (struct object *ob, fde *x, fde *y) read_encoded_value_with_base (y_encoding, base_from_object (y_encoding, ob), y->pc_begin, &y_ptr); - return x_ptr - y_ptr; + if (x_ptr > y_ptr) + return 1; + if (x_ptr < y_ptr) + return -1; + return 0; } -typedef saddr (*fde_compare_t) (struct object *, fde *, fde *); +typedef int (*fde_compare_t) (struct object *, fde *, fde *); /* This is a special mix of insertion sort and heap sort, optimized for |