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,
gpointer user_data)
{
GDBusDaemon *daemon = user_data;
gboolean authorized = TRUE;
if (credentials != NULL)

View File

@ -515,7 +515,7 @@ start_daemon (GTestDBus *self)
GError *error = 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 */
file = write_config_file (self);

View File

@ -297,7 +297,7 @@ test_seek (void)
error = NULL;
/* 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);
g_assert_no_error (error);
g_assert_cmpint (byte, ==, 'a');

View File

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

View File

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

View File

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

View File

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

View File

@ -131,13 +131,14 @@ main (int argc,
/* basic sanity checks */
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();
return 1;
}
g_printerr ("Will allocate and touch %llu blocks of %llu bytes (= %llu bytes) %llu times with color increment: 0x%08llx\n",
n_blocks, block_size, n_blocks * block_size, repeats, g_slice_get_config (G_SLICE_CONFIG_COLOR_INCREMENT));
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,
(guint64)g_slice_get_config (G_SLICE_CONFIG_COLOR_INCREMENT));
touch_mem (block_size, n_blocks, repeats);

View File

@ -297,7 +297,7 @@ main (int argc,
for (i = 0; i < n_chunks; i++)
{
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);
}
}

View File

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