[gtkmm] Fixed warnings in refcount debugging messages.



commit 6fbc5d4638556d3cd357744d51d378964d8f8f56
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Mon Nov 8 15:57:46 2010 +0100

    Fixed warnings in refcount debugging messages.
    
    * gtk/gtkmm/object.cc:
    * gtk/src/window.ccg: Used %p format parameter to print addresses of GObjects
    and cast 'this' and GObjects to void*.

 ChangeLog           |    8 ++++++++
 gtk/gtkmm/object.cc |   14 +++++++-------
 gtk/src/window.ccg  |    4 ++--
 3 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d3bb845..8444fbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-08  Krzesimir Nowak  <qdlacz gmail com>
+
+	Fixed warnings in refcount debugging messages.
+
+	* gtk/gtkmm/object.cc:
+	* gtk/src/window.ccg: Used %p format parameter to print addresses of GObjects
+	and cast 'this' and GObjects to void*.
+
 2010-11-08  Murray Cumming  <murrayc murrayc com>
 
 	Add the Grid container widget.
diff --git a/gtk/gtkmm/object.cc b/gtk/gtkmm/object.cc
index 1d02266..ee68de0 100644
--- a/gtk/gtkmm/object.cc
+++ b/gtk/gtkmm/object.cc
@@ -83,7 +83,7 @@ void Object::_init_unmanage(bool /* is_toplevel = false */)
 void Object::_release_c_instance()
 {
   #ifdef GLIBMM_DEBUG_REFCOUNTING
-  g_warning("Gtk::Object::_release_c_instance() this=%10X, gobject_=%10X\n", this, gobject_);
+  g_warning("Gtk::Object::_release_c_instance() this=%p, gobject_=%p\n", (void*)(Glib::ObjectBase*)this, (void*)gobject_);
     if(gobject_)
       g_warning("  gtypename: %s\n", G_OBJECT_TYPE_NAME(gobject_));
   #endif
@@ -141,7 +141,7 @@ void Object::_release_c_instance()
         if (!gobject_disposed_)
         {
           #ifdef GLIBMM_DEBUG_REFCOUNTING
-          g_warning("Gtk::Object::_release_c_instance(): Calling g_object_run_dispose(): gobject_=%10X, gtypename=%s\n", object, G_OBJECT_TYPE_NAME(object));
+          g_warning("Gtk::Object::_release_c_instance(): Calling g_object_run_dispose(): gobject_=%p, gtypename=%s\n", (void*)object, G_OBJECT_TYPE_NAME(object));
           #endif
 
           g_assert(G_IS_OBJECT(object));
@@ -153,7 +153,7 @@ void Object::_release_c_instance()
         //It's manag()ed, but the coder decided to delete it before deleting its parent.
         //That should be OK because the Container can respond to that.
         #ifdef GLIBMM_DEBUG_REFCOUNTING
-        g_warning("Gtk::Object::_release_c_instance(): Calling g_object_run_dispose(): gobject_=%10X\n", gobject_);
+        g_warning("Gtk::Object::_release_c_instance(): Calling g_object_run_dispose(): gobject_=%p\n", (void*)gobject_);
         #endif
 
         if (!gobject_disposed_)
@@ -171,7 +171,7 @@ void Object::_release_c_instance()
 Object::~Object()
 {
   #ifdef GLIBMM_DEBUG_REFCOUNTING
-  g_warning("Gtk::Object::~Object() gobject_=%10X\n", gobject_);
+  g_warning("Gtk::Object::~Object() gobject_=%p\n", (void*)gobject_);
   #endif
 
   //This has probably been called already from Gtk::Object::_destroy(), which is called from derived destructors.
@@ -183,7 +183,7 @@ void Object::disconnect_cpp_wrapper()
   //GTKMM_LIFECYCLE:
 
   #ifdef GLIBMM_DEBUG_REFCOUNTING
-  g_warning("Gtk::Object::disconnect_cpp_wrapper() this=%10X, gobject_=%10X\n", this, gobject_);
+  g_warning("Gtk::Object::disconnect_cpp_wrapper() this=%p, gobject_=%p\n", (void*)(Glib::ObjectBase*)this, (void*)gobject_);
     if(gobject_)
       g_warning("  gtypename: %s\n", G_OBJECT_TYPE_NAME(gobject_));
   #endif
@@ -210,7 +210,7 @@ void Object::destroy_notify_()
   //GTKMM_LIFECYCLE
 
   #ifdef GLIBMM_DEBUG_REFCOUNTING
-  g_warning("Gtk::Object::destroy_notify_: this=%10X, gobject_=%10X\n", this, gobject_);
+  g_warning("Gtk::Object::destroy_notify_: this=%p, gobject_=%p\n", (void*)(Glib::ObjectBase*)this, (void*)gobject_);
   if(gobject_)
     g_warning("  gtypename=%s\n", G_OBJECT_TYPE_NAME(gobject_));
   #endif
@@ -245,7 +245,7 @@ void Object::destroy_()
   //GTKMM_LIFECYCLE
 
   #ifdef GLIBMM_DEBUG_REFCOUNTING
-  g_warning("Gtk::Object::destroy_(): gobject_: %10X\n", gobject_);
+  g_warning("Gtk::Object::destroy_(): gobject_: %p\n", (void*)gobject_);
   if(gobject_)
    g_warning("  gtypename: %s\n", G_OBJECT_TYPE_NAME(gobject_));
   #endif
diff --git a/gtk/src/window.ccg b/gtk/src/window.ccg
index 4a288d3..18f68be 100644
--- a/gtk/src/window.ccg
+++ b/gtk/src/window.ccg
@@ -61,7 +61,7 @@ void Window::destroy_()
   //GTKMM_LIFECYCLE
 
   #ifdef GLIBMM_DEBUG_REFCOUNTING
-  g_warning("Gtk::Window::destroy_(): gobject_: %10X\n", gobject_);
+  g_warning("Gtk::Window::destroy_(): gobject_: %p\n", (void*) gobject_);
   if(gobject_)
    g_warning("  gtypename: %s\n", G_OBJECT_TYPE_NAME(gobject_));
   #endif
@@ -84,7 +84,7 @@ void Window::_release_c_instance()
   //We override this, (though it's not virtual - we just call it from this class),
   //because top-level windows can only be destroyed with gtk_widget_destroy, according to Owen Taylor. murrayc.
   #ifdef GLIBMM_DEBUG_REFCOUNTING
-  g_warning("Gtk::Window::_destroy_c_instance() gobject_=%10X\n", gobject_);
+  g_warning("Gtk::Window::_destroy_c_instance() gobject_=%p\n", (void*) gobject_);
   #endif
 
   cpp_destruction_in_progress_ = true;



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