diff options
Diffstat (limited to 'src/analysis/routine.c')
-rw-r--r-- | src/analysis/routine.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/analysis/routine.c b/src/analysis/routine.c index d97dfc7..eebcb69 100644 --- a/src/analysis/routine.c +++ b/src/analysis/routine.c @@ -38,7 +38,7 @@ struct _GBinRoutine { GObject parent; /* A laisser en premier */ - vmpa_t addr; /* Position physique/mémoire */ + vmpa2t addr; /* Position physique/mémoire */ off_t size; /* Taille du code associé */ RoutineType type; /* Type de routine */ @@ -214,13 +214,7 @@ void g_binary_routine_finalize(GBinRoutine *routine) int g_binary_routine_compare(const GBinRoutine **a, const GBinRoutine **b) { - int result; /* Bilan à renvoyer */ - - if ((*a)->addr < (*b)->addr) result = -1; - else if((*a)->addr > (*b)->addr) result = 1; - else result = 0; - - return result; + return cmp_vmpa(&(*a)->addr, &(*b)->addr); } @@ -232,7 +226,7 @@ int g_binary_routine_compare(const GBinRoutine **a, const GBinRoutine **b) * * * Description : Etablit la comparaison descendante entre deux routines. * * * -* Retour : Bilan : -1 (a < b), 0 (a == b) ou 1 (a > b). * +* Retour : Bilan : 1 (a < b), 0 (a == b) ou -1 (a > b). * * * * Remarques : - * * * @@ -240,13 +234,7 @@ int g_binary_routine_compare(const GBinRoutine **a, const GBinRoutine **b) int g_binary_routine_rcompare(const GBinRoutine **a, const GBinRoutine **b) { - int result; /* Bilan à renvoyer */ - - if ((*a)->addr > (*b)->addr) result = -1; - else if((*a)->addr < (*b)->addr) result = 1; - else result = 0; - - return result; + return (-1) * cmp_vmpa(&(*a)->addr, &(*b)->addr); } @@ -264,9 +252,9 @@ int g_binary_routine_rcompare(const GBinRoutine **a, const GBinRoutine **b) * * ******************************************************************************/ -void g_binary_routine_set_address(GBinRoutine *routine, vmpa_t addr) +void g_binary_routine_set_address(GBinRoutine *routine, const vmpa2t *addr) { - routine->addr = addr; + copy_vmpa(&routine->addr, addr); } @@ -283,9 +271,9 @@ void g_binary_routine_set_address(GBinRoutine *routine, vmpa_t addr) * * ******************************************************************************/ -vmpa_t g_binary_routine_get_address(const GBinRoutine *routine) +const vmpa2t *g_binary_routine_get_address(const GBinRoutine *routine) { - return routine->addr; + return &routine->addr; } @@ -293,7 +281,7 @@ vmpa_t g_binary_routine_get_address(const GBinRoutine *routine) /****************************************************************************** * * * Paramètres : routine = routine à mettre à jour. * -* addr = taille du code associé. * +* size = taille du code associé. * * * * Description : Définit la taille du code d'une routine. * * * |