fix warnings

This commit is contained in:
Dan Winship
2012-04-30 06:31:20 -04:00
parent c5285b3aba
commit c37273dccb
10 changed files with 22 additions and 17 deletions

View File

@@ -1523,7 +1523,6 @@ on_authorize_authenticated_peer (GDBusAuthObserver *observer,
GCredentials *credentials, GCredentials *credentials,
gpointer user_data) gpointer user_data)
{ {
GDBusDaemon *daemon = user_data;
gboolean authorized = TRUE; gboolean authorized = TRUE;
if (credentials != NULL) if (credentials != NULL)

View File

@@ -515,7 +515,7 @@ start_daemon (GTestDBus *self)
GError *error = NULL; GError *error = NULL;
if (g_getenv ("G_TEST_DBUS_DAEMON") != NULL) if (g_getenv ("G_TEST_DBUS_DAEMON") != NULL)
argv[0] = g_getenv ("G_TEST_DBUS_DAEMON"); argv[0] = (gchar *)g_getenv ("G_TEST_DBUS_DAEMON");
/* Write config file and set its path in argv */ /* Write config file and set its path in argv */
file = write_config_file (self); file = write_config_file (self);

View File

@@ -297,7 +297,7 @@ test_seek (void)
error = NULL; error = NULL;
/* Seek by read */ /* Seek by read */
g_assert_cmpstr (g_seekable_tell (G_SEEKABLE (in)), ==, 0); g_assert_cmpint (g_seekable_tell (G_SEEKABLE (in)), ==, 0);
byte = g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error); byte = g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error);
g_assert_no_error (error); g_assert_no_error (error);
g_assert_cmpint (byte, ==, 'a'); g_assert_cmpint (byte, ==, 'a');

View File

@@ -261,7 +261,6 @@ static glong
_g_utf8_strwidth (const gchar *p) _g_utf8_strwidth (const gchar *p)
{ {
glong len = 0; glong len = 0;
const gchar *start = p;
g_return_val_if_fail (p != NULL, 0); g_return_val_if_fail (p != NULL, 0);
while (*p) while (*p)

View File

@@ -139,10 +139,9 @@ module_register (GTypeModule *module)
static void static void
test_dynamic_iface (void) test_dynamic_iface (void)
{ {
GTypeModule *module;
TestDynamicIfaceClass *dynamic_iface; TestDynamicIfaceClass *dynamic_iface;
module = test_module_new (module_register); test_module_new (module_register);
/* Not loaded until we call ref for the first time */ /* Not loaded until we call ref for the first time */
dynamic_iface = g_type_default_interface_peek (TEST_TYPE_DYNAMIC_IFACE); dynamic_iface = g_type_default_interface_peek (TEST_TYPE_DYNAMIC_IFACE);

View File

@@ -110,10 +110,9 @@ module_register (GTypeModule *module)
static void static void
test_dynamic_type (void) test_dynamic_type (void)
{ {
GTypeModule *module;
DynamicObjectClass *class; DynamicObjectClass *class;
module = test_module_new (module_register); test_module_new (module_register);
/* Not loaded until we call ref for the first time */ /* Not loaded until we call ref for the first time */
class = g_type_class_peek (DYNAMIC_OBJECT_TYPE); class = g_type_class_peek (DYNAMIC_OBJECT_TYPE);

View File

@@ -418,5 +418,7 @@ main (int argc,
iface = TEST_IFACE6_GET_CLASS (object); iface = TEST_IFACE6_GET_CLASS (object);
g_assert (iface && iface->val == 0x60006 && iface->base_val == 0x660066); g_assert (iface && iface->val == 0x60006 && iface->base_val == 0x660066);
g_type_class_unref (object_class);
return 0; return 0;
} }

View File

@@ -131,13 +131,14 @@ main (int argc,
/* basic sanity checks */ /* basic sanity checks */
if (!block_size || !n_blocks || block_size >= area_size) if (!block_size || !n_blocks || block_size >= area_size)
{ {
g_printerr ("Invalid arguments: block-size=%llu memory-size=%llu\n", block_size, area_size); g_printerr ("Invalid arguments: block-size=%" G_GUINT64_FORMAT " memory-size=%" G_GUINT64_FORMAT "\n", block_size, area_size);
usage(); usage();
return 1; return 1;
} }
g_printerr ("Will allocate and touch %llu blocks of %llu bytes (= %llu bytes) %llu times with color increment: 0x%08llx\n", g_printerr ("Will allocate and touch %" G_GUINT64_FORMAT " blocks of %" G_GUINT64_FORMAT " bytes (= %" G_GUINT64_FORMAT " bytes) %" G_GUINT64_FORMAT " times with color increment: 0x%08" G_GUINT64_MODIFIER "x\n",
n_blocks, block_size, n_blocks * block_size, repeats, g_slice_get_config (G_SLICE_CONFIG_COLOR_INCREMENT)); n_blocks, block_size, n_blocks * block_size, repeats,
(guint64)g_slice_get_config (G_SLICE_CONFIG_COLOR_INCREMENT));
touch_mem (block_size, n_blocks, repeats); touch_mem (block_size, n_blocks, repeats);

View File

@@ -297,7 +297,7 @@ main (int argc,
for (i = 0; i < n_chunks; i++) for (i = 0; i < n_chunks; i++)
{ {
gint64 *vals = g_slice_get_config_state (G_SLICE_CONFIG_CONTENTION_COUNTER, i, &n); gint64 *vals = g_slice_get_config_state (G_SLICE_CONFIG_CONTENTION_COUNTER, i, &n);
g_print (" %9llu | %9llu | %9llu\n", vals[0], vals[2], vals[1]); g_print (" %9" G_GINT64_FORMAT " | %9" G_GINT64_FORMAT " | %9" G_GINT64_FORMAT "\n", vals[0], vals[2], vals[1]);
g_free (vals); g_free (vals);
} }
} }

View File

@@ -5,8 +5,13 @@
#include <glib.h> #include <glib.h>
#define DEBUG_MSG(x) /* #define DEBUG 1 */
/* #define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n"); */
#ifdef DEBUG
# define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n");
#else
# define DEBUG_MSG(x)
#endif
#define WAIT 5 /* seconds */ #define WAIT 5 /* seconds */
#define MAX_THREADS 10 #define MAX_THREADS 10
@@ -128,9 +133,11 @@ test_thread_stop_unused (void)
static void static void
test_thread_pools_entry_func (gpointer data, gpointer user_data) test_thread_pools_entry_func (gpointer data, gpointer user_data)
{ {
#ifdef DEBUG
guint id = 0; guint id = 0;
id = GPOINTER_TO_UINT (data); id = GPOINTER_TO_UINT (data);
#endif
DEBUG_MSG (("[pool] ---> [%3.3d] entered thread.", id)); DEBUG_MSG (("[pool] ---> [%3.3d] entered thread.", id));
@@ -293,9 +300,11 @@ test_thread_sort (gboolean sort)
static void static void
test_thread_idle_time_entry_func (gpointer data, gpointer user_data) test_thread_idle_time_entry_func (gpointer data, gpointer user_data)
{ {
#ifdef DEBUG
guint thread_id; guint thread_id;
thread_id = GPOINTER_TO_UINT (data); thread_id = GPOINTER_TO_UINT (data);
#endif
DEBUG_MSG (("[idle] ---> entered thread:%2.2d", thread_id)); DEBUG_MSG (("[idle] ---> entered thread:%2.2d", thread_id));
@@ -307,11 +316,8 @@ test_thread_idle_time_entry_func (gpointer data, gpointer user_data)
static gboolean static gboolean
test_thread_idle_timeout (gpointer data) test_thread_idle_timeout (gpointer data)
{ {
guint interval;
gint i; gint i;
interval = GPOINTER_TO_UINT (data);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
g_thread_pool_push (idle_pool, GUINT_TO_POINTER (100 + i), NULL); g_thread_pool_push (idle_pool, GUINT_TO_POINTER (100 + i), NULL);
DEBUG_MSG (("[idle] ===> pushed new thread with id:%d, number " DEBUG_MSG (("[idle] ===> pushed new thread with id:%d, number "