diff mbox

=?UTF-8?Q?libobjc:=20tidy=20up=20DEBUG=5FPRINTF?=

Message ID 1292943391.03997954@192.168.2.228
State New
Headers show

Commit Message

Nicola Pero Dec. 21, 2010, 2:56 p.m. UTC
Trivial changes to get DEBUG_PRINTF to work correctly when debugging libobjc itself.

Committed to trunk.

Thanks
diff mbox

Patch

Index: init.c
===================================================================
--- init.c      (revision 168114)
+++ init.c      (working copy)
@@ -209,7 +209,7 @@ 
 static objc_class_tree *
 __objc_tree_insert_class (objc_class_tree *tree, Class class)
 {
-  DEBUG_PRINTF ("__objc_tree_insert_class: tree = %x, class = %s\n",
+  DEBUG_PRINTF ("__objc_tree_insert_class: tree = %p, class = %s\n",
                tree, class->name);
 
   if (tree == NULL)
Index: objc-private/common.h
===================================================================
--- objc-private/common.h       (revision 168114)
+++ objc-private/common.h       (working copy)
@@ -33,7 +33,14 @@ 
    being included by an external file.  */
 #define GNU_LIBOBJC_COMPILING_LIBOBJC_ITSELF 1
 
+/* When debugging libobjc, add
+
+   #define DEBUG 1
+
+   at the very beginning of a file in libobjc (before including this file) to turn
+   on DEBUG_PRINTF().  */
 #ifdef DEBUG
+#include <stdio.h>
 #define DEBUG_PRINTF(format, args...) printf (format, ## args)
 #else
 #define DEBUG_PRINTF(format, args...)
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 168115)
+++ ChangeLog   (working copy)
@@ -1,5 +1,12 @@ 
 2010-12-21  Nicola Pero  <nicola.pero@meta-innovation.com>
 
+       * objc-private/common.h: When DEBUG is defined, include <stdio.h>.
+       Updated comments.
+       * init.c (__objc_tree_insert_class): Use %p, not %x, when printing
+       a pointer using DEBUG_PRINTF.
+
+2010-12-21  Nicola Pero  <nicola.pero@meta-innovation.com>
+
        PR libobjc/45953
        * selector.c (__sel_register_typed_name): When registering a new
        selector with the same name as an existing one, reuse the existing