[tracker] SPARQL: Fix compile warnings



commit 26c4809c4891c12949656daddc08189eae0ccd5c
Author: Jürg Billeter <j bitron ch>
Date:   Fri Apr 17 10:19:22 2009 +0200

    SPARQL: Fix compile warnings
---
 src/libtracker-data/tracker-sparql-query.vala |   34 +++++++++++++-----------
 src/rasqal/rasqal.vapi                        |   11 ++++++-
 2 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index b9ba507..eccfa95 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -310,7 +310,7 @@ public class Tracker.SparqlQuery : Object {
 		var query = new Rasqal.Query (world, "laqrs", null);
 
 		foreach (Namespace ns in Ontology.get_namespaces ()) {
-			query.add_prefix (new Rasqal.Prefix (world, ns.prefix, ns.uri));
+			query.add_prefix (new Rasqal.Prefix (world, ns.prefix, new Raptor.Uri (ns.uri)));
 		}
 
 		query.declare_prefixes ();
@@ -1043,23 +1043,23 @@ public class Tracker.SparqlQuery : Object {
 
 	string sql_operator (Rasqal.Op op) {
 		switch (op) {
-		case Rasqal.Op.AND: return " AND ";
-		case Rasqal.Op.OR: return " OR ";
-		case Rasqal.Op.EQ: return " = ";
-		case Rasqal.Op.NEQ: return " <> ";
-		case Rasqal.Op.LT: return " < ";
-		case Rasqal.Op.GT: return " > ";
-		case Rasqal.Op.LE: return " <= ";
-		case Rasqal.Op.GE: return " >= ";
-		case Rasqal.Op.PLUS: return " + ";
-		case Rasqal.Op.MINUS: return " - ";
-		case Rasqal.Op.STAR: return " * ";
-		case Rasqal.Op.SLASH: return " / ";
-		case Rasqal.Op.REM: return " % ";
-		case Rasqal.Op.STR_EQ: return " = ";
+		case Rasqal.Op.AND:     return " AND ";
+		case Rasqal.Op.OR:      return " OR ";
+		case Rasqal.Op.EQ:      return " = ";
+		case Rasqal.Op.NEQ:     return " <> ";
+		case Rasqal.Op.LT:      return " < ";
+		case Rasqal.Op.GT:      return " > ";
+		case Rasqal.Op.LE:      return " <= ";
+		case Rasqal.Op.GE:      return " >= ";
+		case Rasqal.Op.PLUS:    return " + ";
+		case Rasqal.Op.MINUS:   return " - ";
+		case Rasqal.Op.STAR:    return " * ";
+		case Rasqal.Op.SLASH:   return " / ";
+		case Rasqal.Op.REM:     return " % ";
+		case Rasqal.Op.STR_EQ:  return " = ";
 		case Rasqal.Op.STR_NEQ: return " <> ";
+		default:                return "";
 		}
-		return "";
 	}
 
 	bool is_datetime_variable (Rasqal.Expression expr) {
@@ -1145,6 +1145,8 @@ public class Tracker.SparqlQuery : Object {
 			}
 			pattern_sql.append (")");
 			break;
+		default:
+			break;
 		}
 	}
 
diff --git a/src/rasqal/rasqal.vapi b/src/rasqal/rasqal.vapi
index b9d5350..4e8f050 100644
--- a/src/rasqal/rasqal.vapi
+++ b/src/rasqal/rasqal.vapi
@@ -31,6 +31,13 @@ namespace Raptor {
 		public int byte;
 	}
 
+	[Compact]
+	[CCode (cname = "raptor_uri")]
+	public class Uri {
+		[CCode (cname = "raptor_new_uri")]
+		public Uri (string uri_string);
+	}
+
 	[CCode (cname = "raptor_message_handler", instance_pos = 0)]
 	public delegate void MessageHandler (Locator locator, string message);
 }
@@ -145,7 +152,7 @@ namespace Rasqal {
 	[CCode (cname = "rasqal_prefix", free_function = "rasqal_free_prefix")]
 	public class Prefix {
 		[CCode (cname = "rasqal_new_prefix")]
-		public Prefix (World world, string# prefix, string# uri);
+		public Prefix (World world, owned string prefix, owned Raptor.Uri uri);
 	}
 
 	[Compact]
@@ -153,7 +160,7 @@ namespace Rasqal {
 	public class Query {
 		[CCode (cname = "rasqal_new_query")]
 		public Query (World world, string? name, string? uri);
-		public void add_prefix (Prefix# prefix);
+		public void add_prefix (owned Prefix prefix);
 		public void declare_prefixes ();
 		public weak Triple get_construct_triple (int idx);
 		public bool get_distinct ();



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