diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-11-28 09:43:50 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-11-28 09:43:50 (GMT) |
commit | f95598b68b98f6eda701f8f02bc09cb13f65fc72 (patch) | |
tree | eefee33963448a1ce53a7eb80dacabbcdce8fc21 /src/decomp/expr/call.c | |
parent | fbb4b6f53d2189ba9f61c1fd149534d8aef82dcd (diff) |
Followed the excution flow to decompile instructions.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@293 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/decomp/expr/call.c')
-rw-r--r-- | src/decomp/expr/call.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/decomp/expr/call.c b/src/decomp/expr/call.c index aaf9883..e518c6f 100644 --- a/src/decomp/expr/call.c +++ b/src/decomp/expr/call.c @@ -61,7 +61,7 @@ static void g_routine_call_class_init(GRoutineCallClass *); static void g_routine_call_init(GRoutineCall *); /* Imprime pour l'écran un version humaine d'une expression. */ -static void g_routine_call_print(const GRoutineCall *, GCodeBuffer *, GBufferLine *, GLangOutput *); +static GBufferLine *g_routine_call_print(const GRoutineCall *, GCodeBuffer *, GBufferLine *, GLangOutput *); @@ -150,8 +150,9 @@ GDecInstruction *g_routine_call_new(GBinRoutine *routine) * * ******************************************************************************/ -static void g_routine_call_print(const GRoutineCall *call, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output) +static GBufferLine *g_routine_call_print(const GRoutineCall *call, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output) { + GBufferLine *result; /* Ligne à retourner */ const char *name; /* Désignation de la routine */ size_t i; /* Boucle de parcours */ @@ -162,20 +163,23 @@ static void g_routine_call_print(const GRoutineCall *call, GCodeBuffer *buffer, if (call->count > 0) { - g_dec_instruction_print(call->args[0], buffer, line, output); + result = g_dec_instruction_print(call->args[0], buffer, line, output); for (i = 1; i < call->count; i++) { - g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ",", 1, RTT_PUNCT); - g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW); + g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, ",", 1, RTT_PUNCT); + g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW); - g_dec_instruction_print(call->args[i], buffer, line, output); + g_dec_instruction_print(call->args[i], buffer, result, output); } } + else result = line; - g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ")", 1, RTT_PUNCT); + g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, ")", 1, RTT_PUNCT); + + return result; } |