diff --git a/gio/tests/gdbus-proxy.c b/gio/tests/gdbus-proxy.c index e614ed3de..28ac86c44 100644 --- a/gio/tests/gdbus-proxy.c +++ b/gio/tests/gdbus-proxy.c @@ -168,6 +168,8 @@ test_properties (GDBusProxy *proxy) GVariant *variant2; GVariant *result; gchar **names; + gchar *name_owner; + GDBusProxy *proxy2; error = NULL; @@ -296,8 +298,6 @@ test_properties (GDBusProxy *proxy) g_assert (variant == NULL); /* Now test that G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES works - we need a new proxy for that */ - gchar *name_owner; - GDBusProxy *proxy2; error = NULL; proxy2 = g_dbus_proxy_new_sync (g_dbus_proxy_get_connection (proxy), G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES, diff --git a/gio/tests/gdbus-test-codegen.c b/gio/tests/gdbus-test-codegen.c index 8af2ca67d..4e8383a75 100644 --- a/gio/tests/gdbus-test-codegen.c +++ b/gio/tests/gdbus-test-codegen.c @@ -699,6 +699,10 @@ static void check_bar_proxy (FooiGenBar *proxy, GMainLoop *thread_loop) { + const gchar *array_of_strings[3] = {"one", "two", NULL}; + const gchar *array_of_strings_2[3] = {"one2", "two2", NULL}; + const gchar *array_of_objpaths[3] = {"/one", "/one/two", NULL}; + const gchar *array_of_bytestrings[3] = {"one\xff", "two\xff", NULL}; guchar ret_val_byte; gboolean ret_val_boolean; gint16 ret_val_int16; @@ -744,6 +748,9 @@ check_bar_proxy (FooiGenBar *proxy, gchar *val_finally_normal_name; GVariant *v; gchar *s; + const gchar *const *read_as; + const gchar *const *read_as2; + const gchar *const *read_as3; data = g_new0 (ClientData, 1); data->thread_loop = thread_loop; @@ -838,10 +845,6 @@ check_bar_proxy (FooiGenBar *proxy, /* Try setting properties that requires memory management. This * is to exercise the paths that frees the references. */ - const gchar *array_of_strings[3] = {"one", "two", NULL}; - const gchar *array_of_strings_2[3] = {"one2", "two2", NULL}; - const gchar *array_of_objpaths[3] = {"/one", "/one/two", NULL}; - const gchar *array_of_bytestrings[3] = {"one\xff", "two\xff", NULL}; g_object_set (proxy, "s", "a string", @@ -939,9 +942,6 @@ check_bar_proxy (FooiGenBar *proxy, * updates on them works as well (See comment for "property vfuncs" * in gio/gdbus-codegen/codegen.py for details) */ - const gchar *const *read_as; - const gchar *const *read_as2; - const gchar *const *read_as3; read_as = foo_igen_bar_get_as (proxy); read_as2 = foo_igen_bar_get_as (proxy); g_assert_cmpint (g_strv_length ((gchar **) read_as), ==, 2); diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c index f42e32c8a..68c633cdd 100644 --- a/glib/gthread-posix.c +++ b/glib/gthread-posix.c @@ -90,10 +90,12 @@ g_mutex_impl_new (void) g_thread_abort (errno, "malloc"); #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP - pthread_mutexattr_t attr; - pthread_mutexattr_init (&attr); - pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_ADAPTIVE_NP); - pattr = &attr; + { + pthread_mutexattr_t attr; + pthread_mutexattr_init (&attr); + pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_ADAPTIVE_NP); + pattr = &attr; + } #endif if G_UNLIKELY ((status = pthread_mutex_init (mutex, pattr)) != 0) diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c index 5d28ed992..801758d15 100644 --- a/glib/tests/gdatetime.c +++ b/glib/tests/gdatetime.c @@ -1185,12 +1185,13 @@ test_z (void) { GTimeZone *tz; GDateTime *dt; + gchar *p; g_test_bug ("642935"); tz = g_time_zone_new ("-08:00"); dt = g_date_time_new (tz, 0, 0, 0, 0, 0, 0); - gchar *p = g_date_time_format (dt, "%z"); + p = g_date_time_format (dt, "%z"); g_assert_cmpstr (p, ==, "-0800"); g_date_time_unref (dt); g_time_zone_unref (tz);