[pygobject/gsoc2009: 101/160] Refactor pygi_base_info_repr



commit 306d5f64131358ac877f33899db7b0ace8f05b2d
Author: Simon van der Linden <svdlinden src gnome org>
Date:   Mon Aug 3 16:20:20 2009 +0200

    Refactor pygi_base_info_repr

 gi/pygiinfo.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/gi/pygiinfo.c b/gi/pygiinfo.c
index 7e48616..03ea683 100644
--- a/gi/pygiinfo.c
+++ b/gi/pygiinfo.c
@@ -109,13 +109,8 @@ pygi_base_info_free(PyObject *self)
 static PyObject *
 pygi_base_info_repr(PyGIBaseInfo *self)
 {
-    gchar buf[256];
-
-    g_snprintf(buf, sizeof(buf),
-               "<%s object (%s) at 0x%lx>",
-               self->ob_type->tp_name,
-               g_base_info_get_name(self->info), (long)self);
-    return PyString_FromString(buf);
+    return PyString_FromFormat("<%s object (%s) at 0x%p>",
+            self->ob_type->tp_name, g_base_info_get_name(self->info), (void *)self);
 }
 
 static PyMethodDef _PyGIBaseInfo_methods[];



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