summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeif Lotfy <seif@lotfy.com>2012-11-11 23:33:12 +0100
committerSeif Lotfy <seif@lotfy.com>2012-11-11 23:33:12 +0100
commitfe705dc0a7f93e2362e61354e0e347af0037b24f (patch)
tree1f9c50686f57ed477c0daf2ba6f3c4e5cb1f746f
parente0c8dde5e3fb1f19e482198f58295dc52382e102 (diff)
downloadzeitgeist-fe705dc0a7f93e2362e61354e0e347af0037b24f.tar.gz
Reduced warnings
-rw-r--r--examples/Makefile.am1
-rw-r--r--examples/c/find-events.c2
-rw-r--r--examples/c/monitor-events.c11
-rw-r--r--examples/c/search-events.c1
-rw-r--r--libzeitgeist/log.vala2
-rw-r--r--src/engine.vala2
-rw-r--r--src/table-lookup.vala2
-rw-r--r--test/c/test-datasource.c2
-rw-r--r--test/c/test-event.c4
-rw-r--r--test/c/test-log.c1
-rw-r--r--test/c/test-mimetypes.c1
-rw-r--r--test/c/test-monitor.c1
-rw-r--r--test/c/test-symbols.c1
-rw-r--r--test/c/test-timerange.c2
-rw-r--r--test/c/test-timestamp.c1
15 files changed, 16 insertions, 18 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 3474751b..28dd4add 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -2,4 +2,5 @@ NULL =
SUBDIRS = \
vala \
+ c \
$(NULL)
diff --git a/examples/c/find-events.c b/examples/c/find-events.c
index 48a53ddc..7c80c2e8 100644
--- a/examples/c/find-events.c
+++ b/examples/c/find-events.c
@@ -69,8 +69,6 @@ main (gint argc,
ZeitgeistLog *log;
GPtrArray *templates;
- g_type_init ();
-
mainloop = g_main_loop_new (NULL, FALSE);
log = g_object_new (ZEITGEIST_TYPE_LOG, NULL);
diff --git a/examples/c/monitor-events.c b/examples/c/monitor-events.c
index 593bf288..e6d8c114 100644
--- a/examples/c/monitor-events.c
+++ b/examples/c/monitor-events.c
@@ -62,9 +62,9 @@ main (gint argc,
ZeitgeistLog *log;
ZeitgeistMonitor *monitor;
GPtrArray *templates;
+ GError** error;
- g_type_init ();
-
+ error = NULL;
mainloop = g_main_loop_new (NULL, FALSE);
log = g_object_new (ZEITGEIST_TYPE_LOG, NULL);
@@ -75,7 +75,12 @@ main (gint argc,
monitor = zeitgeist_monitor_new (zeitgeist_time_range_new_anytime (),
templates);
- zeitgeist_log_install_monitor (log, monitor, G_CALLBACK (on_events_inserted), NULL);
+ g_signal_connect (monitor, "events-inserted",
+ G_CALLBACK (on_events_inserted), NULL);
+ g_signal_connect (monitor, "events-deleted",
+ G_CALLBACK (on_events_deleted), NULL);
+
+ zeitgeist_log_install_monitor (log, monitor, error);
g_main_loop_run (mainloop);
diff --git a/examples/c/search-events.c b/examples/c/search-events.c
index bc9de9b0..c022b437 100644
--- a/examples/c/search-events.c
+++ b/examples/c/search-events.c
@@ -72,7 +72,6 @@ main (gint argc,
gchar **queryv;
gchar *query;
- g_type_init ();
if (argc <= 1)
{
diff --git a/libzeitgeist/log.vala b/libzeitgeist/log.vala
index 693b941c..781fc582 100644
--- a/libzeitgeist/log.vala
+++ b/libzeitgeist/log.vala
@@ -212,7 +212,7 @@ public class Log : QueuedProxyWrapper
yield proxy.quit (cancellable);
}
- public async void install_monitor (Monitor monitor) throws Error
+ public void install_monitor (Monitor monitor) throws Error
{
// FIXME
//monitor.destroy.connect (() => {});
diff --git a/src/engine.vala b/src/engine.vala
index 094c676b..8d7e1517 100644
--- a/src/engine.vala
+++ b/src/engine.vala
@@ -260,7 +260,7 @@ public class Engine : DbReader
}
private void bind_cached_reference (Sqlite.Statement stmt,
- int position, TableLookup table, string? value_)
+ int position, TableLookup table, string? value_) throws EngineError
{
if (value_ != null)
stmt.bind_int64 (position, table.id_for_string (value_));
diff --git a/src/table-lookup.vala b/src/table-lookup.vala
index 039e3414..b582b143 100644
--- a/src/table-lookup.vala
+++ b/src/table-lookup.vala
@@ -105,7 +105,7 @@ namespace Zeitgeist.SQLite
return id;
}
- public unowned string get_value (int id) throws EngineError
+ public unowned string? get_value (int id) throws EngineError
{
// When we fetch an event, it either was already in the database
// at the time Zeitgeist started or it was inserted later -using
diff --git a/test/c/test-datasource.c b/test/c/test-datasource.c
index 485c228d..14bac27e 100644
--- a/test/c/test-datasource.c
+++ b/test/c/test-datasource.c
@@ -108,6 +108,7 @@ test_to_from_variant (Fixture *fix, gconstpointer data)
gint64 now;
GError** error;
+ error = NULL;
/* Build the data source to serialize */
orig = zeitgeist_data_source_new_full ("my-id", "my-name",
"my description", NULL);
@@ -142,7 +143,6 @@ int
main (int argc,
char *argv[])
{
- g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/Zeitgeist/DataSource/CreateEmpty", Fixture, NULL,
diff --git a/test/c/test-event.c b/test/c/test-event.c
index d2396799..3a09600d 100644
--- a/test/c/test-event.c
+++ b/test/c/test-event.c
@@ -144,8 +144,9 @@ test_from_variant (Fixture *fix, gconstpointer data)
ZeitgeistEvent *ev;
ZeitgeistSubject *su;
GByteArray *payload;
- GError *error;
+ GError **error;
+ error = NULL;
g_variant_builder_init (&b, G_VARIANT_TYPE ("(" ZEITGEIST_EVENT_SIGNATURE ")"));
/* Build event data */
@@ -424,7 +425,6 @@ int
main (int argc,
char *argv[])
{
- g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/Zeitgeist/Event/CreateEmpty", Fixture, NULL,
diff --git a/test/c/test-log.c b/test/c/test-log.c
index 98e12594..b392ea90 100644
--- a/test/c/test-log.c
+++ b/test/c/test-log.c
@@ -202,7 +202,6 @@ int
main (int argc,
char *argv[])
{
- g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/Zeitgeist/Log/InsertGetDelete", Fixture, NULL,
diff --git a/test/c/test-mimetypes.c b/test/c/test-mimetypes.c
index 370c84cd..799656f8 100644
--- a/test/c/test-mimetypes.c
+++ b/test/c/test-mimetypes.c
@@ -79,7 +79,6 @@ int
main (int argc,
char *argv[])
{
- g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/Zeitgeist/Mime/TextPlain", Fixture, NULL,
diff --git a/test/c/test-monitor.c b/test/c/test-monitor.c
index 6a28fc14..5ee76402 100644
--- a/test/c/test-monitor.c
+++ b/test/c/test-monitor.c
@@ -67,7 +67,6 @@ int
main (int argc,
char *argv[])
{
- g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/Zeitgeist/Monitor/Create", Fixture, NULL,
diff --git a/test/c/test-symbols.c b/test/c/test-symbols.c
index 3a63ebe3..636db6fd 100644
--- a/test/c/test-symbols.c
+++ b/test/c/test-symbols.c
@@ -181,7 +181,6 @@ int
main (int argc,
char *argv[])
{
- g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/Zeitgeist/Symbols/NullNull", Fixture, NULL,
diff --git a/test/c/test-timerange.c b/test/c/test-timerange.c
index 4fad4183..e52c0b00 100644
--- a/test/c/test-timerange.c
+++ b/test/c/test-timerange.c
@@ -104,6 +104,7 @@ test_from_variant (Fixture *fix, gconstpointer data)
gint64 i,j;
GError **error;
+ error = NULL;
v = g_variant_new ("(xx)",
G_GINT64_CONSTANT(0), G_MAXINT64);
g_variant_get (v, "(xx)", &i, &j);
@@ -137,7 +138,6 @@ int
main (int argc,
char *argv[])
{
- g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/Zeitgeist/TimeRange/Create", Fixture, NULL,
diff --git a/test/c/test-timestamp.c b/test/c/test-timestamp.c
index 83aaee3e..7f4307e3 100644
--- a/test/c/test-timestamp.c
+++ b/test/c/test-timestamp.c
@@ -159,7 +159,6 @@ int
main (int argc,
char *argv[])
{
- g_type_init ();
g_test_init (&argc, &argv, NULL);
g_test_add ("/Zeitgeist/Timestamp/FromISO8601", Fixture, NULL,