Fix compiler warnings

This commit is contained in:
Dan Winship 2011-05-02 11:45:52 -04:00
parent 6f711a76cd
commit bdc23c44e8
14 changed files with 42 additions and 45 deletions

View File

@ -673,7 +673,7 @@ g_date_prepare_to_parse (const gchar *str,
++i;
}
#ifdef G_ENABLE_DEBUG
#if defined(G_ENABLE_DEBUG) && 0
DEBUG_MSG (("**GDate prepared a new set of locale-specific parse rules."));
i = 1;
while (i < 13)

View File

@ -350,7 +350,7 @@ g_hash_table_lookup_node (GHashTable *hash_table,
{
guint node_index;
guint hash_value;
guint first_tombstone;
guint first_tombstone = 0;
gboolean have_tombstone = FALSE;
guint step = 0;

View File

@ -1292,13 +1292,11 @@ g_utf16_to_ucs4 (const gunichar2 *str,
while ((len < 0 || in - str < len) && *in)
{
gunichar2 c = *in;
gunichar wc;
if (c >= 0xdc00 && c < 0xe000) /* low surrogate */
{
if (high_surrogate)
{
wc = SURROGATE_VALUE (high_surrogate, c);
high_surrogate = 0;
}
else
@ -1322,8 +1320,6 @@ g_utf16_to_ucs4 (const gunichar2 *str,
high_surrogate = c;
goto next1;
}
else
wc = c;
}
/********** DIFFERENT for UTF8/UCS4 **********/

View File

@ -3926,6 +3926,7 @@ test_bytestring (void)
untrusted_empty = g_variant_new_from_data (G_VARIANT_TYPE ("ay"), NULL, 0, FALSE, NULL, NULL);
value = g_variant_get_normal_form (untrusted_empty);
const_str = g_variant_get_bytestring (value);
(void) const_str;
g_variant_unref (value);
g_variant_unref (untrusted_empty);
}

View File

@ -29,7 +29,9 @@
#include <ffi.h>
#include "gclosure.h"
#include "gboxed.h"
#include "gvalue.h"
#include "gvaluetypes.h"
/**

View File

@ -2096,47 +2096,46 @@ g_object_connect (gpointer _object,
{
GCallback callback = va_arg (var_args, GCallback);
gpointer data = va_arg (var_args, gpointer);
gulong sid;
if (strncmp (signal_spec, "signal::", 8) == 0)
sid = g_signal_connect_data (object, signal_spec + 8,
callback, data, NULL,
0);
g_signal_connect_data (object, signal_spec + 8,
callback, data, NULL,
0);
else if (strncmp (signal_spec, "object_signal::", 15) == 0 ||
strncmp (signal_spec, "object-signal::", 15) == 0)
sid = g_signal_connect_object (object, signal_spec + 15,
callback, data,
0);
g_signal_connect_object (object, signal_spec + 15,
callback, data,
0);
else if (strncmp (signal_spec, "swapped_signal::", 16) == 0 ||
strncmp (signal_spec, "swapped-signal::", 16) == 0)
sid = g_signal_connect_data (object, signal_spec + 16,
callback, data, NULL,
G_CONNECT_SWAPPED);
g_signal_connect_data (object, signal_spec + 16,
callback, data, NULL,
G_CONNECT_SWAPPED);
else if (strncmp (signal_spec, "swapped_object_signal::", 23) == 0 ||
strncmp (signal_spec, "swapped-object-signal::", 23) == 0)
sid = g_signal_connect_object (object, signal_spec + 23,
callback, data,
G_CONNECT_SWAPPED);
g_signal_connect_object (object, signal_spec + 23,
callback, data,
G_CONNECT_SWAPPED);
else if (strncmp (signal_spec, "signal_after::", 14) == 0 ||
strncmp (signal_spec, "signal-after::", 14) == 0)
sid = g_signal_connect_data (object, signal_spec + 14,
callback, data, NULL,
G_CONNECT_AFTER);
g_signal_connect_data (object, signal_spec + 14,
callback, data, NULL,
G_CONNECT_AFTER);
else if (strncmp (signal_spec, "object_signal_after::", 21) == 0 ||
strncmp (signal_spec, "object-signal-after::", 21) == 0)
sid = g_signal_connect_object (object, signal_spec + 21,
callback, data,
G_CONNECT_AFTER);
g_signal_connect_object (object, signal_spec + 21,
callback, data,
G_CONNECT_AFTER);
else if (strncmp (signal_spec, "swapped_signal_after::", 22) == 0 ||
strncmp (signal_spec, "swapped-signal-after::", 22) == 0)
sid = g_signal_connect_data (object, signal_spec + 22,
callback, data, NULL,
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
g_signal_connect_data (object, signal_spec + 22,
callback, data, NULL,
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
else if (strncmp (signal_spec, "swapped_object_signal_after::", 29) == 0 ||
strncmp (signal_spec, "swapped-object-signal-after::", 29) == 0)
sid = g_signal_connect_object (object, signal_spec + 29,
callback, data,
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
g_signal_connect_object (object, signal_spec + 29,
callback, data,
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
else
{
g_warning ("%s: invalid signal spec \"%s\"", G_STRFUNC, signal_spec);
@ -2451,11 +2450,10 @@ g_object_ref_sink (gpointer _object)
void
g_object_force_floating (GObject *object)
{
gboolean was_floating;
g_return_if_fail (G_IS_OBJECT (object));
g_return_if_fail (object->ref_count >= 1);
was_floating = floating_flag_handler (object, +1);
floating_flag_handler (object, +1);
}
typedef struct {

View File

@ -391,8 +391,10 @@ main (int argc,
/* test new fundamentals */
g_assert (G_TYPE_MAKE_FUNDAMENTAL (G_TYPE_RESERVED_USER_FIRST) == g_type_fundamental_next ());
type = g_type_register_fundamental (g_type_fundamental_next (), "FooShadow1", &info, &finfo, 0);
g_assert (type == G_TYPE_RESERVED_USER_FIRST);
g_assert (G_TYPE_MAKE_FUNDAMENTAL (G_TYPE_RESERVED_USER_FIRST + 1) == g_type_fundamental_next ());
type = g_type_register_fundamental (g_type_fundamental_next (), "FooShadow2", &info, &finfo, 0);
g_assert (type == G_TYPE_RESERVED_USER_FIRST + 1);
g_assert (G_TYPE_MAKE_FUNDAMENTAL (G_TYPE_RESERVED_USER_FIRST + 2) == g_type_fundamental_next ());
g_assert (g_type_from_name ("FooShadow1") == G_TYPE_MAKE_FUNDAMENTAL (G_TYPE_RESERVED_USER_FIRST));
g_assert (g_type_from_name ("FooShadow2") == G_TYPE_MAKE_FUNDAMENTAL (G_TYPE_RESERVED_USER_FIRST + 1));

View File

@ -198,6 +198,8 @@ test_multithreaded_dynamic_type_init (void)
guint i;
module = test_module_new (module_register);
g_assert (module != NULL);
/* Not loaded until we call ref for the first time */
class = g_type_class_peek (DYNAMIC_OBJECT_TYPE);
g_assert (class == NULL);
@ -339,6 +341,7 @@ test_dynamic_interface_properties (void)
DynObj *obj;
module = test_module_new (mod_register);
g_assert (module != NULL);
obj = g_object_new (dyn_obj_get_type (), "foo", 1, NULL);

View File

@ -107,13 +107,12 @@ tester_init_thread (gpointer data)
static void
test_threaded_class_init (void)
{
GThread *threads[3] = { NULL, };
/* pause newly created threads */
g_mutex_lock (sync_mutex);
/* create threads */
threads[0] = g_thread_create (tester_init_thread, (gpointer) my_tester0_get_type(), TRUE, NULL);
threads[1] = g_thread_create (tester_init_thread, (gpointer) my_tester1_get_type(), TRUE, NULL);
threads[2] = g_thread_create (tester_init_thread, (gpointer) my_tester2_get_type(), TRUE, NULL);
g_thread_create (tester_init_thread, (gpointer) my_tester0_get_type(), TRUE, NULL);
g_thread_create (tester_init_thread, (gpointer) my_tester1_get_type(), TRUE, NULL);
g_thread_create (tester_init_thread, (gpointer) my_tester2_get_type(), TRUE, NULL);
/* execute threads */
g_mutex_unlock (sync_mutex);
while (g_atomic_int_get (&mtsafe_call_counter) < (3 + 3 + 3 * 3) * NUM_COUNTER_INCREMENTS)

View File

@ -81,7 +81,7 @@ my_test_dispose (GObject * object)
test = MY_TEST (object);
g_print ("dispose %p!\n", object);
g_print ("dispose %p!\n", test);
G_OBJECT_CLASS (parent_class)->dispose (object);
}

View File

@ -80,7 +80,7 @@ my_test_dispose (GObject * object)
test = MY_TEST (object);
g_print ("dispose %p!\n", object);
g_print ("dispose %p!\n", test);
G_OBJECT_CLASS (parent_class)->dispose (object);
}

View File

@ -104,10 +104,6 @@ my_test_init (GTest * test)
static void
my_test_dispose (GObject * object)
{
GTest *test;
test = MY_TEST (object);
G_OBJECT_CLASS (parent_class)->dispose (object);
}

View File

@ -105,7 +105,7 @@ my_test_dispose (GObject * object)
test = MY_TEST (object);
g_print ("dispose %p!\n", object);
g_print ("dispose %p!\n", test);
G_OBJECT_CLASS (parent_class)->dispose (object);
}

View File

@ -136,7 +136,7 @@ my_test_dispose (GObject * object)
test = MY_TEST (object);
g_print ("dispose %p!\n", object);
g_print ("dispose %p!\n", test);
G_OBJECT_CLASS (parent_class)->dispose (object);
}