]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Adapt to changes of string bindings wip/strings
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 30 Oct 2018 06:52:36 +0000 (07:52 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 26 Feb 2022 13:25:16 +0000 (14:25 +0100)
ccode/valaccodefunction.vala
compiler/valacompiler.vala
libvaladoc/content/sourcecode.vala
libvaladoc/ctyperesolver.vala
libvaladoc/documentation/girmetadata.vala
libvaladoc/documentation/gtkdocmarkdownscanner.vala
libvaladoc/documentation/importerhelper.vala
vala/valagirparser.vala
vala/valasourcefile.vala
valadoc/valadoc.vala

index 395ffdc8b131539b19fda21a11f22607877fb090..df237d309ee7268e4685dc1f41b143da61792acb 100644 (file)
@@ -130,7 +130,7 @@ public class Vala.CCodeFunction : CCodeNode {
                }
                writer.write_string (name);
                writer.write_string (" (");
-               int param_pos_begin = (is_declaration ? return_type.char_count () + 1 : 0 ) + name.char_count () + 2;
+               int param_pos_begin = (int) ((is_declaration ? return_type.char_count () + 1L : 0L ) + name.char_count () + 2L);
 
                bool has_args = (CCodeModifiers.PRINTF in modifiers || CCodeModifiers.SCANF in modifiers);
                int i = 0;
index a8ebd084e6d6c6d72545e74ae9ef812b233032b7..68d267e848add2059807a6ce3170022aa0f666ab 100644 (file)
@@ -240,7 +240,7 @@ class Vala.Compiler {
                        // strip extension if there is one
                        // else we use the default output file of the C compiler
                        if (sources[0].last_index_of_char ('.') != -1) {
-                               int dot = sources[0].last_index_of_char ('.');
+                               var dot = sources[0].last_index_of_char ('.');
                                output = Path.get_basename (sources[0].substring (0, dot));
                        }
                }
@@ -435,7 +435,7 @@ class Vala.Compiler {
                                if (context.profile == Profile.GOBJECT) {
                                        string gir_base = Path.get_basename (gir);
                                        long gir_len = gir_base.length;
-                                       int last_hyphen = gir_base.last_index_of_char ('-');
+                                       var last_hyphen = gir_base.last_index_of_char ('-');
 
                                        if (last_hyphen == -1 || !gir_base.has_suffix (".gir")) {
                                                Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir", gir);
index e2031ad6272d21a96ac8c83488a5e73f9cb9ac9d..bd62ce592d09503e858dcb6309e2fde47aca2a02 100644 (file)
@@ -31,7 +31,7 @@ public class Valadoc.Content.SourceCode : ContentElement, Inline {
                C;
 
                public static Language from_path (string path) {
-                       int pos = path.last_index_of (".");
+                       var pos = path.last_index_of (".");
                        if (pos < 0) {
                                return Language.UNKNOWN;
                        }
index 22e432b07df7ead3b6a7e38d4bc8e8c861c7c5e5..03232041c78b4e884323bb77ccb03898a62aa3a9 100644 (file)
@@ -161,7 +161,7 @@ public class Valadoc.CTypeResolver : Visitor {
                        return this.tree.search_symbol_str (null, "GLib.FileStream.printf");
                }
 
-               int dotpos = name.index_of_char ('.');
+               var dotpos = name.index_of_char ('.');
                if (dotpos > 0) {
                        string fst = name.substring (0, dotpos);
                        string snd = name.substring (dotpos + 1);
index 7d1b78ee9bb186dfdf5fe740194c1f4d832e06fc..2a1d71dfb2571163a2504d4a259cbb81c7a63e68 100644 (file)
@@ -50,7 +50,7 @@ public class Valadoc.GirMetaData : Object {
 
        private string? get_metadata_file_name (string gir_file_path) {
                string metadata_file_name = Path.get_basename (gir_file_path);
-               int last_dot_pos = metadata_file_name.last_index_of (".");
+               var last_dot_pos = metadata_file_name.last_index_of (".");
                if (last_dot_pos < 0) {
                        return null;
                }
index e7afe18b48875220b0ffc042b518674c2d544555..93ea5209e09cd64cbd2c87f5d4065261db8e3984 100644 (file)
@@ -36,7 +36,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner {
        private Valadoc.Parser parser;
 
        private unowned string _content;
-       private int _skip;
+       private long _skip;
 
        private StringBuilder _current_string = new StringBuilder ();
        private unowned string _index;
@@ -411,7 +411,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner {
                case '|':
                        if (get_next_char () == '[') {
                                unowned string _iter = _index.offset (2);
-                               int end = _iter.index_of ("]|");
+                               var end = _iter.index_of ("]|");
                                if (end < 0) {
                                        append_char ('|');
                                } else {
@@ -717,8 +717,8 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner {
                return Vala.SourceLocation (_index, _last_line, get_line_start_column () + _last_column);
        }
 
-       private Vala.SourceLocation get_end (int offset = 0) {
-               return Vala.SourceLocation (_index, _line, get_line_start_column () + _column + offset);
+       private Vala.SourceLocation get_end (long offset = 0) {
+               return Vala.SourceLocation (_index, _line, (int) (get_line_start_column () + _column + offset));
        }
 
        public int get_line_start_column () {
@@ -729,7 +729,7 @@ public class Valadoc.Gtkdoc.MarkdownScanner : GLib.Object, Valadoc.Scanner {
                _current_string.append_unichar (c);
        }
 
-       private unichar get_next_char (int offset = 1) {
+       private unichar get_next_char (long offset = 1) {
                return _index.get_char (_index.index_of_nth_char (offset));
        }
 
index 98100d308e51b8ce82fac3f2313a509c6c1cabd1..f07126b9cbd309d9c8e5f15a03191051c6e690ab 100644 (file)
@@ -161,7 +161,7 @@ namespace Valadoc.ImporterHelper {
        }
 
        private inline Text? split_text (Text text, ContentFactory factory) {
-               int offset = 0;
+               long offset = 0;
                while ((offset = text.content.index_of_char ('.', offset)) >= 0) {
                        if (offset >= 2) {
                                // ignore "e.g."
index 6b3d693578526c3bf12c313ab16e516fe39345d7..d5ba5b0588caa1476fa7300628339e4afae24302 100644 (file)
@@ -754,7 +754,7 @@ public class Vala.GirParser : CodeVisitor {
                        }
                        if (prefix == null && girdata != null && girdata["c:identifier-prefixes"] != null) {
                                prefix = girdata["c:identifier-prefixes"];
-                               int idx = prefix.index_of (",");
+                               var idx = prefix.index_of (",");
                                if (idx != -1) {
                                        prefix = prefix.substring (0, idx);
                                }
@@ -2163,7 +2163,7 @@ public class Vala.GirParser : CodeVisitor {
 
                string? cprefix = reader.get_attribute ("c:identifier-prefixes");
                if (cprefix != null) {
-                       int idx = cprefix.index_of (",");
+                       var idx = cprefix.index_of (",");
                        if (idx != -1) {
                                cprefix = cprefix.substring (0, idx);
                        }
@@ -2175,7 +2175,7 @@ public class Vala.GirParser : CodeVisitor {
                string gir_version = reader.get_attribute ("version");
 
                if (lower_case_cprefix != null) {
-                       int idx = lower_case_cprefix.index_of (",");
+                       var idx = lower_case_cprefix.index_of (",");
                        if (idx != -1) {
                                lower_case_cprefix = lower_case_cprefix.substring (0, idx);
                        }
index 9d8808038aec2c31be133d502ceb92a40a6d7bc3..0cf76db331c55935861515714637cf3fe4e81313 100644 (file)
@@ -246,7 +246,7 @@ public class Vala.SourceFile {
        }
 
        private string get_basename () {
-               int dot = filename.last_index_of_char ('.');
+               var dot = filename.last_index_of_char ('.');
                return Path.get_basename (filename.substring (0, dot));
        }
 
index 69642864fcb439cb216347832bc803c36c915776..7a5d33260366d7262d3d2f3bde542aa363f91392 100644 (file)
@@ -258,7 +258,7 @@ public class ValaDoc : Object {
 
                if (gir_name != null) {
                        long gir_len = gir_name.length;
-                       int last_hyphen = gir_name.last_index_of_char ('-');
+                       var last_hyphen = gir_name.last_index_of_char ('-');
 
                        if (last_hyphen == -1 || !gir_name.has_suffix (".gir")) {
                                reporter.simple_error (null, "GIR file name '%s' is not well-formed, expected NAME-VERSION.gir", gir_name);