diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-02-25 19:28:36 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-02-25 19:28:36 (GMT) |
commit | 9a7bace1e8afacb3f2be159dafd80b1723f005fd (patch) | |
tree | 2e364720399e48a90b2bf084836643430fc32b0d /src/arch | |
parent | 588c206289a84bfc939ac27dacba991d9b6d0793 (diff) |
Fixed ARM register comparison.
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm/register.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/arch/arm/register.c b/src/arch/arm/register.c index 3cda075..fc7ecde 100644 --- a/src/arch/arm/register.c +++ b/src/arch/arm/register.c @@ -25,6 +25,7 @@ #include "register-int.h" +#include "../../common/sort.h" @@ -44,7 +45,7 @@ static void g_arm_register_finalize(GArmRegister *); static guint g_arm_register_hash(const GArmRegister *); /* Compare un registre avec un autre. */ -static int g_arm_register_compare(const GArmRegister *, const GArmRegister *); +static int g_arm_register_compare(const GArmRegister * const *, const GArmRegister * const *); @@ -188,16 +189,11 @@ static guint g_arm_register_hash(const GArmRegister *reg) * * ******************************************************************************/ -static int g_arm_register_compare(const GArmRegister *a, const GArmRegister *b) +static int g_arm_register_compare(const GArmRegister * const *a, const GArmRegister * const *b) { int result; /* Bilan à retourner */ - if (a->index < b->index) - result = -1; - else if (a->index > b->index) - result = 1; - else - result = 0; + result = sort_unsigned_long((*a)->index, (*b)->index); return result; |