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

« back to all changes in this revision

Viewing changes to vala/valasemanticanalyzer.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2011-01-18 09:51:15 UTC
  • mfrom: (1.5.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20110118095115-r2jr7c63lr0jzj0y
Tags: 0.11.4-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
2638
2638
}
2639
2639
 
2640
2640
 
2641
 
static const gchar* string_offset (const gchar* self, glong offset) {
2642
 
        const gchar* result = NULL;
 
2641
static gchar* string_substring (const gchar* self, glong offset, glong len) {
 
2642
        gchar* result = NULL;
 
2643
        gint _tmp0_;
 
2644
        glong string_length;
 
2645
        gchar* _tmp1_ = NULL;
2643
2646
        g_return_val_if_fail (self != NULL, NULL);
2644
 
        result = (const gchar*) (((gchar*) self) + offset);
 
2647
        _tmp0_ = strlen (self);
 
2648
        string_length = (glong) _tmp0_;
 
2649
        if (offset < 0) {
 
2650
                offset = string_length + offset;
 
2651
                g_return_val_if_fail (offset >= 0, NULL);
 
2652
        } else {
 
2653
                g_return_val_if_fail (offset <= string_length, NULL);
 
2654
        }
 
2655
        if (len < 0) {
 
2656
                len = string_length - offset;
 
2657
        }
 
2658
        g_return_val_if_fail ((offset + len) <= string_length, NULL);
 
2659
        _tmp1_ = g_strndup (((gchar*) self) + offset, (gsize) len);
 
2660
        result = _tmp1_;
2645
2661
        return result;
2646
2662
}
2647
2663
 
3078
3094
                        ValaSourceReference* _tmp100_ = NULL;
3079
3095
                        gint _tmp101_;
3080
3096
                        const gchar* _tmp102_ = NULL;
3081
 
                        const gchar* _tmp103_ = NULL;
3082
 
                        gchar* _tmp104_ = NULL;
3083
 
                        gchar* _tmp105_;
 
3097
                        gchar* _tmp103_ = NULL;
 
3098
                        gchar* _tmp104_;
 
3099
                        gchar* _tmp105_ = NULL;
 
3100
                        gchar* _tmp106_;
3084
3101
                        _tmp95_ = vala_code_node_get_source_reference ((ValaCodeNode*) expr);
3085
3102
                        _tmp96_ = vala_source_reference_get_file (_tmp95_);
3086
3103
                        _tmp97_ = vala_source_file_get_filename (_tmp96_);
3089
3106
                        _tmp100_ = vala_code_node_get_source_reference ((ValaCodeNode*) expr);
3090
3107
                        _tmp101_ = vala_source_reference_get_first_line (_tmp100_);
3091
3108
                        _tmp102_ = vala_string_literal_get_value (format_arg);
3092
 
                        _tmp103_ = string_offset (_tmp102_, (glong) 1);
3093
 
                        _tmp104_ = g_strdup_printf ("\"%s:%d: %s", _tmp99_, _tmp101_, _tmp103_);
3094
 
                        _tmp105_ = _tmp104_;
3095
 
                        vala_string_literal_set_value (format_arg, _tmp105_);
3096
 
                        _g_free0 (_tmp105_);
 
3109
                        _tmp103_ = string_substring (_tmp102_, (glong) 1, (glong) (-1));
 
3110
                        _tmp104_ = _tmp103_;
 
3111
                        _tmp105_ = g_strdup_printf ("\"%s:%d: %s", _tmp99_, _tmp101_, _tmp104_);
 
3112
                        _tmp106_ = _tmp105_;
 
3113
                        vala_string_literal_set_value (format_arg, _tmp106_);
 
3114
                        _g_free0 (_tmp106_);
 
3115
                        _g_free0 (_tmp104_);
3097
3116
                        _g_free0 (_tmp99_);
3098
3117
                }
3099
3118
                _vala_code_node_unref0 (format_arg);