[tracker] Compilation warning fixes



commit cb25be2e5e1e9169e1f3ed94bc4cf000c03a9192
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Aug 26 11:16:41 2009 +0200

    Compilation warning fixes

 src/tracker-miner-fs/tracker-indexer.c             |    1 +
 .../tracker-module-metadata-utils.c                |    4 ++--
 src/tracker-miner-fs/tracker-removable-device.c    |    4 ++++
 tests/libtracker-common/tracker-file-utils-test.c  |    4 ++--
 tests/libtracker-common/tracker-type-utils-test.c  |   14 +++++++-------
 utils/services/ontology-validator.c                |    7 ++++---
 utils/services/ttl_html.c                          |    4 ++--
 utils/services/ttl_loader.c                        |   10 +++++-----
 utils/services/ttl_model.c                         |    2 +-
 utils/services/ttl_model.h                         |    2 +-
 10 files changed, 29 insertions(+), 23 deletions(-)
---
diff --git a/src/tracker-miner-fs/tracker-indexer.c b/src/tracker-miner-fs/tracker-indexer.c
index 59ac05e..824a8da 100644
--- a/src/tracker-miner-fs/tracker-indexer.c
+++ b/src/tracker-miner-fs/tracker-indexer.c
@@ -61,6 +61,7 @@
 #include <libtracker-common/tracker-ontology.h>
 #include <libtracker-common/tracker-module-config.h>
 #include <libtracker-common/tracker-utils.h>
+#include <libtracker-common/tracker-type-utils.h>
 
 #include <libtracker-db/tracker-db-dbus.h>
 
diff --git a/src/tracker-miner-fs/tracker-module-metadata-utils.c b/src/tracker-miner-fs/tracker-module-metadata-utils.c
index 9a54283..8466e49 100644
--- a/src/tracker-miner-fs/tracker-module-metadata-utils.c
+++ b/src/tracker-miner-fs/tracker-module-metadata-utils.c
@@ -811,11 +811,11 @@ tracker_module_metadata_utils_get_data (GFile *file, TrackerSparqlBuilder *sparq
 
 	time_ = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
 	tracker_sparql_builder_predicate (sparql, "nfo:fileLastModified");
-	tracker_sparql_builder_object_date (sparql, &time_);
+	tracker_sparql_builder_object_date (sparql, (const time_t*) &time_);
 	time_ = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_TIME_ACCESS);
 	tracker_sparql_builder_predicate (sparql, "nfo:fileLastAccessed");
 	
-	tracker_sparql_builder_object_date (sparql, &time_);
+	tracker_sparql_builder_object_date (sparql, (const time_t*) &time_);
 
 	/* Check the size is actually non-zero */
 	if (g_file_info_get_size (file_info) > 0) {
diff --git a/src/tracker-miner-fs/tracker-removable-device.c b/src/tracker-miner-fs/tracker-removable-device.c
index b58152c..1e03a45 100644
--- a/src/tracker-miner-fs/tracker-removable-device.c
+++ b/src/tracker-miner-fs/tracker-removable-device.c
@@ -57,6 +57,7 @@ typedef struct {
 } AddMetadataInfo;
 #endif
 
+#if 0
 static void
 commit_turtle_parse_info_storer (TurtleStorerInfo *info, 
 				 gboolean          may_flush, 
@@ -103,7 +104,9 @@ commit_turtle_parse_info_storer (TurtleStorerInfo *info,
 		info->amount = 0;
 	}
 }
+#endif 
 
+#if 0
 static void
 consume_triple_storer (const gchar *subject,
                        const gchar *predicate,
@@ -157,6 +160,7 @@ consume_triple_storer (const gchar *subject,
 				       g_strdup (object));
 	}
 }
+#endif
 
 void
 tracker_removable_device_optimize (TrackerIndexer *indexer,
diff --git a/tests/libtracker-common/tracker-file-utils-test.c b/tests/libtracker-common/tracker-file-utils-test.c
index cb7f8d8..d211d03 100644
--- a/tests/libtracker-common/tracker-file-utils-test.c
+++ b/tests/libtracker-common/tracker-file-utils-test.c
@@ -28,7 +28,7 @@
 #include <tracker-test-helpers.h>
 
 static GSList *
-array_as_list (gchar **array)
+array_as_list (const gchar **array)
 {
 	gint i;
 	GSList *result = NULL;
@@ -56,7 +56,7 @@ string_in_list (GSList *list, const gchar *string)
 static void
 test_path_list_filter_duplicates (void)
 {
-	gchar *input_roots [] = {"/home", "/home/ivan", "/tmp", "/usr/", "/usr/share/local", NULL};
+	const gchar *input_roots [] = {"/home", "/home/ivan", "/tmp", "/usr/", "/usr/share/local", NULL};
 
 	GSList *input_as_list = NULL;
 	GSList *result;
diff --git a/tests/libtracker-common/tracker-type-utils-test.c b/tests/libtracker-common/tracker-type-utils-test.c
index eb56fe7..4c2ad0b 100644
--- a/tests/libtracker-common/tracker-type-utils-test.c
+++ b/tests/libtracker-common/tracker-type-utils-test.c
@@ -74,7 +74,7 @@ test_string_to_date (void)
 	GDate	  *expected;
 	GDate	  *result;
 	time_t	   result_time_t;
-	gchar	  *input = "2008-06-16T11:10:10+0600";
+	const gchar  *input = "2008-06-16T11:10:10+0600";
 
 	expected = g_date_new_dmy (16, G_DATE_JUNE, 2008);
 
@@ -242,7 +242,7 @@ test_string_to_uint (void)
 static void
 test_string_in_string_list (void)
 {
-	gchar *complete = "This is an extract of text with different terms an props like Audio:Title ...";
+	const gchar *complete = "This is an extract of text with different terms an props like Audio:Title ...";
 	gchar **pieces;
 
 	pieces = g_strsplit (complete, " ", -1);
@@ -267,10 +267,10 @@ test_gslist_to_string_list (void)
 	GSList *input = NULL;
 	gchar **result;
 
-	input = g_slist_prepend (input, "four");
-	input = g_slist_prepend (input, "three");
-	input = g_slist_prepend (input, "two");
-	input = g_slist_prepend (input, "one");
+	input = g_slist_prepend (input, (gpointer) "four");
+	input = g_slist_prepend (input, (gpointer) "three");
+	input = g_slist_prepend (input, (gpointer) "two");
+	input = g_slist_prepend (input, (gpointer) "one");
 
 	result = tracker_gslist_to_string_list (input);
 
@@ -291,7 +291,7 @@ test_gslist_to_string_list (void)
 static void
 test_string_list_to_string (void)
 {
-	gchar *input = "one two three four";
+	const gchar *input = "one two three four";
 	gchar **pieces;
 	gchar *result;
 
diff --git a/utils/services/ontology-validator.c b/utils/services/ontology-validator.c
index 649fcd8..5944d32 100644
--- a/utils/services/ontology-validator.c
+++ b/utils/services/ontology-validator.c
@@ -189,14 +189,15 @@ load_ontology_files (const gchar *services_dir)
 static void
 load_basic_classes ()
 {
-        known_items = g_list_prepend (known_items, RDFS_CLASS);
-        known_items = g_list_prepend (known_items, RDF_PROPERTY);
+        known_items = g_list_prepend (known_items, (gpointer) RDFS_CLASS);
+        known_items = g_list_prepend (known_items, (gpointer) RDF_PROPERTY);
 }
 
 gint
 main (gint argc, gchar **argv) 
 {
         GOptionContext *context;
+        GList *it;
 
         g_type_init ();
 
@@ -228,7 +229,7 @@ main (gint argc, gchar **argv)
         //"/home/ivan/devel/codethink/tracker-ssh/data/services"
         load_ontology_files (ontology_dir);
 
-        GList *it;
+
         for (it = unknown_predicates; it != NULL; it = it->next) {
                 g_error ("Predicate '%s' is used in the ontology, but it is not defined\n",
                          (gchar *)it->data);
diff --git a/utils/services/ttl_html.c b/utils/services/ttl_html.c
index bb13636..f7fe08c 100644
--- a/utils/services/ttl_html.c
+++ b/utils/services/ttl_html.c
@@ -4,8 +4,8 @@
 static gchar *local_uri = NULL;
 
 typedef struct {
-        gchar *namespace;
-        gchar *uri;
+        const gchar *namespace;
+        const gchar *uri;
 } Namespace;
 
 Namespace NAMESPACES [] = {
diff --git a/utils/services/ttl_loader.c b/utils/services/ttl_loader.c
index 83dd007..0e9a861 100644
--- a/utils/services/ttl_loader.c
+++ b/utils/services/ttl_loader.c
@@ -16,7 +16,7 @@
 
 #define NRL_MAX_CARDINALITY "http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#maxCardinality";
 
-#define TRACKER_NAMESPACE "http://www.tracker-project.org/ontologies/tracker#Namespace";
+/* #define TRACKER_NAMESPACE "http://www.tracker-project.org/ontologies/tracker#Namespace"; */
 
 /* Ontology description */
 #define DSC_PREFIX "http://www.tracker-project.org/temp/dsc#";
@@ -253,13 +253,13 @@ ttl_loader_load_ontology (const gchar *ttl_file)
 OntologyDescription *
 ttl_loader_load_description (const gchar *filename)
 {
-        OntologyDescription *desc;
-        
-        desc = ttl_model_description_new ();
-
+	OntologyDescription *desc;
 	TrackerTurtleReader *reader;
 	GError *error;
 
+	desc = ttl_model_description_new ();
+
+
 	reader = tracker_turtle_reader_new (filename);
 
 	while (error == NULL && tracker_turtle_reader_next (reader, &error)) {
diff --git a/utils/services/ttl_model.c b/utils/services/ttl_model.c
index c2e2c71..f8a6209 100644
--- a/utils/services/ttl_model.c
+++ b/utils/services/ttl_model.c
@@ -37,7 +37,7 @@ ttl_model_class_free (OntologyClass *def)
 }
 
 OntologyProperty *
-ttl_model_property_new (gchar *propname)
+ttl_model_property_new (const gchar *propname)
 {
         OntologyProperty *prop;
 
diff --git a/utils/services/ttl_model.h b/utils/services/ttl_model.h
index 4695226..2a836ab 100644
--- a/utils/services/ttl_model.h
+++ b/utils/services/ttl_model.h
@@ -46,7 +46,7 @@ void            ttl_model_class_free (OntologyClass *klass);
 OntologyDescription *ttl_model_description_new (void);
 void                 ttl_model_description_free (OntologyDescription *desc);
 
-OntologyProperty *ttl_model_property_new (gchar *propname);
+OntologyProperty *ttl_model_property_new (const gchar *propname);
 void              ttl_model_property_free (OntologyProperty *property);
 
 G_END_DECLS



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