]> granicus.if.org Git - python/commitdiff
Issue #14090: fix some minor C API problems in default branch (3.3)
authorEli Bendersky <eliben@gmail.com>
Sun, 3 Jun 2012 05:07:47 +0000 (08:07 +0300)
committerEli Bendersky <eliben@gmail.com>
Sun, 3 Jun 2012 05:07:47 +0000 (08:07 +0300)
Doc/c-api/code.rst
Doc/c-api/conversion.rst
Doc/c-api/init.rst
Doc/c-api/type.rst
Doc/c-api/unicode.rst
Doc/c-api/veryhigh.rst
Include/pythonrun.h
Misc/ACKS

index 6932bb1964617e178677f919f4a226c2d1f77d07..57e8072d99c80967f6324dff77be4055a4a5a80d 100644 (file)
@@ -31,11 +31,11 @@ bound into a function.
 
    Return true if *co* is a :class:`code` object
 
-.. c:function:: int PyCode_GetNumFree(PyObject *co)
+.. c:function:: int PyCode_GetNumFree(PyCodeObject *co)
 
    Return the number of free variables in *co*.
 
-.. c:function:: PyCodeObject *PyCode_New(int argcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, int firstlineno, PyObject *lnotab)
+.. c:function:: PyCodeObjectPyCode_New(int argcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, int firstlineno, PyObject *lnotab)
 
    Return a new code object.  If you need a dummy code object to
    create a frame, use :c:func:`PyCode_NewEmpty` instead.  Calling
@@ -43,7 +43,7 @@ bound into a function.
    version since the definition of the bytecode changes often.
 
 
-.. c:function:: int PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno)
+.. c:function:: PyCodeObject* PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno)
 
    Return a new empty code object with the specified filename,
    function name, and first line number.  It is illegal to
index dfc0a3aace32e833a8b92b894d4765b7987a7fb3..9578f984fd8e7bed2227caadac1f98bb91363d42 100644 (file)
@@ -119,13 +119,13 @@ The following functions provide locale-independent string to number conversions.
    .. versionadded:: 3.1
 
 
-.. c:function:: char* PyOS_stricmp(char *s1, char *s2)
+.. c:function:: int PyOS_stricmp(char *s1, char *s2)
 
    Case insensitive comparison of strings. The function works almost
    identically to :c:func:`strcmp` except that it ignores the case.
 
 
-.. c:function:: char* PyOS_strnicmp(char *s1, char *s2, Py_ssize_t  size)
+.. c:function:: int PyOS_strnicmp(char *s1, char *s2, Py_ssize_t  size)
 
    Case insensitive comparison of strings. The function works almost
    identically to :c:func:`strncmp` except that it ignores the case.
index 7507e3b52dc4babd557b627d1eec92409fdb219c..95ff4ee285d02b8e1ad0db0719037244cb632b53 100644 (file)
@@ -646,7 +646,7 @@ with sub-interpreters:
    :c:func:`PyGILState_Release` on the same thread.
 
 
-.. c:function:: PyThreadState PyGILState_GetThisThreadState()
+.. c:function:: PyThreadState* PyGILState_GetThisThreadState()
 
    Get the current thread state for this thread.  May return ``NULL`` if no
    GILState API has been used on the current thread.  Note that the main thread
index ce39e4dbac79aa982c4f39c172c88179bdb9f3e3..6f9c7a84a1736df5ab1c1c56523832d041ebbe52 100644 (file)
@@ -51,13 +51,13 @@ Type Objects
    modification of the attributes or base classes of the type.
 
 
-.. c:function:: int PyType_HasFeature(PyObject *o, int feature)
+.. c:function:: int PyType_HasFeature(PyTypeObject *o, int feature)
 
    Return true if the type object *o* sets the feature *feature*.  Type features
    are denoted by single bit flags.
 
 
-.. c:function:: int PyType_IS_GC(PyObject *o)
+.. c:function:: int PyType_IS_GC(PyTypeObject *o)
 
    Return true if the type object includes support for the cycle detector; this
    tests the type flag :const:`Py_TPFLAGS_HAVE_GC`.
index a74a73d350bdd21256ae790fb548c2c018963e36..fb7ba6735a9f7631a8e2a9facc236eed8618c53a 100644 (file)
@@ -1615,7 +1615,7 @@ They all return *NULL* or ``-1`` if an exception occurs.
    ISO-8859-1 if it contains non-ASCII characters".
 
 
-.. c:function:: int PyUnicode_RichCompare(PyObject *left,  PyObject *right,  int op)
+.. c:function:: PyObject* PyUnicode_RichCompare(PyObject *left,  PyObject *right,  int op)
 
    Rich compare two unicode strings and return one of the following:
 
index 41cdd6b0a40374fe78d0effd70b8c2bab1e2c003..499eb3e07d4ba0e105f44087e101d97b258a7c55 100644 (file)
@@ -95,12 +95,6 @@ the same library that the Python runtime is using.
    leaving *closeit* set to ``0`` and *flags* set to *NULL*.
 
 
-.. c:function:: int PyRun_SimpleFileFlags(FILE *fp, const char *filename, PyCompilerFlags *flags)
-
-   This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below,
-   leaving *closeit* set to ``0``.
-
-
 .. c:function:: int PyRun_SimpleFileEx(FILE *fp, const char *filename, int closeit)
 
    This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below,
index 48e39a4522bcb3ed98fd51e9e043c38d81100d86..e5620ee32616a946413a8803a4a964b596be0748 100644 (file)
@@ -82,9 +82,12 @@ PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(
     PyParser_SimpleParseFileFlags(FP, S, B, 0)
 #endif
 PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int,
-                                                          int);
+                                                           int);
+PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(const char *,
+                                                                   const char *,
+                                                                   int, int);
 PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *,
-                                                        int, int);
+                                                         int, int);
 
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,
index 0fbaa44c222e14af68a34391dbcbff3395c21c1b..9c2483c17c18655a58dabc39bc123ff58d207b14 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -989,6 +989,7 @@ Frank Stajano
 Joel Stanley
 Oliver Steele
 Greg Stein
+Baruch Sterin
 Chris Stern
 Alex Stewart
 Victor Stinner