summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@gmail.com>2020-02-13 17:34:45 (GMT)
committerGitHub <noreply@github.com>2020-02-13 17:34:45 (GMT)
commit968dcd9e7a4d3aa9aaa1dfca693adf60d6b71ce7 (patch)
tree1165cd893948b60a81132455b1099194ff26507f
parent925dc7fb1d0db85dc137afa4cd14211bf0d67414 (diff)
downloadcpython-968dcd9e7a4d3aa9aaa1dfca693adf60d6b71ce7.zip
cpython-968dcd9e7a4d3aa9aaa1dfca693adf60d6b71ce7.tar.gz
cpython-968dcd9e7a4d3aa9aaa1dfca693adf60d6b71ce7.tar.bz2
bpo-39573: Fix bad copy-paste in Py_SET_SIZE (GH-18496)
-rw-r--r--Doc/c-api/structures.rst2
-rw-r--r--Include/object.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index 75e2383..083c374 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -103,7 +103,7 @@ the definition of all other Python objects.
.. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size)
- Set the object *o* size of *size*.
+ Set the object *o* size to *size*.
.. versionadded:: 3.9
diff --git a/Include/object.h b/Include/object.h
index 68200f7..11539ee 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -133,10 +133,10 @@ static inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type) {
}
#define Py_SET_TYPE(ob, type) _Py_SET_TYPE(_PyObject_CAST(ob), type)
-static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t refcnt) {
- ob->ob_size = refcnt;
+static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size) {
+ ob->ob_size = size;
}
-#define Py_SET_SIZE(ob, refcnt) _Py_SET_SIZE(_PyVarObject_CAST(ob), refcnt)
+#define Py_SET_SIZE(ob, size) _Py_SET_SIZE(_PyVarObject_CAST(ob), size)
/*