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

« back to all changes in this revision

Viewing changes to vala/valainterface.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:
1335
1335
 */
1336
1336
static gchar* string_substring (const gchar* self, glong offset, glong len) {
1337
1337
        gchar* result = NULL;
1338
 
        gint _tmp0_;
1339
 
        glong string_length;
1340
 
        gchar* _tmp1_ = NULL;
 
1338
        glong string_length = 0L;
 
1339
        gboolean _tmp0_ = FALSE;
 
1340
        gchar* _tmp3_ = NULL;
1341
1341
        g_return_val_if_fail (self != NULL, NULL);
1342
 
        _tmp0_ = strlen (self);
1343
 
        string_length = (glong) _tmp0_;
 
1342
        if (offset >= 0) {
 
1343
                _tmp0_ = len >= 0;
 
1344
        } else {
 
1345
                _tmp0_ = FALSE;
 
1346
        }
 
1347
        if (_tmp0_) {
 
1348
                glong _tmp1_;
 
1349
                _tmp1_ = strnlen ((gchar*) self, (gsize) (offset + len));
 
1350
                string_length = _tmp1_;
 
1351
        } else {
 
1352
                gint _tmp2_;
 
1353
                _tmp2_ = strlen (self);
 
1354
                string_length = (glong) _tmp2_;
 
1355
        }
1344
1356
        if (offset < 0) {
1345
1357
                offset = string_length + offset;
1346
1358
                g_return_val_if_fail (offset >= 0, NULL);
1351
1363
                len = string_length - offset;
1352
1364
        }
1353
1365
        g_return_val_if_fail ((offset + len) <= string_length, NULL);
1354
 
        _tmp1_ = g_strndup (((gchar*) self) + offset, (gsize) len);
1355
 
        result = _tmp1_;
 
1366
        _tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
 
1367
        result = _tmp3_;
1356
1368
        return result;
1357
1369
}
1358
1370