Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: gdb/python/py-evtregistry.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/python/py-events.h ('k') | gdb/python/py-evts.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/python/py-evtregistry.c
diff --git a/gdb/python/py-evtregistry.c b/gdb/python/py-evtregistry.c
index 0a2c336d93f4ef86245abc2ed82f5d39ae37e465..0eeb853a9d5af6996835a2ed6aa4114c4d2e3d7d 100644
--- a/gdb/python/py-evtregistry.c
+++ b/gdb/python/py-evtregistry.c
@@ -1,6 +1,6 @@
/* Python interface to inferior thread event registries.
- Copyright (C) 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,7 +23,8 @@
events_object gdb_py_events;
-static PyTypeObject eventregistry_object_type;
+static PyTypeObject eventregistry_object_type
+ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("eventregistry_object");
/* Implementation of EventRegistry.connect () -> NULL.
Add FUNCTION to the list of listeners. */
@@ -88,7 +89,10 @@ create_eventregistry_object (void)
eventregistry_obj->callbacks = PyList_New (0);
if (!eventregistry_obj->callbacks)
- return NULL;
+ {
+ Py_DECREF (eventregistry_obj);
+ return NULL;
+ }
return eventregistry_obj;
}
@@ -97,20 +101,19 @@ static void
evregpy_dealloc (PyObject *self)
{
Py_XDECREF (((eventregistry_object *) self)->callbacks);
- self->ob_type->tp_free (self);
+ Py_TYPE (self)->tp_free (self);
}
/* Initialize the Python event registry code. */
-void
+int
gdbpy_initialize_eventregistry (void)
{
if (PyType_Ready (&eventregistry_object_type) < 0)
- return;
+ return -1;
- Py_INCREF (&eventregistry_object_type);
- PyModule_AddObject (gdb_module, "EventRegistry",
- (PyObject *) &eventregistry_object_type);
+ return gdb_pymodule_addobject (gdb_module, "EventRegistry",
+ (PyObject *) &eventregistry_object_type);
}
/* Retern the number of listeners currently connected to this
@@ -131,8 +134,7 @@ static PyMethodDef eventregistry_object_methods[] =
static PyTypeObject eventregistry_object_type =
{
- PyObject_HEAD_INIT (NULL)
- 0, /* ob_size */
+ PyVarObject_HEAD_INIT (NULL, 0)
"gdb.EventRegistry", /* tp_name */
sizeof (eventregistry_object), /* tp_basicsize */
0, /* tp_itemsize */
« no previous file with comments | « gdb/python/py-events.h ('k') | gdb/python/py-evts.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698