[vala/wip/strings: 363/363] Adapt to changes of string bindings




commit 24f6ef2f9e7fbbf41a970b3a4daf25c0ad4d9319
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Oct 30 07:52:36 2018 +0100

    Adapt to changes of string bindings

 ccode/valaccodefunction.vala                        |  2 +-
 compiler/valacompiler.vala                          |  4 ++--
 libvaladoc/content/sourcecode.vala                  |  2 +-
 libvaladoc/ctyperesolver.vala                       |  2 +-
 libvaladoc/documentation/girmetadata.vala           |  2 +-
 libvaladoc/documentation/gtkdocmarkdownscanner.vala | 10 +++++-----
 libvaladoc/documentation/importerhelper.vala        |  2 +-
 vala/valagirparser.vala                             |  6 +++---
 vala/valasourcefile.vala                            |  2 +-
 valadoc/valadoc.vala                                |  2 +-
 10 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/ccode/valaccodefunction.vala b/ccode/valaccodefunction.vala
index 395ffdc8b..df237d309 100644
--- a/ccode/valaccodefunction.vala
+++ b/ccode/valaccodefunction.vala
@@ -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;
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index a8ebd084e..68d267e84 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -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);
diff --git a/libvaladoc/content/sourcecode.vala b/libvaladoc/content/sourcecode.vala
index e2031ad62..bd62ce592 100644
--- a/libvaladoc/content/sourcecode.vala
+++ b/libvaladoc/content/sourcecode.vala
@@ -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;
                        }
diff --git a/libvaladoc/ctyperesolver.vala b/libvaladoc/ctyperesolver.vala
index 22e432b07..03232041c 100644
--- a/libvaladoc/ctyperesolver.vala
+++ b/libvaladoc/ctyperesolver.vala
@@ -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);
diff --git a/libvaladoc/documentation/girmetadata.vala b/libvaladoc/documentation/girmetadata.vala
index 7d1b78ee9..2a1d71dfb 100644
--- a/libvaladoc/documentation/girmetadata.vala
+++ b/libvaladoc/documentation/girmetadata.vala
@@ -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;
                }
diff --git a/libvaladoc/documentation/gtkdocmarkdownscanner.vala 
b/libvaladoc/documentation/gtkdocmarkdownscanner.vala
index e7afe18b4..93ea5209e 100644
--- a/libvaladoc/documentation/gtkdocmarkdownscanner.vala
+++ b/libvaladoc/documentation/gtkdocmarkdownscanner.vala
@@ -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));
        }
 
diff --git a/libvaladoc/documentation/importerhelper.vala b/libvaladoc/documentation/importerhelper.vala
index 98100d308..f07126b9c 100644
--- a/libvaladoc/documentation/importerhelper.vala
+++ b/libvaladoc/documentation/importerhelper.vala
@@ -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."
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 6b3d69357..d5ba5b058 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -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);
                        }
diff --git a/vala/valasourcefile.vala b/vala/valasourcefile.vala
index 9d8808038..0cf76db33 100644
--- a/vala/valasourcefile.vala
+++ b/vala/valasourcefile.vala
@@ -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));
        }
 
diff --git a/valadoc/valadoc.vala b/valadoc/valadoc.vala
index 69642864f..7a5d33260 100644
--- a/valadoc/valadoc.vala
+++ b/valadoc/valadoc.vala
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]