From 8dbcee674ea4a8daa55f880ad7ade96efca96951 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 20 Nov 2016 11:16:41 -0700 Subject: Remove make_cleanup_py_decref and make_cleanup_py_xdecref make_cleanup_py_decref and make_cleanup_py_xdecref are now unused, so this patch removes themm. Future Python changes should use gdbpy_ref instead. 2017-01-10 Tom Tromey * python/python-internal.h (make_cleanup_py_decref) (make_cleanup_py_xdecref): Don't declare. * python/py-utils.c (py_decref, make_cleanup_py_decref) (py_xdecref, make_cleanup_py_xdecref): Remove. --- gdb/python/py-utils.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'gdb/python/py-utils.c') diff --git a/gdb/python/py-utils.c b/gdb/python/py-utils.c index 2cbf29eff1f..e26de41604a 100644 --- a/gdb/python/py-utils.c +++ b/gdb/python/py-utils.c @@ -23,48 +23,6 @@ #include "python-internal.h" #include "py-ref.h" -/* This is a cleanup function which decrements the refcount on a - Python object. */ - -static void -py_decref (void *p) -{ - PyObject *py = (PyObject *) p; - - Py_DECREF (py); -} - -/* Return a new cleanup which will decrement the Python object's - refcount when run. */ - -struct cleanup * -make_cleanup_py_decref (PyObject *py) -{ - return make_cleanup (py_decref, (void *) py); -} - -/* This is a cleanup function which decrements the refcount on a - Python object. This function accounts appropriately for NULL - references. */ - -static void -py_xdecref (void *p) -{ - PyObject *py = (PyObject *) p; - - Py_XDECREF (py); -} - -/* Return a new cleanup which will decrement the Python object's - refcount when run. Account for and operate on NULL references - correctly. */ - -struct cleanup * -make_cleanup_py_xdecref (PyObject *py) -{ - return make_cleanup (py_xdecref, py); -} - /* Converts a Python 8-bit string to a unicode string object. Assumes the 8-bit string is in the host charset. If an error occurs during conversion, returns NULL with a python exception set. -- cgit v1.2.3-65-gdbad