X-Git-Url: https://repo.jachan.dev/binutils.git/blobdiff_plain/0b30217134add051e159a192066a1e568ebd837f..256458bc0ed6b39c34afefb60d2b1009603fd62a:/gdb/python/py-lazy-string.c diff --git a/gdb/python/py-lazy-string.c b/gdb/python/py-lazy-string.c index 11048b3e50..ea193a97f6 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) @@ -84,7 +85,7 @@ stpy_get_length (PyObject *self, void *closure) return PyLong_FromLong (self_string->length); } -PyObject * +static PyObject * stpy_get_type (PyObject *self, void *closure) { lazy_string_object *str_obj = (lazy_string_object *) self; @@ -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*/