[glib] g_steal_pointer: make it C++ clean



commit 0110f2a810cfd638a0a6525deb69aeec7a0f0cab
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Feb 6 17:00:01 2015 +0100

    g_steal_pointer: make it C++ clean
    
    We have a test that #includes our headers from a C++ program to make
    sure we don't throw any errors or warnings as a result of that.
    
    The new inline implementation of g_steal_pointer() does an implicit
    conversion from (void *), which is not valid in C++.
    
    Add a cast to avoid the problem.
    
    Thanks to Ignacio Casal Quinteiro for the report.

 glib/gmem.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/glib/gmem.h b/glib/gmem.h
index 82507b5..8358f86 100644
--- a/glib/gmem.h
+++ b/glib/gmem.h
@@ -183,7 +183,7 @@ gpointer g_try_realloc_n  (gpointer  mem,
 static inline gpointer
 (g_steal_pointer) (gpointer pp)
 {
-  gpointer *ptr = pp;
+  gpointer *ptr = (gpointer *) pp;
   gpointer ref;
 
   ref = *ptr;


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