summaryrefslogtreecommitdiff
path: root/src/decomp/lang
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-10-23 16:22:50 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-10-23 18:53:25 (GMT)
commit56f7524c4fd0fc14a509be7689f4820b31564dbc (patch)
tree9c84e11279cd5711a4e0af907ca6160b62317528 /src/decomp/lang
parent3f05bacd4fec23824489b51d964a7ce3565bb85b (diff)
Deleted a level of data to reduce the memory fingerprint.
Diffstat (limited to 'src/decomp/lang')
-rw-r--r--src/decomp/lang/asm.c28
-rw-r--r--src/decomp/lang/java.c74
2 files changed, 51 insertions, 51 deletions
diff --git a/src/decomp/lang/asm.c b/src/decomp/lang/asm.c
index bafef2e..069d0c4 100644
--- a/src/decomp/lang/asm.c
+++ b/src/decomp/lang/asm.c
@@ -165,10 +165,10 @@ static GBufferLine *g_asm_output_write_comments(GAsmOutput *output, GCodeBuffer
result = g_code_buffer_append_new_line_fixme(buffer);
- g_buffer_line_insert_text(result, BLC_COMMENTS, "; ", 2, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_COMMENTS, "; ", 2, RTT_COMMENT, NULL);
if (length > 0)
- g_buffer_line_insert_text(result, BLC_COMMENTS, text, length, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_COMMENTS, text, length, RTT_COMMENT, NULL);
return result;
@@ -191,34 +191,34 @@ static GBufferLine *g_asm_output_write_comments(GAsmOutput *output, GCodeBuffer
static void g_asm_output_write_comp_sign(GAsmOutput *output, GBufferLine *line, CompSignType sign)
{
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
switch (sign)
{
case CST_EQ:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "==", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "==", 2, RTT_SIGNS, NULL);
break;
case CST_NE:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "!=", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "!=", 2, RTT_SIGNS, NULL);
break;
case CST_LT:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "<", 1, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "<", 1, RTT_SIGNS, NULL);
break;
case CST_GE:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ">=", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ">=", 2, RTT_SIGNS, NULL);
break;
case CST_GT:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ">", 1, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ">", 1, RTT_SIGNS, NULL);
break;
case CST_LE:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "<=", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "<=", 2, RTT_SIGNS, NULL);
break;
default:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "?", 1, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "?", 1, RTT_SIGNS, NULL);
break;
}
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
}
@@ -242,7 +242,7 @@ static GBufferLine *g_asm_output_start_routine_info(const GAsmOutput *output, GC
result = g_code_buffer_append_new_line_fixme(buffer);
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "; ", 2, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "; ", 2, RTT_COMMENT, NULL);
return result;
@@ -270,7 +270,7 @@ static GBufferLine *g_asm_output_start_routine_prototype(GAsmOutput *output, GCo
result = g_code_buffer_append_new_line_fixme(buffer);
/* TODO */
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "XXX", 3, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "XXX", 3, RTT_COMMENT, NULL);
return result;
@@ -293,6 +293,6 @@ static GBufferLine *g_asm_output_start_routine_prototype(GAsmOutput *output, GCo
static void g_asm_output_end_routine_prototype(GAsmOutput *output, GCodeBuffer *buffer, GBufferLine *line)
{
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ";", 1, RTT_COMMENT);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ";", 1, RTT_COMMENT, NULL);
}
diff --git a/src/decomp/lang/java.c b/src/decomp/lang/java.c
index d3db691..f8954a8 100644
--- a/src/decomp/lang/java.c
+++ b/src/decomp/lang/java.c
@@ -204,7 +204,7 @@ static GBufferLine *g_java_output_start_comments(GJavaOutput *output, GCodeBuffe
result = g_code_buffer_append_new_line_fixme(buffer);
- g_buffer_line_insert_text(result, BLC_COMMENTS, "/**", 3, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_COMMENTS, "/**", 3, RTT_COMMENT, NULL);
return result;
@@ -232,10 +232,10 @@ static GBufferLine *g_java_output_continue_comments(GJavaOutput *output, GCodeBu
result = g_code_buffer_append_new_line_fixme(buffer);
- g_buffer_line_insert_text(result, BLC_COMMENTS, " * ", 3, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_COMMENTS, " * ", 3, RTT_COMMENT, NULL);
if (length > 0)
- g_buffer_line_insert_text(result, BLC_COMMENTS, text, length, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_COMMENTS, text, length, RTT_COMMENT, NULL);
return result;
@@ -261,7 +261,7 @@ static GBufferLine *g_java_output_end_comments(GJavaOutput *output, GCodeBuffer
result = g_code_buffer_append_new_line_fixme(buffer);
- g_buffer_line_insert_text(result, BLC_COMMENTS, " */", 3, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_COMMENTS, " */", 3, RTT_COMMENT, NULL);
return result;
@@ -289,10 +289,10 @@ static GBufferLine *g_java_output_write_comments(GJavaOutput *output, GCodeBuffe
result = g_code_buffer_append_new_line_fixme(buffer);
- g_buffer_line_insert_text(result, BLC_COMMENTS, "// ", 3, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_COMMENTS, "// ", 3, RTT_COMMENT, NULL);
if (length > 0)
- g_buffer_line_insert_text(result, BLC_COMMENTS, text, length, RTT_COMMENT);
+ g_buffer_line_append_text(result, BLC_COMMENTS, text, length, RTT_COMMENT, NULL);
return result;
@@ -315,34 +315,34 @@ static GBufferLine *g_java_output_write_comments(GJavaOutput *output, GCodeBuffe
static void g_java_output_write_comp_sign(GJavaOutput *output, GBufferLine *line, CompSignType sign)
{
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
switch (sign)
{
case CST_EQ:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "==", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "==", 2, RTT_SIGNS, NULL);
break;
case CST_NE:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "!=", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "!=", 2, RTT_SIGNS, NULL);
break;
case CST_LT:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "<", 1, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "<", 1, RTT_SIGNS, NULL);
break;
case CST_GE:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ">=", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ">=", 2, RTT_SIGNS, NULL);
break;
case CST_GT:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ">", 1, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ">", 1, RTT_SIGNS, NULL);
break;
case CST_LE:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "<=", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "<=", 2, RTT_SIGNS, NULL);
break;
default:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "?", 1, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "?", 1, RTT_SIGNS, NULL);
break;
}
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
}
@@ -363,22 +363,22 @@ static void g_java_output_write_comp_sign(GJavaOutput *output, GBufferLine *line
static void g_java_output_write_cond_operator(GLangOutput *output, GBufferLine *line, CondOperatorType op)
{
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
switch (op)
{
case COT_AND:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "&&", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "&&", 2, RTT_SIGNS, NULL);
break;
case COT_OR:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "||", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "||", 2, RTT_SIGNS, NULL);
break;
default:
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "??", 2, RTT_SIGNS);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "??", 2, RTT_SIGNS, NULL);
break;
}
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
}
@@ -404,15 +404,15 @@ static GBufferLine *g_java_output_start_class(GJavaOutput *output, GCodeBuffer *
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);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "class", 5, RTT_KEY_WORD, NULL);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
name = _g_data_type_to_string(type, true);
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, name, strlen(name), RTT_RAW);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, name, strlen(name), RTT_RAW, NULL);
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);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK, NULL);
result = g_code_buffer_append_new_line_fixme(buffer);
@@ -444,7 +444,7 @@ static void g_java_output_end_class(GJavaOutput *output, GCodeBuffer *buffer)
result = g_code_buffer_append_new_line_fixme(buffer);
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK, NULL);
result = g_code_buffer_append_new_line_fixme(buffer);
@@ -474,7 +474,7 @@ static GBufferLine *g_java_output_start_routine_prototype(GJavaOutput *output, G
result = g_code_buffer_append_new_line_fixme(buffer);
/* TODO */
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "XXX", 3, RTT_RAW);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "XXX", 3, RTT_RAW, NULL);
return result;
@@ -497,7 +497,7 @@ static GBufferLine *g_java_output_start_routine_prototype(GJavaOutput *output, G
static void g_java_output_end_routine_prototype(GJavaOutput *output, GCodeBuffer *buffer, GBufferLine *line)
{
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ";", 1, RTT_PUNCT);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, ";", 1, RTT_PUNCT, NULL);
}
@@ -519,8 +519,8 @@ static void g_java_output_end_routine_prototype(GJavaOutput *output, GCodeBuffer
static void g_java_output_start_routine_body(GJavaOutput *output, GCodeBuffer *buffer, GBufferLine *line)
{
/*
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK, NULL);
g_code_buffer_inc_indentation(buffer);
*/
@@ -548,7 +548,7 @@ static void g_java_output_end_routine_body(GJavaOutput *output, GCodeBuffer *buf
line = g_code_buffer_append_new_line_fixme(buffer);
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK, NULL);
*/
}
@@ -574,8 +574,8 @@ static GBufferLine *g_java_output_start_code_block(GJavaOutput *output, GCodeBuf
if (count > 1)
{
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
- g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, "{", 1, RTT_HOOK, NULL);
}
g_code_buffer_inc_indentation(buffer);
@@ -612,8 +612,8 @@ static GBufferLine *g_java_output_end_code_block(GJavaOutput *output, GCodeBuffe
if (count > 1)
{
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK);
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "}", 1, RTT_HOOK, NULL);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW, NULL);
}
return result;
@@ -643,9 +643,9 @@ static GBufferLine *g_java_output_encapsulate_condition(GLangOutput *output, GCo
result = line;
if (opening)
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, "(", 1, RTT_HOOK);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, "(", 1, RTT_HOOK, NULL);
else
- g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, ")", 1, RTT_HOOK);
+ g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, ")", 1, RTT_HOOK, NULL);
return result;