Index: gdb/python/py-lazy-string.c |
diff --git a/gdb/python/py-lazy-string.c b/gdb/python/py-lazy-string.c |
index 3c908296f2811928d5abad4409b678c74e1f2084..ea193a97f6e67433ecc02f559b03341d06ca061f 100644 |
--- a/gdb/python/py-lazy-string.c |
+++ b/gdb/python/py-lazy-string.c |
@@ -1,6 +1,6 @@ |
/* Python interface to lazy strings. |
- Copyright (C) 2010-2012 Free Software Foundation, Inc. |
+ Copyright (C) 2010-2013 Free Software Foundation, Inc. |
This file is part of GDB. |
@@ -47,7 +47,8 @@ typedef struct { |
struct type *type; |
} lazy_string_object; |
-static PyTypeObject lazy_string_object_type; |
+static PyTypeObject lazy_string_object_type |
+ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("lazy_string_object"); |
static PyObject * |
stpy_get_address (PyObject *self, void *closure) |
@@ -159,13 +160,14 @@ gdbpy_create_lazy_string_object (CORE_ADDR address, long length, |
return (PyObject *) str_obj; |
} |
-void |
+int |
gdbpy_initialize_lazy_string (void) |
{ |
if (PyType_Ready (&lazy_string_object_type) < 0) |
- return; |
+ return -1; |
Py_INCREF (&lazy_string_object_type); |
+ return 0; |
} |
/* Determine whether the printer object pointed to by OBJ is a |
@@ -216,8 +218,7 @@ static PyGetSetDef lazy_string_object_getset[] = { |
}; |
static PyTypeObject lazy_string_object_type = { |
- PyObject_HEAD_INIT (NULL) |
- 0, /*ob_size*/ |
+ PyVarObject_HEAD_INIT (NULL, 0) |
"gdb.LazyString", /*tp_name*/ |
sizeof (lazy_string_object), /*tp_basicsize*/ |
0, /*tp_itemsize*/ |