diff options
Diffstat (limited to 'src/arch/operand.c')
-rw-r--r-- | src/arch/operand.c | 49 |
1 files changed, 14 insertions, 35 deletions
diff --git a/src/arch/operand.c b/src/arch/operand.c index 43d0027..e98683e 100644 --- a/src/arch/operand.c +++ b/src/arch/operand.c @@ -37,7 +37,7 @@ static void g_arch_operand_init(GArchOperand *); /* Indique le type défini pour un opérande d'architecture. */ -G_DEFINE_TYPE(GArchOperand, g_arch_operand, G_TYPE_CONTENT_EXPORTER); +G_DEFINE_TYPE(GArchOperand, g_arch_operand, G_TYPE_OBJECT); @@ -79,21 +79,27 @@ static void g_arch_operand_init(GArchOperand *operand) /****************************************************************************** * * -* Paramètres : operand = opérande à traiter. * -* format = format du binaire manipulé. * -* syntax = type de représentation demandée. * +* Paramètres : a = premier opérande à consulter. * +* b = second opérande à consulter. * * * -* Description : Traduit un opérande en version humainement lisible. * +* Description : Compare un opérande avec un autre. * * * -* Retour : Chaîne de caractères à libérer de la mémoire. * +* Retour : Bilan de la comparaison. * * * * Remarques : - * * * ******************************************************************************/ -char *g_arch_operand_get_text(const GArchOperand *operand, const GExeFormat *format, AsmSyntax syntax) +bool g_arch_operand_compare(const GArchOperand *a, const GArchOperand *b) { - return operand->get_text(operand, format, syntax); + bool result; /* Bilan à faire remonter */ + + result = (G_OBJECT_TYPE(G_OBJECT(a)) == G_OBJECT_TYPE(G_OBJECT(b))); + + if (result) + result = a->compare(a, b); + + return result; } @@ -117,30 +123,3 @@ void g_arch_operand_print(const GArchOperand *operand, GBufferLine *line, AsmSyn return operand->print(operand, line, syntax); } - - -/****************************************************************************** -* * -* Paramètres : a = premier opérande à consulter. * -* b = second opérande à consulter. * -* * -* Description : Compare un opérande avec un autre. * -* * -* Retour : Bilan de la comparaison. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool g_arch_operand_compare(const GArchOperand *a, const GArchOperand *b) -{ - bool result; /* Bilan à faire remonter */ - - result = (G_OBJECT_TYPE(G_OBJECT(a)) == G_OBJECT_TYPE(G_OBJECT(b))); - - if (result) - result = a->compare(a, b); - - return result; - -} |