diff options
Diffstat (limited to 'tools/d2c/hooks/manager.c')
-rw-r--r-- | tools/d2c/hooks/manager.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/tools/d2c/hooks/manager.c b/tools/d2c/hooks/manager.c index ff2749b..02544d0 100644 --- a/tools/d2c/hooks/manager.c +++ b/tools/d2c/hooks/manager.c @@ -134,7 +134,6 @@ void register_hook_function(instr_hooks *hooks, char *type, char *name) /****************************************************************************** * * * Paramètres : hooks = gestionnaire d'un ensemble de fonctions associées. * -* top = indique si l'écriture se réalise au plus haut niveau.* * fd = descripteur d'un flux ouvert en écriture. * * * * Description : Déclare des opérations complémentaires pour une instruction. * @@ -145,7 +144,7 @@ void register_hook_function(instr_hooks *hooks, char *type, char *name) * * ******************************************************************************/ -bool declare_hook_functions(const instr_hooks *hooks, bool top, int fd) +bool declare_hook_functions(const instr_hooks *hooks, int fd) { bool result; /* Bilan à retourner */ size_t i; /* Boucle de parcours #1 */ @@ -176,27 +175,18 @@ bool declare_hook_functions(const instr_hooks *hooks, bool top, int fd) if (hooks->func_count > 0) { - if (!top) - dprintf(fd, "\t"); - dprintf(fd, "\tstatic const instr_hook_fc hooks[IPH_COUNT] = {\n\n"); for (i = 0; i < (sizeof(hook_types) / sizeof(hook_types[0])); i++) { func = find_hook_by_name(hooks, hook_types[i]); - if (!top) - dprintf(fd, "\t"); - dprintf(fd, "\t\t[IPH_%s] = (instr_hook_fc)%s,\n", hook_types[i], func != NULL ? func->name : "NULL"); } dprintf(fd, "\n"); - if (!top) - dprintf(fd, "\t"); - dprintf(fd, "\t};\n"); dprintf(fd, "\n"); @@ -211,7 +201,6 @@ bool declare_hook_functions(const instr_hooks *hooks, bool top, int fd) /****************************************************************************** * * * Paramètres : hooks = gestionnaire d'un ensemble de fonctions associées. * -* top = indique si l'écriture se réalise au plus haut niveau.* * fd = descripteur d'un flux ouvert en écriture. * * * * Description : Associe dans le code des fonctions à une instruction. * @@ -222,7 +211,7 @@ bool declare_hook_functions(const instr_hooks *hooks, bool top, int fd) * * ******************************************************************************/ -bool write_hook_functions(const instr_hooks *hooks, bool top, int fd) +bool write_hook_functions(const instr_hooks *hooks, int fd) { bool result; /* Bilan à retourner */ @@ -230,11 +219,7 @@ bool write_hook_functions(const instr_hooks *hooks, bool top, int fd) if (hooks->func_count > 0) { - if (!top) - dprintf(fd, "\t"); - - dprintf(fd, "\tg_arch_instruction_set_hooks(%s, hooks);\n", - top ? "result" : "instr"); + dprintf(fd, "\tg_arch_instruction_set_hooks(result, hooks);\n"); dprintf(fd, "\n"); |