summaryrefslogtreecommitdiff
path: root/src/decomp
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-07-14 09:49:51 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-07-14 09:49:51 (GMT)
commit9371129c1b7aa830ed889abd4481cb505d90c4a7 (patch)
tree579dd07fc31bab09c30e0dcdc60a356d5eaac99e /src/decomp
parent412f9fd31e625dbb2b00c25b6cc6b4753acd409d (diff)
Indented the output of decompilations.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@249 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/decomp')
-rw-r--r--src/decomp/lang/java.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/decomp/lang/java.c b/src/decomp/lang/java.c
index 7c5750b..e5ebdf9 100644
--- a/src/decomp/lang/java.c
+++ b/src/decomp/lang/java.c
@@ -346,18 +346,24 @@ static void g_java_output_write_comp_sign(GJavaOutput *output, GBufferLine *line
static GBufferLine *g_java_output_start_class(GJavaOutput *output, GCodeBuffer *buffer, const GOpenidaType *type)
{
GBufferLine *result; /* Adresse nouvelle à remonter */
+ char *name; /* Désignation humaine */
result = g_code_buffer_append_new_line_fixme(buffer);
g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "class", 5, RTT_KEY_WORD);
g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
- /* TODO */
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "XXX", 3, RTT_RAW);
+ name = _g_openida_type_to_string(type, true);
+ g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, name, strlen(name), RTT_RAW);
+ free(name);
g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK);
+ result = g_code_buffer_append_new_line_fixme(buffer);
+
+ g_code_buffer_inc_indentation(buffer);
+
return result;
}
@@ -380,10 +386,14 @@ static void g_java_output_end_class(GJavaOutput *output, GCodeBuffer *buffer)
{
GBufferLine *result; /* Adresse nouvelle à remonter */
+ g_code_buffer_dec_indentation(buffer);
+
result = g_code_buffer_append_new_line_fixme(buffer);
g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK);
+ result = g_code_buffer_append_new_line_fixme(buffer);
+
return result;
}