[glib] gdbus-test-codegen: Cast to void* to printf "%p"



commit b441c21a09db52db0af715e1d702c765ae38346e
Author: Daniel Boles <dboles src gnome org>
Date:   Mon Jan 1 16:12:37 2018 +0000

    gdbus-test-codegen: Cast to void* to printf "%p"
    
    to suppress a compiler error with stricter warnings enabled (GCC):
    
    gdbus-test-codegen.c: In function ‘on_handle_get_self’:
    gdbus-test-codegen.c:403:26: error: format ‘%p’ expects argument of type
     ‘void *’, but argument 2 has type ‘GThread * {aka struct _GThread *}’
     [-Werror=format=]
       s = g_strdup_printf ("%p", g_thread_self ());
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792099

 gio/tests/gdbus-test-codegen.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/tests/gdbus-test-codegen.c b/gio/tests/gdbus-test-codegen.c
index c974d20..1c4e83c 100644
--- a/gio/tests/gdbus-test-codegen.c
+++ b/gio/tests/gdbus-test-codegen.c
@@ -405,7 +405,7 @@ on_handle_get_self (FooiGenMethodThreads   *object,
                     gpointer                user_data)
 {
   gchar *s;
-  s = g_strdup_printf ("%p", g_thread_self ());
+  s = g_strdup_printf ("%p", (void *)g_thread_self ());
   foo_igen_method_threads_complete_get_self (object, invocation, s);
   g_free (s);
   return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]