Make formatting of some return codes conforming to the general style. (#5587)
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index bae49d5..f2564c4 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -273,8 +273,8 @@
the last call to :c:func:`Py_Initialize`. Ideally, this frees all memory
allocated by the Python interpreter. This is a no-op when called for a second
time (without calling :c:func:`Py_Initialize` again first). Normally the
- return value is 0. If there were errors during finalization
- (flushing buffered data), -1 is returned.
+ return value is ``0``. If there were errors during finalization
+ (flushing buffered data), ``-1`` is returned.
This function is provided for a number of reasons. An embedding application
might want to restart Python without having to restart the application itself.
@@ -1018,7 +1018,7 @@
.. c:function:: PY_INT64_T PyInterpreterState_GetID(PyInterpreterState *interp)
Return the interpreter's unique ID. If there was any error in doing
- so then -1 is returned and an error is set.
+ so then ``-1`` is returned and an error is set.
.. versionadded:: 3.7
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index 4f16b57..5b1f386 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -137,7 +137,7 @@
Raise :exc:`OverflowError` if the value of *obj* is out of range for a
:c:type:`long`.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: long PyLong_AsLongAndOverflow(PyObject *obj, int *overflow)
@@ -151,7 +151,7 @@
return ``-1``; otherwise, set *\*overflow* to ``0``. If any other exception
occurs set *\*overflow* to ``0`` and return ``-1`` as usual.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: long long PyLong_AsLongLong(PyObject *obj)
@@ -166,7 +166,7 @@
Raise :exc:`OverflowError` if the value of *obj* is out of range for a
:c:type:`long`.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: long long PyLong_AsLongLongAndOverflow(PyObject *obj, int *overflow)
@@ -180,7 +180,7 @@
and return ``-1``; otherwise, set *\*overflow* to ``0``. If any other
exception occurs set *\*overflow* to ``0`` and return ``-1`` as usual.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. versionadded:: 3.2
@@ -197,7 +197,7 @@
Raise :exc:`OverflowError` if the value of *pylong* is out of range for a
:c:type:`Py_ssize_t`.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: unsigned long PyLong_AsUnsignedLong(PyObject *pylong)
@@ -259,7 +259,7 @@
If the value of *obj* is out of range for an :c:type:`unsigned long`,
return the reduction of that value modulo ``ULONG_MAX + 1``.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: unsigned long long PyLong_AsUnsignedLongLongMask(PyObject *obj)
@@ -271,7 +271,7 @@
If the value of *obj* is out of range for an :c:type:`unsigned long long`,
return the reduction of that value modulo ``PY_ULLONG_MAX + 1``.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: double PyLong_AsDouble(PyObject *pylong)
@@ -282,7 +282,7 @@
Raise :exc:`OverflowError` if the value of *pylong* is out of range for a
:c:type:`double`.
- Returns -1.0 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: void* PyLong_AsVoidPtr(PyObject *pylong)
@@ -292,4 +292,4 @@
is only assured to produce a usable :c:type:`void` pointer for values created
with :c:func:`PyLong_FromVoidPtr`.
- Returns NULL on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns *NULL* on error. Use :c:func:`PyErr_Occurred` to disambiguate.
diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst
index 2af0c46..73ae6db 100644
--- a/Doc/c-api/memory.rst
+++ b/Doc/c-api/memory.rst
@@ -530,7 +530,7 @@
Track an allocated memory block in the :mod:`tracemalloc` module.
- Return 0 on success, return ``-1`` on error (failed to allocate memory to
+ Return ``0`` on success, return ``-1`` on error (failed to allocate memory to
store the trace). Return ``-2`` if tracemalloc is disabled.
If memory block is already tracked, update the existing trace.