Remove make_cleanup_py_decref and make_cleanup_py_xdecref
authorTom Tromey <tom@tromey.com>
Sun, 20 Nov 2016 18:16:41 +0000 (11:16 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 11 Jan 2017 02:14:08 +0000 (19:14 -0700)
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  <tom@tromey.com>

* 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/ChangeLog
gdb/python/py-utils.c
gdb/python/python-internal.h

index 6bae94a0505e1a1a3f37aa26bf637d18a4d91f88..e3e46323a89827b1449b47894776ce5085fbeb77 100644 (file)
@@ -1,3 +1,10 @@
+2017-01-10  Tom Tromey  <tom@tromey.com>
+
+       * 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.
+
 2017-01-10  Tom Tromey  <tom@tromey.com>
 
        * python/py-framefilter.c (py_mi_print_variables): Use gdbpy_ref.
index 2cbf29eff1f312b04bf6cf1145d22f19c3f70900..e26de41604aa498ab1f560537eae98c64b5c2578 100644 (file)
 #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.
index 1d0ce0b4caa516e6dd130f5d8d5090e00a8fbbd1..908a878095929b1f517c179fc181ab0a62515954 100644 (file)
@@ -498,9 +498,6 @@ int gdbpy_initialize_xmethods (void)
 int gdbpy_initialize_unwind (void)
   CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;
 
-struct cleanup *make_cleanup_py_decref (PyObject *py);
-struct cleanup *make_cleanup_py_xdecref (PyObject *py);
-
 /* Called before entering the Python interpreter to install the
    current language and architecture to be used for Python values.
    Also set the active extension language for GDB so that SIGINT's
This page took 0.028083 seconds and 4 git commands to generate.