~ubuntu-branches/ubuntu/quantal/vala/quantal

« back to all changes in this revision

Viewing changes to codegen/valadovadelegatemodule.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-03-17 09:35:15 UTC
  • mfrom: (1.5.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20110317093515-veyqriw9egujkws2
Tags: 0.11.7-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
386
386
        ValaCCodeFunction* _tmp37_ = NULL;
387
387
        ValaCCodeFunction* function;
388
388
        ValaCCodeFunction* _tmp38_ = NULL;
389
 
        ValaCCodeFunction* _tmp39_;
390
389
        self = (ValaDovaDelegateModule*) base;
391
390
        g_return_if_fail (d != NULL);
392
391
        g_return_if_fail (decl_space != NULL);
393
392
        _tmp0_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) d, FALSE);
394
393
        _tmp1_ = _tmp0_;
395
394
        _tmp2_ = vala_dova_base_module_add_symbol_declaration ((ValaDovaBaseModule*) self, decl_space, (ValaSymbol*) d, _tmp1_);
396
 
        if ((_tmp3_ = _tmp2_, _g_free0 (_tmp1_), _tmp3_)) {
 
395
        _tmp3_ = _tmp2_;
 
396
        _g_free0 (_tmp1_);
 
397
        if (_tmp3_) {
397
398
                return;
398
399
        }
399
400
        _tmp4_ = vala_typesymbol_get_cname ((ValaTypeSymbol*) d, FALSE);
428
429
        _tmp22_ = g_strdup_printf ("%s_type_get", _tmp21_);
429
430
        _tmp23_ = _tmp22_;
430
431
        _tmp24_ = vala_ccode_function_new (_tmp23_, "DovaType *");
431
 
        type_fun = (_tmp25_ = _tmp24_, _g_free0 (_tmp23_), _g_free0 (_tmp21_), _tmp25_);
 
432
        _tmp25_ = _tmp24_;
 
433
        _g_free0 (_tmp23_);
 
434
        _g_free0 (_tmp21_);
 
435
        type_fun = _tmp25_;
432
436
        _tmp26_ = vala_symbol_is_internal_symbol ((ValaSymbol*) d);
433
437
        if (_tmp26_) {
434
438
                vala_ccode_function_set_modifiers (type_fun, VALA_CCODE_MODIFIERS_STATIC);
439
443
        _tmp29_ = g_strdup_printf ("%s_type_init", _tmp28_);
440
444
        _tmp30_ = _tmp29_;
441
445
        _tmp31_ = vala_ccode_function_new (_tmp30_, "void");
442
 
        type_init_fun = (_tmp32_ = _tmp31_, _g_free0 (_tmp30_), _g_free0 (_tmp28_), _tmp32_);
 
446
        _tmp32_ = _tmp31_;
 
447
        _g_free0 (_tmp30_);
 
448
        _g_free0 (_tmp28_);
 
449
        type_init_fun = _tmp32_;
443
450
        _tmp33_ = vala_symbol_is_internal_symbol ((ValaSymbol*) d);
444
451
        if (_tmp33_) {
445
452
                vala_ccode_function_set_modifiers (type_init_fun, VALA_CCODE_MODIFIERS_STATIC);
456
463
        vala_ccode_function_set_block (function, NULL);
457
464
        vala_ccode_file_add_function_declaration (decl_space, function);
458
465
        _tmp38_ = vala_dova_delegate_module_generate_invoke_function (self, d, decl_space);
459
 
        _tmp39_ = _tmp38_;
460
466
        _vala_ccode_node_unref0 (function);
461
 
        function = _tmp39_;
 
467
        function = _tmp38_;
462
468
        vala_ccode_function_set_block (function, NULL);
463
469
        vala_ccode_file_add_function_declaration (decl_space, function);
464
470
        _vala_ccode_node_unref0 (function);
560
566
        _tmp6_ = g_strdup_printf ("%s*", _tmp5_);
561
567
        _tmp7_ = _tmp6_;
562
568
        _tmp8_ = vala_ccode_function_new (_tmp3_, _tmp7_);
563
 
        function = (_tmp9_ = _tmp8_, _g_free0 (_tmp7_), _g_free0 (_tmp5_), _g_free0 (_tmp3_), _g_free0 (_tmp1_), _tmp9_);
 
569
        _tmp9_ = _tmp8_;
 
570
        _g_free0 (_tmp7_);
 
571
        _g_free0 (_tmp5_);
 
572
        _g_free0 (_tmp3_);
 
573
        _g_free0 (_tmp1_);
 
574
        function = _tmp9_;
564
575
        _tmp10_ = vala_symbol_is_internal_symbol ((ValaSymbol*) d);
565
576
        if (_tmp10_) {
566
577
                ValaCCodeModifiers _tmp11_;
582
593
        _tmp18_ = vala_ccode_identifier_new ("dova_object_alloc");
583
594
        _tmp19_ = _tmp18_;
584
595
        _tmp20_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp19_);
585
 
        alloc_call = (_tmp21_ = _tmp20_, _vala_ccode_node_unref0 (_tmp19_), _tmp21_);
 
596
        _tmp21_ = _tmp20_;
 
597
        _vala_ccode_node_unref0 (_tmp19_);
 
598
        alloc_call = _tmp21_;
586
599
        _tmp22_ = vala_symbol_get_lower_case_cname ((ValaSymbol*) d, NULL);
587
600
        _tmp23_ = _tmp22_;
588
601
        _tmp24_ = g_strdup_printf ("%s_type_get", _tmp23_);
601
614
        _tmp32_ = g_strdup_printf ("%s*", _tmp31_);
602
615
        _tmp33_ = _tmp32_;
603
616
        _tmp34_ = vala_ccode_declaration_new (_tmp33_);
604
 
        _cdecl_ = (_tmp35_ = _tmp34_, _g_free0 (_tmp33_), _g_free0 (_tmp31_), _tmp35_);
 
617
        _tmp35_ = _tmp34_;
 
618
        _g_free0 (_tmp33_);
 
619
        _g_free0 (_tmp31_);
 
620
        _cdecl_ = _tmp35_;
605
621
        _tmp36_ = vala_ccode_variable_declarator_new ("this", (ValaCCodeExpression*) alloc_call, NULL);
606
622
        _tmp37_ = _tmp36_;
607
623
        vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) _tmp37_);
611
627
        _tmp39_ = vala_ccode_identifier_new ("dova_delegate_init");
612
628
        _tmp40_ = _tmp39_;
613
629
        _tmp41_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp40_);
614
 
        init_call = (_tmp42_ = _tmp41_, _vala_ccode_node_unref0 (_tmp40_), _tmp42_);
 
630
        _tmp42_ = _tmp41_;
 
631
        _vala_ccode_node_unref0 (_tmp40_);
 
632
        init_call = _tmp42_;
615
633
        _tmp43_ = vala_ccode_identifier_new ("this");
616
634
        _tmp44_ = _tmp43_;
617
635
        vala_ccode_function_call_add_argument (init_call, (ValaCCodeExpression*) _tmp44_);
632
650
        _tmp54_ = vala_ccode_identifier_new (_tmp53_);
633
651
        _tmp55_ = _tmp54_;
634
652
        _tmp56_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp55_);
635
 
        priv = (_tmp57_ = _tmp56_, _vala_ccode_node_unref0 (_tmp55_), _g_free0 (_tmp53_), _g_free0 (_tmp51_), _tmp57_);
 
653
        _tmp57_ = _tmp56_;
 
654
        _vala_ccode_node_unref0 (_tmp55_);
 
655
        _g_free0 (_tmp53_);
 
656
        _g_free0 (_tmp51_);
 
657
        priv = _tmp57_;
636
658
        _tmp58_ = vala_ccode_identifier_new ("this");
637
659
        _tmp59_ = _tmp58_;
638
660
        vala_ccode_function_call_add_argument (priv, (ValaCCodeExpression*) _tmp59_);
642
664
        _tmp62_ = vala_ccode_identifier_new ("method");
643
665
        _tmp63_ = _tmp62_;
644
666
        _tmp64_ = vala_ccode_assignment_new ((ValaCCodeExpression*) _tmp61_, (ValaCCodeExpression*) _tmp63_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
645
 
        assignment = (_tmp65_ = _tmp64_, _vala_ccode_node_unref0 (_tmp63_), _vala_ccode_node_unref0 (_tmp61_), _tmp65_);
 
667
        _tmp65_ = _tmp64_;
 
668
        _vala_ccode_node_unref0 (_tmp63_);
 
669
        _vala_ccode_node_unref0 (_tmp61_);
 
670
        assignment = _tmp65_;
646
671
        _tmp66_ = vala_ccode_function_get_block (function);
647
672
        _tmp67_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) assignment);
648
673
        _tmp68_ = _tmp67_;
756
781
        _tmp2_ = g_strdup_printf ("%s_invoke", _tmp1_);
757
782
        _tmp3_ = _tmp2_;
758
783
        _tmp4_ = vala_ccode_function_new (_tmp3_, "void");
759
 
        function = (_tmp5_ = _tmp4_, _g_free0 (_tmp3_), _g_free0 (_tmp1_), _tmp5_);
 
784
        _tmp5_ = _tmp4_;
 
785
        _g_free0 (_tmp3_);
 
786
        _g_free0 (_tmp1_);
 
787
        function = _tmp5_;
760
788
        _tmp6_ = vala_symbol_is_internal_symbol ((ValaSymbol*) d);
761
789
        if (_tmp6_) {
762
790
                ValaCCodeModifiers _tmp7_;
869
897
        _tmp40_ = vala_ccode_identifier_new ("dova_delegate_get_target");
870
898
        _tmp41_ = _tmp40_;
871
899
        _tmp42_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp41_);
872
 
        get_target = (_tmp43_ = _tmp42_, _vala_ccode_node_unref0 (_tmp41_), _tmp43_);
 
900
        _tmp43_ = _tmp42_;
 
901
        _vala_ccode_node_unref0 (_tmp41_);
 
902
        get_target = _tmp43_;
873
903
        _tmp44_ = vala_ccode_identifier_new ("this");
874
904
        _tmp45_ = _tmp44_;
875
905
        vala_ccode_function_call_add_argument (get_target, (ValaCCodeExpression*) _tmp45_);
889
919
        _tmp54_ = vala_ccode_identifier_new (_tmp53_);
890
920
        _tmp55_ = _tmp54_;
891
921
        _tmp56_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp55_);
892
 
        priv = (_tmp57_ = _tmp56_, _vala_ccode_node_unref0 (_tmp55_), _g_free0 (_tmp53_), _g_free0 (_tmp51_), _tmp57_);
 
922
        _tmp57_ = _tmp56_;
 
923
        _vala_ccode_node_unref0 (_tmp55_);
 
924
        _g_free0 (_tmp53_);
 
925
        _g_free0 (_tmp51_);
 
926
        priv = _tmp57_;
893
927
        _tmp58_ = vala_ccode_identifier_new ("this");
894
928
        _tmp59_ = _tmp58_;
895
929
        vala_ccode_function_call_add_argument (priv, (ValaCCodeExpression*) _tmp59_);
919
953
        _tmp70_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) _tmp66_, _tmp69_);
920
954
        _tmp71_ = _tmp70_;
921
955
        _tmp72_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp71_);
922
 
        instance_call = (_tmp73_ = _tmp72_, _vala_ccode_node_unref0 (_tmp71_), _g_free0 (_tmp69_), _vala_ccode_node_unref0 (_tmp66_), _tmp73_);
 
956
        _tmp73_ = _tmp72_;
 
957
        _vala_ccode_node_unref0 (_tmp71_);
 
958
        _g_free0 (_tmp69_);
 
959
        _vala_ccode_node_unref0 (_tmp66_);
 
960
        instance_call = _tmp73_;
923
961
        _tmp74_ = vala_ccode_identifier_new ("target");
924
962
        _tmp75_ = _tmp74_;
925
963
        vala_ccode_function_call_add_argument (instance_call, (ValaCCodeExpression*) _tmp75_);
950
988
        _tmp86_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) _tmp82_, _tmp85_);
951
989
        _tmp87_ = _tmp86_;
952
990
        _tmp88_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp87_);
953
 
        static_call = (_tmp89_ = _tmp88_, _vala_ccode_node_unref0 (_tmp87_), _g_free0 (_tmp85_), _vala_ccode_node_unref0 (_tmp82_), _tmp89_);
 
991
        _tmp89_ = _tmp88_;
 
992
        _vala_ccode_node_unref0 (_tmp87_);
 
993
        _g_free0 (_tmp85_);
 
994
        _vala_ccode_node_unref0 (_tmp82_);
 
995
        static_call = _tmp89_;
954
996
        {
955
997
                ValaList* _tmp90_ = NULL;
956
998
                ValaList* _param_list;
1118
1160
        ValaCCodeVariableDeclarator* _tmp39_ = NULL;
1119
1161
        ValaCCodeVariableDeclarator* _tmp40_;
1120
1162
        ValaCCodeDeclaration* _tmp41_ = NULL;
1121
 
        ValaCCodeDeclaration* _tmp42_;
1122
 
        gchar* _tmp43_ = NULL;
1123
 
        gchar* _tmp44_;
1124
 
        gchar* _tmp45_ = NULL;
1125
 
        gchar* _tmp46_;
1126
 
        ValaCCodeConstant* _tmp47_ = NULL;
1127
 
        ValaCCodeConstant* _tmp48_;
1128
 
        ValaCCodeVariableDeclarator* _tmp49_ = NULL;
1129
 
        ValaCCodeVariableDeclarator* _tmp50_;
1130
 
        ValaCCodeFunction* _tmp51_ = NULL;
1131
 
        ValaCCodeFunction* _tmp52_;
1132
 
        ValaCCodeFunction* _tmp53_ = NULL;
1133
 
        ValaCCodeFunction* _tmp54_;
 
1163
        gchar* _tmp42_ = NULL;
 
1164
        gchar* _tmp43_;
 
1165
        gchar* _tmp44_ = NULL;
 
1166
        gchar* _tmp45_;
 
1167
        ValaCCodeConstant* _tmp46_ = NULL;
 
1168
        ValaCCodeConstant* _tmp47_;
 
1169
        ValaCCodeVariableDeclarator* _tmp48_ = NULL;
 
1170
        ValaCCodeVariableDeclarator* _tmp49_;
 
1171
        ValaCCodeFunction* _tmp50_ = NULL;
 
1172
        ValaCCodeFunction* _tmp51_;
 
1173
        ValaCCodeFunction* _tmp52_ = NULL;
 
1174
        ValaCCodeFunction* _tmp53_;
1134
1175
        self = (ValaDovaDelegateModule*) base;
1135
1176
        g_return_if_fail (d != NULL);
1136
1177
        vala_code_node_accept_children ((ValaCodeNode*) d, (ValaCodeVisitor*) self);
1147
1188
        _tmp5_ = g_strdup_printf ("_%sPrivate", _tmp4_);
1148
1189
        _tmp6_ = _tmp5_;
1149
1190
        _tmp7_ = vala_ccode_struct_new (_tmp6_);
1150
 
        instance_priv_struct = (_tmp8_ = _tmp7_, _g_free0 (_tmp6_), _g_free0 (_tmp4_), _tmp8_);
 
1191
        _tmp8_ = _tmp7_;
 
1192
        _g_free0 (_tmp6_);
 
1193
        _g_free0 (_tmp4_);
 
1194
        instance_priv_struct = _tmp8_;
1151
1195
        vala_ccode_struct_add_field (instance_priv_struct, "void", "(*method) (void)", NULL);
1152
1196
        _tmp9_ = vala_ccode_struct_get_name (instance_priv_struct);
1153
1197
        _tmp10_ = g_strdup_printf ("struct %s", _tmp9_);
1172
1216
        _tmp22_ = vala_symbol_get_lower_case_cname ((ValaSymbol*) d, NULL);
1173
1217
        _tmp23_ = _tmp22_;
1174
1218
        _tmp24_ = g_strdup_printf ("((%sPrivate *) (((char *) o) + _%s_object_offset))", _tmp21_, _tmp23_);
1175
 
        macro = (_tmp25_ = _tmp24_, _g_free0 (_tmp23_), _g_free0 (_tmp21_), _tmp25_);
 
1219
        _tmp25_ = _tmp24_;
 
1220
        _g_free0 (_tmp23_);
 
1221
        _g_free0 (_tmp21_);
 
1222
        macro = _tmp25_;
1176
1223
        _tmp26_ = vala_typesymbol_get_upper_case_cname ((ValaTypeSymbol*) d, NULL);
1177
1224
        _tmp27_ = _tmp26_;
1178
1225
        _tmp28_ = g_strdup_printf ("%s_GET_PRIVATE(o)", _tmp27_);
1201
1248
        vala_ccode_declaration_set_modifiers (_cdecl_, VALA_CCODE_MODIFIERS_STATIC);
1202
1249
        vala_ccode_file_add_type_member_declaration (((ValaDovaBaseModule*) self)->cfile, (ValaCCodeNode*) _cdecl_);
1203
1250
        _tmp41_ = vala_ccode_declaration_new ("intptr_t");
1204
 
        _tmp42_ = _tmp41_;
1205
1251
        _vala_ccode_node_unref0 (_cdecl_);
1206
 
        _cdecl_ = _tmp42_;
1207
 
        _tmp43_ = vala_symbol_get_lower_case_cname ((ValaSymbol*) d, NULL);
1208
 
        _tmp44_ = _tmp43_;
1209
 
        _tmp45_ = g_strdup_printf ("_%s_type_offset", _tmp44_);
1210
 
        _tmp46_ = _tmp45_;
1211
 
        _tmp47_ = vala_ccode_constant_new ("0");
1212
 
        _tmp48_ = _tmp47_;
1213
 
        _tmp49_ = vala_ccode_variable_declarator_new (_tmp46_, (ValaCCodeExpression*) _tmp48_, NULL);
1214
 
        _tmp50_ = _tmp49_;
1215
 
        vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) _tmp50_);
1216
 
        _vala_ccode_node_unref0 (_tmp50_);
1217
 
        _vala_ccode_node_unref0 (_tmp48_);
1218
 
        _g_free0 (_tmp46_);
1219
 
        _g_free0 (_tmp44_);
 
1252
        _cdecl_ = _tmp41_;
 
1253
        _tmp42_ = vala_symbol_get_lower_case_cname ((ValaSymbol*) d, NULL);
 
1254
        _tmp43_ = _tmp42_;
 
1255
        _tmp44_ = g_strdup_printf ("_%s_type_offset", _tmp43_);
 
1256
        _tmp45_ = _tmp44_;
 
1257
        _tmp46_ = vala_ccode_constant_new ("0");
 
1258
        _tmp47_ = _tmp46_;
 
1259
        _tmp48_ = vala_ccode_variable_declarator_new (_tmp45_, (ValaCCodeExpression*) _tmp47_, NULL);
 
1260
        _tmp49_ = _tmp48_;
 
1261
        vala_ccode_declaration_add_declarator (_cdecl_, (ValaCCodeDeclarator*) _tmp49_);
 
1262
        _vala_ccode_node_unref0 (_tmp49_);
 
1263
        _vala_ccode_node_unref0 (_tmp47_);
 
1264
        _g_free0 (_tmp45_);
 
1265
        _g_free0 (_tmp43_);
1220
1266
        vala_ccode_declaration_set_modifiers (_cdecl_, VALA_CCODE_MODIFIERS_STATIC);
1221
1267
        vala_ccode_file_add_type_member_declaration (((ValaDovaBaseModule*) self)->cfile, (ValaCCodeNode*) _cdecl_);
1222
 
        _tmp51_ = vala_dova_delegate_module_generate_new_function (self, d, ((ValaDovaBaseModule*) self)->cfile);
1223
 
        _tmp52_ = _tmp51_;
1224
 
        vala_ccode_file_add_function (((ValaDovaBaseModule*) self)->cfile, _tmp52_);
1225
 
        _vala_ccode_node_unref0 (_tmp52_);
1226
 
        _tmp53_ = vala_dova_delegate_module_generate_invoke_function (self, d, ((ValaDovaBaseModule*) self)->cfile);
1227
 
        _tmp54_ = _tmp53_;
1228
 
        vala_ccode_file_add_function (((ValaDovaBaseModule*) self)->cfile, _tmp54_);
1229
 
        _vala_ccode_node_unref0 (_tmp54_);
 
1268
        _tmp50_ = vala_dova_delegate_module_generate_new_function (self, d, ((ValaDovaBaseModule*) self)->cfile);
 
1269
        _tmp51_ = _tmp50_;
 
1270
        vala_ccode_file_add_function (((ValaDovaBaseModule*) self)->cfile, _tmp51_);
 
1271
        _vala_ccode_node_unref0 (_tmp51_);
 
1272
        _tmp52_ = vala_dova_delegate_module_generate_invoke_function (self, d, ((ValaDovaBaseModule*) self)->cfile);
 
1273
        _tmp53_ = _tmp52_;
 
1274
        vala_ccode_file_add_function (((ValaDovaBaseModule*) self)->cfile, _tmp53_);
 
1275
        _vala_ccode_node_unref0 (_tmp53_);
1230
1276
        _vala_ccode_node_unref0 (_cdecl_);
1231
1277
        _g_free0 (macro);
1232
1278
        _vala_ccode_node_unref0 (instance_priv_struct);