~ubuntu-branches/ubuntu/precise/vala/precise

« back to all changes in this revision

Viewing changes to vala/valasourcefile.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-02-15 11:44:25 UTC
  • mfrom: (1.5.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20110215114425-8vtvfqmnely5x8tt
Tags: 0.11.6-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
436
436
 
437
437
static gchar* string_substring (const gchar* self, glong offset, glong len) {
438
438
        gchar* result = NULL;
439
 
        gint _tmp0_;
440
 
        glong string_length;
441
 
        gchar* _tmp1_ = NULL;
 
439
        glong string_length = 0L;
 
440
        gboolean _tmp0_ = FALSE;
 
441
        gchar* _tmp3_ = NULL;
442
442
        g_return_val_if_fail (self != NULL, NULL);
443
 
        _tmp0_ = strlen (self);
444
 
        string_length = (glong) _tmp0_;
 
443
        if (offset >= 0) {
 
444
                _tmp0_ = len >= 0;
 
445
        } else {
 
446
                _tmp0_ = FALSE;
 
447
        }
 
448
        if (_tmp0_) {
 
449
                glong _tmp1_;
 
450
                _tmp1_ = strnlen ((gchar*) self, (gsize) (offset + len));
 
451
                string_length = _tmp1_;
 
452
        } else {
 
453
                gint _tmp2_;
 
454
                _tmp2_ = strlen (self);
 
455
                string_length = (glong) _tmp2_;
 
456
        }
445
457
        if (offset < 0) {
446
458
                offset = string_length + offset;
447
459
                g_return_val_if_fail (offset >= 0, NULL);
452
464
                len = string_length - offset;
453
465
        }
454
466
        g_return_val_if_fail ((offset + len) <= string_length, NULL);
455
 
        _tmp1_ = g_strndup (((gchar*) self) + offset, (gsize) len);
456
 
        result = _tmp1_;
 
467
        _tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
 
468
        result = _tmp3_;
457
469
        return result;
458
470
}
459
471