[tracker] libtracker-client: Fixed compilation warnings
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-client: Fixed compilation warnings
- Date: Tue, 29 Jun 2010 09:10:25 +0000 (UTC)
commit 0d7f48ae12670ffbe281c1afaa3a6b7f9cb88141
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Jun 29 11:08:33 2010 +0200
libtracker-client: Fixed compilation warnings
src/libtracker-client/tracker.c | 73 ++++++++++++++++++++++++++------------
1 files changed, 50 insertions(+), 23 deletions(-)
---
diff --git a/src/libtracker-client/tracker.c b/src/libtracker-client/tracker.c
index 49497b2..0b291d7 100644
--- a/src/libtracker-client/tracker.c
+++ b/src/libtracker-client/tracker.c
@@ -1776,9 +1776,6 @@ tracker_resources_sparql_query_iterate (TrackerClient *client,
const gchar *query,
GError **error)
{
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
- g_return_val_if_fail (query, NULL);
-
#ifdef HAVE_DBUS_FD_PASSING
TrackerClientPrivate *private;
TrackerResultIterator *iterator;
@@ -1793,6 +1790,9 @@ tracker_resources_sparql_query_iterate (TrackerClient *client,
GOutputStream *iterator_output_stream;
GError *inner_error = NULL;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
+ g_return_val_if_fail (query, NULL);
+
if (pipe (pipefd) < 0) {
g_set_error (error,
TRACKER_CLIENT_ERROR,
@@ -1891,6 +1891,9 @@ tracker_resources_sparql_query_iterate (TrackerClient *client,
TrackerResultIterator *iterator;
GError *inner_error = NULL;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
+ g_return_val_if_fail (query, NULL);
+
iterator = g_slice_new0 (TrackerResultIterator);
iterator->results = tracker_resources_sparql_query (client, query, &inner_error);
@@ -1939,14 +1942,17 @@ tracker_result_iterator_free (TrackerResultIterator *iterator)
guint
tracker_result_iterator_n_columns (TrackerResultIterator *iterator)
{
+#ifdef HAVE_DBUS_FD_PASSING
+
g_return_val_if_fail (iterator != NULL, 0);
-#ifdef HAVE_DBUS_FD_PASSING
return iterator->n_columns;
#else /* HAVE_DBUS_FD_PASSING */
GStrv row;
guint i = 0;
+ g_return_val_if_fail (iterator != NULL, 0);
+
if (!iterator->results->len) {
return 0;
}
@@ -2022,10 +2028,10 @@ const gchar *
tracker_result_iterator_value (TrackerResultIterator *iterator,
guint column)
{
+#ifdef HAVE_DBUS_FD_PASSING
g_return_val_if_fail (iterator != NULL, NULL);
g_return_val_if_fail (column < tracker_result_iterator_n_columns (iterator), NULL);
-#ifdef HAVE_DBUS_FD_PASSING
if (column == 0) {
return iterator->data;
} else {
@@ -2034,6 +2040,9 @@ tracker_result_iterator_value (TrackerResultIterator *iterator,
#else /* HAVE_DBUS_FD_PASSING */
GStrv row;
+ g_return_val_if_fail (iterator != NULL, NULL);
+ g_return_val_if_fail (column < tracker_result_iterator_n_columns (iterator), NULL);
+
if (!iterator->results->len) {
return NULL;
}
@@ -2067,12 +2076,12 @@ tracker_resources_sparql_update (TrackerClient *client,
const gchar *query,
GError **error)
{
- g_return_if_fail (TRACKER_IS_CLIENT (client));
- g_return_if_fail (query != NULL);
-
#ifdef HAVE_DBUS_FD_PASSING
DBusMessage *reply;
+ g_return_if_fail (TRACKER_IS_CLIENT (client));
+ g_return_if_fail (query != NULL);
+
reply = sparql_update_fast (client, query, FAST_UPDATE, error);
if (!reply) {
@@ -2083,6 +2092,9 @@ tracker_resources_sparql_update (TrackerClient *client,
#else /* HAVE_DBUS_FD_PASSING */
TrackerClientPrivate *private;
+ g_return_if_fail (TRACKER_IS_CLIENT (client));
+ g_return_if_fail (query != NULL);
+
private = TRACKER_CLIENT_GET_PRIVATE (client);
org_freedesktop_Tracker1_Resources_sparql_update (private->proxy_resources,
@@ -2096,14 +2108,14 @@ tracker_resources_sparql_update_blank (TrackerClient *client,
const gchar *query,
GError **error)
{
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
- g_return_val_if_fail (query != NULL, NULL);
-
#ifdef HAVE_DBUS_FD_PASSING
DBusMessage *reply;
DBusMessageIter iter, subiter, subsubiter;
GPtrArray *result;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
+ g_return_val_if_fail (query != NULL, NULL);
+
reply = sparql_update_fast (client, query, FAST_UPDATE_BLANK, error);
if (!reply) {
@@ -2145,6 +2157,9 @@ tracker_resources_sparql_update_blank (TrackerClient *client,
TrackerClientPrivate *private;
GPtrArray *result;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), NULL);
+ g_return_val_if_fail (query != NULL, NULL);
+
private = TRACKER_CLIENT_GET_PRIVATE (client);
if (!org_freedesktop_Tracker1_Resources_sparql_update_blank (private->proxy_resources,
@@ -2456,14 +2471,14 @@ tracker_resources_sparql_update_async (TrackerClient *client,
TrackerReplyVoid callback,
gpointer user_data)
{
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
#ifdef HAVE_DBUS_FD_PASSING
FastAsyncData *fad;
GError *error = NULL;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
+ g_return_val_if_fail (query != NULL, 0);
+ g_return_val_if_fail (callback != NULL, 0);
+
fad = fast_async_data_new (client,
FAST_UPDATE,
NULL,
@@ -2490,6 +2505,10 @@ tracker_resources_sparql_update_async (TrackerClient *client,
CallbackVoid *cb;
DBusGProxyCall *call;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
+ g_return_val_if_fail (query != NULL, 0);
+ g_return_val_if_fail (callback != NULL, 0);
+
private = TRACKER_CLIENT_GET_PRIVATE (client);
cb = g_slice_new0 (CallbackVoid);
@@ -2514,14 +2533,14 @@ tracker_resources_sparql_update_blank_async (TrackerClient *client,
TrackerReplyGPtrArray callback,
gpointer user_data)
{
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
#ifdef HAVE_DBUS_FD_PASSING
FastAsyncData *fad;
GError *error = NULL;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
+ g_return_val_if_fail (query != NULL, 0);
+ g_return_val_if_fail (callback != NULL, 0);
+
fad = fast_async_data_new (client,
FAST_UPDATE_BLANK,
NULL,
@@ -2548,6 +2567,10 @@ tracker_resources_sparql_update_blank_async (TrackerClient *client,
CallbackGPtrArray *cb;
DBusGProxyCall *call;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
+ g_return_val_if_fail (query != NULL, 0);
+ g_return_val_if_fail (callback != NULL, 0);
+
private = TRACKER_CLIENT_GET_PRIVATE (client);
cb = g_slice_new0 (CallbackGPtrArray);
@@ -2586,14 +2609,14 @@ tracker_resources_batch_sparql_update_async (TrackerClient *client,
TrackerReplyVoid callback,
gpointer user_data)
{
- g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
- g_return_val_if_fail (query != NULL, 0);
- g_return_val_if_fail (callback != NULL, 0);
-
#ifdef HAVE_DBUS_FD_PASSING
FastAsyncData *fad;
GError *error = NULL;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
+ g_return_val_if_fail (query != NULL, 0);
+ g_return_val_if_fail (callback != NULL, 0);
+
fad = fast_async_data_new (client,
FAST_UPDATE_BATCH,
NULL,
@@ -2620,6 +2643,10 @@ tracker_resources_batch_sparql_update_async (TrackerClient *client,
CallbackVoid *cb;
DBusGProxyCall *call;
+ g_return_val_if_fail (TRACKER_IS_CLIENT (client), 0);
+ g_return_val_if_fail (query != NULL, 0);
+ g_return_val_if_fail (callback != NULL, 0);
+
private = TRACKER_CLIENT_GET_PRIVATE (client);
cb = g_slice_new0 (CallbackVoid);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]