Commit 8a5b4892 authored by Jürg Billeter's avatar Jürg Billeter Committed by Martyn Russell

Fix Vala warnings

parent 32d8f75c
...@@ -51,9 +51,7 @@ internal class Tracker.Bus.ArrayCursor : Tracker.Sparql.Cursor { ...@@ -51,9 +51,7 @@ internal class Tracker.Bus.ArrayCursor : Tracker.Sparql.Cursor {
str = results[current_row, column]; str = results[current_row, column];
if (&length != null) {
length = str.length; length = str.length;
}
return str; return str;
} }
......
...@@ -838,6 +838,8 @@ class Tracker.Sparql.Expression : Object { ...@@ -838,6 +838,8 @@ class Tracker.Sparql.Expression : Object {
} }
internal string parse_string_literal (out PropertyType type = null) throws Sparql.Error { internal string parse_string_literal (out PropertyType type = null) throws Sparql.Error {
type = PropertyType.STRING;
next (); next ();
switch (last ()) { switch (last ()) {
case SparqlTokenType.STRING_LITERAL1: case SparqlTokenType.STRING_LITERAL1:
...@@ -889,12 +891,7 @@ class Tracker.Sparql.Expression : Object { ...@@ -889,12 +891,7 @@ class Tracker.Sparql.Expression : Object {
if (accept (SparqlTokenType.DOUBLE_CIRCUMFLEX)) { if (accept (SparqlTokenType.DOUBLE_CIRCUMFLEX)) {
// typed literal // typed literal
var parsed_type = parse_type_uri (); type = parse_type_uri ();
if (&type == null) {
// caller not interested in type
} else {
type = parsed_type;
}
} }
return sb.str; return sb.str;
...@@ -904,12 +901,7 @@ class Tracker.Sparql.Expression : Object { ...@@ -904,12 +901,7 @@ class Tracker.Sparql.Expression : Object {
if (accept (SparqlTokenType.DOUBLE_CIRCUMFLEX)) { if (accept (SparqlTokenType.DOUBLE_CIRCUMFLEX)) {
// typed literal // typed literal
var parsed_type = parse_type_uri (); type = parse_type_uri ();
if (&type == null) {
// caller not interested in type
} else {
type = parsed_type;
}
} }
return result; return result;
......
...@@ -468,9 +468,7 @@ public class Tracker.SparqlScanner : Object { ...@@ -468,9 +468,7 @@ public class Tracker.SparqlScanner : Object {
SparqlTokenType type; SparqlTokenType type;
char* begin = current; char* begin = current;
token_begin.pos = begin; token_begin = SourceLocation (begin, line, column);
token_begin.line = line;
token_begin.column = column;
int token_length_in_chars = -1; int token_length_in_chars = -1;
...@@ -792,9 +790,7 @@ public class Tracker.SparqlScanner : Object { ...@@ -792,9 +790,7 @@ public class Tracker.SparqlScanner : Object {
column += token_length_in_chars; column += token_length_in_chars;
} }
token_end.pos = current; token_end = SourceLocation (current, line, column - 1);
token_end.line = line;
token_end.column = column - 1;
return type; return type;
} }
...@@ -850,6 +846,12 @@ public struct Tracker.SourceLocation { ...@@ -850,6 +846,12 @@ public struct Tracker.SourceLocation {
public char* pos; public char* pos;
public int line; public int line;
public int column; public int column;
public SourceLocation (char* pos, int line, int column) {
this.pos = pos;
this.line = line;
this.column = column;
}
} }
public enum Tracker.SparqlTokenType { public enum Tracker.SparqlTokenType {
......
...@@ -63,7 +63,7 @@ public class Tracker.Store { ...@@ -63,7 +63,7 @@ public class Tracker.Store {
public string query; public string query;
public Cancellable cancellable; public Cancellable cancellable;
public uint watchdog_id; public uint watchdog_id;
public SparqlQueryInThread in_thread; public unowned SparqlQueryInThread in_thread;
~QueryTask () { ~QueryTask () {
if (watchdog_id > 0) { if (watchdog_id > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment