summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-06-21 13:26:28 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-06-21 13:26:28 (GMT)
commit1670af6c33beb4851934b481ed8dfde3baf139a2 (patch)
treea6c8f716eb4f6fd5e52976a87d41c5b980126810
parent18d69e0edc4c7497f92126dc105444f5ebeb39d6 (diff)
downloadcpython-1670af6c33beb4851934b481ed8dfde3baf139a2.zip
cpython-1670af6c33beb4851934b481ed8dfde3baf139a2.tar.gz
cpython-1670af6c33beb4851934b481ed8dfde3baf139a2.tar.bz2
Added the const qualifier for char* argument of Py_EnterRecursiveCall().
-rw-r--r--Doc/c-api/exceptions.rst2
-rw-r--r--Include/ceval.h2
-rw-r--r--Python/ceval.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index 6f8f243..65249e1 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -493,7 +493,7 @@ level, both in the core and in extension modules. They are needed if the
recursive code does not necessarily invoke Python code (which tracks its
recursion depth automatically).
-.. c:function:: int Py_EnterRecursiveCall(char *where)
+.. c:function:: int Py_EnterRecursiveCall(const char *where)
Marks a point where a recursive C-level call is about to be performed.
diff --git a/Include/ceval.h b/Include/ceval.h
index 0e8bd2a..3735f00 100644
--- a/Include/ceval.h
+++ b/Include/ceval.h
@@ -50,7 +50,7 @@ PyAPI_FUNC(int) Py_GetRecursionLimit(void);
_Py_CheckRecursiveCall(where))
#define Py_LeaveRecursiveCall() \
(--PyThreadState_GET()->recursion_depth)
-PyAPI_FUNC(int) _Py_CheckRecursiveCall(char *where);
+PyAPI_FUNC(int) _Py_CheckRecursiveCall(const char *where);
PyAPI_DATA(int) _Py_CheckRecursionLimit;
#ifdef USE_STACKCHECK
# define _Py_MakeRecCheck(x) (++(x) > --_Py_CheckRecursionLimit)
diff --git a/Python/ceval.c b/Python/ceval.c
index 115d278..fa9e7e0 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -615,7 +615,7 @@ Py_SetRecursionLimit(int new_limit)
to guarantee that _Py_CheckRecursiveCall() is regularly called.
Without USE_STACKCHECK, there is no need for this. */
int
-_Py_CheckRecursiveCall(char *where)
+_Py_CheckRecursiveCall(const char *where)
{
PyThreadState *tstate = PyThreadState_GET();