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

« back to all changes in this revision

Viewing changes to codegen/valaccodearraymodule.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-09-05 10:32:13 UTC
  • mfrom: (1.5.9 upstream) (28.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20100905103213-8nn88erk20o4wgm3
Tags: 0.9.8-1
New upstream development release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2580
2580
        if (!vala_formal_parameter_get_no_array_length (param)) {
2581
2581
                char* length_ctype;
2582
2582
                length_ctype = g_strdup ("int");
 
2583
                if (vala_formal_parameter_get_array_length_type (param) != NULL) {
 
2584
                        char* _tmp4_;
 
2585
                        length_ctype = (_tmp4_ = g_strdup (vala_formal_parameter_get_array_length_type (param)), _g_free0 (length_ctype), _tmp4_);
 
2586
                }
2583
2587
                if (vala_formal_parameter_get_direction (param) != VALA_PARAMETER_DIRECTION_IN) {
2584
 
                        char* _tmp4_;
2585
 
                        length_ctype = (_tmp4_ = g_strdup ("int*"), _g_free0 (length_ctype), _tmp4_);
 
2588
                        char* _tmp5_;
 
2589
                        length_ctype = (_tmp5_ = g_strdup_printf ("%s*", length_ctype), _g_free0 (length_ctype), _tmp5_);
2586
2590
                }
2587
2591
                {
2588
2592
                        gint dim;
2589
2593
                        dim = 1;
2590
2594
                        {
2591
 
                                gboolean _tmp5_;
2592
 
                                _tmp5_ = TRUE;
 
2595
                                gboolean _tmp6_;
 
2596
                                _tmp6_ = TRUE;
2593
2597
                                while (TRUE) {
2594
 
                                        char* _tmp6_;
2595
2598
                                        char* _tmp7_;
2596
 
                                        ValaCCodeFormalParameter* _tmp8_;
 
2599
                                        char* _tmp8_;
 
2600
                                        ValaCCodeFormalParameter* _tmp9_;
2597
2601
                                        ValaCCodeFormalParameter* cparam;
2598
 
                                        if (!_tmp5_) {
 
2602
                                        if (!_tmp6_) {
2599
2603
                                                dim++;
2600
2604
                                        }
2601
 
                                        _tmp5_ = FALSE;
 
2605
                                        _tmp6_ = FALSE;
2602
2606
                                        if (!(dim <= vala_array_type_get_rank (array_type))) {
2603
2607
                                                break;
2604
2608
                                        }
2605
 
                                        cparam = (_tmp8_ = vala_ccode_formal_parameter_new (_tmp7_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp6_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) param)), dim), length_ctype), _g_free0 (_tmp7_), _g_free0 (_tmp6_), _tmp8_);
 
2609
                                        cparam = (_tmp9_ = vala_ccode_formal_parameter_new (_tmp8_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp7_ = vala_ccode_base_module_get_variable_cname ((ValaCCodeBaseModule*) self, vala_symbol_get_name ((ValaSymbol*) param)), dim), length_ctype), _g_free0 (_tmp8_), _g_free0 (_tmp7_), _tmp9_);
2606
2610
                                        vala_map_set (cparam_map, GINT_TO_POINTER (vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, vala_formal_parameter_get_carray_length_parameter_position (param) + (0.01 * dim), FALSE)), cparam);
2607
2611
                                        if (carg_map != NULL) {
2608
 
                                                ValaCCodeExpression* _tmp9_;
2609
 
                                                vala_map_set (carg_map, GINT_TO_POINTER (vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, vala_formal_parameter_get_carray_length_parameter_position (param) + (0.01 * dim), FALSE)), _tmp9_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, vala_ccode_formal_parameter_get_name (cparam)));
2610
 
                                                _vala_ccode_node_unref0 (_tmp9_);
 
2612
                                                ValaCCodeExpression* _tmp10_;
 
2613
                                                vala_map_set (carg_map, GINT_TO_POINTER (vala_ccode_base_module_get_param_pos ((ValaCCodeBaseModule*) self, vala_formal_parameter_get_carray_length_parameter_position (param) + (0.01 * dim), FALSE)), _tmp10_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, vala_ccode_formal_parameter_get_name (cparam)));
 
2614
                                                _vala_ccode_node_unref0 (_tmp10_);
2611
2615
                                        }
2612
2616
                                        _vala_ccode_node_unref0 (cparam);
2613
2617
                                }