782
816
cparam_map = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_FORMAL_PARAMETER, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal);
783
817
carg_map = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_EXPRESSION, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal);
784
cl = _vala_code_node_ref0 ((_tmp4_ = vala_symbol_get_parent_symbol ((ValaSymbol*) m), VALA_IS_CLASS (_tmp4_) ? ((ValaClass*) _tmp4_) : NULL));
818
cl = _vala_code_node_ref0 ((_tmp5_ = vala_symbol_get_parent_symbol ((ValaSymbol*) m), VALA_IS_CLASS (_tmp5_) ? ((ValaClass*) _tmp5_) : NULL));
785
819
if (VALA_IS_CREATION_METHOD (m)) {
825
_tmp6_ = vala_class_get_is_abstract (cl);
791
_tmp5_ = vala_class_get_is_abstract (cl);
796
ValaCCodeFunctionCall* _tmp8_;
797
ValaCCodeIdentifier* _tmp7_;
798
vala_ccode_base_module_generate_cparameters ((ValaCCodeBaseModule*) self, m, decl_space, (ValaMap*) cparam_map, function, NULL, (ValaMap*) carg_map, _tmp8_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp7_ = vala_ccode_identifier_new ("fake"))), 3);
830
ValaCCodeFunctionCall* _tmp9_;
831
ValaCCodeIdentifier* _tmp8_;
832
vala_ccode_base_module_generate_cparameters ((ValaCCodeBaseModule*) self, m, decl_space, (ValaMap*) cparam_map, function, NULL, (ValaMap*) carg_map, _tmp9_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp8_ = vala_ccode_identifier_new ("fake"))), 3);
833
_vala_ccode_node_unref0 (_tmp9_);
799
834
_vala_ccode_node_unref0 (_tmp8_);
800
_vala_ccode_node_unref0 (_tmp7_);
801
835
vala_ccode_declaration_space_add_type_member_declaration (decl_space, (ValaCCodeNode*) function);
803
837
if (VALA_IS_CREATION_METHOD (m)) {
838
_tmp10_ = cl != NULL;
809
ValaCCodeFunction* _tmp11_;
811
ValaHashMap* _tmp12_;
812
function = (_tmp11_ = vala_ccode_function_new (_tmp10_ = vala_method_get_real_cname (m), "void"), _vala_ccode_node_unref0 (function), _tmp11_);
843
ValaCCodeFunction* _tmp12_;
845
ValaHashMap* _tmp13_;
846
function = (_tmp12_ = vala_ccode_function_new (_tmp11_ = vala_method_get_real_cname (m), "void"), _vala_ccode_node_unref0 (function), _tmp12_);
814
848
if (vala_symbol_is_private_symbol ((ValaSymbol*) m)) {
815
849
vala_ccode_function_set_modifiers (function, vala_ccode_function_get_modifiers (function) | VALA_CCODE_MODIFIERS_STATIC);
817
cparam_map = (_tmp12_ = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_FORMAL_PARAMETER, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal), _vala_collection_object_unref0 (cparam_map), _tmp12_);
851
cparam_map = (_tmp13_ = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_FORMAL_PARAMETER, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal), _vala_collection_object_unref0 (cparam_map), _tmp13_);
818
852
vala_ccode_base_module_generate_cparameters ((ValaCCodeBaseModule*) self, m, decl_space, (ValaMap*) cparam_map, function, NULL, NULL, NULL, 3);
819
853
vala_ccode_declaration_space_add_type_member_declaration (decl_space, (ValaCCodeNode*) function);
1047
1086
((ValaCCodeBaseModule*) self)->temp_ref_vars = (_tmp2_ = vala_array_list_new (VALA_TYPE_LOCAL_VARIABLE, (GBoxedCopyFunc) vala_code_node_ref, vala_code_node_unref, g_direct_equal), _vala_collection_object_unref0 (((ValaCCodeBaseModule*) self)->temp_ref_vars), _tmp2_);
1048
1087
((ValaCCodeBaseModule*) self)->variable_name_map = (_tmp3_ = (ValaMap*) vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_str_hash, g_str_equal, g_direct_equal), _vala_collection_object_unref0 (((ValaCCodeBaseModule*) self)->variable_name_map), _tmp3_);
1049
1088
((ValaCCodeBaseModule*) self)->current_try = (_tmp4_ = NULL, _vala_code_node_unref0 (((ValaCCodeBaseModule*) self)->current_try), _tmp4_);
1089
((ValaCCodeBaseModule*) self)->state_switch_statement = (_tmp5_ = NULL, _vala_ccode_node_unref0 (((ValaCCodeBaseModule*) self)->state_switch_statement), _tmp5_);
1050
1090
in_gobject_creation_method = FALSE;
1051
1091
in_fundamental_creation_method = FALSE;
1052
1092
vala_ccode_base_module_check_type ((ValaCCodeBaseModule*) self, vala_method_get_return_type (m));
1053
1093
if (VALA_IS_CREATION_METHOD (m)) {
1054
ValaTypeSymbol* _tmp5_;
1094
ValaTypeSymbol* _tmp6_;
1056
gboolean _tmp6_ = FALSE;
1057
cl = _vala_code_node_ref0 ((_tmp5_ = vala_ccode_base_module_get_current_type_symbol ((ValaCCodeBaseModule*) self), VALA_IS_CLASS (_tmp5_) ? ((ValaClass*) _tmp5_) : NULL));
1096
gboolean _tmp7_ = FALSE;
1097
cl = _vala_code_node_ref0 ((_tmp6_ = vala_ccode_base_module_get_current_type_symbol ((ValaCCodeBaseModule*) self), VALA_IS_CLASS (_tmp6_) ? ((ValaClass*) _tmp6_) : NULL));
1058
1098
if (cl != NULL) {
1059
_tmp6_ = !vala_class_get_is_compact (cl);
1099
_tmp7_ = !vala_class_get_is_compact (cl);
1064
1104
if (vala_class_get_base_class (cl) == NULL) {
1065
1105
in_fundamental_creation_method = TRUE;
1067
gboolean _tmp7_ = FALSE;
1107
gboolean _tmp8_ = FALSE;
1068
1108
if (((ValaCCodeBaseModule*) self)->gobject_type != NULL) {
1069
_tmp7_ = vala_typesymbol_is_subtype_of ((ValaTypeSymbol*) cl, ((ValaCCodeBaseModule*) self)->gobject_type);
1109
_tmp8_ = vala_typesymbol_is_subtype_of ((ValaTypeSymbol*) cl, ((ValaCCodeBaseModule*) self)->gobject_type);
1074
1114
in_gobject_creation_method = TRUE;
1078
1118
_vala_code_node_unref0 (cl);
1120
if (vala_method_get_coroutine (m)) {
1121
ValaCCodeSwitchStatement* _tmp11_;
1122
ValaCCodeMemberAccess* _tmp10_;
1123
ValaCCodeIdentifier* _tmp9_;
1124
ValaCCodeCaseStatement* _tmp13_;
1125
ValaCCodeConstant* _tmp12_;
1126
ValaCCodeGotoStatement* _tmp14_;
1127
((ValaCCodeBaseModule*) self)->state_switch_statement = (_tmp11_ = vala_ccode_switch_statement_new ((ValaCCodeExpression*) (_tmp10_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp9_ = vala_ccode_identifier_new ("data")), "_state_"))), _vala_ccode_node_unref0 (((ValaCCodeBaseModule*) self)->state_switch_statement), _tmp11_);
1128
_vala_ccode_node_unref0 (_tmp10_);
1129
_vala_ccode_node_unref0 (_tmp9_);
1130
vala_ccode_block_add_statement ((ValaCCodeBlock*) ((ValaCCodeBaseModule*) self)->state_switch_statement, (ValaCCodeNode*) (_tmp13_ = vala_ccode_case_statement_new ((ValaCCodeExpression*) (_tmp12_ = vala_ccode_constant_new ("0")))));
1131
_vala_ccode_node_unref0 (_tmp13_);
1132
_vala_ccode_node_unref0 (_tmp12_);
1133
vala_ccode_block_add_statement ((ValaCCodeBlock*) ((ValaCCodeBaseModule*) self)->state_switch_statement, (ValaCCodeNode*) (_tmp14_ = vala_ccode_goto_statement_new ("_state_0")));
1134
_vala_ccode_node_unref0 (_tmp14_);
1136
current_state_switch = _vala_ccode_node_ref0 (((ValaCCodeBaseModule*) self)->state_switch_statement);
1080
1137
creturn_type = _vala_code_node_ref0 (vala_method_get_return_type (m));
1081
1138
if (vala_data_type_is_real_non_null_struct_type (vala_method_get_return_type (m))) {
1082
ValaDataType* _tmp8_;
1083
creturn_type = (_tmp8_ = (ValaDataType*) vala_void_type_new (NULL), _vala_code_node_unref0 (creturn_type), _tmp8_);
1139
ValaDataType* _tmp15_;
1140
creturn_type = (_tmp15_ = (ValaDataType*) vala_void_type_new (NULL), _vala_code_node_unref0 (creturn_type), _tmp15_);
1085
1142
if (vala_method_get_binding (m) == MEMBER_BINDING_CLASS) {
1088
_tmp9_ = vala_method_get_binding (m) == MEMBER_BINDING_STATIC;
1145
_tmp16_ = vala_method_get_binding (m) == MEMBER_BINDING_STATIC;
1091
1148
((ValaCCodeBaseModule*) self)->in_static_or_class_context = TRUE;
1093
1150
vala_code_node_accept_children ((ValaCodeNode*) m, (ValaCodeVisitor*) vala_ccode_module_get_codegen ((ValaCCodeModule*) self));
1094
1151
((ValaCCodeBaseModule*) self)->in_static_or_class_context = FALSE;
1095
1152
if (VALA_IS_CREATION_METHOD (m)) {
1096
gboolean _tmp10_ = FALSE;
1153
gboolean _tmp17_ = FALSE;
1097
1154
if (in_gobject_creation_method) {
1098
_tmp10_ = vala_method_get_body (m) != NULL;
1155
_tmp17_ = vala_method_get_body (m) != NULL;
1103
1160
if (!vala_creation_method_get_chain_up (VALA_CREATION_METHOD (m))) {
1104
1161
ValaCCodeBlock* cblock;
1105
1162
ValaCodeNode* last_stmt;
1106
gboolean _tmp20_ = FALSE;
1163
gboolean _tmp27_ = FALSE;
1107
1164
if (vala_block_get_captured (vala_method_get_body (m))) {
1108
1165
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) m), "Closures are not supported in GObject-style creation methods");
1110
1167
cblock = vala_ccode_block_new ();
1111
1168
last_stmt = NULL;
1114
ValaIterator* _tmp12_;
1171
ValaIterator* _tmp19_;
1115
1172
ValaIterator* _stmt_it;
1116
_stmt_it = (_tmp12_ = vala_iterable_iterator ((ValaIterable*) (_tmp11_ = vala_block_get_statements (vala_method_get_body (m)))), _vala_collection_object_unref0 (_tmp11_), _tmp12_);
1173
_stmt_it = (_tmp19_ = vala_iterable_iterator ((ValaIterable*) (_tmp18_ = vala_block_get_statements (vala_method_get_body (m)))), _vala_collection_object_unref0 (_tmp18_), _tmp19_);
1118
1175
ValaCodeNode* stmt;
1119
ValaCodeNode* _tmp13_;
1176
ValaCodeNode* _tmp20_;
1120
1177
ValaExpressionStatement* expr_stmt;
1121
1178
if (!vala_iterator_next (_stmt_it)) {
1124
1181
stmt = (ValaCodeNode*) ((ValaStatement*) vala_iterator_get (_stmt_it));
1125
expr_stmt = _vala_code_node_ref0 ((_tmp13_ = stmt, VALA_IS_EXPRESSION_STATEMENT (_tmp13_) ? ((ValaExpressionStatement*) _tmp13_) : NULL));
1182
expr_stmt = _vala_code_node_ref0 ((_tmp20_ = stmt, VALA_IS_EXPRESSION_STATEMENT (_tmp20_) ? ((ValaExpressionStatement*) _tmp20_) : NULL));
1126
1183
if (expr_stmt != NULL) {
1127
1184
ValaProperty* prop;
1128
gboolean _tmp14_ = FALSE;
1185
gboolean _tmp21_ = FALSE;
1129
1186
prop = vala_expression_statement_assigned_property (expr_stmt);
1130
1187
if (prop != NULL) {
1131
_tmp14_ = vala_property_accessor_get_construction (vala_property_get_set_accessor (prop));
1188
_tmp21_ = vala_property_accessor_get_construction (vala_property_get_set_accessor (prop));
1136
ValaCodeNode* _tmp15_;
1137
last_stmt = (_tmp15_ = _vala_code_node_ref0 (stmt), _vala_code_node_unref0 (last_stmt), _tmp15_);
1193
ValaCodeNode* _tmp22_;
1194
last_stmt = (_tmp22_ = _vala_code_node_ref0 (stmt), _vala_code_node_unref0 (last_stmt), _tmp22_);
1139
1196
_vala_code_node_unref0 (prop);
1236
1293
_vala_collection_object_unref0 (_stmt_it);
1240
ValaIterator* _tmp28_;
1297
ValaIterator* _tmp35_;
1241
1298
ValaIterator* _local_it;
1242
_local_it = (_tmp28_ = vala_iterable_iterator ((ValaIterable*) (_tmp27_ = vala_block_get_local_variables (vala_method_get_body (m)))), _vala_collection_object_unref0 (_tmp27_), _tmp28_);
1299
_local_it = (_tmp35_ = vala_iterable_iterator ((ValaIterable*) (_tmp34_ = vala_block_get_local_variables (vala_method_get_body (m)))), _vala_collection_object_unref0 (_tmp34_), _tmp35_);
1244
1301
ValaLocalVariable* local;
1245
gboolean _tmp29_ = FALSE;
1302
gboolean _tmp36_ = FALSE;
1246
1303
if (!vala_iterator_next (_local_it)) {
1249
1306
local = (ValaLocalVariable*) vala_iterator_get (_local_it);
1250
1307
if (!vala_local_variable_get_floating (local)) {
1251
_tmp29_ = vala_ccode_base_module_requires_destroy ((ValaCCodeBaseModule*) self, vala_local_variable_get_variable_type (local));
1308
_tmp36_ = vala_ccode_base_module_requires_destroy ((ValaCCodeBaseModule*) self, vala_local_variable_get_variable_type (local));
1256
1313
ValaMemberAccess* ma;
1257
ValaDataType* _tmp30_;
1258
ValaCCodeExpressionStatement* _tmp33_;
1259
ValaCCodeExpression* _tmp32_;
1260
ValaCCodeExpression* _tmp31_;
1314
ValaDataType* _tmp37_;
1315
ValaCCodeExpressionStatement* _tmp40_;
1316
ValaCCodeExpression* _tmp39_;
1317
ValaCCodeExpression* _tmp38_;
1261
1318
ma = vala_member_access_new_simple (vala_symbol_get_name ((ValaSymbol*) local), NULL);
1262
1319
vala_expression_set_symbol_reference ((ValaExpression*) ma, (ValaSymbol*) local);
1263
vala_expression_set_value_type ((ValaExpression*) ma, _tmp30_ = vala_data_type_copy (vala_local_variable_get_variable_type (local)));
1264
_vala_code_node_unref0 (_tmp30_);
1265
vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) (_tmp33_ = vala_ccode_expression_statement_new (_tmp32_ = vala_ccode_base_module_get_unref_expression ((ValaCCodeBaseModule*) self, _tmp31_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) local)), vala_local_variable_get_variable_type (local), (ValaExpression*) ma, FALSE))));
1266
_vala_ccode_node_unref0 (_tmp33_);
1267
_vala_ccode_node_unref0 (_tmp32_);
1268
_vala_ccode_node_unref0 (_tmp31_);
1320
vala_expression_set_value_type ((ValaExpression*) ma, _tmp37_ = vala_data_type_copy (vala_local_variable_get_variable_type (local)));
1321
_vala_code_node_unref0 (_tmp37_);
1322
vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) (_tmp40_ = vala_ccode_expression_statement_new (_tmp39_ = vala_ccode_base_module_get_unref_expression ((ValaCCodeBaseModule*) self, _tmp38_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) local)), vala_local_variable_get_variable_type (local), (ValaExpression*) ma, FALSE))));
1323
_vala_ccode_node_unref0 (_tmp40_);
1324
_vala_ccode_node_unref0 (_tmp39_);
1325
_vala_ccode_node_unref0 (_tmp38_);
1269
1326
_vala_code_node_unref0 (ma);
1271
1328
_vala_code_node_unref0 (local);
1295
1352
inner_error = ((ValaCCodeBaseModule*) self)->current_method_inner_error;
1296
((ValaCCodeBaseModule*) self)->current_symbol = (_tmp38_ = _vala_code_node_ref0 (old_symbol), _vala_code_node_unref0 (((ValaCCodeBaseModule*) self)->current_symbol), _tmp38_);
1353
((ValaCCodeBaseModule*) self)->current_symbol = (_tmp45_ = _vala_code_node_ref0 (old_symbol), _vala_code_node_unref0 (((ValaCCodeBaseModule*) self)->current_symbol), _tmp45_);
1297
1354
((ValaCCodeBaseModule*) self)->current_method_inner_error = old_method_inner_error;
1298
1355
((ValaCCodeBaseModule*) self)->next_temp_var_id = old_next_temp_var_id;
1299
((ValaCCodeBaseModule*) self)->temp_vars = (_tmp39_ = _vala_collection_object_ref0 (old_temp_vars), _vala_collection_object_unref0 (((ValaCCodeBaseModule*) self)->temp_vars), _tmp39_);
1300
((ValaCCodeBaseModule*) self)->temp_ref_vars = (_tmp40_ = _vala_collection_object_ref0 (old_temp_ref_vars), _vala_collection_object_unref0 (((ValaCCodeBaseModule*) self)->temp_ref_vars), _tmp40_);
1301
((ValaCCodeBaseModule*) self)->variable_name_map = (_tmp41_ = _vala_collection_object_ref0 (old_variable_name_map), _vala_collection_object_unref0 (((ValaCCodeBaseModule*) self)->variable_name_map), _tmp41_);
1302
((ValaCCodeBaseModule*) self)->current_try = (_tmp42_ = _vala_code_node_ref0 (old_try), _vala_code_node_unref0 (((ValaCCodeBaseModule*) self)->current_try), _tmp42_);
1356
((ValaCCodeBaseModule*) self)->temp_vars = (_tmp46_ = _vala_collection_object_ref0 (old_temp_vars), _vala_collection_object_unref0 (((ValaCCodeBaseModule*) self)->temp_vars), _tmp46_);
1357
((ValaCCodeBaseModule*) self)->temp_ref_vars = (_tmp47_ = _vala_collection_object_ref0 (old_temp_ref_vars), _vala_collection_object_unref0 (((ValaCCodeBaseModule*) self)->temp_ref_vars), _tmp47_);
1358
((ValaCCodeBaseModule*) self)->variable_name_map = (_tmp48_ = _vala_collection_object_ref0 (old_variable_name_map), _vala_collection_object_unref0 (((ValaCCodeBaseModule*) self)->variable_name_map), _tmp48_);
1359
((ValaCCodeBaseModule*) self)->current_try = (_tmp49_ = _vala_code_node_ref0 (old_try), _vala_code_node_unref0 (((ValaCCodeBaseModule*) self)->current_try), _tmp49_);
1360
((ValaCCodeBaseModule*) self)->state_switch_statement = (_tmp50_ = _vala_ccode_node_ref0 (old_state_switch_statement), _vala_ccode_node_unref0 (((ValaCCodeBaseModule*) self)->state_switch_statement), _tmp50_);
1303
1361
if (vala_method_get_is_abstract (m)) {
1306
_tmp44_ = vala_method_get_is_virtual (m);
1364
_tmp52_ = vala_method_get_is_virtual (m);
1311
gboolean _tmp45_ = FALSE;
1369
gboolean _tmp53_ = FALSE;
1312
1370
if (vala_method_get_base_method (m) == NULL) {
1313
_tmp45_ = vala_method_get_base_interface_method (m) == NULL;
1371
_tmp53_ = vala_method_get_base_interface_method (m) == NULL;
1320
1378
vala_ccode_base_module_generate_method_declaration ((ValaCCodeBaseModule*) self, m, ((ValaCCodeBaseModule*) self)->source_declarations);
1321
1379
if (!vala_symbol_is_internal_symbol ((ValaSymbol*) m)) {
1322
1380
vala_ccode_base_module_generate_method_declaration ((ValaCCodeBaseModule*) self, m, ((ValaCCodeBaseModule*) self)->header_declarations);
1366
1424
if (vala_method_get_body (m) != NULL) {
1367
1425
ValaCCodeFragment* cinit;
1368
gboolean _tmp115_ = FALSE;
1369
gboolean _tmp116_ = FALSE;
1370
gboolean _tmp219_ = FALSE;
1426
gboolean _tmp121_ = FALSE;
1427
gboolean _tmp122_ = FALSE;
1428
gboolean _tmp228_ = FALSE;
1371
1429
vala_ccode_function_set_block (((ValaCCodeBaseModule*) self)->function, VALA_CCODE_BLOCK (vala_code_node_get_ccodenode ((ValaCodeNode*) vala_method_get_body (m))));
1372
1430
vala_ccode_node_set_line ((ValaCCodeNode*) vala_ccode_function_get_block (((ValaCCodeBaseModule*) self)->function), vala_ccode_node_get_line ((ValaCCodeNode*) ((ValaCCodeBaseModule*) self)->function));
1373
1431
cinit = vala_ccode_fragment_new ();
1374
1432
vala_ccode_block_prepend_statement (vala_ccode_function_get_block (((ValaCCodeBaseModule*) self)->function), (ValaCCodeNode*) cinit);
1375
1433
if (vala_method_get_coroutine (m)) {
1378
ValaCCodeFunction* _tmp54_;
1436
ValaCCodeFunction* _tmp62_;
1379
1437
ValaCCodeFunction* co_function;
1380
ValaCCodeFormalParameter* _tmp58_;
1384
ValaCCodeFunction* _tmp59_;
1385
ValaCCodeMemberAccess* _tmp61_;
1386
ValaCCodeIdentifier* _tmp60_;
1387
ValaCCodeSwitchStatement* _tmp62_;
1388
ValaCCodeSwitchStatement* cswitch;
1389
ValaCCodeLabel* _tmp63_;
1390
ValaCCodeExpressionStatement* _tmp66_;
1391
ValaCCodeFunctionCall* _tmp65_;
1392
ValaCCodeIdentifier* _tmp64_;
1393
ValaCCodeCaseStatement* _tmp68_;
1394
ValaCCodeConstant* _tmp67_;
1395
ValaCCodeStatement* _tmp69_;
1396
ValaCCodeBlock* _tmp70_;
1397
co_function = (_tmp54_ = vala_ccode_function_new (_tmp53_ = g_strconcat (_tmp52_ = vala_method_get_real_cname (m), "_co", NULL), "gboolean"), _g_free0 (_tmp53_), _g_free0 (_tmp52_), _tmp54_);
1398
vala_ccode_function_add_parameter (co_function, _tmp58_ = vala_ccode_formal_parameter_new ("data", _tmp57_ = g_strconcat (_tmp56_ = vala_symbol_lower_case_to_camel_case (_tmp55_ = vala_method_get_cname (m)), "Data*", NULL)));
1399
_vala_ccode_node_unref0 (_tmp58_);
1438
ValaCCodeFormalParameter* _tmp66_;
1442
ValaCCodeFunction* _tmp67_;
1443
ValaCCodeLabel* _tmp68_;
1444
ValaCCodeExpressionStatement* _tmp71_;
1445
ValaCCodeFunctionCall* _tmp70_;
1446
ValaCCodeIdentifier* _tmp69_;
1447
ValaCCodeBlock* _tmp72_;
1448
ValaCCodeLabel* _tmp73_;
1449
ValaCCodeStatement* _tmp74_;
1450
co_function = (_tmp62_ = vala_ccode_function_new (_tmp61_ = g_strconcat (_tmp60_ = vala_method_get_real_cname (m), "_co", NULL), "gboolean"), _g_free0 (_tmp61_), _g_free0 (_tmp60_), _tmp62_);
1451
vala_ccode_function_add_parameter (co_function, _tmp66_ = vala_ccode_formal_parameter_new ("data", _tmp65_ = g_strconcat (_tmp64_ = vala_symbol_lower_case_to_camel_case (_tmp63_ = vala_method_get_cname (m)), "Data*", NULL)));
1452
_vala_ccode_node_unref0 (_tmp66_);
1403
1456
vala_ccode_function_set_modifiers (co_function, vala_ccode_function_get_modifiers (co_function) | VALA_CCODE_MODIFIERS_STATIC);
1404
vala_ccode_declaration_space_add_type_member_declaration (((ValaCCodeBaseModule*) self)->source_declarations, (ValaCCodeNode*) (_tmp59_ = vala_ccode_function_copy (co_function)));
1405
_vala_ccode_node_unref0 (_tmp59_);
1406
cswitch = (_tmp62_ = vala_ccode_switch_statement_new ((ValaCCodeExpression*) (_tmp61_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp60_ = vala_ccode_identifier_new ("data")), "_state_"))), _vala_ccode_node_unref0 (_tmp61_), _vala_ccode_node_unref0 (_tmp60_), _tmp62_);
1407
vala_ccode_block_add_statement ((ValaCCodeBlock*) cswitch, (ValaCCodeNode*) (_tmp63_ = vala_ccode_label_new ("default")));
1408
_vala_ccode_node_unref0 (_tmp63_);
1409
vala_ccode_block_add_statement ((ValaCCodeBlock*) cswitch, (ValaCCodeNode*) (_tmp66_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) (_tmp65_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp64_ = vala_ccode_identifier_new ("g_assert_not_reached")))))));
1410
_vala_ccode_node_unref0 (_tmp66_);
1411
_vala_ccode_node_unref0 (_tmp65_);
1412
_vala_ccode_node_unref0 (_tmp64_);
1413
vala_ccode_block_add_statement ((ValaCCodeBlock*) cswitch, (ValaCCodeNode*) (_tmp68_ = vala_ccode_case_statement_new ((ValaCCodeExpression*) (_tmp67_ = vala_ccode_constant_new ("0")))));
1457
vala_ccode_declaration_space_add_type_member_declaration (((ValaCCodeBaseModule*) self)->source_declarations, (ValaCCodeNode*) (_tmp67_ = vala_ccode_function_copy (co_function)));
1458
_vala_ccode_node_unref0 (_tmp67_);
1459
vala_ccode_block_add_statement ((ValaCCodeBlock*) current_state_switch, (ValaCCodeNode*) (_tmp68_ = vala_ccode_label_new ("default")));
1414
1460
_vala_ccode_node_unref0 (_tmp68_);
1415
_vala_ccode_node_unref0 (_tmp67_);
1416
vala_ccode_block_add_statement ((ValaCCodeBlock*) cswitch, (ValaCCodeNode*) vala_ccode_function_get_block (((ValaCCodeBaseModule*) self)->function));
1417
vala_ccode_block_add_statement ((ValaCCodeBlock*) cswitch, (ValaCCodeNode*) (_tmp69_ = vala_ccode_method_module_complete_async (self)));
1461
vala_ccode_block_add_statement ((ValaCCodeBlock*) current_state_switch, (ValaCCodeNode*) (_tmp71_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) (_tmp70_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp69_ = vala_ccode_identifier_new ("g_assert_not_reached")))))));
1462
_vala_ccode_node_unref0 (_tmp71_);
1463
_vala_ccode_node_unref0 (_tmp70_);
1418
1464
_vala_ccode_node_unref0 (_tmp69_);
1419
vala_ccode_function_set_block (co_function, _tmp70_ = vala_ccode_block_new ());
1420
_vala_ccode_node_unref0 (_tmp70_);
1421
vala_ccode_block_add_statement (vala_ccode_function_get_block (co_function), (ValaCCodeNode*) cswitch);
1465
vala_ccode_function_set_block (co_function, _tmp72_ = vala_ccode_block_new ());
1466
_vala_ccode_node_unref0 (_tmp72_);
1467
vala_ccode_block_add_statement (vala_ccode_function_get_block (co_function), (ValaCCodeNode*) current_state_switch);
1468
vala_ccode_block_add_statement (vala_ccode_function_get_block (co_function), (ValaCCodeNode*) (_tmp73_ = vala_ccode_label_new ("_state_0")));
1469
_vala_ccode_node_unref0 (_tmp73_);
1470
vala_ccode_block_add_statement (vala_ccode_function_get_block (co_function), (ValaCCodeNode*) vala_ccode_function_get_block (((ValaCCodeBaseModule*) self)->function));
1471
vala_ccode_block_add_statement (vala_ccode_function_get_block (co_function), (ValaCCodeNode*) (_tmp74_ = vala_ccode_method_module_complete_async (self)));
1472
_vala_ccode_node_unref0 (_tmp74_);
1422
1473
vala_ccode_fragment_append (((ValaCCodeBaseModule*) self)->source_type_member_definition, (ValaCCodeNode*) co_function);
1423
1474
_vala_ccode_node_unref0 (co_function);
1424
_vala_ccode_node_unref0 (cswitch);
1426
1476
if (vala_method_get_closure (m)) {
1427
1477
ValaBlock* closure_block;
1432
1482
ValaBlock* parent_closure_block;
1433
1483
gint parent_block_id;
1435
ValaCCodeIdentifier* _tmp72_;
1437
ValaCCodeMemberAccess* _tmp74_;
1485
ValaCCodeIdentifier* _tmp76_;
1487
ValaCCodeMemberAccess* _tmp78_;
1438
1488
ValaCCodeMemberAccess* parent_data;
1440
ValaCCodeDeclaration* _tmp76_;
1490
ValaCCodeDeclaration* _tmp80_;
1441
1491
ValaCCodeDeclaration* _cdecl_;
1442
ValaCCodeVariableDeclarator* _tmp78_;
1492
ValaCCodeVariableDeclarator* _tmp82_;
1445
1495
parent_closure_block = _vala_code_node_ref0 (vala_ccode_base_module_next_closure_block ((ValaCCodeBaseModule*) self, vala_symbol_get_parent_symbol ((ValaSymbol*) closure_block)));
1446
1496
if (parent_closure_block == NULL) {
1447
1497
_vala_code_node_unref0 (parent_closure_block);
1450
1500
parent_block_id = vala_ccode_base_module_get_block_id ((ValaCCodeBaseModule*) self, parent_closure_block);
1451
parent_data = (_tmp74_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp72_ = vala_ccode_identifier_new (_tmp71_ = g_strdup_printf ("_data%d_", block_id))), _tmp73_ = g_strdup_printf ("_data%d_", parent_block_id)), _g_free0 (_tmp73_), _vala_ccode_node_unref0 (_tmp72_), _g_free0 (_tmp71_), _tmp74_);
1452
_cdecl_ = (_tmp76_ = vala_ccode_declaration_new (_tmp75_ = g_strdup_printf ("Block%dData*", parent_block_id)), _g_free0 (_tmp75_), _tmp76_);
1453
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp78_ = vala_ccode_variable_declarator_new (_tmp77_ = g_strdup_printf ("_data%d_", parent_block_id), (ValaCCodeExpression*) parent_data, NULL)));
1454
_vala_ccode_node_unref0 (_tmp78_);
1501
parent_data = (_tmp78_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp76_ = vala_ccode_identifier_new (_tmp75_ = g_strdup_printf ("_data%d_", block_id))), _tmp77_ = g_strdup_printf ("_data%d_", parent_block_id)), _g_free0 (_tmp77_), _vala_ccode_node_unref0 (_tmp76_), _g_free0 (_tmp75_), _tmp78_);
1502
_cdecl_ = (_tmp80_ = vala_ccode_declaration_new (_tmp79_ = g_strdup_printf ("Block%dData*", parent_block_id)), _g_free0 (_tmp79_), _tmp80_);
1503
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp82_ = vala_ccode_variable_declarator_new (_tmp81_ = g_strdup_printf ("_data%d_", parent_block_id), (ValaCCodeExpression*) parent_data, NULL)));
1504
_vala_ccode_node_unref0 (_tmp82_);
1456
1506
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) _cdecl_);
1457
closure_block = (_tmp79_ = _vala_code_node_ref0 (parent_closure_block), _vala_code_node_unref0 (closure_block), _tmp79_);
1507
closure_block = (_tmp83_ = _vala_code_node_ref0 (parent_closure_block), _vala_code_node_unref0 (closure_block), _tmp83_);
1458
1508
block_id = parent_block_id;
1459
1509
_vala_code_node_unref0 (parent_closure_block);
1460
1510
_vala_ccode_node_unref0 (parent_data);
1461
1511
_vala_ccode_node_unref0 (_cdecl_);
1463
1513
if (vala_method_get_binding (m) == MEMBER_BINDING_INSTANCE) {
1464
ValaCCodeIdentifier* _tmp81_;
1466
ValaCCodeMemberAccess* _tmp82_;
1514
ValaCCodeIdentifier* _tmp85_;
1516
ValaCCodeMemberAccess* _tmp86_;
1467
1517
ValaCCodeMemberAccess* cself;
1470
ValaCCodeDeclaration* _tmp85_;
1520
ValaCCodeDeclaration* _tmp89_;
1471
1521
ValaCCodeDeclaration* _cdecl_;
1472
ValaCCodeVariableDeclarator* _tmp86_;
1473
cself = (_tmp82_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp81_ = vala_ccode_identifier_new (_tmp80_ = g_strdup_printf ("_data%d_", block_id))), "self"), _vala_ccode_node_unref0 (_tmp81_), _g_free0 (_tmp80_), _tmp82_);
1474
_cdecl_ = (_tmp85_ = vala_ccode_declaration_new (_tmp84_ = g_strdup_printf ("%s *", _tmp83_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self), FALSE))), _g_free0 (_tmp84_), _g_free0 (_tmp83_), _tmp85_);
1475
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp86_ = vala_ccode_variable_declarator_new ("self", (ValaCCodeExpression*) cself, NULL)));
1476
_vala_ccode_node_unref0 (_tmp86_);
1522
ValaCCodeVariableDeclarator* _tmp90_;
1523
cself = (_tmp86_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp85_ = vala_ccode_identifier_new (_tmp84_ = g_strdup_printf ("_data%d_", block_id))), "self"), _vala_ccode_node_unref0 (_tmp85_), _g_free0 (_tmp84_), _tmp86_);
1524
_cdecl_ = (_tmp89_ = vala_ccode_declaration_new (_tmp88_ = g_strdup_printf ("%s *", _tmp87_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self), FALSE))), _g_free0 (_tmp88_), _g_free0 (_tmp87_), _tmp89_);
1525
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp90_ = vala_ccode_variable_declarator_new ("self", (ValaCCodeExpression*) cself, NULL)));
1526
_vala_ccode_node_unref0 (_tmp90_);
1477
1527
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) _cdecl_);
1478
1528
_vala_ccode_node_unref0 (cself);
1479
1529
_vala_ccode_node_unref0 (_cdecl_);
1481
1531
_vala_code_node_unref0 (closure_block);
1483
gboolean _tmp87_ = FALSE;
1533
gboolean _tmp91_ = FALSE;
1484
1534
if (VALA_IS_CLASS (vala_symbol_get_parent_symbol ((ValaSymbol*) m))) {
1485
_tmp87_ = !vala_method_get_coroutine (m);
1535
_tmp91_ = !vala_method_get_coroutine (m);
1491
gboolean _tmp88_ = FALSE;
1541
gboolean _tmp92_ = FALSE;
1492
1542
cl = _vala_code_node_ref0 (VALA_CLASS (vala_symbol_get_parent_symbol ((ValaSymbol*) m)));
1493
1543
if (vala_method_get_overrides (m)) {
1496
gboolean _tmp89_ = FALSE;
1497
gboolean _tmp90_ = FALSE;
1546
gboolean _tmp93_ = FALSE;
1547
gboolean _tmp94_ = FALSE;
1498
1548
if (vala_method_get_base_interface_method (m) != NULL) {
1499
_tmp90_ = !vala_method_get_is_abstract (m);
1504
_tmp89_ = !vala_method_get_is_virtual (m);
1549
_tmp94_ = !vala_method_get_is_abstract (m);
1554
_tmp93_ = !vala_method_get_is_virtual (m);
1511
1561
ValaMethod* base_method;
1512
1562
ValaReferenceType* base_expression_type;
1513
1563
ValaObjectType* self_target_type;
1514
ValaCCodeIdentifier* _tmp95_;
1515
ValaCCodeExpression* _tmp96_;
1564
ValaCCodeIdentifier* _tmp99_;
1565
ValaCCodeExpression* _tmp100_;
1516
1566
ValaCCodeExpression* cself;
1519
ValaCCodeDeclaration* _tmp99_;
1569
ValaCCodeDeclaration* _tmp103_;
1520
1570
ValaCCodeDeclaration* _cdecl_;
1521
ValaCCodeVariableDeclarator* _tmp100_;
1571
ValaCCodeVariableDeclarator* _tmp104_;
1522
1572
base_method = NULL;
1523
1573
base_expression_type = NULL;
1524
1574
if (vala_method_get_overrides (m)) {
1525
ValaMethod* _tmp91_;
1526
ValaReferenceType* _tmp92_;
1527
base_method = (_tmp91_ = _vala_code_node_ref0 (vala_method_get_base_method (m)), _vala_code_node_unref0 (base_method), _tmp91_);
1528
base_expression_type = (_tmp92_ = (ValaReferenceType*) vala_object_type_new ((ValaObjectTypeSymbol*) VALA_CLASS (vala_symbol_get_parent_symbol ((ValaSymbol*) base_method))), _vala_code_node_unref0 (base_expression_type), _tmp92_);
1575
ValaMethod* _tmp95_;
1576
ValaReferenceType* _tmp96_;
1577
base_method = (_tmp95_ = _vala_code_node_ref0 (vala_method_get_base_method (m)), _vala_code_node_unref0 (base_method), _tmp95_);
1578
base_expression_type = (_tmp96_ = (ValaReferenceType*) vala_object_type_new ((ValaObjectTypeSymbol*) VALA_CLASS (vala_symbol_get_parent_symbol ((ValaSymbol*) base_method))), _vala_code_node_unref0 (base_expression_type), _tmp96_);
1530
ValaMethod* _tmp93_;
1531
ValaReferenceType* _tmp94_;
1532
base_method = (_tmp93_ = _vala_code_node_ref0 (vala_method_get_base_interface_method (m)), _vala_code_node_unref0 (base_method), _tmp93_);
1533
base_expression_type = (_tmp94_ = (ValaReferenceType*) vala_object_type_new ((ValaObjectTypeSymbol*) VALA_INTERFACE (vala_symbol_get_parent_symbol ((ValaSymbol*) base_method))), _vala_code_node_unref0 (base_expression_type), _tmp94_);
1580
ValaMethod* _tmp97_;
1581
ValaReferenceType* _tmp98_;
1582
base_method = (_tmp97_ = _vala_code_node_ref0 (vala_method_get_base_interface_method (m)), _vala_code_node_unref0 (base_method), _tmp97_);
1583
base_expression_type = (_tmp98_ = (ValaReferenceType*) vala_object_type_new ((ValaObjectTypeSymbol*) VALA_INTERFACE (vala_symbol_get_parent_symbol ((ValaSymbol*) base_method))), _vala_code_node_unref0 (base_expression_type), _tmp98_);
1535
1585
self_target_type = vala_object_type_new ((ValaObjectTypeSymbol*) cl);
1536
cself = (_tmp96_ = vala_ccode_base_module_transform_expression ((ValaCCodeBaseModule*) self, (ValaCCodeExpression*) (_tmp95_ = vala_ccode_identifier_new ("base")), (ValaDataType*) base_expression_type, (ValaDataType*) self_target_type, NULL), _vala_ccode_node_unref0 (_tmp95_), _tmp96_);
1537
_cdecl_ = (_tmp99_ = vala_ccode_declaration_new (_tmp98_ = g_strdup_printf ("%s *", _tmp97_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE))), _g_free0 (_tmp98_), _g_free0 (_tmp97_), _tmp99_);
1538
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp100_ = vala_ccode_variable_declarator_new ("self", cself, NULL)));
1539
_vala_ccode_node_unref0 (_tmp100_);
1586
cself = (_tmp100_ = vala_ccode_base_module_transform_expression ((ValaCCodeBaseModule*) self, (ValaCCodeExpression*) (_tmp99_ = vala_ccode_identifier_new ("base")), (ValaDataType*) base_expression_type, (ValaDataType*) self_target_type, NULL), _vala_ccode_node_unref0 (_tmp99_), _tmp100_);
1587
_cdecl_ = (_tmp103_ = vala_ccode_declaration_new (_tmp102_ = g_strdup_printf ("%s *", _tmp101_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE))), _g_free0 (_tmp102_), _g_free0 (_tmp101_), _tmp103_);
1588
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp104_ = vala_ccode_variable_declarator_new ("self", cself, NULL)));
1589
_vala_ccode_node_unref0 (_tmp104_);
1540
1590
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) _cdecl_);
1541
1591
_vala_code_node_unref0 (base_method);
1542
1592
_vala_code_node_unref0 (base_expression_type);
1580
1628
_vala_code_node_unref0 (param);
1583
t = _vala_code_node_ref0 (vala_data_type_get_data_type (vala_formal_parameter_get_parameter_type (param)));
1585
_tmp104_ = vala_typesymbol_is_reference_type (t);
1590
if (vala_formal_parameter_get_direction (param) != VALA_PARAMETER_DIRECTION_OUT) {
1592
ValaCCodeStatement* _tmp106_;
1631
if (vala_formal_parameter_get_direction (param) != VALA_PARAMETER_DIRECTION_OUT) {
1633
gboolean _tmp108_ = FALSE;
1634
t = _vala_code_node_ref0 (vala_data_type_get_data_type (vala_formal_parameter_get_parameter_type (param)));
1636
_tmp108_ = vala_typesymbol_is_reference_type (t);
1642
ValaCCodeStatement* _tmp110_;
1593
1643
ValaCCodeStatement* type_check;
1594
type_check = (_tmp106_ = vala_ccode_method_module_create_method_type_check_statement (self, m, creturn_type, t, !vala_data_type_get_nullable (vala_formal_parameter_get_parameter_type (param)), _tmp105_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) param))), _g_free0 (_tmp105_), _tmp106_);
1644
type_check = (_tmp110_ = vala_ccode_method_module_create_method_type_check_statement (self, m, creturn_type, t, !vala_data_type_get_nullable (vala_formal_parameter_get_parameter_type (param)), _tmp109_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) param))), _g_free0 (_tmp109_), _tmp110_);
1595
1645
if (type_check != NULL) {
1596
1646
vala_ccode_node_set_line ((ValaCCodeNode*) type_check, vala_ccode_node_get_line ((ValaCCodeNode*) ((ValaCCodeBaseModule*) self)->function));
1597
1647
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) type_check);
1599
1649
_vala_ccode_node_unref0 (type_check);
1601
if (!vala_method_get_coroutine (m)) {
1602
ValaCCodeConstant* _tmp109_;
1603
ValaCCodeUnaryExpression* _tmp108_;
1604
ValaCCodeExpression* _tmp107_;
1605
ValaCCodeAssignment* _tmp110_;
1651
_vala_code_node_unref0 (t);
1653
if (!vala_method_get_coroutine (m)) {
1655
gboolean _tmp111_ = FALSE;
1656
gboolean _tmp112_ = FALSE;
1657
t = _vala_code_node_ref0 (vala_data_type_get_data_type (vala_formal_parameter_get_parameter_type (param)));
1659
_tmp112_ = vala_typesymbol_is_reference_type (t);
1666
_tmp111_ = VALA_IS_ARRAY_TYPE (vala_formal_parameter_get_parameter_type (param));
1669
ValaCCodeConstant* _tmp115_;
1670
ValaCCodeUnaryExpression* _tmp114_;
1671
ValaCCodeExpression* _tmp113_;
1672
ValaCCodeAssignment* _tmp116_;
1606
1673
ValaCCodeAssignment* a;
1607
1674
ValaCCodeBlock* cblock;
1608
ValaCCodeExpressionStatement* _tmp111_;
1609
ValaCCodeConstant* _tmp113_;
1610
ValaCCodeExpression* _tmp112_;
1611
ValaCCodeBinaryExpression* _tmp114_;
1675
ValaCCodeExpressionStatement* _tmp117_;
1676
ValaCCodeConstant* _tmp119_;
1677
ValaCCodeExpression* _tmp118_;
1678
ValaCCodeBinaryExpression* _tmp120_;
1612
1679
ValaCCodeBinaryExpression* condition;
1613
1680
ValaCCodeIfStatement* if_statement;
1614
a = (_tmp110_ = vala_ccode_assignment_new ((ValaCCodeExpression*) (_tmp108_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp107_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) param)))), (ValaCCodeExpression*) (_tmp109_ = vala_ccode_constant_new ("NULL")), VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE), _vala_ccode_node_unref0 (_tmp109_), _vala_ccode_node_unref0 (_tmp108_), _vala_ccode_node_unref0 (_tmp107_), _tmp110_);
1681
a = (_tmp116_ = vala_ccode_assignment_new ((ValaCCodeExpression*) (_tmp114_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp113_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) param)))), (ValaCCodeExpression*) (_tmp115_ = vala_ccode_constant_new ("NULL")), VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE), _vala_ccode_node_unref0 (_tmp115_), _vala_ccode_node_unref0 (_tmp114_), _vala_ccode_node_unref0 (_tmp113_), _tmp116_);
1615
1682
cblock = vala_ccode_block_new ();
1616
vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) (_tmp111_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) a)));
1617
_vala_ccode_node_unref0 (_tmp111_);
1618
condition = (_tmp114_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_INEQUALITY, _tmp112_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) param)), (ValaCCodeExpression*) (_tmp113_ = vala_ccode_constant_new ("NULL"))), _vala_ccode_node_unref0 (_tmp113_), _vala_ccode_node_unref0 (_tmp112_), _tmp114_);
1683
vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) (_tmp117_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) a)));
1684
_vala_ccode_node_unref0 (_tmp117_);
1685
condition = (_tmp120_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_INEQUALITY, _tmp118_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) param)), (ValaCCodeExpression*) (_tmp119_ = vala_ccode_constant_new ("NULL"))), _vala_ccode_node_unref0 (_tmp119_), _vala_ccode_node_unref0 (_tmp118_), _tmp120_);
1619
1686
if_statement = vala_ccode_if_statement_new ((ValaCCodeExpression*) condition, (ValaCCodeStatement*) cblock, NULL);
1620
1687
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) if_statement);
1621
1688
_vala_ccode_node_unref0 (a);
1623
1690
_vala_ccode_node_unref0 (condition);
1624
1691
_vala_ccode_node_unref0 (if_statement);
1693
_vala_code_node_unref0 (t);
1628
1696
_vala_code_node_unref0 (param);
1629
_vala_code_node_unref0 (t);
1631
1698
_vala_collection_object_unref0 (_param_it);
1633
1700
if (!VALA_IS_VOID_TYPE (vala_method_get_return_type (m))) {
1634
_tmp116_ = !vala_data_type_is_real_non_null_struct_type (vala_method_get_return_type (m));
1639
_tmp115_ = !vala_method_get_coroutine (m);
1644
gboolean _tmp117_ = FALSE;
1645
if (vala_method_get_exit_block (m) == NULL) {
1701
_tmp122_ = !vala_data_type_is_real_non_null_struct_type (vala_method_get_return_type (m));
1706
_tmp121_ = !vala_method_get_coroutine (m);
1712
ValaCCodeDeclaration* _tmp124_;
1713
ValaCCodeDeclaration* _cdecl_;
1714
ValaCCodeExpression* _tmp125_;
1715
ValaCCodeVariableDeclarator* _tmp126_;
1716
ValaCCodeVariableDeclarator* vardecl;
1717
gboolean _tmp127_ = FALSE;
1718
_cdecl_ = (_tmp124_ = vala_ccode_declaration_new (_tmp123_ = vala_data_type_get_cname (vala_method_get_return_type (m))), _g_free0 (_tmp123_), _tmp124_);
1719
vardecl = (_tmp126_ = vala_ccode_variable_declarator_new ("result", _tmp125_ = vala_ccode_base_module_default_value_for_type ((ValaCCodeBaseModule*) self, vala_method_get_return_type (m), TRUE), NULL), _vala_ccode_node_unref0 (_tmp125_), _tmp126_);
1720
vala_ccode_variable_declarator_set_init0 (vardecl, TRUE);
1721
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) vardecl);
1722
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) _cdecl_);
1723
if (vala_method_get_exit_block (m) != NULL) {
1725
_tmp127_ = vala_collection_get_size ((ValaCollection*) (_tmp128_ = vala_basic_block_get_predecessors (vala_method_get_exit_block (m)))) == 0;
1726
_vala_collection_object_unref0 (_tmp128_);
1649
_tmp117_ = vala_collection_get_size ((ValaCollection*) (_tmp118_ = vala_basic_block_get_predecessors (vala_method_get_exit_block (m)))) > 0;
1650
_vala_collection_object_unref0 (_tmp118_);
1654
ValaCCodeDeclaration* _tmp120_;
1655
ValaCCodeDeclaration* _cdecl_;
1656
ValaCCodeVariableDeclarator* _tmp121_;
1657
_cdecl_ = (_tmp120_ = vala_ccode_declaration_new (_tmp119_ = vala_data_type_get_cname (vala_method_get_return_type (m))), _g_free0 (_tmp119_), _tmp120_);
1658
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp121_ = vala_ccode_variable_declarator_new ("result", NULL, NULL)));
1659
_vala_ccode_node_unref0 (_tmp121_);
1660
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) _cdecl_);
1661
_vala_ccode_node_unref0 (_cdecl_);
1731
ValaCCodeReturnStatement* _tmp130_;
1732
ValaCCodeIdentifier* _tmp129_;
1733
vala_ccode_block_add_statement (vala_ccode_function_get_block (((ValaCCodeBaseModule*) self)->function), (ValaCCodeNode*) (_tmp130_ = vala_ccode_return_statement_new ((ValaCCodeExpression*) (_tmp129_ = vala_ccode_identifier_new ("result")))));
1734
_vala_ccode_node_unref0 (_tmp130_);
1735
_vala_ccode_node_unref0 (_tmp129_);
1737
_vala_ccode_node_unref0 (_cdecl_);
1738
_vala_ccode_node_unref0 (vardecl);
1664
1740
if (inner_error) {
1665
1741
if (vala_method_get_coroutine (m)) {
1666
vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, "GError *", "_inner_error_");
1742
vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, "GError *", "_inner_error_", NULL);
1668
1744
ValaCCodeDeclaration* _cdecl_;
1669
ValaCCodeVariableDeclarator* _tmp123_;
1670
ValaCCodeConstant* _tmp122_;
1745
ValaCCodeVariableDeclarator* _tmp132_;
1746
ValaCCodeConstant* _tmp131_;
1671
1747
_cdecl_ = vala_ccode_declaration_new ("GError *");
1672
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp123_ = vala_ccode_variable_declarator_new ("_inner_error_", (ValaCCodeExpression*) (_tmp122_ = vala_ccode_constant_new ("NULL")), NULL)));
1673
_vala_ccode_node_unref0 (_tmp123_);
1674
_vala_ccode_node_unref0 (_tmp122_);
1748
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp132_ = vala_ccode_variable_declarator_new ("_inner_error_", (ValaCCodeExpression*) (_tmp131_ = vala_ccode_constant_new ("NULL")), NULL)));
1749
_vala_ccode_node_unref0 (_tmp132_);
1750
_vala_ccode_node_unref0 (_tmp131_);
1675
1751
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) _cdecl_);
1676
1752
_vala_ccode_node_unref0 (_cdecl_);
1685
1761
n_params = vala_creation_method_get_n_construction_params (VALA_CREATION_METHOD (m));
1686
1762
if (!vala_creation_method_get_chain_up (VALA_CREATION_METHOD (m))) {
1687
gboolean _tmp124_ = FALSE;
1763
gboolean _tmp133_ = FALSE;
1688
1764
if (n_params > 0) {
1692
_tmp124_ = vala_collection_get_size ((ValaCollection*) (_tmp125_ = vala_object_type_symbol_get_type_parameters ((ValaObjectTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self)))) > 0;
1693
_vala_collection_object_unref0 (_tmp125_);
1768
_tmp133_ = vala_collection_get_size ((ValaCollection*) (_tmp134_ = vala_object_type_symbol_get_type_parameters ((ValaObjectTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self)))) > 0;
1769
_vala_collection_object_unref0 (_tmp134_);
1696
ValaCCodeIdentifier* _tmp126_;
1697
ValaCCodeFunctionCall* _tmp127_;
1772
ValaCCodeIdentifier* _tmp135_;
1773
ValaCCodeFunctionCall* _tmp136_;
1698
1774
ValaCCodeFunctionCall* cparamsinit;
1699
ValaCCodeIdentifier* _tmp128_;
1700
ValaCCodeConstant* _tmp131_;
1775
ValaCCodeIdentifier* _tmp137_;
1776
ValaCCodeConstant* _tmp140_;
1703
1779
ValaCCodeDeclaration* _cdecl_;
1704
ValaCCodeVariableDeclarator* _tmp132_;
1705
ValaCCodeDeclaration* _tmp133_;
1706
ValaCCodeVariableDeclarator* _tmp135_;
1707
ValaCCodeIdentifier* _tmp134_;
1708
cparamsinit = (_tmp127_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp126_ = vala_ccode_identifier_new ("g_new0"))), _vala_ccode_node_unref0 (_tmp126_), _tmp127_);
1709
vala_ccode_function_call_add_argument (cparamsinit, (ValaCCodeExpression*) (_tmp128_ = vala_ccode_identifier_new ("GParameter")));
1710
_vala_ccode_node_unref0 (_tmp128_);
1711
vala_ccode_function_call_add_argument (cparamsinit, (ValaCCodeExpression*) (_tmp131_ = vala_ccode_constant_new (_tmp130_ = g_strdup_printf ("%i", n_params + (3 * vala_collection_get_size ((ValaCollection*) (_tmp129_ = vala_object_type_symbol_get_type_parameters ((ValaObjectTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self)))))))));
1712
_vala_ccode_node_unref0 (_tmp131_);
1713
_g_free0 (_tmp130_);
1714
_vala_collection_object_unref0 (_tmp129_);
1780
ValaCCodeVariableDeclarator* _tmp141_;
1781
ValaCCodeDeclaration* _tmp142_;
1782
ValaCCodeVariableDeclarator* _tmp144_;
1783
ValaCCodeIdentifier* _tmp143_;
1784
cparamsinit = (_tmp136_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp135_ = vala_ccode_identifier_new ("g_new0"))), _vala_ccode_node_unref0 (_tmp135_), _tmp136_);
1785
vala_ccode_function_call_add_argument (cparamsinit, (ValaCCodeExpression*) (_tmp137_ = vala_ccode_identifier_new ("GParameter")));
1786
_vala_ccode_node_unref0 (_tmp137_);
1787
vala_ccode_function_call_add_argument (cparamsinit, (ValaCCodeExpression*) (_tmp140_ = vala_ccode_constant_new (_tmp139_ = g_strdup_printf ("%i", n_params + (3 * vala_collection_get_size ((ValaCollection*) (_tmp138_ = vala_object_type_symbol_get_type_parameters ((ValaObjectTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self)))))))));
1788
_vala_ccode_node_unref0 (_tmp140_);
1789
_g_free0 (_tmp139_);
1790
_vala_collection_object_unref0 (_tmp138_);
1715
1791
_cdecl_ = vala_ccode_declaration_new ("GParameter *");
1716
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp132_ = vala_ccode_variable_declarator_new ("__params", (ValaCCodeExpression*) cparamsinit, NULL)));
1717
_vala_ccode_node_unref0 (_tmp132_);
1792
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp141_ = vala_ccode_variable_declarator_new ("__params", (ValaCCodeExpression*) cparamsinit, NULL)));
1793
_vala_ccode_node_unref0 (_tmp141_);
1718
1794
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) _cdecl_);
1719
_cdecl_ = (_tmp133_ = vala_ccode_declaration_new ("GParameter *"), _vala_ccode_node_unref0 (_cdecl_), _tmp133_);
1720
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp135_ = vala_ccode_variable_declarator_new ("__params_it", (ValaCCodeExpression*) (_tmp134_ = vala_ccode_identifier_new ("__params")), NULL)));
1721
_vala_ccode_node_unref0 (_tmp135_);
1722
_vala_ccode_node_unref0 (_tmp134_);
1795
_cdecl_ = (_tmp142_ = vala_ccode_declaration_new ("GParameter *"), _vala_ccode_node_unref0 (_cdecl_), _tmp142_);
1796
vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) (_tmp144_ = vala_ccode_variable_declarator_new ("__params_it", (ValaCCodeExpression*) (_tmp143_ = vala_ccode_identifier_new ("__params")), NULL)));
1797
_vala_ccode_node_unref0 (_tmp144_);
1798
_vala_ccode_node_unref0 (_tmp143_);
1723
1799
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) _cdecl_);
1724
1800
_vala_ccode_node_unref0 (cparamsinit);
1725
1801
_vala_ccode_node_unref0 (_cdecl_);
1729
ValaIterator* _tmp137_;
1805
ValaIterator* _tmp146_;
1730
1806
ValaIterator* _type_param_it;
1731
_type_param_it = (_tmp137_ = vala_iterable_iterator ((ValaIterable*) (_tmp136_ = vala_object_type_symbol_get_type_parameters ((ValaObjectTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self)))), _vala_collection_object_unref0 (_tmp136_), _tmp137_);
1807
_type_param_it = (_tmp146_ = vala_iterable_iterator ((ValaIterable*) (_tmp145_ = vala_object_type_symbol_get_type_parameters ((ValaObjectTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self)))), _vala_collection_object_unref0 (_tmp145_), _tmp146_);
1733
1809
ValaTypeParameter* type_param;
1734
1810
ValaCCodeConstant* prop_name;
1735
1811
ValaCCodeIdentifier* param_name;
1736
ValaCCodeConstant* _tmp140_;
1739
ValaCCodeIdentifier* _tmp143_;
1742
ValaCCodeExpressionStatement* _tmp146_;
1743
ValaCCodeExpression* _tmp145_;
1744
ValaIntegerType* _tmp144_;
1745
1812
ValaCCodeConstant* _tmp149_;
1746
1813
char* _tmp148_;
1747
1814
char* _tmp147_;
1748
1815
ValaCCodeIdentifier* _tmp152_;
1749
1816
char* _tmp151_;
1750
1817
char* _tmp150_;
1751
ValaCCodeExpressionStatement* _tmp156_;
1752
ValaCCodeExpression* _tmp155_;
1753
ValaPointerType* _tmp154_;
1754
ValaVoidType* _tmp153_;
1755
ValaCCodeConstant* _tmp159_;
1818
ValaCCodeExpressionStatement* _tmp155_;
1819
ValaCCodeExpression* _tmp154_;
1820
ValaIntegerType* _tmp153_;
1821
ValaCCodeConstant* _tmp158_;
1757
1822
char* _tmp157_;
1758
ValaCCodeIdentifier* _tmp162_;
1824
ValaCCodeIdentifier* _tmp161_;
1760
1825
char* _tmp160_;
1761
ValaCCodeExpressionStatement* _tmp166_;
1762
ValaCCodeExpression* _tmp165_;
1763
ValaPointerType* _tmp164_;
1764
ValaVoidType* _tmp163_;
1827
ValaCCodeExpressionStatement* _tmp165_;
1828
ValaCCodeExpression* _tmp164_;
1829
ValaPointerType* _tmp163_;
1830
ValaVoidType* _tmp162_;
1831
ValaCCodeConstant* _tmp168_;
1834
ValaCCodeIdentifier* _tmp171_;
1837
ValaCCodeExpressionStatement* _tmp175_;
1838
ValaCCodeExpression* _tmp174_;
1839
ValaPointerType* _tmp173_;
1840
ValaVoidType* _tmp172_;
1765
1841
if (!vala_iterator_next (_type_param_it)) {
1768
1844
type_param = (ValaTypeParameter*) vala_iterator_get (_type_param_it);
1769
1845
prop_name = NULL;
1770
1846
param_name = NULL;
1771
prop_name = (_tmp140_ = vala_ccode_constant_new (_tmp139_ = g_strdup_printf ("\"%s-type\"", _tmp138_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (prop_name), _tmp140_);
1772
_g_free0 (_tmp139_);
1773
_g_free0 (_tmp138_);
1774
param_name = (_tmp143_ = vala_ccode_identifier_new (_tmp142_ = g_strdup_printf ("%s_type", _tmp141_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp143_);
1775
_g_free0 (_tmp142_);
1776
_g_free0 (_tmp141_);
1777
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp146_ = vala_ccode_expression_statement_new (_tmp145_ = vala_ccode_module_get_construct_property_assignment ((ValaCCodeModule*) self, prop_name, (ValaDataType*) (_tmp144_ = vala_integer_type_new (VALA_STRUCT (((ValaCCodeBaseModule*) self)->gtype_type), NULL, NULL)), (ValaCCodeExpression*) param_name))));
1778
_vala_ccode_node_unref0 (_tmp146_);
1779
_vala_ccode_node_unref0 (_tmp145_);
1780
_vala_code_node_unref0 (_tmp144_);
1781
prop_name = (_tmp149_ = vala_ccode_constant_new (_tmp148_ = g_strdup_printf ("\"%s-dup-func\"", _tmp147_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (prop_name), _tmp149_);
1847
prop_name = (_tmp149_ = vala_ccode_constant_new (_tmp148_ = g_strdup_printf ("\"%s-type\"", _tmp147_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (prop_name), _tmp149_);
1782
1848
_g_free0 (_tmp148_);
1783
1849
_g_free0 (_tmp147_);
1784
param_name = (_tmp152_ = vala_ccode_identifier_new (_tmp151_ = g_strdup_printf ("%s_dup_func", _tmp150_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp152_);
1850
param_name = (_tmp152_ = vala_ccode_identifier_new (_tmp151_ = g_strdup_printf ("%s_type", _tmp150_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp152_);
1785
1851
_g_free0 (_tmp151_);
1786
1852
_g_free0 (_tmp150_);
1787
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp156_ = vala_ccode_expression_statement_new (_tmp155_ = vala_ccode_module_get_construct_property_assignment ((ValaCCodeModule*) self, prop_name, (ValaDataType*) (_tmp154_ = vala_pointer_type_new ((ValaDataType*) (_tmp153_ = vala_void_type_new (NULL)), NULL)), (ValaCCodeExpression*) param_name))));
1788
_vala_ccode_node_unref0 (_tmp156_);
1853
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp155_ = vala_ccode_expression_statement_new (_tmp154_ = vala_ccode_module_get_construct_property_assignment ((ValaCCodeModule*) self, prop_name, (ValaDataType*) (_tmp153_ = vala_integer_type_new (VALA_STRUCT (((ValaCCodeBaseModule*) self)->gtype_type), NULL, NULL)), (ValaCCodeExpression*) param_name))));
1789
1854
_vala_ccode_node_unref0 (_tmp155_);
1790
_vala_code_node_unref0 (_tmp154_);
1855
_vala_ccode_node_unref0 (_tmp154_);
1791
1856
_vala_code_node_unref0 (_tmp153_);
1792
prop_name = (_tmp159_ = vala_ccode_constant_new (_tmp158_ = g_strdup_printf ("\"%s-destroy-func\"", _tmp157_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (prop_name), _tmp159_);
1793
_g_free0 (_tmp158_);
1857
prop_name = (_tmp158_ = vala_ccode_constant_new (_tmp157_ = g_strdup_printf ("\"%s-dup-func\"", _tmp156_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (prop_name), _tmp158_);
1794
1858
_g_free0 (_tmp157_);
1795
param_name = (_tmp162_ = vala_ccode_identifier_new (_tmp161_ = g_strdup_printf ("%s_destroy_func", _tmp160_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp162_);
1796
_g_free0 (_tmp161_);
1859
_g_free0 (_tmp156_);
1860
param_name = (_tmp161_ = vala_ccode_identifier_new (_tmp160_ = g_strdup_printf ("%s_dup_func", _tmp159_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp161_);
1797
1861
_g_free0 (_tmp160_);
1798
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp166_ = vala_ccode_expression_statement_new (_tmp165_ = vala_ccode_module_get_construct_property_assignment ((ValaCCodeModule*) self, prop_name, (ValaDataType*) (_tmp164_ = vala_pointer_type_new ((ValaDataType*) (_tmp163_ = vala_void_type_new (NULL)), NULL)), (ValaCCodeExpression*) param_name))));
1799
_vala_ccode_node_unref0 (_tmp166_);
1862
_g_free0 (_tmp159_);
1863
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp165_ = vala_ccode_expression_statement_new (_tmp164_ = vala_ccode_module_get_construct_property_assignment ((ValaCCodeModule*) self, prop_name, (ValaDataType*) (_tmp163_ = vala_pointer_type_new ((ValaDataType*) (_tmp162_ = vala_void_type_new (NULL)), NULL)), (ValaCCodeExpression*) param_name))));
1800
1864
_vala_ccode_node_unref0 (_tmp165_);
1801
_vala_code_node_unref0 (_tmp164_);
1865
_vala_ccode_node_unref0 (_tmp164_);
1802
1866
_vala_code_node_unref0 (_tmp163_);
1867
_vala_code_node_unref0 (_tmp162_);
1868
prop_name = (_tmp168_ = vala_ccode_constant_new (_tmp167_ = g_strdup_printf ("\"%s-destroy-func\"", _tmp166_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (prop_name), _tmp168_);
1869
_g_free0 (_tmp167_);
1870
_g_free0 (_tmp166_);
1871
param_name = (_tmp171_ = vala_ccode_identifier_new (_tmp170_ = g_strdup_printf ("%s_destroy_func", _tmp169_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp171_);
1872
_g_free0 (_tmp170_);
1873
_g_free0 (_tmp169_);
1874
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp175_ = vala_ccode_expression_statement_new (_tmp174_ = vala_ccode_module_get_construct_property_assignment ((ValaCCodeModule*) self, prop_name, (ValaDataType*) (_tmp173_ = vala_pointer_type_new ((ValaDataType*) (_tmp172_ = vala_void_type_new (NULL)), NULL)), (ValaCCodeExpression*) param_name))));
1875
_vala_ccode_node_unref0 (_tmp175_);
1876
_vala_ccode_node_unref0 (_tmp174_);
1877
_vala_code_node_unref0 (_tmp173_);
1878
_vala_code_node_unref0 (_tmp172_);
1803
1879
_vala_code_node_unref0 (type_param);
1804
1880
_vala_ccode_node_unref0 (prop_name);
1805
1881
_vala_ccode_node_unref0 (param_name);
1811
1887
if (vala_ccode_method_module_is_gtypeinstance_creation_method (self, m)) {
1815
ValaCCodeDeclaration* _tmp169_;
1891
ValaCCodeDeclaration* _tmp178_;
1816
1892
ValaCCodeDeclaration* cdeclaration;
1817
1893
ValaCCodeVariableDeclarator* _cdecl_;
1818
1894
cl = _vala_code_node_ref0 (VALA_CLASS (vala_symbol_get_parent_symbol ((ValaSymbol*) m)));
1819
cdeclaration = (_tmp169_ = vala_ccode_declaration_new (_tmp168_ = g_strconcat (_tmp167_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE), "*", NULL)), _g_free0 (_tmp168_), _g_free0 (_tmp167_), _tmp169_);
1895
cdeclaration = (_tmp178_ = vala_ccode_declaration_new (_tmp177_ = g_strconcat (_tmp176_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE), "*", NULL)), _g_free0 (_tmp177_), _g_free0 (_tmp176_), _tmp178_);
1820
1896
_cdecl_ = vala_ccode_variable_declarator_new ("self", NULL, NULL);
1821
1897
vala_ccode_declaration_add_declarator (cdeclaration, (ValaCCodeDeclarator*) _cdecl_);
1822
1898
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) cdeclaration);
1823
1899
if (!vala_creation_method_get_chain_up (VALA_CREATION_METHOD (m))) {
1824
ValaCCodeIdentifier* _tmp170_;
1825
ValaCCodeFunctionCall* _tmp171_;
1900
ValaCCodeIdentifier* _tmp179_;
1901
ValaCCodeFunctionCall* _tmp180_;
1826
1902
ValaCCodeFunctionCall* ccall;
1827
ValaCCodeIdentifier* _tmp172_;
1828
ValaCCodeCastExpression* _tmp175_;
1831
ccall = (_tmp171_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp170_ = vala_ccode_identifier_new ("g_type_create_instance"))), _vala_ccode_node_unref0 (_tmp170_), _tmp171_);
1832
vala_ccode_function_call_add_argument (ccall, (ValaCCodeExpression*) (_tmp172_ = vala_ccode_identifier_new ("object_type")));
1833
_vala_ccode_node_unref0 (_tmp172_);
1834
vala_ccode_variable_declarator_set_initializer (_cdecl_, (ValaCCodeExpression*) (_tmp175_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) ccall, _tmp174_ = g_strconcat (_tmp173_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE), "*", NULL))));
1835
_vala_ccode_node_unref0 (_tmp175_);
1836
_g_free0 (_tmp174_);
1837
_g_free0 (_tmp173_);
1903
ValaCCodeIdentifier* _tmp181_;
1904
ValaCCodeCastExpression* _tmp184_;
1907
ccall = (_tmp180_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp179_ = vala_ccode_identifier_new ("g_type_create_instance"))), _vala_ccode_node_unref0 (_tmp179_), _tmp180_);
1908
vala_ccode_function_call_add_argument (ccall, (ValaCCodeExpression*) (_tmp181_ = vala_ccode_identifier_new ("object_type")));
1909
_vala_ccode_node_unref0 (_tmp181_);
1910
vala_ccode_variable_declarator_set_initializer (_cdecl_, (ValaCCodeExpression*) (_tmp184_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) ccall, _tmp183_ = g_strconcat (_tmp182_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE), "*", NULL))));
1911
_vala_ccode_node_unref0 (_tmp184_);
1912
_g_free0 (_tmp183_);
1913
_g_free0 (_tmp182_);
1840
ValaIterator* _tmp177_;
1916
ValaIterator* _tmp186_;
1841
1917
ValaIterator* _type_param_it;
1842
_type_param_it = (_tmp177_ = vala_iterable_iterator ((ValaIterable*) (_tmp176_ = vala_object_type_symbol_get_type_parameters ((ValaObjectTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self)))), _vala_collection_object_unref0 (_tmp176_), _tmp177_);
1918
_type_param_it = (_tmp186_ = vala_iterable_iterator ((ValaIterable*) (_tmp185_ = vala_object_type_symbol_get_type_parameters ((ValaObjectTypeSymbol*) vala_ccode_base_module_get_current_class ((ValaCCodeBaseModule*) self)))), _vala_collection_object_unref0 (_tmp185_), _tmp186_);
1844
1920
ValaTypeParameter* type_param;
1845
1921
ValaCCodeIdentifier* param_name;
1846
1922
ValaCCodeAssignment* assign;
1847
ValaCCodeIdentifier* _tmp178_;
1848
ValaCCodeMemberAccess* _tmp179_;
1923
ValaCCodeIdentifier* _tmp187_;
1924
ValaCCodeMemberAccess* _tmp188_;
1849
1925
ValaCCodeMemberAccess* priv_access;
1850
ValaCCodeIdentifier* _tmp182_;
1853
ValaCCodeAssignment* _tmp184_;
1854
ValaCCodeMemberAccess* _tmp183_;
1855
ValaCCodeExpressionStatement* _tmp185_;
1856
ValaCCodeIdentifier* _tmp188_;
1859
ValaCCodeAssignment* _tmp190_;
1860
ValaCCodeMemberAccess* _tmp189_;
1861
ValaCCodeExpressionStatement* _tmp191_;
1862
ValaCCodeIdentifier* _tmp194_;
1865
ValaCCodeAssignment* _tmp196_;
1866
ValaCCodeMemberAccess* _tmp195_;
1867
ValaCCodeExpressionStatement* _tmp197_;
1926
ValaCCodeIdentifier* _tmp191_;
1929
ValaCCodeAssignment* _tmp193_;
1930
ValaCCodeMemberAccess* _tmp192_;
1931
ValaCCodeExpressionStatement* _tmp194_;
1932
ValaCCodeIdentifier* _tmp197_;
1935
ValaCCodeAssignment* _tmp199_;
1936
ValaCCodeMemberAccess* _tmp198_;
1937
ValaCCodeExpressionStatement* _tmp200_;
1938
ValaCCodeIdentifier* _tmp203_;
1941
ValaCCodeAssignment* _tmp205_;
1942
ValaCCodeMemberAccess* _tmp204_;
1943
ValaCCodeExpressionStatement* _tmp206_;
1868
1944
if (!vala_iterator_next (_type_param_it)) {
1871
1947
type_param = (ValaTypeParameter*) vala_iterator_get (_type_param_it);
1872
1948
param_name = NULL;
1874
priv_access = (_tmp179_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp178_ = vala_ccode_identifier_new ("self")), "priv"), _vala_ccode_node_unref0 (_tmp178_), _tmp179_);
1875
param_name = (_tmp182_ = vala_ccode_identifier_new (_tmp181_ = g_strdup_printf ("%s_type", _tmp180_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp182_);
1876
_g_free0 (_tmp181_);
1877
_g_free0 (_tmp180_);
1878
assign = (_tmp184_ = vala_ccode_assignment_new ((ValaCCodeExpression*) (_tmp183_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) priv_access, vala_ccode_identifier_get_name (param_name))), (ValaCCodeExpression*) param_name, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE), _vala_ccode_node_unref0 (assign), _tmp184_);
1879
_vala_ccode_node_unref0 (_tmp183_);
1880
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp185_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) assign)));
1881
_vala_ccode_node_unref0 (_tmp185_);
1882
param_name = (_tmp188_ = vala_ccode_identifier_new (_tmp187_ = g_strdup_printf ("%s_dup_func", _tmp186_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp188_);
1883
_g_free0 (_tmp187_);
1884
_g_free0 (_tmp186_);
1885
assign = (_tmp190_ = vala_ccode_assignment_new ((ValaCCodeExpression*) (_tmp189_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) priv_access, vala_ccode_identifier_get_name (param_name))), (ValaCCodeExpression*) param_name, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE), _vala_ccode_node_unref0 (assign), _tmp190_);
1886
_vala_ccode_node_unref0 (_tmp189_);
1887
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp191_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) assign)));
1888
_vala_ccode_node_unref0 (_tmp191_);
1889
param_name = (_tmp194_ = vala_ccode_identifier_new (_tmp193_ = g_strdup_printf ("%s_destroy_func", _tmp192_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp194_);
1890
_g_free0 (_tmp193_);
1891
_g_free0 (_tmp192_);
1892
assign = (_tmp196_ = vala_ccode_assignment_new ((ValaCCodeExpression*) (_tmp195_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) priv_access, vala_ccode_identifier_get_name (param_name))), (ValaCCodeExpression*) param_name, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE), _vala_ccode_node_unref0 (assign), _tmp196_);
1893
_vala_ccode_node_unref0 (_tmp195_);
1894
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp197_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) assign)));
1895
_vala_ccode_node_unref0 (_tmp197_);
1950
priv_access = (_tmp188_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp187_ = vala_ccode_identifier_new ("self")), "priv"), _vala_ccode_node_unref0 (_tmp187_), _tmp188_);
1951
param_name = (_tmp191_ = vala_ccode_identifier_new (_tmp190_ = g_strdup_printf ("%s_type", _tmp189_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp191_);
1952
_g_free0 (_tmp190_);
1953
_g_free0 (_tmp189_);
1954
assign = (_tmp193_ = vala_ccode_assignment_new ((ValaCCodeExpression*) (_tmp192_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) priv_access, vala_ccode_identifier_get_name (param_name))), (ValaCCodeExpression*) param_name, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE), _vala_ccode_node_unref0 (assign), _tmp193_);
1955
_vala_ccode_node_unref0 (_tmp192_);
1956
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp194_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) assign)));
1957
_vala_ccode_node_unref0 (_tmp194_);
1958
param_name = (_tmp197_ = vala_ccode_identifier_new (_tmp196_ = g_strdup_printf ("%s_dup_func", _tmp195_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp197_);
1959
_g_free0 (_tmp196_);
1960
_g_free0 (_tmp195_);
1961
assign = (_tmp199_ = vala_ccode_assignment_new ((ValaCCodeExpression*) (_tmp198_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) priv_access, vala_ccode_identifier_get_name (param_name))), (ValaCCodeExpression*) param_name, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE), _vala_ccode_node_unref0 (assign), _tmp199_);
1962
_vala_ccode_node_unref0 (_tmp198_);
1963
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp200_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) assign)));
1964
_vala_ccode_node_unref0 (_tmp200_);
1965
param_name = (_tmp203_ = vala_ccode_identifier_new (_tmp202_ = g_strdup_printf ("%s_destroy_func", _tmp201_ = g_utf8_strdown (vala_symbol_get_name ((ValaSymbol*) type_param), -1))), _vala_ccode_node_unref0 (param_name), _tmp203_);
1966
_g_free0 (_tmp202_);
1967
_g_free0 (_tmp201_);
1968
assign = (_tmp205_ = vala_ccode_assignment_new ((ValaCCodeExpression*) (_tmp204_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) priv_access, vala_ccode_identifier_get_name (param_name))), (ValaCCodeExpression*) param_name, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE), _vala_ccode_node_unref0 (assign), _tmp205_);
1969
_vala_ccode_node_unref0 (_tmp204_);
1970
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp206_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) assign)));
1971
_vala_ccode_node_unref0 (_tmp206_);
1896
1972
_vala_code_node_unref0 (type_param);
1897
1973
_vala_ccode_node_unref0 (param_name);
1898
1974
_vala_ccode_node_unref0 (assign);
1909
1985
if (VALA_IS_CLASS (vala_ccode_base_module_get_current_type_symbol ((ValaCCodeBaseModule*) self))) {
1913
ValaCCodeDeclaration* _tmp200_;
1989
ValaCCodeDeclaration* _tmp209_;
1914
1990
ValaCCodeDeclaration* cdeclaration;
1915
1991
ValaCCodeVariableDeclarator* _cdecl_;
1916
1992
cl = _vala_code_node_ref0 (VALA_CLASS (vala_symbol_get_parent_symbol ((ValaSymbol*) m)));
1917
cdeclaration = (_tmp200_ = vala_ccode_declaration_new (_tmp199_ = g_strconcat (_tmp198_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE), "*", NULL)), _g_free0 (_tmp199_), _g_free0 (_tmp198_), _tmp200_);
1993
cdeclaration = (_tmp209_ = vala_ccode_declaration_new (_tmp208_ = g_strconcat (_tmp207_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE), "*", NULL)), _g_free0 (_tmp208_), _g_free0 (_tmp207_), _tmp209_);
1918
1994
_cdecl_ = vala_ccode_variable_declarator_new ("self", NULL, NULL);
1919
1995
vala_ccode_declaration_add_declarator (cdeclaration, (ValaCCodeDeclarator*) _cdecl_);
1920
1996
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) cdeclaration);
1921
1997
if (!vala_creation_method_get_chain_up (VALA_CREATION_METHOD (m))) {
1922
ValaCCodeIdentifier* _tmp201_;
1923
ValaCCodeFunctionCall* _tmp202_;
1998
ValaCCodeIdentifier* _tmp210_;
1999
ValaCCodeFunctionCall* _tmp211_;
1924
2000
ValaCCodeFunctionCall* ccall;
1925
ValaCCodeIdentifier* _tmp204_;
1927
ccall = (_tmp202_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp201_ = vala_ccode_identifier_new ("g_slice_new0"))), _vala_ccode_node_unref0 (_tmp201_), _tmp202_);
1928
vala_ccode_function_call_add_argument (ccall, (ValaCCodeExpression*) (_tmp204_ = vala_ccode_identifier_new (_tmp203_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE))));
1929
_vala_ccode_node_unref0 (_tmp204_);
1930
_g_free0 (_tmp203_);
2001
ValaCCodeIdentifier* _tmp213_;
2003
ccall = (_tmp211_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp210_ = vala_ccode_identifier_new ("g_slice_new0"))), _vala_ccode_node_unref0 (_tmp210_), _tmp211_);
2004
vala_ccode_function_call_add_argument (ccall, (ValaCCodeExpression*) (_tmp213_ = vala_ccode_identifier_new (_tmp212_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) cl, FALSE))));
2005
_vala_ccode_node_unref0 (_tmp213_);
2006
_g_free0 (_tmp212_);
1931
2007
vala_ccode_variable_declarator_set_initializer (_cdecl_, (ValaCCodeExpression*) ccall);
1932
2008
_vala_ccode_node_unref0 (ccall);
1934
2010
if (vala_class_get_base_class (cl) == NULL) {
1935
ValaCCodeIdentifier* _tmp207_;
1938
ValaCCodeFunctionCall* _tmp208_;
2011
ValaCCodeIdentifier* _tmp216_;
2014
ValaCCodeFunctionCall* _tmp217_;
1939
2015
ValaCCodeFunctionCall* cinitcall;
1940
ValaCCodeIdentifier* _tmp209_;
1941
ValaCCodeExpressionStatement* _tmp210_;
1942
cinitcall = (_tmp208_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp207_ = vala_ccode_identifier_new (_tmp206_ = g_strdup_printf ("%s_instance_init", _tmp205_ = vala_symbol_get_lower_case_cname ((ValaSymbol*) cl, NULL))))), _vala_ccode_node_unref0 (_tmp207_), _g_free0 (_tmp206_), _g_free0 (_tmp205_), _tmp208_);
1943
vala_ccode_function_call_add_argument (cinitcall, (ValaCCodeExpression*) (_tmp209_ = vala_ccode_identifier_new ("self")));
1944
_vala_ccode_node_unref0 (_tmp209_);
1945
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp210_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) cinitcall)));
1946
_vala_ccode_node_unref0 (_tmp210_);
2016
ValaCCodeIdentifier* _tmp218_;
2017
ValaCCodeExpressionStatement* _tmp219_;
2018
cinitcall = (_tmp217_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp216_ = vala_ccode_identifier_new (_tmp215_ = g_strdup_printf ("%s_instance_init", _tmp214_ = vala_symbol_get_lower_case_cname ((ValaSymbol*) cl, NULL))))), _vala_ccode_node_unref0 (_tmp216_), _g_free0 (_tmp215_), _g_free0 (_tmp214_), _tmp217_);
2019
vala_ccode_function_call_add_argument (cinitcall, (ValaCCodeExpression*) (_tmp218_ = vala_ccode_identifier_new ("self")));
2020
_vala_ccode_node_unref0 (_tmp218_);
2021
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp219_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) cinitcall)));
2022
_vala_ccode_node_unref0 (_tmp219_);
1947
2023
_vala_ccode_node_unref0 (cinitcall);
1949
2025
_vala_code_node_unref0 (cl);
1951
2027
_vala_ccode_node_unref0 (_cdecl_);
1953
2029
ValaStruct* st;
1954
ValaCCodeIdentifier* _tmp211_;
1955
ValaCCodeFunctionCall* _tmp212_;
2030
ValaCCodeIdentifier* _tmp220_;
2031
ValaCCodeFunctionCall* _tmp221_;
1956
2032
ValaCCodeFunctionCall* czero;
1957
ValaCCodeIdentifier* _tmp213_;
1958
ValaCCodeConstant* _tmp214_;
1959
ValaCCodeIdentifier* _tmp217_;
1962
ValaCCodeExpressionStatement* _tmp218_;
2033
ValaCCodeIdentifier* _tmp222_;
2034
ValaCCodeConstant* _tmp223_;
2035
ValaCCodeIdentifier* _tmp226_;
2038
ValaCCodeExpressionStatement* _tmp227_;
1963
2039
st = _vala_code_node_ref0 (VALA_STRUCT (vala_symbol_get_parent_symbol ((ValaSymbol*) m)));
1964
2040
vala_ccode_declaration_space_add_include (((ValaCCodeBaseModule*) self)->source_declarations, "string.h", FALSE);
1965
czero = (_tmp212_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp211_ = vala_ccode_identifier_new ("memset"))), _vala_ccode_node_unref0 (_tmp211_), _tmp212_);
1966
vala_ccode_function_call_add_argument (czero, (ValaCCodeExpression*) (_tmp213_ = vala_ccode_identifier_new ("self")));
1967
_vala_ccode_node_unref0 (_tmp213_);
1968
vala_ccode_function_call_add_argument (czero, (ValaCCodeExpression*) (_tmp214_ = vala_ccode_constant_new ("0")));
1969
_vala_ccode_node_unref0 (_tmp214_);
1970
vala_ccode_function_call_add_argument (czero, (ValaCCodeExpression*) (_tmp217_ = vala_ccode_identifier_new (_tmp216_ = g_strdup_printf ("sizeof (%s)", _tmp215_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE)))));
1971
_vala_ccode_node_unref0 (_tmp217_);
1972
_g_free0 (_tmp216_);
1973
_g_free0 (_tmp215_);
1974
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp218_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) czero)));
1975
_vala_ccode_node_unref0 (_tmp218_);
2041
czero = (_tmp221_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp220_ = vala_ccode_identifier_new ("memset"))), _vala_ccode_node_unref0 (_tmp220_), _tmp221_);
2042
vala_ccode_function_call_add_argument (czero, (ValaCCodeExpression*) (_tmp222_ = vala_ccode_identifier_new ("self")));
2043
_vala_ccode_node_unref0 (_tmp222_);
2044
vala_ccode_function_call_add_argument (czero, (ValaCCodeExpression*) (_tmp223_ = vala_ccode_constant_new ("0")));
2045
_vala_ccode_node_unref0 (_tmp223_);
2046
vala_ccode_function_call_add_argument (czero, (ValaCCodeExpression*) (_tmp226_ = vala_ccode_identifier_new (_tmp225_ = g_strdup_printf ("sizeof (%s)", _tmp224_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) st, FALSE)))));
2047
_vala_ccode_node_unref0 (_tmp226_);
2048
_g_free0 (_tmp225_);
2049
_g_free0 (_tmp224_);
2050
vala_ccode_fragment_append (cinit, (ValaCCodeNode*) (_tmp227_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) czero)));
2051
_vala_ccode_node_unref0 (_tmp227_);
1976
2052
_vala_code_node_unref0 (st);
1977
2053
_vala_ccode_node_unref0 (czero);
2015
2091
if (vala_method_get_is_abstract (m)) {
2016
2092
ValaCCodeBlock* cblock;
2017
2093
ValaCCodeStatement* check_stmt;
2018
ValaCCodeIdentifier* _tmp223_;
2019
ValaCCodeFunctionCall* _tmp224_;
2094
ValaCCodeIdentifier* _tmp232_;
2095
ValaCCodeFunctionCall* _tmp233_;
2020
2096
ValaCCodeFunctionCall* type_from_instance_call;
2021
ValaCCodeIdentifier* _tmp225_;
2022
ValaCCodeIdentifier* _tmp226_;
2023
ValaCCodeFunctionCall* _tmp227_;
2097
ValaCCodeIdentifier* _tmp234_;
2098
ValaCCodeIdentifier* _tmp235_;
2099
ValaCCodeFunctionCall* _tmp236_;
2024
2100
ValaCCodeFunctionCall* type_name_call;
2027
2103
char* error_string;
2028
ValaCCodeIdentifier* _tmp230_;
2029
ValaCCodeFunctionCall* _tmp231_;
2104
ValaCCodeIdentifier* _tmp239_;
2105
ValaCCodeFunctionCall* _tmp240_;
2030
2106
ValaCCodeFunctionCall* cerrorcall;
2031
ValaCCodeConstant* _tmp232_;
2032
ValaCCodeExpressionStatement* _tmp233_;
2033
ValaCCodeReturnStatement* _tmp235_;
2034
ValaCCodeExpression* _tmp234_;
2107
ValaCCodeConstant* _tmp241_;
2108
ValaCCodeExpressionStatement* _tmp242_;
2109
ValaCCodeReturnStatement* _tmp244_;
2110
ValaCCodeExpression* _tmp243_;
2035
2111
cblock = vala_ccode_block_new ();
2036
2112
check_stmt = vala_ccode_method_module_create_method_type_check_statement (self, m, creturn_type, vala_ccode_base_module_get_current_type_symbol ((ValaCCodeBaseModule*) self), TRUE, "self");
2037
2113
if (check_stmt != NULL) {
2038
2114
vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) check_stmt);
2040
type_from_instance_call = (_tmp224_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp223_ = vala_ccode_identifier_new ("G_TYPE_FROM_INSTANCE"))), _vala_ccode_node_unref0 (_tmp223_), _tmp224_);
2041
vala_ccode_function_call_add_argument (type_from_instance_call, (ValaCCodeExpression*) (_tmp225_ = vala_ccode_identifier_new ("self")));
2042
_vala_ccode_node_unref0 (_tmp225_);
2043
type_name_call = (_tmp227_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp226_ = vala_ccode_identifier_new ("g_type_name"))), _vala_ccode_node_unref0 (_tmp226_), _tmp227_);
2116
type_from_instance_call = (_tmp233_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp232_ = vala_ccode_identifier_new ("G_TYPE_FROM_INSTANCE"))), _vala_ccode_node_unref0 (_tmp232_), _tmp233_);
2117
vala_ccode_function_call_add_argument (type_from_instance_call, (ValaCCodeExpression*) (_tmp234_ = vala_ccode_identifier_new ("self")));
2118
_vala_ccode_node_unref0 (_tmp234_);
2119
type_name_call = (_tmp236_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp235_ = vala_ccode_identifier_new ("g_type_name"))), _vala_ccode_node_unref0 (_tmp235_), _tmp236_);
2044
2120
vala_ccode_function_call_add_argument (type_name_call, (ValaCCodeExpression*) type_from_instance_call);
2045
error_string = (_tmp229_ = g_strdup_printf ("\"Type `%%s' does not implement abstract method `%s'\"", _tmp228_ = vala_method_get_cname (m)), _g_free0 (_tmp228_), _tmp229_);
2046
cerrorcall = (_tmp231_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp230_ = vala_ccode_identifier_new ("g_critical"))), _vala_ccode_node_unref0 (_tmp230_), _tmp231_);
2047
vala_ccode_function_call_add_argument (cerrorcall, (ValaCCodeExpression*) (_tmp232_ = vala_ccode_constant_new (error_string)));
2048
_vala_ccode_node_unref0 (_tmp232_);
2121
error_string = (_tmp238_ = g_strdup_printf ("\"Type `%%s' does not implement abstract method `%s'\"", _tmp237_ = vala_method_get_cname (m)), _g_free0 (_tmp237_), _tmp238_);
2122
cerrorcall = (_tmp240_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp239_ = vala_ccode_identifier_new ("g_critical"))), _vala_ccode_node_unref0 (_tmp239_), _tmp240_);
2123
vala_ccode_function_call_add_argument (cerrorcall, (ValaCCodeExpression*) (_tmp241_ = vala_ccode_constant_new (error_string)));
2124
_vala_ccode_node_unref0 (_tmp241_);
2049
2125
vala_ccode_function_call_add_argument (cerrorcall, (ValaCCodeExpression*) type_name_call);
2050
vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) (_tmp233_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) cerrorcall)));
2051
_vala_ccode_node_unref0 (_tmp233_);
2052
vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) (_tmp235_ = vala_ccode_return_statement_new (_tmp234_ = vala_ccode_base_module_default_value_for_type ((ValaCCodeBaseModule*) self, creturn_type, FALSE))));
2053
_vala_ccode_node_unref0 (_tmp235_);
2054
_vala_ccode_node_unref0 (_tmp234_);
2126
vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) (_tmp242_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) cerrorcall)));
2127
_vala_ccode_node_unref0 (_tmp242_);
2128
vala_ccode_block_add_statement (cblock, (ValaCCodeNode*) (_tmp244_ = vala_ccode_return_statement_new (_tmp243_ = vala_ccode_base_module_default_value_for_type ((ValaCCodeBaseModule*) self, creturn_type, FALSE))));
2129
_vala_ccode_node_unref0 (_tmp244_);
2130
_vala_ccode_node_unref0 (_tmp243_);
2055
2131
vala_ccode_function_set_block (((ValaCCodeBaseModule*) self)->function, cblock);
2056
2132
vala_ccode_fragment_append (((ValaCCodeBaseModule*) self)->source_type_member_definition, (ValaCCodeNode*) ((ValaCCodeBaseModule*) self)->function);
2057
2133
_vala_ccode_node_unref0 (cblock);
2066
2142
if (vala_method_get_is_abstract (m)) {
2069
_tmp238_ = vala_method_get_is_virtual (m);
2072
_tmp237_ = !vala_method_get_coroutine (m);
2077
_tmp236_ = vala_method_get_signal_reference (m) == NULL;
2082
ValaHashMap* _tmp239_;
2145
_tmp247_ = vala_method_get_is_virtual (m);
2148
_tmp246_ = !vala_method_get_coroutine (m);
2153
_tmp245_ = vala_method_get_signal_reference (m) == NULL;
2158
ValaHashMap* _tmp248_;
2083
2159
ValaHashMap* carg_map;
2084
cparam_map = (_tmp239_ = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_FORMAL_PARAMETER, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal), _vala_collection_object_unref0 (cparam_map), _tmp239_);
2160
cparam_map = (_tmp248_ = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_FORMAL_PARAMETER, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal), _vala_collection_object_unref0 (cparam_map), _tmp248_);
2085
2161
carg_map = vala_hash_map_new (G_TYPE_INT, NULL, NULL, VALA_TYPE_CCODE_EXPRESSION, (GBoxedCopyFunc) vala_ccode_node_ref, vala_ccode_node_unref, g_direct_hash, g_direct_equal, g_direct_equal);
2086
2162
vala_ccode_method_module_generate_vfunc (self, m, creturn_type, (ValaMap*) cparam_map, (ValaMap*) carg_map, "", 3);
2087
2163
_vala_collection_object_unref0 (carg_map);
2089
2165
if (vala_method_get_entry_point (m)) {
2090
2166
ValaCCodeFunction* cmain;
2091
ValaCCodeFormalParameter* _tmp240_;
2092
ValaCCodeFormalParameter* _tmp241_;
2167
ValaCCodeFormalParameter* _tmp249_;
2168
ValaCCodeFormalParameter* _tmp250_;
2093
2169
ValaCCodeBlock* main_block;
2094
ValaCCodeIdentifier* _tmp253_;
2095
ValaCCodeFunctionCall* _tmp254_;
2170
ValaCCodeIdentifier* _tmp262_;
2171
ValaCCodeFunctionCall* _tmp263_;
2096
2172
ValaCCodeFunctionCall* main_call;
2099
2175
cmain = vala_ccode_function_new ("main", "int");
2100
2176
vala_ccode_node_set_line ((ValaCCodeNode*) cmain, vala_ccode_node_get_line ((ValaCCodeNode*) ((ValaCCodeBaseModule*) self)->function));
2101
vala_ccode_function_add_parameter (cmain, _tmp240_ = vala_ccode_formal_parameter_new ("argc", "int"));
2102
_vala_ccode_node_unref0 (_tmp240_);
2103
vala_ccode_function_add_parameter (cmain, _tmp241_ = vala_ccode_formal_parameter_new ("argv", "char **"));
2104
_vala_ccode_node_unref0 (_tmp241_);
2177
vala_ccode_function_add_parameter (cmain, _tmp249_ = vala_ccode_formal_parameter_new ("argc", "int"));
2178
_vala_ccode_node_unref0 (_tmp249_);
2179
vala_ccode_function_add_parameter (cmain, _tmp250_ = vala_ccode_formal_parameter_new ("argv", "char **"));
2180
_vala_ccode_node_unref0 (_tmp250_);
2105
2181
main_block = vala_ccode_block_new ();
2106
2182
if (vala_code_context_get_profile (vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self)) == VALA_PROFILE_GOBJECT) {
2107
ValaCCodeFunctionCall* _tmp251_;
2108
ValaCCodeIdentifier* _tmp250_;
2109
ValaCCodeExpressionStatement* _tmp252_;
2183
ValaCCodeFunctionCall* _tmp260_;
2184
ValaCCodeIdentifier* _tmp259_;
2185
ValaCCodeExpressionStatement* _tmp261_;
2110
2186
ValaCCodeExpressionStatement* type_init_call;
2187
if (vala_code_context_get_mem_profiler (vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self))) {
2188
ValaCCodeIdentifier* _tmp251_;
2189
ValaCCodeFunctionCall* _tmp252_;
2190
ValaCCodeFunctionCall* mem_profiler_init_call;
2191
ValaCCodeConstant* _tmp253_;
2192
ValaCCodeExpressionStatement* _tmp254_;
2193
mem_profiler_init_call = (_tmp252_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp251_ = vala_ccode_identifier_new ("g_mem_set_vtable"))), _vala_ccode_node_unref0 (_tmp251_), _tmp252_);
2194
vala_ccode_node_set_line ((ValaCCodeNode*) mem_profiler_init_call, vala_ccode_node_get_line ((ValaCCodeNode*) cmain));
2195
vala_ccode_function_call_add_argument (mem_profiler_init_call, (ValaCCodeExpression*) (_tmp253_ = vala_ccode_constant_new ("glib_mem_profiler_table")));
2196
_vala_ccode_node_unref0 (_tmp253_);
2197
vala_ccode_block_add_statement (main_block, (ValaCCodeNode*) (_tmp254_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) mem_profiler_init_call)));
2198
_vala_ccode_node_unref0 (_tmp254_);
2199
_vala_ccode_node_unref0 (mem_profiler_init_call);
2111
2201
if (vala_code_context_get_thread (vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self))) {
2112
ValaCCodeIdentifier* _tmp242_;
2113
ValaCCodeFunctionCall* _tmp243_;
2202
ValaCCodeIdentifier* _tmp255_;
2203
ValaCCodeFunctionCall* _tmp256_;
2114
2204
ValaCCodeFunctionCall* thread_init_call;
2115
ValaCCodeConstant* _tmp244_;
2116
ValaCCodeExpressionStatement* _tmp245_;
2117
thread_init_call = (_tmp243_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp242_ = vala_ccode_identifier_new ("g_thread_init"))), _vala_ccode_node_unref0 (_tmp242_), _tmp243_);
2205
ValaCCodeConstant* _tmp257_;
2206
ValaCCodeExpressionStatement* _tmp258_;
2207
thread_init_call = (_tmp256_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp255_ = vala_ccode_identifier_new ("g_thread_init"))), _vala_ccode_node_unref0 (_tmp255_), _tmp256_);
2118
2208
vala_ccode_node_set_line ((ValaCCodeNode*) thread_init_call, vala_ccode_node_get_line ((ValaCCodeNode*) cmain));
2119
vala_ccode_function_call_add_argument (thread_init_call, (ValaCCodeExpression*) (_tmp244_ = vala_ccode_constant_new ("NULL")));
2120
_vala_ccode_node_unref0 (_tmp244_);
2121
vala_ccode_block_add_statement (main_block, (ValaCCodeNode*) (_tmp245_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) thread_init_call)));
2122
_vala_ccode_node_unref0 (_tmp245_);
2209
vala_ccode_function_call_add_argument (thread_init_call, (ValaCCodeExpression*) (_tmp257_ = vala_ccode_constant_new ("NULL")));
2210
_vala_ccode_node_unref0 (_tmp257_);
2211
vala_ccode_block_add_statement (main_block, (ValaCCodeNode*) (_tmp258_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) thread_init_call)));
2212
_vala_ccode_node_unref0 (_tmp258_);
2123
2213
_vala_ccode_node_unref0 (thread_init_call);
2125
if (vala_code_context_get_mem_profiler (vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self))) {
2126
ValaCCodeIdentifier* _tmp246_;
2127
ValaCCodeFunctionCall* _tmp247_;
2128
ValaCCodeFunctionCall* mem_profiler_init_call;
2129
ValaCCodeConstant* _tmp248_;
2130
ValaCCodeExpressionStatement* _tmp249_;
2131
mem_profiler_init_call = (_tmp247_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp246_ = vala_ccode_identifier_new ("g_mem_set_vtable"))), _vala_ccode_node_unref0 (_tmp246_), _tmp247_);
2132
vala_ccode_node_set_line ((ValaCCodeNode*) mem_profiler_init_call, vala_ccode_node_get_line ((ValaCCodeNode*) cmain));
2133
vala_ccode_function_call_add_argument (mem_profiler_init_call, (ValaCCodeExpression*) (_tmp248_ = vala_ccode_constant_new ("glib_mem_profiler_table")));
2134
_vala_ccode_node_unref0 (_tmp248_);
2135
vala_ccode_block_add_statement (main_block, (ValaCCodeNode*) (_tmp249_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) mem_profiler_init_call)));
2136
_vala_ccode_node_unref0 (_tmp249_);
2137
_vala_ccode_node_unref0 (mem_profiler_init_call);
2139
type_init_call = (_tmp252_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) (_tmp251_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp250_ = vala_ccode_identifier_new ("g_type_init"))))), _vala_ccode_node_unref0 (_tmp251_), _vala_ccode_node_unref0 (_tmp250_), _tmp252_);
2215
type_init_call = (_tmp261_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) (_tmp260_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp259_ = vala_ccode_identifier_new ("g_type_init"))))), _vala_ccode_node_unref0 (_tmp260_), _vala_ccode_node_unref0 (_tmp259_), _tmp261_);
2140
2216
vala_ccode_node_set_line ((ValaCCodeNode*) type_init_call, vala_ccode_node_get_line ((ValaCCodeNode*) cmain));
2141
2217
vala_ccode_block_add_statement (main_block, (ValaCCodeNode*) type_init_call);
2142
2218
_vala_ccode_node_unref0 (type_init_call);
2144
main_call = (_tmp254_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp253_ = vala_ccode_identifier_new (vala_ccode_function_get_name (((ValaCCodeBaseModule*) self)->function)))), _vala_ccode_node_unref0 (_tmp253_), _tmp254_);
2145
if ((_tmp256_ = vala_collection_get_size ((ValaCollection*) (_tmp255_ = vala_method_get_parameters (m))) == 1, _vala_collection_object_unref0 (_tmp255_), _tmp256_)) {
2146
ValaCCodeIdentifier* _tmp257_;
2147
ValaCCodeIdentifier* _tmp258_;
2148
vala_ccode_function_call_add_argument (main_call, (ValaCCodeExpression*) (_tmp257_ = vala_ccode_identifier_new ("argv")));
2149
_vala_ccode_node_unref0 (_tmp257_);
2150
vala_ccode_function_call_add_argument (main_call, (ValaCCodeExpression*) (_tmp258_ = vala_ccode_identifier_new ("argc")));
2151
_vala_ccode_node_unref0 (_tmp258_);
2220
main_call = (_tmp263_ = vala_ccode_function_call_new ((ValaCCodeExpression*) (_tmp262_ = vala_ccode_identifier_new (vala_ccode_function_get_name (((ValaCCodeBaseModule*) self)->function)))), _vala_ccode_node_unref0 (_tmp262_), _tmp263_);
2221
if ((_tmp265_ = vala_collection_get_size ((ValaCollection*) (_tmp264_ = vala_method_get_parameters (m))) == 1, _vala_collection_object_unref0 (_tmp264_), _tmp265_)) {
2222
ValaCCodeIdentifier* _tmp266_;
2223
ValaCCodeIdentifier* _tmp267_;
2224
vala_ccode_function_call_add_argument (main_call, (ValaCCodeExpression*) (_tmp266_ = vala_ccode_identifier_new ("argv")));
2225
_vala_ccode_node_unref0 (_tmp266_);
2226
vala_ccode_function_call_add_argument (main_call, (ValaCCodeExpression*) (_tmp267_ = vala_ccode_identifier_new ("argc")));
2227
_vala_ccode_node_unref0 (_tmp267_);
2153
2229
if (VALA_IS_VOID_TYPE (vala_method_get_return_type (m))) {
2154
2230
ValaCCodeExpressionStatement* main_stmt;
2155
ValaCCodeConstant* _tmp259_;
2156
ValaCCodeReturnStatement* _tmp260_;
2231
ValaCCodeConstant* _tmp268_;
2232
ValaCCodeReturnStatement* _tmp269_;
2157
2233
ValaCCodeReturnStatement* ret_stmt;
2158
2234
main_stmt = vala_ccode_expression_statement_new ((ValaCCodeExpression*) main_call);
2159
2235
vala_ccode_node_set_line ((ValaCCodeNode*) main_stmt, vala_ccode_node_get_line ((ValaCCodeNode*) cmain));
2160
2236
vala_ccode_block_add_statement (main_block, (ValaCCodeNode*) main_stmt);
2161
ret_stmt = (_tmp260_ = vala_ccode_return_statement_new ((ValaCCodeExpression*) (_tmp259_ = vala_ccode_constant_new ("0"))), _vala_ccode_node_unref0 (_tmp259_), _tmp260_);
2237
ret_stmt = (_tmp269_ = vala_ccode_return_statement_new ((ValaCCodeExpression*) (_tmp268_ = vala_ccode_constant_new ("0"))), _vala_ccode_node_unref0 (_tmp268_), _tmp269_);
2162
2238
vala_ccode_node_set_line ((ValaCCodeNode*) ret_stmt, vala_ccode_node_get_line ((ValaCCodeNode*) cmain));
2163
2239
vala_ccode_block_add_statement (main_block, (ValaCCodeNode*) ret_stmt);
2164
2240
_vala_ccode_node_unref0 (main_stmt);