summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-02-25 19:28:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-02-25 19:28:36 (GMT)
commit9a7bace1e8afacb3f2be159dafd80b1723f005fd (patch)
tree2e364720399e48a90b2bf084836643430fc32b0d /src/arch
parent588c206289a84bfc939ac27dacba991d9b6d0793 (diff)
Fixed ARM register comparison.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/register.c12
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;