[tracker] Fix a bunch of compiler warnings.



commit 9ece8a9bd02207ebb74449ad3af5c5a39ab6a4eb
Author: Carlos Garnacho <carlos gnome org>
Date:   Wed Dec 2 15:04:55 2009 +0200

    Fix a bunch of compiler warnings.

 src/libtracker-data/tracker-data-manager.c |    2 +-
 src/libtracker-db/tracker-db-dbus.c        |   17 ++++++++++-------
 src/libtracker-fts/tracker-fts.c           |   10 +++++-----
 3 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 67da442..48f5231 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -828,7 +828,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		TrackerProperty **properties;
 		gint max_id = 0;
 		GList *sorted = NULL, *l;
-		gchar *test_schema_path;
+		gchar *test_schema_path = NULL;
 		const gchar *env_path;
 		GError *error = NULL;
 		guint i, n_props, n_classes;
diff --git a/src/libtracker-db/tracker-db-dbus.c b/src/libtracker-db/tracker-db-dbus.c
index 412ea64..d49f98c 100644
--- a/src/libtracker-db/tracker-db-dbus.c
+++ b/src/libtracker-db/tracker-db-dbus.c
@@ -271,16 +271,19 @@ tracker_dbus_query_result_columns_to_strv (TrackerDBResultSet *result_set,
 {
 	gchar    **strv = NULL;
 	gint	   i = 0;
-	gint	   columns;
+	gint	   columns = 0;
 	gint       row_counter = 0;
 	gboolean   valid = TRUE;
 
-	if (result_set) {
-		columns = tracker_db_result_set_get_n_columns (result_set);
-		if (rewind) {
-			 /* Make sure we rewind before iterating the result set */
-			tracker_db_result_set_rewind (result_set);
-		}
+	if (!result_set) {
+		return NULL;
+	}
+
+	columns = tracker_db_result_set_get_n_columns (result_set);
+
+	if (rewind) {
+		/* Make sure we rewind before iterating the result set */
+		tracker_db_result_set_rewind (result_set);
 	}
 
 	if (!result_set || offset_column > columns) {
diff --git a/src/libtracker-fts/tracker-fts.c b/src/libtracker-fts/tracker-fts.c
index 53238b0..8849dcd 100644
--- a/src/libtracker-fts/tracker-fts.c
+++ b/src/libtracker-fts/tracker-fts.c
@@ -426,7 +426,7 @@ static int fts3GetVarint(const char *p, sqlite_int64 *v){
 }
 
 static int fts3GetVarint32(const char *p, int *pi){
- sqlite_int64 i;
+ sqlite_int64 i = 0;
  int ret = fts3GetVarint(p, &i);
  *pi = (int) i;
  assert( *pi==i );
@@ -673,7 +673,7 @@ static void dlrStep(DLReader *pReader){
 
   /* If there is more data, read the next doclist element. */
   if( pReader->nData!=0 ){
-    sqlite_int64 iDocidDelta;
+    sqlite_int64 iDocidDelta = 0;
     
     int iDummy, n = fts3GetVarint(pReader->pData, &iDocidDelta);
     pReader->iDocid += iDocidDelta;
@@ -2771,7 +2771,7 @@ static int segdir_span(fulltext_vtab *v, int iLevel,
 */
 static int segdir_delete(fulltext_vtab *v, int iLevel){
   sqlite3_stmt *s;
-  sqlite_int64 iStartBlockid, iEndBlockid;
+  sqlite_int64 iStartBlockid = 0, iEndBlockid = 0;
   int rc = segdir_span(v, iLevel, &iStartBlockid, &iEndBlockid);
   if( rc!=SQLITE_ROW && rc!=SQLITE_DONE ) return rc;
 
@@ -7176,9 +7176,9 @@ static void optimizeFunc(sqlite3_context *pContext,
     sqlite3_result_error(pContext, "illegal first argument to optimize",-1);
   }else{
     fulltext_vtab *v;
-    int i, rc, iMaxLevel;
+    int i, rc, iMaxLevel = 0;
     OptLeavesReader *readers;
-    int nReaders;
+    int nReaders = 0;
     LeafWriter writer;
     sqlite3_stmt *s;
 



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