Issue #14090: fix some minor C API problems in default branch (3.3) · Lincoln-developer/cpython@0813168 · GitHub
Skip to content

Commit 0813168

Browse files
committed
Issue python#14090: fix some minor C API problems in default branch (3.3)
1 parent 11cfea9 commit 0813168

8 files changed

Lines changed: 15 additions & 17 deletions

File tree

Doc/c-api/code.rst

Lines changed: 3 additions & 3 deletions

Doc/c-api/conversion.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ The following functions provide locale-independent string to number conversions.
119119
.. versionadded:: 3.1
120120
121121
122-
.. c:function:: char* PyOS_stricmp(char *s1, char *s2)
122+
.. c:function:: int PyOS_stricmp(char *s1, char *s2)
123123
124124
Case insensitive comparison of strings. The function works almost
125125
identically to :c:func:`strcmp` except that it ignores the case.
126126
127127
128-
.. c:function:: char* PyOS_strnicmp(char *s1, char *s2, Py_ssize_t size)
128+
.. c:function:: int PyOS_strnicmp(char *s1, char *s2, Py_ssize_t size)
129129
130130
Case insensitive comparison of strings. The function works almost
131131
identically to :c:func:`strncmp` except that it ignores the case.

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ with sub-interpreters:
646646
:c:func:`PyGILState_Release` on the same thread.
647647
648648
649-
.. c:function:: PyThreadState PyGILState_GetThisThreadState()
649+
.. c:function:: PyThreadState* PyGILState_GetThisThreadState()
650650
651651
Get the current thread state for this thread. May return ``NULL`` if no
652652
GILState API has been used on the current thread. Note that the main thread

Doc/c-api/type.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ Type Objects
5151
modification of the attributes or base classes of the type.
5252
5353
54-
.. c:function:: int PyType_HasFeature(PyObject *o, int feature)
54+
.. c:function:: int PyType_HasFeature(PyTypeObject *o, int feature)
5555
5656
Return true if the type object *o* sets the feature *feature*. Type features
5757
are denoted by single bit flags.
5858
5959
60-
.. c:function:: int PyType_IS_GC(PyObject *o)
60+
.. c:function:: int PyType_IS_GC(PyTypeObject *o)
6161
6262
Return true if the type object includes support for the cycle detector; this
6363
tests the type flag :const:`Py_TPFLAGS_HAVE_GC`.

Doc/c-api/unicode.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ They all return *NULL* or ``-1`` if an exception occurs.
16151615
ISO-8859-1 if it contains non-ASCII characters".
16161616
16171617
1618-
.. c:function:: int PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
1618+
.. c:function:: PyObject* PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
16191619
16201620
Rich compare two unicode strings and return one of the following:
16211621

Doc/c-api/veryhigh.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ the same library that the Python runtime is using.
9595
leaving *closeit* set to ``0`` and *flags* set to *NULL*.
9696
9797
98-
.. c:function:: int PyRun_SimpleFileFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
99-
100-
This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below,
101-
leaving *closeit* set to ``0``.
102-
103-
10498
.. c:function:: int PyRun_SimpleFileEx(FILE *fp, const char *filename, int closeit)
10599
106100
This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below,

Include/pythonrun.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@ PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(
8282
PyParser_SimpleParseFileFlags(FP, S, B, 0)
8383
#endif
8484
PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int,
85-
int);
85+
int);
86+
PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(const char *,
87+
const char *,
88+
int, int);
8689
PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *,
87-
int, int);
90+
int, int);
8891

8992
#ifndef Py_LIMITED_API
9093
PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,

Misc/ACKS

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)