diff options
author | Jürg Billeter <j@bitron.ch> | 2011-01-15 20:57:07 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2011-01-15 21:00:40 +0100 |
commit | bd05eda863e6a6395e4709d7cbebb2969efa16ca (patch) | |
tree | 81434864437c71b5f8b472ad91bc1b0e63799f1b /compiler | |
parent | faa908c621f6f09a06503bf099e48474d36a1303 (diff) | |
download | vala-bd05eda863e6a6395e4709d7cbebb2969efa16ca.tar.gz |
glib-2.0: Add string.index_of_nth_char
This deprecates string.utf8_offset, string.offset,
string.pointer_to_offset, and string.ndup.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/valacompiler.vala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index ae88a6b0f..1a4a9df19 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -160,7 +160,7 @@ class Vala.Compiler { // strip extension if there is one // else we use the default output file of the C compiler if (sources[0].rchr (-1, '.') != null) { - long dot = sources[0].pointer_to_offset (sources[0].rchr (-1, '.')); + long dot = (long) ((char*) sources[0].rchr (-1, '.') - (char*) sources[0]); output = Path.get_basename (sources[0].substring (0, dot)); } } @@ -380,7 +380,7 @@ class Vala.Compiler { if (last_hyphen == null || !gir.has_suffix (".gir")) { Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir)); } else { - long offset = gir.pointer_to_offset (last_hyphen); + long offset = (long) ((char*) last_hyphen - (char*) gir); string gir_namespace = gir.substring (0, offset); string gir_version = gir.substring (offset + 1, gir_len - offset - 5); gir_version.canon ("0123456789.", '?'); |