[Vala] Redundant C code
- From: Kentaro NAKAZAWA <kentaro nakazawa nifty com>
- To: vala-list gnome org
- Subject: [Vala] Redundant C code
- Date: Wed, 09 Jun 2010 00:27:31 +0900
Hello.
(sorry, my English is not so good ;)
When I convert the following code into C language.
----------------
void main () {
int[] a = { };
a += 1;
a += 1;
}
----------------
It is converted into a redundant following C code.
----------------
static void _vala_array_add1 (gint** array, int* length, int* size, gint value) {
if ((*length) == (*size)) {
*size = (*size) ? (2 * (*size)) : 4;
*array = g_renew (gint, *array, *size);
}
(*array)[(*length)++] = value;
}
static void _vala_array_add2 (gint** array, int* length, int* size, gint value) {
if ((*length) == (*size)) {
*size = (*size) ? (2 * (*size)) : 4;
*array = g_renew (gint, *array, *size);
}
(*array)[(*length)++] = value;
}
----------------
I think enough by one.
--
Kentaro NAKAZAWA
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]