[tracker/return-types: 20/26] libtracker-bus: Use g_return_val_if_fail instead of if(fail)return;



commit 1ddd2b93cf6a5241df8e55f3dd56430292f4eaee
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Sep 13 12:05:20 2010 +0200

    libtracker-bus: Use g_return_val_if_fail instead of if(fail)return;

 src/libtracker-bus/tracker-bus-fd-cursor.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus-fd-cursor.c b/src/libtracker-bus/tracker-bus-fd-cursor.c
index 64d6e38..1f5188b 100644
--- a/src/libtracker-bus/tracker-bus-fd-cursor.c
+++ b/src/libtracker-bus/tracker-bus-fd-cursor.c
@@ -171,6 +171,8 @@ tracker_bus_fd_cursor_get_n_columns (TrackerBusFDCursor *cursor)
 static TrackerSparqlValueType
 tracker_bus_fd_cursor_get_value_type (TrackerBusFDCursor *cursor,  guint column)
 {
+	g_return_val_if_fail (cursor->types != NULL, TRACKER_SPARQL_VALUE_TYPE_UNBOUND);
+
 	/* Cast from int to enum */
 	return (TrackerSparqlValueType) cursor->types[column];
 }
@@ -178,8 +180,7 @@ tracker_bus_fd_cursor_get_value_type (TrackerBusFDCursor *cursor,  guint column)
 static const gchar*
 tracker_bus_fd_cursor_get_variable_name (TrackerBusFDCursor *cursor,  guint column)
 {
-	if (!cursor->variable_names)
-		return NULL;
+	g_return_val_if_fail (cursor->variable_names != NULL, NULL);
 
 	return cursor->variable_names[column];
 }



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