Commit 61be57c5 authored by Martyn Russell's avatar Martyn Russell

build: Fixed various compiler warnings across the entire code base

parent 4ba59dc3
......@@ -36,6 +36,7 @@
#include "tracker-keyfile-object.h"
#include "tracker-language.h"
#include "tracker-log.h"
#include "tracker-media-art.h"
#include "tracker-ontologies.h"
#include "tracker-os-dependant.h"
#include "tracker-sched.h"
......
......@@ -684,9 +684,6 @@ ensure_mount_point_exists (TrackerMinerFiles *miner,
uri, iri);
g_free (iri);
} else {
TrackerIndexingTree *indexing_tree;
TrackerDirectoryFlags flags;
/* If it doesn't exist, we need to create it */
g_message ("Mount point '%s' does not exist in store, need to create it",
uri);
......
......@@ -330,13 +330,6 @@ tracker_gsettings_get_all (gint *longest_name_length)
miners_available = tracker_miner_manager_get_available (manager);
/* First iterate to get max width for nice formatting */
for (l = miners_available; l; l = l->next) {
const gchar *name;
name = tracker_miner_manager_get_display_name (manager, l->data);
}
/* Get valid schemas so we don't try to load invalid ones */
for (schema = g_settings_list_schemas (); schema && *schema; schema++) {
if (!g_str_has_prefix (*schema, "org.freedesktop.Tracker.")) {
......
......@@ -37,6 +37,8 @@
#include "tracker-cue-sheet.h"
#if defined(HAVE_LIBCUE)
static TrackerToc *
tracker_toc_new (void)
{
......@@ -49,6 +51,8 @@ tracker_toc_new (void)
return toc;
}
#endif /* HAVE_LIBCUE */
void
tracker_toc_free (TrackerToc *toc)
{
......
......@@ -30,8 +30,6 @@
#warning Stayalive traces enabled
#endif /* STAYALIVE_ENABLE_TRACE */
#define THREAD_ENABLE_TRACE
#ifdef THREAD_ENABLE_TRACE
#warning Controller thread traces enabled
#endif /* THREAD_ENABLE_TRACE */
......
......@@ -46,10 +46,10 @@ struct {
{ NULL, NULL}
};
void
test_albumart_stripping ()
static void
test_albumart_stripping (void)
{
gint i;
gint i;
gchar *result;
for (i = 0; strip_test_cases[i].input != NULL; i++) {
......@@ -61,8 +61,8 @@ test_albumart_stripping ()
g_print ("(%d test cases) ", i);
}
void
test_albumart_stripping_null ()
static void
test_albumart_stripping_null (void)
{
// FIXME: Decide what is the expected behaviour here...
// a. Return NULL
......@@ -93,12 +93,12 @@ struct {
{ NULL, NULL, NULL }
};
void
test_albumart_location ()
static void
test_albumart_location (void)
{
gchar *path = NULL, *local_uri = NULL;
gchar *expected;
gint i;
gint i;
for (i = 0; albumart_test_cases[i].filename != NULL; i++) {
tracker_media_art_get_path (albumart_test_cases[i].artist,
......@@ -123,8 +123,8 @@ test_albumart_location ()
}
void
test_albumart_location_null ()
static void
test_albumart_location_null (void)
{
gchar *path = NULL, *local_uri = NULL;
......@@ -133,8 +133,8 @@ test_albumart_location_null ()
g_assert (!path && !local_uri);
}
void
test_albumart_location_path ()
static void
test_albumart_location_path (void)
{
gchar *path = NULL, *local_uri = NULL;
gchar *expected;
......
......@@ -31,8 +31,8 @@
#include <errno.h>
gboolean
scheduler_is (gint scheduler)
static gboolean
scheduler_is (gint scheduler)
{
#ifdef __linux__
return (sched_getscheduler (0) == scheduler);
......@@ -41,8 +41,8 @@ scheduler_is (gint scheduler)
#endif
}
void
test_sched_set_and_get ()
static void
test_sched_set_and_get (void)
{
g_assert (scheduler_is (SCHED_OTHER));
g_assert (tracker_sched_idle ());
......
......@@ -97,7 +97,7 @@ test_is_blank_string ()
}
static void
test_seconds_estimate ()
test_seconds_estimate (void)
{
g_assert_cmpint (tracker_seconds_estimate (10, 10, 20), ==, 20);
g_assert_cmpint (tracker_seconds_estimate (10, 9, 20), ==, 22);
......@@ -107,15 +107,14 @@ test_seconds_estimate ()
g_assert_cmpint (tracker_seconds_estimate (1, 0, 2), ==, 0);
g_assert_cmpint (tracker_seconds_estimate (1, -1, 2), ==, 0);
g_assert_cmpint (tracker_seconds_estimate (1, 1, 0), ==, 0);
// g_assert_cmpint (tracker_seconds_estimate (1, 1, -1), ==, 0);
}
void
test_strhex ()
static void
test_strhex (void)
{
gchar *result;
result = tracker_strhex ((const guint8 *)"a", 1, "|");
result = tracker_strhex ((const guint8 *)"a", 1, '|');
g_assert_cmpstr (result, ==, "61");
g_free (result);
......
......@@ -52,9 +52,8 @@ test_encoding_guessing ()
g_free (output);
}
void
test_encoding_can_guess ()
static void
test_encoding_can_guess (void)
{
/* This just duplicates the function code... */
#if defined (HAVE_ENCA) || defined (HAVE_MEEGOTOUCH)
......
......@@ -16,12 +16,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <glib.h>
#include <glib-object.h>
#include <libtracker-extract/tracker-exif.h>
void
test_exif_parse ()
#include <libtracker-extract/tracker-extract.h>
static void
test_exif_parse (void)
{
TrackerExifData *exif;
gchar *blob;
......@@ -67,8 +68,8 @@ test_exif_parse ()
tracker_exif_free (exif);
}
void
test_exif_parse_empty ()
static void
test_exif_parse_empty (void)
{
TrackerExifData *exif;
gchar *blob;
......
......@@ -16,11 +16,13 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <glib.h>
#include <libtracker-extract/tracker-extract-info.h>
void
test_extract_info_setters ()
#include <libtracker-extract/tracker-extract.h>
static void
test_extract_info_setters (void)
{
TrackerExtractInfo *info, *info_ref;
GFile *file;
......@@ -48,8 +50,8 @@ test_extract_info_setters ()
g_object_unref (file);
}
void
test_extract_info_empty_objects ()
static void
test_extract_info_empty_objects (void)
{
TrackerExtractInfo *info, *info_ref;
GFile *file;
......
......@@ -41,13 +41,12 @@ TestCase test_cases_title [] = {
{ NULL, NULL, NULL}
};
/*
* @uri of the file that is being processed
* @value is the title returned by the extractor
* @expected can be either the title of the extractor (if not NULL or empty) or calculated from the filename
*/
void
static void
internal_test_title (const gchar *uri,
const gchar *value,
const gchar *expected)
......@@ -80,7 +79,7 @@ internal_test_title (const gchar *uri,
g_free (sparql);
}
void
static void
internal_test_date (const gchar *uri,
const gchar *value)
{
......@@ -100,8 +99,8 @@ internal_test_date (const gchar *uri,
g_object_unref (builder);
}
void
test_guarantee_title ()
static void
test_guarantee_title (void)
{
int i;
......@@ -118,16 +117,17 @@ test_guarantee_title ()
#endif
}
void
test_guarantee_date ()
static void
test_guarantee_date (void)
{
#ifdef GUARANTEE_METADATA
GFile *f;
gchar *uri;
#endif
internal_test_date ("file:///does/not/matter/here", "2011-10-10T12:13:14Z0300");
#ifdef GUARANTEE_METADATA
f = g_file_new_for_path (TOP_SRCDIR "/tests/libtracker-extract/guarantee-mtime-test.txt");
uri = g_file_get_uri (f);
......
......@@ -51,7 +51,7 @@ extract_jpeg_error_exit (j_common_ptr cinfo)
* libiptcdata doesn't scan the file until find the IPTC blob.
* We need to find the blob ourselves. This code comes from tracker-extract-jpeg
*/
TrackerIptcData *
static TrackerIptcData *
load_iptc_blob (const gchar *filename)
{
struct jpeg_decompress_struct cinfo;
......@@ -126,9 +126,8 @@ load_iptc_blob (const gchar *filename)
return id;
}
void
test_iptc_extraction ()
static void
test_iptc_extraction (void)
{
TrackerIptcData *data;
......
......@@ -241,8 +241,8 @@ test_merge_const ()
g_assert (!result);
}
void
test_getline ()
static void
test_getline (void)
{
FILE *f;
gchar *line = NULL;
......
......@@ -17,13 +17,13 @@
* 02110-1301, USA.
*/
#include <glib.h>
#include <glib-object.h>
/* NOTE: We're not including tracker-miner.h here because this is private. */
#include <libtracker-miner/tracker-priority-queue.h>
void
test_priority_queue_ref_unref()
static void
test_priority_queue_ref_unref (void)
{
TrackerPriorityQueue *one, *two;
......@@ -34,8 +34,8 @@ test_priority_queue_ref_unref()
tracker_priority_queue_unref (one);
}
void
test_priority_queue_emptiness ()
static void
test_priority_queue_emptiness (void)
{
TrackerPriorityQueue *one;
......@@ -47,8 +47,8 @@ test_priority_queue_emptiness ()
tracker_priority_queue_unref (one);
}
void
test_priority_queue_insertion_pop ()
static void
test_priority_queue_insertion_pop (void)
{
TrackerPriorityQueue *queue;
int i, priority;
......@@ -81,8 +81,8 @@ test_priority_queue_insertion_pop ()
tracker_priority_queue_unref (queue);
}
void
test_priority_queue_peek ()
static void
test_priority_queue_peek (void)
{
TrackerPriorityQueue *queue;
gchar *result;
......@@ -110,13 +110,12 @@ test_priority_queue_peek ()
tracker_priority_queue_unref (queue);
}
void
test_priority_queue_find ()
static void
test_priority_queue_find (void)
{
TrackerPriorityQueue *queue;
gchar *result;
int priority;
gchar *result;
int priority;
queue = tracker_priority_queue_new ();
......@@ -124,21 +123,23 @@ test_priority_queue_find ()
tracker_priority_queue_add (queue, g_strdup ("Not me"), 1);
tracker_priority_queue_add (queue, g_strdup ("Not me either"), 20);
result = (gchar *)tracker_priority_queue_find (queue, &priority, g_str_equal, "search me");
result = (gchar *) tracker_priority_queue_find (queue, &priority, g_str_equal, "search me");
g_assert_cmpstr (result, !=, NULL);
g_assert_cmpint (priority, ==, 10);
tracker_priority_queue_unref (queue);
}
void
foreach_testing_cb (G_GNUC_UNUSED gpointer data, gpointer user_data)
static void
foreach_testing_cb (G_GNUC_UNUSED gpointer data,
gpointer user_data)
{
gint *counter = (gint *)user_data;
(*counter) += 1;
}
void
test_priority_queue_foreach ()
static void
test_priority_queue_foreach (void)
{
TrackerPriorityQueue *queue;
gint counter = 0;
......@@ -156,8 +157,8 @@ test_priority_queue_foreach ()
tracker_priority_queue_unref (queue);
}
void
test_priority_queue_foreach_remove ()
static void
test_priority_queue_foreach_remove (void)
{
TrackerPriorityQueue *queue;
......@@ -179,9 +180,8 @@ test_priority_queue_foreach_remove ()
tracker_priority_queue_unref (queue);
}
void
test_priority_queue_branches ()
static void
test_priority_queue_branches (void)
{
/* Few specific testing to improve the branch coverage */
......
......@@ -18,9 +18,11 @@
*
*/
#include <glib.h>
/* NOTE: We're not including tracker-miner.h here because this is private. */
#include <libtracker-miner/tracker-task-pool.h>
void
static void
test_task_pool_limit_set (void)
{
TrackerTaskPool *pool;
......@@ -35,8 +37,11 @@ test_task_pool_limit_set (void)
g_object_unref (pool);
}
void
add_task (TrackerTaskPool *pool, const gchar *filename, gint expected_size, gboolean hit_limit)
static void
add_task (TrackerTaskPool *pool,
const gchar *filename,
gint expected_size,
gboolean hit_limit)
{
TrackerTask *task;
......@@ -50,8 +55,11 @@ add_task (TrackerTaskPool *pool, const gchar *filename, gint expected_size, gboo
tracker_task_unref (task);
}
void
remove_task (TrackerTaskPool *pool, const gchar *filename, gint expected_size, gboolean hit_limit)
static void
remove_task (TrackerTaskPool *pool,
const gchar *filename,
gint expected_size,
gboolean hit_limit)
{
TrackerTask *task;
......@@ -65,7 +73,7 @@ remove_task (TrackerTaskPool *pool, const gchar *filename, gint expected_size, g
tracker_task_unref (task);
}
void
static void
test_task_pool_add_remove (void)
{
TrackerTaskPool *pool;
......@@ -95,12 +103,12 @@ test_task_pool_add_remove (void)
g_object_unref (pool);
}
void
test_task_pool_find ()
static void
test_task_pool_find (void)
{
TrackerTaskPool *pool;
TrackerTask *task;
GFile *goal;
TrackerTask *task;
GFile *goal;
pool = tracker_task_pool_new (3);
......@@ -132,18 +140,19 @@ test_task_pool_find ()
g_object_unref (pool);
}
void
count_elements_cb (gpointer data, gpointer user_data)
static void
count_elements_cb (gpointer data,
gpointer user_data)
{
gint *counter = (gint*)user_data;
(*counter) += 1;
}
void
test_task_pool_foreach ()
static void
test_task_pool_foreach (void)
{
TrackerTaskPool *pool;
int counter = 0;
int counter = 0;
pool = tracker_task_pool_new (3);
......@@ -156,7 +165,6 @@ test_task_pool_foreach ()
g_assert_cmpint (counter, ==, 3);
}
gint
main (gint argc, gchar **argv)
{
......
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