[tracker/return-types] libtracker-bus: Use g_return_val_if_fail instead of if(fail)return;
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/return-types] libtracker-bus: Use g_return_val_if_fail instead of if(fail)return;
- Date: Mon, 13 Sep 2010 13:03:59 +0000 (UTC)
commit e997991be7fbe2d86455027fa4b19ec802791f22
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]