[tracker] Various compiler warning fixes
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] Various compiler warning fixes
- Date: Fri, 14 Aug 2009 12:35:43 +0000 (UTC)
commit 02f2f99484241956cecd64abf90b5f3b89947263
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Aug 14 14:35:04 2009 +0200
Various compiler warning fixes
src/libtracker-data/tracker-data-manager.c | 3 ++
src/libtracker-data/tracker-data-update.c | 21 +++++++++----
src/libtracker-db/tracker-db-interface.c | 19 +++++++-----
src/tracker-extract/tracker-albumart.c | 2 +-
src/tracker-extract/tracker-config.c | 6 ++--
src/tracker-extract/tracker-extract-jpeg.c | 2 +
src/tracker-extract/tracker-iptc.c | 10 +++---
src/tracker-extract/tracker-iptc.h | 2 +-
src/tracker-extract/tracker-main.c | 1 +
src/tracker-fts/tracker-fts-config.c | 6 ++--
src/tracker-fts/tracker-fts.c | 46 ++++++++++++++++------------
src/tracker-miner-fs/tracker-config.c | 6 ++--
src/tracker-miner-fs/tracker-dbus.c | 4 +-
src/tracker-store/tracker-config.c | 6 ++--
src/tracker-utils/tracker-processes.c | 1 +
src/tracker-utils/tracker-search.c | 4 +-
src/tracker-utils/tracker-status.c | 2 +-
17 files changed, 83 insertions(+), 58 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index d0f2d93..3f4c00e 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -545,6 +545,9 @@ create_decomposed_metadata_property_table (TrackerDBInterface *iface,
case TRACKER_PROPERTY_TYPE_DOUBLE:
sql_type = "REAL";
break;
+ case TRACKER_PROPERTY_TYPE_BLOB:
+ case TRACKER_PROPERTY_TYPE_STRUCT:
+ case TRACKER_PROPERTY_TYPE_FULLTEXT:
default:
sql_type = "";
break;
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 316752e..cd82bac 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -306,24 +306,27 @@ ensure_resource_id (const gchar *uri)
static void
statement_bind_gvalue (TrackerDBStatement *stmt,
- gint index,
+ gint idx,
const GValue *value)
{
switch (G_VALUE_TYPE (value)) {
case G_TYPE_STRING:
- tracker_db_statement_bind_text (stmt, index, g_value_get_string (value));
+ tracker_db_statement_bind_text (stmt, idx, g_value_get_string (value));
break;
case G_TYPE_INT:
- tracker_db_statement_bind_int (stmt, index, g_value_get_int (value));
+ tracker_db_statement_bind_int (stmt, idx, g_value_get_int (value));
break;
case G_TYPE_INT64:
- tracker_db_statement_bind_int64 (stmt, index, g_value_get_int64 (value));
+ tracker_db_statement_bind_int64 (stmt, idx, g_value_get_int64 (value));
break;
case G_TYPE_BOOLEAN:
- tracker_db_statement_bind_int (stmt, index, g_value_get_boolean (value));
+ tracker_db_statement_bind_int (stmt, idx, g_value_get_boolean (value));
break;
case G_TYPE_DOUBLE:
- tracker_db_statement_bind_double (stmt, index, g_value_get_double (value));
+ tracker_db_statement_bind_double (stmt, idx, g_value_get_double (value));
+ break;
+ default:
+ g_warning ("Unknown type for binding: %s\n", G_VALUE_TYPE_NAME (value));
break;
}
}
@@ -643,6 +646,9 @@ cache_set_metadata_decomposed (TrackerProperty *property,
g_value_init (&gvalue, G_TYPE_INT);
g_value_set_int (&gvalue, object_id);
break;
+ case TRACKER_PROPERTY_TYPE_BLOB:
+ case TRACKER_PROPERTY_TYPE_STRUCT:
+ case TRACKER_PROPERTY_TYPE_FULLTEXT:
default:
return;
}
@@ -729,6 +735,9 @@ delete_metadata_decomposed (gint resource_id,
object_id = ensure_resource_id (value);
tracker_db_statement_bind_int (stmt, 1, object_id);
break;
+ case TRACKER_PROPERTY_TYPE_BLOB:
+ case TRACKER_PROPERTY_TYPE_STRUCT:
+ case TRACKER_PROPERTY_TYPE_FULLTEXT:
default:
g_assert_not_reached ();
}
diff --git a/src/libtracker-db/tracker-db-interface.c b/src/libtracker-db/tracker-db-interface.c
index 43b507f..5bcb2d4 100644
--- a/src/libtracker-db/tracker-db-interface.c
+++ b/src/libtracker-db/tracker-db-interface.c
@@ -374,43 +374,43 @@ tracker_db_interface_end_transaction (TrackerDBInterface *interface)
void
tracker_db_statement_bind_double (TrackerDBStatement *stmt,
- int index,
+ int idx,
double value)
{
g_return_if_fail (TRACKER_IS_DB_STATEMENT (stmt));
- TRACKER_DB_STATEMENT_GET_IFACE (stmt)->bind_double (stmt, index, value);
+ TRACKER_DB_STATEMENT_GET_IFACE (stmt)->bind_double (stmt, idx, value);
}
void
tracker_db_statement_bind_int (TrackerDBStatement *stmt,
- int index,
+ int idx,
int value)
{
g_return_if_fail (TRACKER_IS_DB_STATEMENT (stmt));
- TRACKER_DB_STATEMENT_GET_IFACE (stmt)->bind_int (stmt, index, value);
+ TRACKER_DB_STATEMENT_GET_IFACE (stmt)->bind_int (stmt, idx, value);
}
void
tracker_db_statement_bind_int64 (TrackerDBStatement *stmt,
- int index,
+ int idx,
gint64 value)
{
g_return_if_fail (TRACKER_IS_DB_STATEMENT (stmt));
- TRACKER_DB_STATEMENT_GET_IFACE (stmt)->bind_int64 (stmt, index, value);
+ TRACKER_DB_STATEMENT_GET_IFACE (stmt)->bind_int64 (stmt, idx, value);
}
void
tracker_db_statement_bind_text (TrackerDBStatement *stmt,
- int index,
+ int idx,
const gchar *value)
{
g_return_if_fail (TRACKER_IS_DB_STATEMENT (stmt));
- TRACKER_DB_STATEMENT_GET_IFACE (stmt)->bind_text (stmt, index, value);
+ TRACKER_DB_STATEMENT_GET_IFACE (stmt)->bind_text (stmt, idx, value);
}
TrackerDBResultSet *
@@ -521,6 +521,9 @@ fill_in_value (GValue *value,
case G_TYPE_STRING:
g_value_set_string (value, data);
break;
+ default:
+ g_warning ("Unknown type for resultset: %s\n", G_VALUE_TYPE_NAME (value));
+ break;
}
}
diff --git a/src/tracker-extract/tracker-albumart.c b/src/tracker-extract/tracker-albumart.c
index 698178c..1515a85 100644
--- a/src/tracker-extract/tracker-albumart.c
+++ b/src/tracker-extract/tracker-albumart.c
@@ -967,7 +967,7 @@ tracker_albumart_process (const unsigned char *buffer,
gchar *filename_uri;
g_debug ("Processing album art, buffer is %ld bytes, artist:'%s', album:'%s', filename:'%s', mime:'%s'",
- len,
+ (long int) len,
artist ? artist : "",
album ? album : "",
filename,
diff --git a/src/tracker-extract/tracker-config.c b/src/tracker-extract/tracker-config.c
index 186ce3b..1e24ffb 100644
--- a/src/tracker-extract/tracker-config.c
+++ b/src/tracker-extract/tracker-config.c
@@ -39,9 +39,9 @@ typedef struct {
typedef struct {
GType type;
- gchar *property;
- gchar *group;
- gchar *key;
+ const gchar *property;
+ const gchar *group;
+ const gchar *key;
} ObjectToKeyFile;
static void config_set_property (GObject *object,
diff --git a/src/tracker-extract/tracker-extract-jpeg.c b/src/tracker-extract/tracker-extract-jpeg.c
index d6972a6..6988b18 100644
--- a/src/tracker-extract/tracker-extract-jpeg.c
+++ b/src/tracker-extract/tracker-extract-jpeg.c
@@ -300,6 +300,8 @@ fix_orientation (const gchar *orientation, gboolean *free_it)
return (gchar *) "nfo:orientation-right-mirror";
case 7:
return (gchar *) "nfo:orientation-left";
+ default:
+ break;
}
}
}
diff --git a/src/tracker-extract/tracker-iptc.c b/src/tracker-extract/tracker-iptc.c
index 13fd5e7..575b9d2 100644
--- a/src/tracker-extract/tracker-iptc.c
+++ b/src/tracker-extract/tracker-iptc.c
@@ -100,7 +100,7 @@ void
tracker_read_iptc (const unsigned char *buffer,
size_t len,
const gchar *uri,
- GPtrArray *metadata)
+ TrackerSparqlBuilder *metadata)
{
#ifdef HAVE_LIBIPTCDATA
IptcData *iptc = NULL;
@@ -119,15 +119,15 @@ tracker_read_iptc (const unsigned char *buffer,
IptcDataSet *dataset = NULL;
while ( (dataset = iptc_data_get_next_dataset (iptc, dataset, p->record, p->tag) ) ) {
- gchar buffer[1024];
+ gchar mbuffer[1024];
const gchar *what_i_need;
- iptc_dataset_get_as_str (dataset, buffer, 1024);
+ iptc_dataset_get_as_str (dataset, mbuffer, 1024);
if (p->post) {
- what_i_need = (*p->post) (buffer);
+ what_i_need = (*p->post) (mbuffer);
} else {
- what_i_need = buffer;
+ what_i_need = mbuffer;
}
if (p->urn) {
diff --git a/src/tracker-extract/tracker-iptc.h b/src/tracker-extract/tracker-iptc.h
index a173aac..c688844 100644
--- a/src/tracker-extract/tracker-iptc.h
+++ b/src/tracker-extract/tracker-iptc.h
@@ -7,6 +7,6 @@
void tracker_read_iptc (const unsigned char *buffer,
size_t len,
const gchar *uri,
- GPtrArray *metadata);
+ TrackerSparqlBuilder *metadata);
#endif
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index 591b5b3..301b789 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -246,6 +246,7 @@ log_handler (const gchar *domain,
case G_LOG_LEVEL_INFO:
case G_LOG_LEVEL_DEBUG:
case G_LOG_LEVEL_MASK:
+ default:
g_fprintf (stdout, "%s\n", message);
fflush (stdout);
break;
diff --git a/src/tracker-fts/tracker-fts-config.c b/src/tracker-fts/tracker-fts-config.c
index 8691306..b452fbf 100644
--- a/src/tracker-fts/tracker-fts-config.c
+++ b/src/tracker-fts/tracker-fts-config.c
@@ -49,9 +49,9 @@ typedef struct {
typedef struct {
GType type;
- gchar *property;
- gchar *group;
- gchar *key;
+ const gchar *property;
+ const gchar *group;
+ const gchar *key;
} ObjectToKeyFile;
static void config_set_property (GObject *object,
diff --git a/src/tracker-fts/tracker-fts.c b/src/tracker-fts/tracker-fts.c
index f4412a0..e37bef3 100644
--- a/src/tracker-fts/tracker-fts.c
+++ b/src/tracker-fts/tracker-fts.c
@@ -3359,7 +3359,9 @@ static int constructVtab(
int rc;
fulltext_vtab *v = 0;
char *schema;
-
+ TrackerFTSConfig *config;
+ TrackerLanguage *language;
+ int min_len, max_len;
v = (fulltext_vtab *) sqlite3_malloc(sizeof(fulltext_vtab));
if( v==0 ) return SQLITE_NOMEM;
@@ -3405,12 +3407,13 @@ static int constructVtab(
/* set up our parser */
- TrackerFTSConfig *config = tracker_fts_config_new ();
+ config = tracker_fts_config_new ();
+
+ language = tracker_language_new (NULL);
- TrackerLanguage *language = tracker_language_new (NULL);
+ min_len = tracker_fts_config_get_min_word_length (config);
+ max_len = tracker_fts_config_get_max_word_length (config);
- int min_len = tracker_fts_config_get_min_word_length (config);
- int max_len = tracker_fts_config_get_max_word_length (config);
v->max_words = tracker_fts_config_get_max_words_to_index (config);
v->parser = tracker_parser_new (language, max_len, min_len);
@@ -3844,6 +3847,11 @@ static void snippetAllOffsets(fulltext_cursor *p){
int iColumn, i;
fulltext_vtab *pFts;
+#ifndef STORE_CATEGORY
+ int iFirst, iLast;
+ int nColumn;
+#endif
+
if( p->snippet.nMatch ) return;
if( p->q.nTerms==0 ) return;
pFts = p->q.pFts;
@@ -3910,9 +3918,7 @@ static void snippetAllOffsets(fulltext_cursor *p){
#else
- int iFirst, iLast;
- int nColumn;
-
+
nColumn = pFts->nColumn;
iColumn = (p->iCursorType - QUERY_FULLTEXT);
if( iColumn<0 || iColumn>=nColumn ){
@@ -4156,6 +4162,8 @@ static int fulltextClose(sqlite3_vtab_cursor *pCursor){
static int fulltextNext(sqlite3_vtab_cursor *pCursor){
fulltext_cursor *c = (fulltext_cursor *) pCursor;
int rc;
+ PLReader plReader;
+ gboolean first_pos = TRUE;
FTSTRACE(("FTS3 Next %p\n", pCursor));
snippetClear(&c->snippet);
@@ -4189,8 +4197,6 @@ static int fulltextNext(sqlite3_vtab_cursor *pCursor){
/* (tracker) read position offsets here */
- PLReader plReader;
- gboolean first_pos = TRUE;
c->offsets = g_string_assign (c->offsets, "");
c->rank = 0;
@@ -4815,6 +4821,8 @@ int Catid,
int iStartOffset, iEndOffset, iPosition, stop_word, new_paragraph;
int rc;
TrackerParser *parser = v->parser;
+ DLCollector *p;
+ int nData; /* Size of doclist before our update. */
if (!zText) return SQLITE_OK;
@@ -4841,8 +4849,6 @@ int Catid,
- DLCollector *p;
- int nData; /* Size of doclist before our update. */
/* Positions can't be negative; we use -1 as a terminator
* internally. Token can't be NULL or empty. */
@@ -5008,7 +5014,7 @@ static int index_update(fulltext_vtab *v, sqlite_int64 iRow,
for(i = 0; i < v->nColumn ; ++i){
char *zText = (char*)sqlite3_value_text(pValues[i]);
- int rc = buildTerms(v, iRow, zText, delete ? -1 : i);
+ rc = buildTerms(v, iRow, zText, delete ? -1 : i);
if( rc!=SQLITE_OK ) return rc;
}
@@ -7147,7 +7153,7 @@ static int optimizeInternal(fulltext_vtab *v,
-1, DL_DEFAULT, &merged);
}else{
DLReader dlReaders[MERGE_COUNT];
- int iReader, nReaders;
+ int iReader, pnReaders;
/* Prime the pipeline with the first reader's doclist. After
** one pass index 0 will reference the accumulated doclist.
@@ -7160,22 +7166,22 @@ static int optimizeInternal(fulltext_vtab *v,
assert( iReader<i ); /* Must execute the loop at least once. */
while( iReader<i ){
/* Merge 16 inputs per pass. */
- for( nReaders=1; iReader<i && nReaders<MERGE_COUNT;
- iReader++, nReaders++ ){
- dlrInit(&dlReaders[nReaders], DL_DEFAULT,
+ for( pnReaders=1; iReader<i && pnReaders<MERGE_COUNT;
+ iReader++, pnReaders++ ){
+ dlrInit(&dlReaders[pnReaders], DL_DEFAULT,
optLeavesReaderData(&readers[iReader]),
optLeavesReaderDataBytes(&readers[iReader]));
}
/* Merge doclists and swap result into accumulator. */
dataBufferReset(&merged);
- docListMerge(&merged, dlReaders, nReaders);
+ docListMerge(&merged, dlReaders, pnReaders);
tmp = merged;
merged = doclist;
doclist = tmp;
- while( nReaders-- > 0 ){
- dlrDestroy(&dlReaders[nReaders]);
+ while( pnReaders-- > 0 ){
+ dlrDestroy(&dlReaders[pnReaders]);
}
/* Accumulated doclist to reader 0 for next pass. */
diff --git a/src/tracker-miner-fs/tracker-config.c b/src/tracker-miner-fs/tracker-config.c
index ec58c56..c7e87fb 100644
--- a/src/tracker-miner-fs/tracker-config.c
+++ b/src/tracker-miner-fs/tracker-config.c
@@ -76,9 +76,9 @@ typedef struct {
typedef struct {
GType type;
- gchar *property;
- gchar *group;
- gchar *key;
+ const gchar *property;
+ const gchar *group;
+ const gchar *key;
} ObjectToKeyFile;
static void config_set_property (GObject *object,
diff --git a/src/tracker-miner-fs/tracker-dbus.c b/src/tracker-miner-fs/tracker-dbus.c
index b87068b..38f390b 100644
--- a/src/tracker-miner-fs/tracker-dbus.c
+++ b/src/tracker-miner-fs/tracker-dbus.c
@@ -91,7 +91,7 @@ name_owner_changed_cb (DBusGProxy *proxy,
static gboolean
dbus_register_object (GObject *object,
- DBusGConnection *connection,
+ DBusGConnection *mconnection,
DBusGProxy *proxy,
const DBusGObjectInfo *info,
const gchar *path)
@@ -101,7 +101,7 @@ dbus_register_object (GObject *object,
g_message (" Object Type:'%s'", G_OBJECT_TYPE_NAME (object));
dbus_g_object_type_install_info (G_OBJECT_TYPE (object), info);
- dbus_g_connection_register_g_object (connection, path, object);
+ dbus_g_connection_register_g_object (mconnection, path, object);
dbus_g_proxy_add_signal (proxy, "NameOwnerChanged",
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
diff --git a/src/tracker-store/tracker-config.c b/src/tracker-store/tracker-config.c
index c4dd2df..f261fde 100644
--- a/src/tracker-store/tracker-config.c
+++ b/src/tracker-store/tracker-config.c
@@ -50,9 +50,9 @@ typedef struct {
typedef struct {
GType type;
- gchar *property;
- gchar *group;
- gchar *key;
+ const gchar *property;
+ const gchar *group;
+ const gchar *key;
} ObjectToKeyFile;
static void config_set_property (GObject *object,
diff --git a/src/tracker-utils/tracker-processes.c b/src/tracker-utils/tracker-processes.c
index 344853d..020e079 100644
--- a/src/tracker-utils/tracker-processes.c
+++ b/src/tracker-utils/tracker-processes.c
@@ -109,6 +109,7 @@ log_handler (const gchar *domain,
case G_LOG_LEVEL_INFO:
case G_LOG_LEVEL_DEBUG:
case G_LOG_LEVEL_MASK:
+ default:
g_fprintf (stdout, "%s\n", message);
fflush (stdout);
break;
diff --git a/src/tracker-utils/tracker-search.c b/src/tracker-utils/tracker-search.c
index e05aee1..e2d15c0 100644
--- a/src/tracker-utils/tracker-search.c
+++ b/src/tracker-utils/tracker-search.c
@@ -61,7 +61,7 @@ static GOptionEntry entries[] = {
static void
get_meta_table_data (gpointer value, gpointer user_data)
{
- gboolean detailed = GPOINTER_TO_INT (user_data);
+ gboolean pdetailed = GPOINTER_TO_INT (user_data);
gchar **meta;
gchar **p;
gint i;
@@ -71,7 +71,7 @@ get_meta_table_data (gpointer value, gpointer user_data)
for (p = meta, i = 0; *p; p++, i++) {
if (i == 0) {
g_print (" %s", *p);
- } else if (detailed) {
+ } else if (pdetailed) {
g_print (", %s", *p);
}
}
diff --git a/src/tracker-utils/tracker-status.c b/src/tracker-utils/tracker-status.c
index c20d396..d3142e4 100644
--- a/src/tracker-utils/tracker-status.c
+++ b/src/tracker-utils/tracker-status.c
@@ -482,7 +482,7 @@ main (gint argc, gchar *argv[])
if (!follow) {
GError *error = NULL;
- gchar *state;
+ const gchar *state;
/* state = tracker_get_status (client, &error); */
state = "Idle";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]