}
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;
// 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));
}
}
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);
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;
}
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);
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;
}
private Valadoc.Parser parser;
private unowned string _content;
- private int _skip;
+ private long _skip;
private StringBuilder _current_string = new StringBuilder ();
private unowned string _index;
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 {
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 () {
_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));
}
}
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."
}
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);
}
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);
}
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);
}
}
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));
}
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);