Turn value_incref and value_decref into methods

This changes value_incref and value_decref to be methods of value.
Much of this patch was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey
2023-01-31 14:25:29 -07:00
parent d3824ae14a
commit cdf3de175d
7 changed files with 27 additions and 39 deletions

View File

@ -81,7 +81,7 @@ static void
valpy_clear_value (value_object *self)
{
/* Indicate we are no longer interested in the value object. */
value_decref (self->value);
self->value->decref ();
self->value = nullptr;
Py_CLEAR (self->address);
@ -1806,7 +1806,7 @@ value_to_value_object_no_release (struct value *val)
val_obj = PyObject_New (value_object, &value_object_type);
if (val_obj != NULL)
{
value_incref (val);
val->incref ();
val_obj->value = val;
val_obj->next = nullptr;
val_obj->prev = nullptr;