Commit 02f2f994 authored by Philip Van Hoof's avatar Philip Van Hoof

Various compiler warning fixes

parent f9b87f0b
......@@ -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;
......
......@@ -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 ();
}
......
......@@ -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;
}
}
......
......@@ -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,
......
......@@ -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,
......
......@@ -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;
}
}
}
......
......@@ -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) {
......
......@@ -7,6 +7,6 @@
void tracker_read_iptc (const unsigned char *buffer,
size_t len,
const gchar *uri,
GPtrArray *metadata);
TrackerSparqlBuilder *metadata);
#endif
......@@ -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;
......
......@@ -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,
......
......@@ -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,8 +3918,6 @@ static void snippetAllOffsets(fulltext_cursor *p){
#else
int iFirst, iLast;
int nColumn;
nColumn = pFts->nColumn;
iColumn = (p->iCursorType - QUERY_FULLTEXT);
......@@ -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. */
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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;
......
......@@ -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);
}
}
......
......@@ -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";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment