diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2013-03-19 21:13:51 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2013-03-19 21:13:51 (GMT) |
commit | cf97db0ea4d1ea983db38df85984034b49fa4f77 (patch) | |
tree | b6d69945b24ec8da93f0bef7ccf4dfdbe1d920a2 /src/arch/instruction.c | |
parent | e7a85861ba8bcd00ceb7bf9e47f4eadccd48ce3f (diff) |
Defined the first steps towards new graph renderings.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@345 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r-- | src/arch/instruction.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c index c40ff51..3831ee4 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -533,6 +533,42 @@ GArchInstruction *g_arch_instruction_get_given_destination(const GArchInstructio } +/****************************************************************************** +* * +* Paramètres : iter = membre du groupe donné en référence. * +* list = liste des instructions à analyser. * +* count = taille de cette liste. * +* * +* Description : Indique la position dans les instructions identiques. * +* * +* Retour : Indice dans les instructions identiques du groupe. * +* * +* Remarques : - * +* * +******************************************************************************/ + +size_t g_arch_instruction_compute_group_index(GArchInstruction **iter, GArchInstruction **list, size_t count) +{ + size_t result; /* Valeur à retourner */ + size_t i; /* Boucle de parcours */ + + result = 0; + + for (i = 0; i < count; i++) + { + if ((list + i) == iter) + break; + + if (list[i] == *iter) + result++; + + } + + return result; + +} + + /* ---------------------------------------------------------------------------------- */ /* CONVERSIONS DU FORMAT DES INSTRUCTIONS */ |