~ubuntu-branches/ubuntu/vivid/vala/vivid

« back to all changes in this revision

Viewing changes to codegen/valaccodestructmodule.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-07-28 07:58:01 UTC
  • mfrom: (1.5.5 upstream) (7.3.14 experimental)
  • Revision ID: james.westby@ubuntu.com-20100728075801-18u9cg5hv5oety6m
Tags: 0.9.4-1
New upstream development release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
        void (*visit_enum) (ValaCCodeModule* self, ValaEnum* en);
130
130
        void (*visit_error_domain) (ValaCCodeModule* self, ValaErrorDomain* edomain);
131
131
        void (*visit_delegate) (ValaCCodeModule* self, ValaDelegate* d);
132
 
        void (*visit_member) (ValaCCodeModule* self, ValaMember* m);
 
132
        void (*visit_member) (ValaCCodeModule* self, ValaSymbol* m);
133
133
        void (*visit_constant) (ValaCCodeModule* self, ValaConstant* c);
134
134
        void (*visit_field) (ValaCCodeModule* self, ValaField* f);
135
135
        void (*visit_method) (ValaCCodeModule* self, ValaMethod* m);
525
525
                                break;
526
526
                        }
527
527
                        f = (ValaField*) vala_iterator_get (_f_it);
528
 
                        field_ctype = vala_data_type_get_cname (vala_field_get_field_type (f));
 
528
                        field_ctype = vala_data_type_get_cname (vala_variable_get_variable_type ((ValaVariable*) f));
529
529
                        if (vala_field_get_is_volatile (f)) {
530
530
                                char* _tmp16_;
531
531
                                field_ctype = (_tmp16_ = g_strconcat ("volatile ", field_ctype, NULL), _g_free0 (field_ctype), _tmp16_);
536
536
                                char* _tmp19_;
537
537
                                char* _tmp18_;
538
538
                                gboolean _tmp21_ = FALSE;
539
 
                                vala_ccode_base_module_generate_type_declaration ((ValaCCodeBaseModule*) self, vala_field_get_field_type (f), decl_space);
 
539
                                vala_ccode_base_module_generate_type_declaration ((ValaCCodeBaseModule*) self, vala_variable_get_variable_type ((ValaVariable*) f), decl_space);
540
540
                                _tmp17_ = NULL;
541
541
                                if (vala_symbol_get_deprecated ((ValaSymbol*) f)) {
542
542
                                        _tmp17_ = " G_GNUC_DEPRECATED";
543
543
                                } else {
544
544
                                        _tmp17_ = NULL;
545
545
                                }
546
 
                                vala_ccode_struct_add_field (instance_struct, field_ctype, _tmp20_ = g_strconcat (_tmp18_ = vala_field_get_cname (f), _tmp19_ = vala_data_type_get_cdeclarator_suffix (vala_field_get_field_type (f)), NULL), _tmp17_);
 
546
                                vala_ccode_struct_add_field (instance_struct, field_ctype, _tmp20_ = g_strconcat (_tmp18_ = vala_field_get_cname (f), _tmp19_ = vala_data_type_get_cdeclarator_suffix (vala_variable_get_variable_type ((ValaVariable*) f)), NULL), _tmp17_);
547
547
                                _g_free0 (_tmp20_);
548
548
                                _g_free0 (_tmp19_);
549
549
                                _g_free0 (_tmp18_);
550
 
                                if (VALA_IS_ARRAY_TYPE (vala_field_get_field_type (f))) {
 
550
                                if (VALA_IS_ARRAY_TYPE (vala_variable_get_variable_type ((ValaVariable*) f))) {
551
551
                                        _tmp21_ = !vala_field_get_no_array_length (f);
552
552
                                } else {
553
553
                                        _tmp21_ = FALSE;
554
554
                                }
555
555
                                if (_tmp21_) {
556
556
                                        ValaArrayType* array_type;
557
 
                                        array_type = _vala_code_node_ref0 (VALA_ARRAY_TYPE (vala_field_get_field_type (f)));
 
557
                                        array_type = _vala_code_node_ref0 (VALA_ARRAY_TYPE (vala_variable_get_variable_type ((ValaVariable*) f)));
558
558
                                        if (!vala_array_type_get_fixed_length (array_type)) {
559
559
                                                ValaDataType* len_type;
560
560
                                                gboolean _tmp25_ = FALSE;
597
597
                                        }
598
598
                                        _vala_code_node_unref0 (array_type);
599
599
                                } else {
600
 
                                        if (VALA_IS_DELEGATE_TYPE (vala_field_get_field_type (f))) {
 
600
                                        if (VALA_IS_DELEGATE_TYPE (vala_variable_get_variable_type ((ValaVariable*) f))) {
601
601
                                                ValaDelegateType* delegate_type;
602
 
                                                delegate_type = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (vala_field_get_field_type (f)));
 
602
                                                delegate_type = _vala_code_node_ref0 (VALA_DELEGATE_TYPE (vala_variable_get_variable_type ((ValaVariable*) f)));
603
603
                                                if (vala_delegate_get_has_target (vala_delegate_type_get_delegate_symbol (delegate_type))) {
604
604
                                                        char* _tmp28_;
605
605
                                                        vala_ccode_struct_add_field (instance_struct, "gpointer", _tmp28_ = vala_ccode_base_module_get_delegate_target_cname ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) f)), NULL);
982
982
                                ValaArrayType* array_type;
983
983
                                gboolean _tmp19_ = FALSE;
984
984
                                copy = (_tmp12_ = (ValaCCodeExpression*) vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp11_ = vala_ccode_identifier_new ("self")), vala_symbol_get_name ((ValaSymbol*) f)), _vala_ccode_node_unref0 (_tmp11_), _tmp12_);
985
 
                                if (vala_ccode_base_module_requires_copy ((ValaCCodeBaseModule*) self, vala_field_get_field_type (f))) {
 
985
                                if (vala_ccode_base_module_requires_copy ((ValaCCodeBaseModule*) self, vala_variable_get_variable_type ((ValaVariable*) f))) {
986
986
                                        ValaMemberAccess* this_access;
987
987
                                        ValaDataType* _tmp13_;
988
988
                                        ValaCCodeIdentifier* _tmp14_;
995
995
                                        _vala_ccode_node_unref0 (_tmp14_);
996
996
                                        ma = vala_member_access_new ((ValaExpression*) this_access, vala_symbol_get_name ((ValaSymbol*) f), NULL);
997
997
                                        vala_expression_set_symbol_reference ((ValaExpression*) ma, (ValaSymbol*) f);
998
 
                                        copy = (_tmp15_ = vala_ccode_base_module_get_ref_cexpression ((ValaCCodeBaseModule*) self, vala_field_get_field_type (f), copy, (ValaExpression*) ma, (ValaCodeNode*) f), _vala_ccode_node_unref0 (copy), _tmp15_);
 
998
                                        copy = (_tmp15_ = vala_ccode_base_module_get_ref_cexpression ((ValaCCodeBaseModule*) self, vala_variable_get_variable_type ((ValaVariable*) f), copy, (ValaExpression*) ma, (ValaCodeNode*) f), _vala_ccode_node_unref0 (copy), _tmp15_);
999
999
                                        _vala_code_node_unref0 (ma);
1000
1000
                                        _vala_code_node_unref0 (this_access);
1001
1001
                                }
1002
1002
                                dest = (_tmp17_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) (_tmp16_ = vala_ccode_identifier_new ("dest")), vala_symbol_get_name ((ValaSymbol*) f)), _vala_ccode_node_unref0 (_tmp16_), _tmp17_);
1003
 
                                array_type = _vala_code_node_ref0 ((_tmp18_ = vala_field_get_field_type (f), VALA_IS_ARRAY_TYPE (_tmp18_) ? ((ValaArrayType*) _tmp18_) : NULL));
 
1003
                                array_type = _vala_code_node_ref0 ((_tmp18_ = vala_variable_get_variable_type ((ValaVariable*) f), VALA_IS_ARRAY_TYPE (_tmp18_) ? ((ValaArrayType*) _tmp18_) : NULL));
1004
1004
                                if (array_type != NULL) {
1005
1005
                                        _tmp19_ = vala_array_type_get_fixed_length (array_type);
1006
1006
                                } else {