diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/tools/python | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python')
47 files changed, 605 insertions, 605 deletions
diff --git a/contrib/tools/python/pyconfig.inc b/contrib/tools/python/pyconfig.inc index 01da7d4566..ed28034d14 100644 --- a/contrib/tools/python/pyconfig.inc +++ b/contrib/tools/python/pyconfig.inc @@ -36,10 +36,10 @@ IF (NOT WIN32) -DUNQUOTED_PYTHONPATH=:plat-darwin -DUNQUOTED_PLATFORM=darwin ) - LDFLAGS( - -framework SystemConfiguration - -framework CoreFoundation - ) + LDFLAGS( + -framework SystemConfiguration + -framework CoreFoundation + ) ENDIF () ENDIF () diff --git a/contrib/tools/python/src/Include/Python.h b/contrib/tools/python/src/Include/Python.h index 7199224e2d..d244733f9c 100644 --- a/contrib/tools/python/src/Include/Python.h +++ b/contrib/tools/python/src/Include/Python.h @@ -47,9 +47,9 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAVE_CRYPT_H -#include <crypt.h> -#endif +#ifdef HAVE_CRYPT_H +#include <crypt.h> +#endif /* For size_t? */ #ifdef HAVE_STDDEF_H diff --git a/contrib/tools/python/src/Include/abstract.h b/contrib/tools/python/src/Include/abstract.h index 7818e45304..d98722e079 100644 --- a/contrib/tools/python/src/Include/abstract.h +++ b/contrib/tools/python/src/Include/abstract.h @@ -94,7 +94,7 @@ Proposal numeric, sequence, and mapping. Each protocol consists of a collection of related operations. If an operation that is not provided by a particular type is invoked, then a standard exception, - NotImplementedError is raised with an operation name as an argument. + NotImplementedError is raised with an operation name as an argument. In addition, for convenience this interface defines a set of constructors for building objects of built-in types. This is needed so new objects can be returned from C functions that otherwise treat @@ -191,8 +191,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ int PyObject_SetAttrString(PyObject *o, char *attr_name, PyObject *v); Set the value of the attribute named attr_name, for object o, - to the value v. Raise an exception and return -1 on failure; return 0 on - success. This is the equivalent of the Python statement o.attr_name=v. + to the value v. Raise an exception and return -1 on failure; return 0 on + success. This is the equivalent of the Python statement o.attr_name=v. */ @@ -201,8 +201,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v); Set the value of the attribute named attr_name, for object o, - to the value v. Raise an exception and return -1 on failure; return 0 on - success. This is the equivalent of the Python statement o.attr_name=v. + to the value v. Raise an exception and return -1 on failure; return 0 on + success. This is the equivalent of the Python statement o.attr_name=v. */ @@ -453,9 +453,9 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ PyAPI_FUNC(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v); /* - Map the object key to the value v. Raise an exception and return -1 - on failure; return 0 on success. This is the equivalent of the Python - statement o[key]=v. + Map the object key to the value v. Raise an exception and return -1 + on failure; return 0 on success. This is the equivalent of the Python + statement o[key]=v. */ PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, char *key); @@ -1102,9 +1102,9 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ PyAPI_FUNC(int) PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v); /* - Assign object v to the ith element of o. Raise an exception and return - -1 on failure; return 0 on success. This is the equivalent of the - Python statement o[i]=v. + Assign object v to the ith element of o. Raise an exception and return + -1 on failure; return 0 on success. This is the equivalent of the + Python statement o[i]=v. */ PyAPI_FUNC(int) PySequence_DelItem(PyObject *o, Py_ssize_t i); @@ -1120,8 +1120,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ /* Assign the sequence object, v, to the slice in sequence - object, o, from i1 to i2. Raise an exception and return - -1 on failure; return 0 on success. This is the + object, o, from i1 to i2. Raise an exception and return + -1 on failure; return 0 on success. This is the equivalent of the Python statement: o[i1:i2]=v. */ @@ -1149,7 +1149,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m); /* - Return the sequence, o, as a list, unless it's already a + Return the sequence, o, as a list, unless it's already a tuple or list. Use PySequence_Fast_GET_ITEM to access the members of this list, and PySequence_Fast_GET_SIZE to get its length. diff --git a/contrib/tools/python/src/Include/cStringIO.h b/contrib/tools/python/src/Include/cStringIO.h index 973a471086..df9b493a19 100644 --- a/contrib/tools/python/src/Include/cStringIO.h +++ b/contrib/tools/python/src/Include/cStringIO.h @@ -7,7 +7,7 @@ extern "C" { This header provides access to cStringIO objects from C. Functions are provided for calling cStringIO objects and - macros are provided for testing whether you have cStringIO + macros are provided for testing whether you have cStringIO objects. Before calling any of the functions or macros, you must initialize @@ -28,7 +28,7 @@ extern "C" { /* Basic functions to manipulate cStringIO objects from C */ static struct PycStringIO_CAPI { - + /* Read a string from an input object. If the last argument is -1, the remainder will be read. */ diff --git a/contrib/tools/python/src/Include/ceval.h b/contrib/tools/python/src/Include/ceval.h index f46160158e..50beed2a5a 100644 --- a/contrib/tools/python/src/Include/ceval.h +++ b/contrib/tools/python/src/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(const 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) @@ -145,7 +145,7 @@ PyAPI_FUNC(void) PyEval_ReInitThreads(void); #endif /* !WITH_THREAD */ PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); -PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *); +PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *); #ifdef __cplusplus diff --git a/contrib/tools/python/src/Include/code.h b/contrib/tools/python/src/Include/code.h index 16aee701e0..312fa8e8e6 100644 --- a/contrib/tools/python/src/Include/code.h +++ b/contrib/tools/python/src/Include/code.h @@ -70,7 +70,7 @@ PyAPI_DATA(PyTypeObject) PyCode_Type; /* Public interface */ PyAPI_FUNC(PyCodeObject *) PyCode_New( int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *, - PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *); + PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *); /* same as struct above */ /* Creates a new empty code object with the specified source location. */ @@ -98,17 +98,17 @@ typedef struct _addr_pair { PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds); -/* Create a comparable key used to compare constants taking in account the - * object type. It is used to make sure types are not coerced (e.g., float and - * complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms - * - * Return (type(obj), obj, ...): a tuple with variable size (at least 2 items) - * depending on the type and the value. The type is the first item to not - * compare bytes and str which can raise a BytesWarning exception. */ -PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj); - +/* Create a comparable key used to compare constants taking in account the + * object type. It is used to make sure types are not coerced (e.g., float and + * complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms + * + * Return (type(obj), obj, ...): a tuple with variable size (at least 2 items) + * depending on the type and the value. The type is the first item to not + * compare bytes and str which can raise a BytesWarning exception. */ +PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj); + PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, - PyObject *names, PyObject *lnotab); + PyObject *names, PyObject *lnotab); #ifdef __cplusplus } diff --git a/contrib/tools/python/src/Include/codecs.h b/contrib/tools/python/src/Include/codecs.h index 851bc9f107..4596ee1c3b 100644 --- a/contrib/tools/python/src/Include/codecs.h +++ b/contrib/tools/python/src/Include/codecs.h @@ -81,51 +81,51 @@ PyAPI_FUNC(PyObject *) PyCodec_Decode( const char *errors ); -/* Text codec specific encoding and decoding API. - - Checks the encoding against a list of codecs which do not - implement a unicode<->bytes encoding before attempting the - operation. - - Please note that these APIs are internal and should not - be used in Python C extensions. - - XXX (ncoghlan): should we make these, or something like them, public - in Python 3.5+? - - */ -PyAPI_FUNC(PyObject *) _PyCodec_LookupTextEncoding( - const char *encoding, - const char *alternate_command - ); - -PyAPI_FUNC(PyObject *) _PyCodec_EncodeText( - PyObject *object, - const char *encoding, - const char *errors - ); - -PyAPI_FUNC(PyObject *) _PyCodec_DecodeText( - PyObject *object, - const char *encoding, - const char *errors - ); - -/* These two aren't actually text encoding specific, but _io.TextIOWrapper - * is the only current API consumer. - */ -PyAPI_FUNC(PyObject *) _PyCodecInfo_GetIncrementalDecoder( - PyObject *codec_info, - const char *errors - ); - -PyAPI_FUNC(PyObject *) _PyCodecInfo_GetIncrementalEncoder( - PyObject *codec_info, - const char *errors - ); - - - +/* Text codec specific encoding and decoding API. + + Checks the encoding against a list of codecs which do not + implement a unicode<->bytes encoding before attempting the + operation. + + Please note that these APIs are internal and should not + be used in Python C extensions. + + XXX (ncoghlan): should we make these, or something like them, public + in Python 3.5+? + + */ +PyAPI_FUNC(PyObject *) _PyCodec_LookupTextEncoding( + const char *encoding, + const char *alternate_command + ); + +PyAPI_FUNC(PyObject *) _PyCodec_EncodeText( + PyObject *object, + const char *encoding, + const char *errors + ); + +PyAPI_FUNC(PyObject *) _PyCodec_DecodeText( + PyObject *object, + const char *encoding, + const char *errors + ); + +/* These two aren't actually text encoding specific, but _io.TextIOWrapper + * is the only current API consumer. + */ +PyAPI_FUNC(PyObject *) _PyCodecInfo_GetIncrementalDecoder( + PyObject *codec_info, + const char *errors + ); + +PyAPI_FUNC(PyObject *) _PyCodecInfo_GetIncrementalEncoder( + PyObject *codec_info, + const char *errors + ); + + + /* --- Codec Lookup APIs -------------------------------------------------- All APIs return a codec object with incremented refcount and are @@ -146,14 +146,14 @@ PyAPI_FUNC(PyObject *) PyCodec_Decoder( const char *encoding ); -/* Get an IncrementalEncoder object for the given encoding. */ +/* Get an IncrementalEncoder object for the given encoding. */ PyAPI_FUNC(PyObject *) PyCodec_IncrementalEncoder( const char *encoding, const char *errors ); -/* Get an IncrementalDecoder object function for the given encoding. */ +/* Get an IncrementalDecoder object function for the given encoding. */ PyAPI_FUNC(PyObject *) PyCodec_IncrementalDecoder( const char *encoding, diff --git a/contrib/tools/python/src/Include/datetime.h b/contrib/tools/python/src/Include/datetime.h index c0e7ffd00a..5d58d3caaf 100644 --- a/contrib/tools/python/src/Include/datetime.h +++ b/contrib/tools/python/src/Include/datetime.h @@ -42,7 +42,7 @@ typedef struct typedef struct { - PyObject_HEAD /* a pure abstract base class */ + PyObject_HEAD /* a pure abstract base class */ } PyDateTime_TZInfo; diff --git a/contrib/tools/python/src/Include/dictobject.h b/contrib/tools/python/src/Include/dictobject.h index 5a1e9feea1..039049317a 100644 --- a/contrib/tools/python/src/Include/dictobject.h +++ b/contrib/tools/python/src/Include/dictobject.h @@ -108,12 +108,12 @@ PyAPI_DATA(PyTypeObject) PyDictValues_Type; PyAPI_FUNC(PyObject *) PyDict_New(void); PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key); -PyAPI_FUNC(PyObject *) _PyDict_GetItemWithError(PyObject *mp, PyObject *key); +PyAPI_FUNC(PyObject *) _PyDict_GetItemWithError(PyObject *mp, PyObject *key); PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item); PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key); -PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key, - int (*predicate)(PyObject *value)); - +PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key, + int (*predicate)(PyObject *value)); + PyAPI_FUNC(void) PyDict_Clear(PyObject *mp); PyAPI_FUNC(int) PyDict_Next( PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value); diff --git a/contrib/tools/python/src/Include/errcode.h b/contrib/tools/python/src/Include/errcode.h index 5c5a0f7fa3..b7358969b4 100644 --- a/contrib/tools/python/src/Include/errcode.h +++ b/contrib/tools/python/src/Include/errcode.h @@ -29,7 +29,7 @@ extern "C" { #define E_EOFS 23 /* EOF in triple-quoted string */ #define E_EOLS 24 /* EOL in single-quoted string */ #define E_LINECONT 25 /* Unexpected characters after a line continuation */ -#define E_IO 26 /* I/O error */ +#define E_IO 26 /* I/O error */ #ifdef __cplusplus } diff --git a/contrib/tools/python/src/Include/frameobject.h b/contrib/tools/python/src/Include/frameobject.h index 34603794c6..784f5086c8 100644 --- a/contrib/tools/python/src/Include/frameobject.h +++ b/contrib/tools/python/src/Include/frameobject.h @@ -54,9 +54,9 @@ typedef struct _frame { PyAPI_DATA(PyTypeObject) PyFrame_Type; -#define PyFrame_Check(op) (Py_TYPE(op) == &PyFrame_Type) +#define PyFrame_Check(op) (Py_TYPE(op) == &PyFrame_Type) #define PyFrame_IsRestricted(f) \ - ((f)->f_tstate && (f)->f_builtins != (f)->f_tstate->interp->builtins) + ((f)->f_tstate && (f)->f_builtins != (f)->f_tstate->interp->builtins) PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, PyObject *, PyObject *); diff --git a/contrib/tools/python/src/Include/grammar.h b/contrib/tools/python/src/Include/grammar.h index decf2e6126..3f1ecc66d1 100644 --- a/contrib/tools/python/src/Include/grammar.h +++ b/contrib/tools/python/src/Include/grammar.h @@ -69,7 +69,7 @@ typedef struct { /* FUNCTIONS */ grammar *newgrammar(int start); -void freegrammar(grammar *g); +void freegrammar(grammar *g); dfa *adddfa(grammar *g, int type, char *name); int addstate(dfa *d); void addarc(dfa *d, int from, int to, int lbl); diff --git a/contrib/tools/python/src/Include/import.h b/contrib/tools/python/src/Include/import.h index 89f51b55d5..f98e2307e1 100644 --- a/contrib/tools/python/src/Include/import.h +++ b/contrib/tools/python/src/Include/import.h @@ -40,8 +40,8 @@ PyAPI_FUNC(struct filedescr *) _PyImport_FindModule( PyAPI_FUNC(int) _PyImport_IsScript(struct filedescr *); PyAPI_FUNC(void) _PyImport_ReInitLock(void); -PyAPI_FUNC(PyObject *) _PyImport_FindExtension(char *, char *); -PyAPI_FUNC(PyObject *) _PyImport_FixupExtension(char *, char *); +PyAPI_FUNC(PyObject *) _PyImport_FindExtension(char *, char *); +PyAPI_FUNC(PyObject *) _PyImport_FixupExtension(char *, char *); struct _inittab { char *name; diff --git a/contrib/tools/python/src/Include/intobject.h b/contrib/tools/python/src/Include/intobject.h index d1985748b3..82b41b52e8 100644 --- a/contrib/tools/python/src/Include/intobject.h +++ b/contrib/tools/python/src/Include/intobject.h @@ -28,12 +28,12 @@ typedef struct { PyAPI_DATA(PyTypeObject) PyInt_Type; #define PyInt_Check(op) \ - PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_INT_SUBCLASS) -#define PyInt_CheckExact(op) (Py_TYPE(op) == &PyInt_Type) - -#define _PyAnyInt_Check(op) (PyInt_Check(op) || PyLong_Check(op)) -#define _PyAnyInt_CheckExact(op) (PyInt_CheckExact(op) || PyLong_CheckExact(op)) + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_INT_SUBCLASS) +#define PyInt_CheckExact(op) (Py_TYPE(op) == &PyInt_Type) +#define _PyAnyInt_Check(op) (PyInt_Check(op) || PyLong_Check(op)) +#define _PyAnyInt_CheckExact(op) (PyInt_CheckExact(op) || PyLong_CheckExact(op)) + PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int); #ifdef Py_USING_UNICODE PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, Py_ssize_t, int); @@ -43,7 +43,7 @@ PyAPI_FUNC(PyObject *) PyInt_FromSize_t(size_t); PyAPI_FUNC(PyObject *) PyInt_FromSsize_t(Py_ssize_t); PyAPI_FUNC(long) PyInt_AsLong(PyObject *); PyAPI_FUNC(Py_ssize_t) PyInt_AsSsize_t(PyObject *); -PyAPI_FUNC(int) _PyInt_AsInt(PyObject *); +PyAPI_FUNC(int) _PyInt_AsInt(PyObject *); PyAPI_FUNC(unsigned long) PyInt_AsUnsignedLongMask(PyObject *); #ifdef HAVE_LONG_LONG PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); diff --git a/contrib/tools/python/src/Include/listobject.h b/contrib/tools/python/src/Include/listobject.h index f19b1c5e56..f104429dcd 100644 --- a/contrib/tools/python/src/Include/listobject.h +++ b/contrib/tools/python/src/Include/listobject.h @@ -2,7 +2,7 @@ /* List object interface */ /* -Another generally useful object type is a list of object pointers. +Another generally useful object type is a list of object pointers. This is a mutable type: the list items can be changed, and items can be added or removed. Out-of-range indices or non-list objects are ignored. @@ -41,7 +41,7 @@ typedef struct { PyAPI_DATA(PyTypeObject) PyList_Type; #define PyList_Check(op) \ - PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS) + PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS) #define PyList_CheckExact(op) (Py_TYPE(op) == &PyList_Type) PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size); diff --git a/contrib/tools/python/src/Include/longobject.h b/contrib/tools/python/src/Include/longobject.h index 4e33ff2bb1..e801fc25a0 100644 --- a/contrib/tools/python/src/Include/longobject.h +++ b/contrib/tools/python/src/Include/longobject.h @@ -25,7 +25,7 @@ PyAPI_FUNC(long) PyLong_AsLongAndOverflow(PyObject *, int *); PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *); PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *); PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *); -PyAPI_FUNC(int) _PyLong_AsInt(PyObject *); +PyAPI_FUNC(int) _PyLong_AsInt(PyObject *); PyAPI_FUNC(PyObject *) PyLong_GetInfo(void); /* For use by intobject.c only */ @@ -110,7 +110,7 @@ PyAPI_FUNC(PyObject *) _PyLong_FromByteArray( example, if is_signed is 0 and there are more digits in the v than fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of being large enough to hold a sign bit. OverflowError is set in this - case, but bytes holds the least-significant n bytes of the true value. + case, but bytes holds the least-significant n bytes of the true value. */ PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v, unsigned char* bytes, size_t n, diff --git a/contrib/tools/python/src/Include/memoryobject.h b/contrib/tools/python/src/Include/memoryobject.h index e6a5c4506b..ae19fe1549 100644 --- a/contrib/tools/python/src/Include/memoryobject.h +++ b/contrib/tools/python/src/Include/memoryobject.h @@ -33,7 +33,7 @@ PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base, original buffer if a copy must be made. If buffertype is PyBUF_WRITE and the buffer is not contiguous an error will be raised. In this circumstance, the user can use - PyBUF_SHADOW to ensure that a writable temporary + PyBUF_SHADOW to ensure that a writable temporary contiguous buffer is returned. The contents of this contiguous buffer will be copied back into the original object after the memoryview object is deleted as long as diff --git a/contrib/tools/python/src/Include/node.h b/contrib/tools/python/src/Include/node.h index 517c3dc43e..fa88940286 100644 --- a/contrib/tools/python/src/Include/node.h +++ b/contrib/tools/python/src/Include/node.h @@ -20,7 +20,7 @@ PyAPI_FUNC(node *) PyNode_New(int type); PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, char *str, int lineno, int col_offset); PyAPI_FUNC(void) PyNode_Free(node *n); -PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); +PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); /* Node access functions */ #define NCH(n) ((n)->n_nchildren) diff --git a/contrib/tools/python/src/Include/object.h b/contrib/tools/python/src/Include/object.h index 807b24188a..1494950906 100644 --- a/contrib/tools/python/src/Include/object.h +++ b/contrib/tools/python/src/Include/object.h @@ -527,9 +527,9 @@ PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret; PyAPI_DATA(int) _Py_HashSecret_Initialized; #endif -/* Helper for passing objects to printf and the like. - Leaks refcounts. Don't use it! -*/ +/* Helper for passing objects to printf and the like. + Leaks refcounts. Don't use it! +*/ #define PyObject_REPR(obj) PyString_AS_STRING(PyObject_Repr(obj)) /* Flag bits for printing: */ @@ -778,7 +778,7 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force); } while (0) /* Safely decref `op` and set `op` to NULL, especially useful in tp_clear - * and tp_dealloc implementations. + * and tp_dealloc implementations. * * Note that "the obvious" code can be deadly: * @@ -824,39 +824,39 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force); #define Py_XINCREF(op) do { if ((op) == NULL) ; else Py_INCREF(op); } while (0) #define Py_XDECREF(op) do { if ((op) == NULL) ; else Py_DECREF(op); } while (0) -/* Safely decref `op` and set `op` to `op2`. - * - * As in case of Py_CLEAR "the obvious" code can be deadly: - * - * Py_DECREF(op); - * op = op2; - * - * The safe way is: - * - * Py_SETREF(op, op2); - * - * That arranges to set `op` to `op2` _before_ decref'ing, so that any code - * triggered as a side-effect of `op` getting torn down no longer believes - * `op` points to a valid object. - * - * Py_XSETREF is a variant of Py_SETREF that uses Py_XDECREF instead of - * Py_DECREF. - */ - -#define Py_SETREF(op, op2) \ - do { \ - PyObject *_py_tmp = (PyObject *)(op); \ - (op) = (op2); \ - Py_DECREF(_py_tmp); \ - } while (0) - -#define Py_XSETREF(op, op2) \ - do { \ - PyObject *_py_tmp = (PyObject *)(op); \ - (op) = (op2); \ - Py_XDECREF(_py_tmp); \ - } while (0) - +/* Safely decref `op` and set `op` to `op2`. + * + * As in case of Py_CLEAR "the obvious" code can be deadly: + * + * Py_DECREF(op); + * op = op2; + * + * The safe way is: + * + * Py_SETREF(op, op2); + * + * That arranges to set `op` to `op2` _before_ decref'ing, so that any code + * triggered as a side-effect of `op` getting torn down no longer believes + * `op` points to a valid object. + * + * Py_XSETREF is a variant of Py_SETREF that uses Py_XDECREF instead of + * Py_DECREF. + */ + +#define Py_SETREF(op, op2) \ + do { \ + PyObject *_py_tmp = (PyObject *)(op); \ + (op) = (op2); \ + Py_DECREF(_py_tmp); \ + } while (0) + +#define Py_XSETREF(op, op2) \ + do { \ + PyObject *_py_tmp = (PyObject *)(op); \ + (op) = (op2); \ + Py_XDECREF(_py_tmp); \ + } while (0) + /* These are provided as conveniences to Python runtime embedders, so that they can have object code that is not dependent on Python compilation flags. @@ -1006,39 +1006,39 @@ chain of N deallocations is broken into N / PyTrash_UNWIND_LEVEL pieces, with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL. */ -/* This is the old private API, invoked by the macros before 2.7.4. - Kept for binary compatibility of extensions. */ +/* This is the old private API, invoked by the macros before 2.7.4. + Kept for binary compatibility of extensions. */ PyAPI_FUNC(void) _PyTrash_deposit_object(PyObject*); PyAPI_FUNC(void) _PyTrash_destroy_chain(void); PyAPI_DATA(int) _PyTrash_delete_nesting; PyAPI_DATA(PyObject *) _PyTrash_delete_later; -/* The new thread-safe private API, invoked by the macros below. */ -PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyObject*); -PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void); - +/* The new thread-safe private API, invoked by the macros below. */ +PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyObject*); +PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void); + #define PyTrash_UNWIND_LEVEL 50 -/* Note the workaround for when the thread state is NULL (issue #17703) */ +/* Note the workaround for when the thread state is NULL (issue #17703) */ #define Py_TRASHCAN_SAFE_BEGIN(op) \ - do { \ - PyThreadState *_tstate = PyThreadState_GET(); \ - if (!_tstate || \ - _tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \ - if (_tstate) \ - ++_tstate->trash_delete_nesting; - /* The body of the deallocator is here. */ + do { \ + PyThreadState *_tstate = PyThreadState_GET(); \ + if (!_tstate || \ + _tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \ + if (_tstate) \ + ++_tstate->trash_delete_nesting; + /* The body of the deallocator is here. */ #define Py_TRASHCAN_SAFE_END(op) \ - if (_tstate) { \ - --_tstate->trash_delete_nesting; \ - if (_tstate->trash_delete_later \ - && _tstate->trash_delete_nesting <= 0) \ - _PyTrash_thread_destroy_chain(); \ - } \ - } \ - else \ - _PyTrash_thread_deposit_object((PyObject*)op); \ - } while (0); + if (_tstate) { \ + --_tstate->trash_delete_nesting; \ + if (_tstate->trash_delete_later \ + && _tstate->trash_delete_nesting <= 0) \ + _PyTrash_thread_destroy_chain(); \ + } \ + } \ + else \ + _PyTrash_thread_deposit_object((PyObject*)op); \ + } while (0); #ifdef __cplusplus } diff --git a/contrib/tools/python/src/Include/objimpl.h b/contrib/tools/python/src/Include/objimpl.h index c02c47ed10..c7c611d212 100644 --- a/contrib/tools/python/src/Include/objimpl.h +++ b/contrib/tools/python/src/Include/objimpl.h @@ -56,7 +56,7 @@ must use the platform malloc heap(s), or shared memory, or C++ local storage or operator new), you must first allocate the object with your custom allocator, then pass its pointer to PyObject_{Init, InitVar} for filling in its Python- specific fields: reference count, type pointer, possibly others. You should -be aware that Python has no control over these objects because they don't +be aware that Python has no control over these objects because they don't cooperate with the Python memory manager. Such objects may not be eligible for automatic garbage collection and you have to make sure that they are released accordingly whenever their destructor gets called (cf. the specific @@ -100,7 +100,7 @@ PyAPI_FUNC(void) PyObject_Free(void *); /* Macros */ -#if defined(WITH_PYMALLOC) && defined(PYMALLOC_DEBUG) +#if defined(WITH_PYMALLOC) && defined(PYMALLOC_DEBUG) PyAPI_FUNC(void *) _PyObject_DebugMalloc(size_t nbytes); PyAPI_FUNC(void *) _PyObject_DebugRealloc(void *p, size_t nbytes); PyAPI_FUNC(void) _PyObject_DebugFree(void *p); @@ -114,16 +114,16 @@ PyAPI_FUNC(void) _PyObject_DebugCheckAddressApi(char api, const void *p); PyAPI_FUNC(void *) _PyMem_DebugMalloc(size_t nbytes); PyAPI_FUNC(void *) _PyMem_DebugRealloc(void *p, size_t nbytes); PyAPI_FUNC(void) _PyMem_DebugFree(void *p); -#endif +#endif #define PyObject_MALLOC PyObject_Malloc #define PyObject_REALLOC PyObject_Realloc #define PyObject_FREE PyObject_Free -#define PyObject_Del PyObject_Free -#define PyObject_DEL PyObject_Free - -#ifdef PYMALLOC_DEBUG /* WITH_PYMALLOC && PYMALLOC_DEBUG */ -PyAPI_FUNC(void) _PyObject_DebugMallocStats(void); +#define PyObject_Del PyObject_Free +#define PyObject_DEL PyObject_Free + +#ifdef PYMALLOC_DEBUG /* WITH_PYMALLOC && PYMALLOC_DEBUG */ +PyAPI_FUNC(void) _PyObject_DebugMallocStats(void); #endif /* for source compatibility with 2.2 */ @@ -236,20 +236,20 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); /* for source compatibility with 2.2 */ #define _PyObject_GC_Del PyObject_GC_Del -/* - * Former over-aligned definition of PyGC_Head, used to compute the size of the - * padding for the new version below. - */ -union _gc_head; -union _gc_head_old { - struct { - union _gc_head_old *gc_next; - union _gc_head_old *gc_prev; - Py_ssize_t gc_refs; - } gc; - long double dummy; -}; - +/* + * Former over-aligned definition of PyGC_Head, used to compute the size of the + * padding for the new version below. + */ +union _gc_head; +union _gc_head_old { + struct { + union _gc_head_old *gc_next; + union _gc_head_old *gc_prev; + Py_ssize_t gc_refs; + } gc; + long double dummy; +}; + /* GC information is stored BEFORE the object structure. */ typedef union _gc_head { struct { @@ -257,8 +257,8 @@ typedef union _gc_head { union _gc_head *gc_prev; Py_ssize_t gc_refs; } gc; - double dummy; /* Force at least 8-byte alignment. */ - char dummy_padding[sizeof(union _gc_head_old)]; + double dummy; /* Force at least 8-byte alignment. */ + char dummy_padding[sizeof(union _gc_head_old)]; } PyGC_Head; extern PyGC_Head *_PyGC_generation0; diff --git a/contrib/tools/python/src/Include/opcode.h b/contrib/tools/python/src/Include/opcode.h index 9ed548729e..3e4c7bd29b 100644 --- a/contrib/tools/python/src/Include/opcode.h +++ b/contrib/tools/python/src/Include/opcode.h @@ -37,21 +37,21 @@ extern "C" { #define SLICE 30 /* Also uses 31-33 */ -#define SLICE_1 31 -#define SLICE_2 32 -#define SLICE_3 33 +#define SLICE_1 31 +#define SLICE_2 32 +#define SLICE_3 33 #define STORE_SLICE 40 /* Also uses 41-43 */ -#define STORE_SLICE_1 41 -#define STORE_SLICE_2 42 -#define STORE_SLICE_3 43 +#define STORE_SLICE_1 41 +#define STORE_SLICE_2 42 +#define STORE_SLICE_3 43 #define DELETE_SLICE 50 /* Also uses 51-53 */ -#define DELETE_SLICE_1 51 -#define DELETE_SLICE_2 52 -#define DELETE_SLICE_3 53 +#define DELETE_SLICE_1 51 +#define DELETE_SLICE_2 52 +#define DELETE_SLICE_3 53 #define STORE_MAP 54 #define INPLACE_ADD 55 diff --git a/contrib/tools/python/src/Include/osdefs.h b/contrib/tools/python/src/Include/osdefs.h index 77af923754..0bd3fcdaef 100644 --- a/contrib/tools/python/src/Include/osdefs.h +++ b/contrib/tools/python/src/Include/osdefs.h @@ -36,14 +36,14 @@ extern "C" { #endif /* Max pathname length */ -#ifdef __hpux -#include <sys/param.h> -#include <limits.h> -#ifndef PATH_MAX -#define PATH_MAX MAXPATHLEN -#endif -#endif - +#ifdef __hpux +#include <sys/param.h> +#include <limits.h> +#ifndef PATH_MAX +#define PATH_MAX MAXPATHLEN +#endif +#endif + #ifndef MAXPATHLEN #if defined(PATH_MAX) && PATH_MAX > 1024 #define MAXPATHLEN PATH_MAX diff --git a/contrib/tools/python/src/Include/patchlevel.h b/contrib/tools/python/src/Include/patchlevel.h index b12d901685..e71b818175 100644 --- a/contrib/tools/python/src/Include/patchlevel.h +++ b/contrib/tools/python/src/Include/patchlevel.h @@ -6,7 +6,7 @@ defined(PY_MAJOR_VERSION). When the major or minor version changes, the VERSION variable in - configure.ac must also be changed. + configure.ac must also be changed. There is also (independent) API version information in modsupport.h. */ @@ -22,12 +22,12 @@ /*--start constants--*/ #define PY_MAJOR_VERSION 2 #define PY_MINOR_VERSION 7 -#define PY_MICRO_VERSION 16 +#define PY_MICRO_VERSION 16 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL #define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.7.16" +#define PY_VERSION "2.7.16" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository). Empty diff --git a/contrib/tools/python/src/Include/pgenheaders.h b/contrib/tools/python/src/Include/pgenheaders.h index 4843de6c02..b53aef65bf 100644 --- a/contrib/tools/python/src/Include/pgenheaders.h +++ b/contrib/tools/python/src/Include/pgenheaders.h @@ -23,7 +23,7 @@ PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) #define delbitset _Py_delbitset #define dumptree _Py_dumptree #define findlabel _Py_findlabel -#define freegrammar _Py_freegrammar +#define freegrammar _Py_freegrammar #define mergebitset _Py_mergebitset #define meta_grammar _Py_meta_grammar #define newbitset _Py_newbitset diff --git a/contrib/tools/python/src/Include/py_curses.h b/contrib/tools/python/src/Include/py_curses.h index eb77e35d8b..caa04ad6db 100644 --- a/contrib/tools/python/src/Include/py_curses.h +++ b/contrib/tools/python/src/Include/py_curses.h @@ -7,7 +7,7 @@ ** On Mac OS X 10.2 [n]curses.h and stdlib.h use different guards ** against multiple definition of wchar_t. */ -#ifdef _BSD_WCHAR_T_DEFINED_ +#ifdef _BSD_WCHAR_T_DEFINED_ #define _WCHAR_T #endif #endif /* __APPLE__ */ @@ -17,7 +17,7 @@ ** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards ** against multiple definition of wchar_t and wint_t. */ -#ifdef _XOPEN_SOURCE_EXTENDED +#ifdef _XOPEN_SOURCE_EXTENDED #ifndef __FreeBSD_version #include <osreldate.h> #endif @@ -39,13 +39,13 @@ #endif #endif -#if !defined(HAVE_CURSES_IS_PAD) && defined(WINDOW_HAS_FLAGS) -/* The following definition is necessary for ncurses 5.7; without it, - some of [n]curses.h set NCURSES_OPAQUE to 1, and then Python - can't get at the WINDOW flags field. */ -#define NCURSES_OPAQUE 0 -#endif - +#if !defined(HAVE_CURSES_IS_PAD) && defined(WINDOW_HAS_FLAGS) +/* The following definition is necessary for ncurses 5.7; without it, + some of [n]curses.h set NCURSES_OPAQUE to 1, and then Python + can't get at the WINDOW flags field. */ +#define NCURSES_OPAQUE 0 +#endif + #ifdef HAVE_NCURSES_H #include <ncurses.h> #else @@ -54,13 +54,13 @@ #ifdef HAVE_NCURSES_H /* configure was checking <curses.h>, but we will - use <ncurses.h>, which has some or all these features. */ -#if !defined(WINDOW_HAS_FLAGS) && !(NCURSES_OPAQUE+0) + use <ncurses.h>, which has some or all these features. */ +#if !defined(WINDOW_HAS_FLAGS) && !(NCURSES_OPAQUE+0) #define WINDOW_HAS_FLAGS 1 #endif -#if !defined(HAVE_CURSES_IS_PAD) && NCURSES_VERSION_PATCH+0 >= 20090906 -#define HAVE_CURSES_IS_PAD 1 -#endif +#if !defined(HAVE_CURSES_IS_PAD) && NCURSES_VERSION_PATCH+0 >= 20090906 +#define HAVE_CURSES_IS_PAD 1 +#endif #ifndef MVWDELCH_IS_EXPRESSION #define MVWDELCH_IS_EXPRESSION 1 #endif @@ -75,11 +75,11 @@ extern "C" { /* Type declarations */ typedef struct { - PyObject_HEAD - WINDOW *win; + PyObject_HEAD + WINDOW *win; } PyCursesWindowObject; -#define PyCursesWindow_Check(v) (Py_TYPE(v) == &PyCursesWindow_Type) +#define PyCursesWindow_Check(v) (Py_TYPE(v) == &PyCursesWindow_Type) #define PyCurses_CAPSULE_NAME "_curses._C_API" diff --git a/contrib/tools/python/src/Include/pyconfig.linux.h b/contrib/tools/python/src/Include/pyconfig.linux.h index 9c5d2035f4..48b25406e2 100644 --- a/contrib/tools/python/src/Include/pyconfig.linux.h +++ b/contrib/tools/python/src/Include/pyconfig.linux.h @@ -55,8 +55,8 @@ #define HAVE_FTRUNCATE 1 #define HAVE_GAI_STRERROR 1 #define HAVE_GAMMA 1 -#if defined(__x86_64__) || defined(__i386__) -# define HAVE_GCC_ASM_FOR_X87 1 +#if defined(__x86_64__) || defined(__i386__) +# define HAVE_GCC_ASM_FOR_X87 1 #endif #define HAVE_GETADDRINFO 1 #define HAVE_GETCWD 1 @@ -231,37 +231,37 @@ #define SHLIB_EXT ".so" #if defined(_64_) -# define SIZEOF_FPOS_T 16 -# define SIZEOF_LONG 8 -# define SIZEOF_PTHREAD_T 8 -# if !defined(SIZEOF_SIZE_T) -# define SIZEOF_SIZE_T 8 -# endif -# define SIZEOF_TIME_T 8 -# define SIZEOF_UINTPTR_T 8 -# define SIZEOF_VOID_P 8 +# define SIZEOF_FPOS_T 16 +# define SIZEOF_LONG 8 +# define SIZEOF_PTHREAD_T 8 +# if !defined(SIZEOF_SIZE_T) +# define SIZEOF_SIZE_T 8 +# endif +# define SIZEOF_TIME_T 8 +# define SIZEOF_UINTPTR_T 8 +# define SIZEOF_VOID_P 8 #else -# if defined(_arm32_) -# define SIZEOF_FPOS_T 16 -# else -# define SIZEOF_FPOS_T 8 -# endif -# define SIZEOF_LONG 4 -# define SIZEOF_PTHREAD_T 4 -# if !defined(SIZEOF_SIZE_T) -# define SIZEOF_SIZE_T 4 -# endif -# define SIZEOF_TIME_T 4 -# define SIZEOF_UINTPTR_T 4 -# define SIZEOF_VOID_P 4 +# if defined(_arm32_) +# define SIZEOF_FPOS_T 16 +# else +# define SIZEOF_FPOS_T 8 +# endif +# define SIZEOF_LONG 4 +# define SIZEOF_PTHREAD_T 4 +# if !defined(SIZEOF_SIZE_T) +# define SIZEOF_SIZE_T 4 +# endif +# define SIZEOF_TIME_T 4 +# define SIZEOF_UINTPTR_T 4 +# define SIZEOF_VOID_P 4 #endif #define SIZEOF_DOUBLE 8 -#if defined(_arm32_) -# define SIZEOF_LONG_DOUBLE 8 -#else -# define SIZEOF_LONG_DOUBLE 16 -#endif +#if defined(_arm32_) +# define SIZEOF_LONG_DOUBLE 8 +#else +# define SIZEOF_LONG_DOUBLE 16 +#endif #define SIZEOF_FLOAT 4 #define SIZEOF_INT 4 #define SIZEOF_LONG_LONG 8 @@ -277,14 +277,14 @@ #define TIME_WITH_SYS_TIME 1 #ifndef _ALL_SOURCE -# define _ALL_SOURCE 1 +# define _ALL_SOURCE 1 #endif #if defined(_64_) -# if defined(__aarch64__) || defined(__powerpc__) -# else -# define VA_LIST_IS_ARRAY 1 -# endif +# if defined(__aarch64__) || defined(__powerpc__) +# else +# define VA_LIST_IS_ARRAY 1 +# endif #endif #define WITH_DOC_STRINGS 1 #define WITH_PYMALLOC 1 @@ -294,12 +294,12 @@ #define _GNU_SOURCE 1 #define _LARGEFILE_SOURCE 1 #if !defined(_POSIX_C_SOURCE) -# define _POSIX_C_SOURCE 200112L +# define _POSIX_C_SOURCE 200112L #endif #define __BSD_VISIBLE 1 #ifndef HAVE_VALGRIND -# undef WITH_VALGRIND +# undef WITH_VALGRIND #endif #endif /*Py_PYCONFIG_H*/ diff --git a/contrib/tools/python/src/Include/pyerrors.h b/contrib/tools/python/src/Include/pyerrors.h index 51134ef7b2..095594959e 100644 --- a/contrib/tools/python/src/Include/pyerrors.h +++ b/contrib/tools/python/src/Include/pyerrors.h @@ -91,7 +91,7 @@ PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *); PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *); PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**); -PyAPI_FUNC(void) _PyErr_ReplaceException(PyObject *, PyObject *, PyObject *); +PyAPI_FUNC(void) _PyErr_ReplaceException(PyObject *, PyObject *, PyObject *); /* */ diff --git a/contrib/tools/python/src/Include/pyexpat.h b/contrib/tools/python/src/Include/pyexpat.h index 3fc5fa54da..f4d7b2d4c2 100644 --- a/contrib/tools/python/src/Include/pyexpat.h +++ b/contrib/tools/python/src/Include/pyexpat.h @@ -3,7 +3,7 @@ /* note: you must import expat.h before importing this module! */ -#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1" +#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1" #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI" struct PyExpat_CAPI @@ -43,8 +43,8 @@ struct PyExpat_CAPI XML_Parser parser, XML_UnknownEncodingHandler handler, void *encodingHandlerData); void (*SetUserData)(XML_Parser parser, void *userData); - /* might be none for expat < 2.1.0 */ - int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt); + /* might be none for expat < 2.1.0 */ + int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt); /* always add new stuff to the end! */ }; diff --git a/contrib/tools/python/src/Include/pyfpe.h b/contrib/tools/python/src/Include/pyfpe.h index f9a15e622b..943e3e267a 100644 --- a/contrib/tools/python/src/Include/pyfpe.h +++ b/contrib/tools/python/src/Include/pyfpe.h @@ -4,8 +4,8 @@ extern "C" { #endif /* - --------------------------------------------------------------------- - / Copyright (c) 1996. \ + --------------------------------------------------------------------- + / Copyright (c) 1996. \ | The Regents of the University of California. | | All rights reserved. | | | @@ -37,18 +37,18 @@ extern "C" { | opinions of authors expressed herein do not necessarily state or | | reflect those of the United States Government or the University | | of California, and shall not be used for advertising or product | - \ endorsement purposes. / - --------------------------------------------------------------------- + \ endorsement purposes. / + --------------------------------------------------------------------- */ /* * Define macros for handling SIGFPE. * Lee Busby, LLNL, November, 1996 * busby1@llnl.gov - * + * ********************************************* * Overview of the system for handling SIGFPE: - * + * * This file (Include/pyfpe.h) defines a couple of "wrapper" macros for * insertion into your Python C code of choice. Their proper use is * discussed below. The file Python/pyfpe.c defines a pair of global @@ -59,33 +59,33 @@ extern "C" { * named fpectl. This module is standard in every respect. It can be loaded * either statically or dynamically as you choose, and like any other * Python module, has no effect until you import it. - * + * * In the general case, there are three steps toward handling SIGFPE in any * Python code: - * + * * 1) Add the *_PROTECT macros to your C code as required to protect * dangerous floating point sections. - * + * * 2) Turn on the inclusion of the code by adding the ``--with-fpectl'' * flag at the time you run configure. If the fpectl or other modules * which use the *_PROTECT macros are to be dynamically loaded, be * sure they are compiled with WANT_SIGFPE_HANDLER defined. - * + * * 3) When python is built and running, import fpectl, and execute * fpectl.turnon_sigfpe(). This sets up the signal handler and enables * generation of SIGFPE whenever an exception occurs. From this point * on, any properly trapped SIGFPE should result in the Python * FloatingPointError exception. - * + * * Step 1 has been done already for the Python kernel code, and should be * done soon for the NumPy array package. Step 2 is usually done once at * python install time. Python's behavior with respect to SIGFPE is not * changed unless you also do step 3. Thus you can control this new * facility at compile time, or run time, or both. - * - ******************************** + * + ******************************** * Using the macros in your code: - * + * * static PyObject *foobar(PyObject *self,PyObject *args) * { * .... @@ -94,17 +94,17 @@ extern "C" { * PyFPE_END_PROTECT(result) * .... * } - * + * * If a floating point error occurs in dangerous_op, foobar returns 0 (NULL), * after setting the associated value of the FloatingPointError exception to * "Error in foobar". ``Dangerous_op'' can be a single operation, or a block * of code, function calls, or any combination, so long as no alternate * return is possible before the PyFPE_END_PROTECT macro is reached. - * + * * The macros can only be used in a function context where an error return * can be recognized as signaling a Python exception. (Generally, most * functions that return a PyObject * will qualify.) - * + * * Guido's original design suggestion for PyFPE_START_PROTECT and * PyFPE_END_PROTECT had them open and close a local block, with a locally * defined jmp_buf and jmp_buf pointer. This would allow recursive nesting @@ -112,17 +112,17 @@ extern "C" { * variables need to be declared with the "volatile" type qualifier to keep * setjmp from corrupting their values. Some current implementations seem * to be more restrictive. For example, the HPUX man page for setjmp says - * + * * Upon the return from a setjmp() call caused by a longjmp(), the * values of any non-static local variables belonging to the routine * from which setjmp() was called are undefined. Code which depends on * such values is not guaranteed to be portable. - * + * * I therefore decided on a more limited form of nesting, using a counter * variable (PyFPE_counter) to keep track of any recursion. If an exception * occurs in an ``inner'' pair of macros, the return will apparently * come from the outermost level. - * + * */ #ifdef WANT_SIGFPE_HANDLER @@ -146,14 +146,14 @@ if (!PyFPE_counter++ && setjmp(PyFPE_jbuf)) { \ * this statement so that it gets executed *before* the unsafe expression * which we're trying to protect. That pretty well messes things up, * of course. - * + * * If the expression(s) you're trying to protect don't happen to return a * value, you will need to manufacture a dummy result just to preserve the * correct ordering of statements. Note that the macro passes the address * of its argument (so you need to give it something which is addressable). * If your expression returns multiple results, pass the last such result * to PyFPE_END_PROTECT. - * + * * Note that PyFPE_dummy returns a double, which is cast to int. * This seeming insanity is to tickle the Floating Point Unit (FPU). * If an exception has occurred in a preceding floating point operation, diff --git a/contrib/tools/python/src/Include/pymacconfig.h b/contrib/tools/python/src/Include/pymacconfig.h index 9dde11bd58..936dbad7c4 100644 --- a/contrib/tools/python/src/Include/pymacconfig.h +++ b/contrib/tools/python/src/Include/pymacconfig.h @@ -63,10 +63,10 @@ # if defined(__LP64__) /* MacOSX 10.4 (the first release to support 64-bit code * at all) only supports 64-bit in the UNIX layer. - * Therefore suppress the toolbox-glue in 64-bit mode. + * Therefore suppress the toolbox-glue in 64-bit mode. */ - /* In 64-bit mode setpgrp always has no arguments, in 32-bit + /* In 64-bit mode setpgrp always has no arguments, in 32-bit * mode that depends on the compilation environment */ # undef SETPGRP_HAVE_ARG @@ -91,7 +91,7 @@ * * Specifically: OSX 10.4 has limited supported for '%zd', while * 10.5 has full support for '%zd'. A binary built on 10.5 won't - * work properly on 10.4 unless we suppress the definition + * work properly on 10.4 unless we suppress the definition * of PY_FORMAT_SIZE_T */ #undef PY_FORMAT_SIZE_T diff --git a/contrib/tools/python/src/Include/pymactoolbox.h b/contrib/tools/python/src/Include/pymactoolbox.h index 6e48ca36a2..77b86a77e4 100644 --- a/contrib/tools/python/src/Include/pymactoolbox.h +++ b/contrib/tools/python/src/Include/pymactoolbox.h @@ -9,24 +9,24 @@ #include <Carbon/Carbon.h> -/* -** Issue #27806: Workaround for gcc 4.x which does not have _has_include. -*/ -#ifndef __has_include -#define __has_include(x) 0 -#endif -/* Workaround */ - -#if __has_include(<Availability.h>) -#include <Availability.h> -#define APPLE_SUPPORTS_QUICKTIME (__MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !__LP64__ -#else -#define APPLE_SUPPORTS_QUICKTIME !__LP64__ -#endif - -#if APPLE_SUPPORTS_QUICKTIME +/* +** Issue #27806: Workaround for gcc 4.x which does not have _has_include. +*/ +#ifndef __has_include +#define __has_include(x) 0 +#endif +/* Workaround */ + +#if __has_include(<Availability.h>) +#include <Availability.h> +#define APPLE_SUPPORTS_QUICKTIME (__MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !__LP64__ +#else +#define APPLE_SUPPORTS_QUICKTIME !__LP64__ +#endif + +#if APPLE_SUPPORTS_QUICKTIME #include <QuickTime/QuickTime.h> -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* ** Helper routines for error codes and such. @@ -36,10 +36,10 @@ extern PyObject *PyMac_OSErrException; /* Exception for OSErr */ PyObject *PyMac_GetOSErrException(void); /* Initialize & return it */ PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */ PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern OSErr PyMac_GetFullPathname(FSSpec *, char *, int); /* convert fsspec->path */ -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* ** These conversion routines are defined in mactoolboxglue.c itself. @@ -124,54 +124,54 @@ extern PyObject *CmpInstObj_New(ComponentInstance); extern int CmpInstObj_Convert(PyObject *, ComponentInstance *); /* Ctl exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *CtlObj_New(ControlHandle); extern int CtlObj_Convert(PyObject *, ControlHandle *); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* Dlg exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *DlgObj_New(DialogPtr); extern int DlgObj_Convert(PyObject *, DialogPtr *); extern PyObject *DlgObj_WhichDialog(DialogPtr); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* Drag exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *DragObj_New(DragReference); extern int DragObj_Convert(PyObject *, DragReference *); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* List exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *ListObj_New(ListHandle); extern int ListObj_Convert(PyObject *, ListHandle *); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* Menu exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *MenuObj_New(MenuHandle); extern int MenuObj_Convert(PyObject *, MenuHandle *); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* Qd exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *GrafObj_New(GrafPtr); extern int GrafObj_Convert(PyObject *, GrafPtr *); extern PyObject *BMObj_New(BitMapPtr); extern int BMObj_Convert(PyObject *, BitMapPtr *); extern PyObject *QdRGB_New(RGBColor *); extern int QdRGB_Convert(PyObject *, RGBColor *); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* Qdoffs exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *GWorldObj_New(GWorldPtr); extern int GWorldObj_Convert(PyObject *, GWorldPtr *); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* Qt exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *TrackObj_New(Track); extern int TrackObj_Convert(PyObject *, Track *); extern PyObject *MovieObj_New(Movie); @@ -184,7 +184,7 @@ extern PyObject *UserDataObj_New(UserData); extern int UserDataObj_Convert(PyObject *, UserData *); extern PyObject *MediaObj_New(Media); extern int MediaObj_Convert(PyObject *, Media *); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* Res exports */ extern PyObject *ResObj_New(Handle); @@ -193,17 +193,17 @@ extern PyObject *OptResObj_New(Handle); extern int OptResObj_Convert(PyObject *, Handle *); /* TE exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *TEObj_New(TEHandle); extern int TEObj_Convert(PyObject *, TEHandle *); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* Win exports */ -#if APPLE_SUPPORTS_QUICKTIME +#if APPLE_SUPPORTS_QUICKTIME extern PyObject *WinObj_New(WindowPtr); extern int WinObj_Convert(PyObject *, WindowPtr *); extern PyObject *WinObj_WhichWindow(WindowPtr); -#endif /* APPLE_SUPPORTS_QUICKTIME */ +#endif /* APPLE_SUPPORTS_QUICKTIME */ /* CF exports */ extern PyObject *CFObj_New(CFTypeRef); diff --git a/contrib/tools/python/src/Include/pymath.h b/contrib/tools/python/src/Include/pymath.h index b234f973f5..123c0db555 100644 --- a/contrib/tools/python/src/Include/pymath.h +++ b/contrib/tools/python/src/Include/pymath.h @@ -43,7 +43,7 @@ extern int finite(double); extern double copysign(double, double); #endif -/* High precision definition of pi and e (Euler) +/* High precision definition of pi and e (Euler) * The values are taken from libc6's math.h. */ #ifndef Py_MATH_PIl @@ -152,29 +152,29 @@ PyAPI_FUNC(void) _Py_set_387controlword(unsigned short); * doesn't support NaNs. */ #if !defined(Py_NAN) && !defined(Py_NO_NAN) -#if !defined(__INTEL_COMPILER) - #define Py_NAN (Py_HUGE_VAL * 0.) -#else /* __INTEL_COMPILER */ - #if defined(ICC_NAN_STRICT) - #pragma float_control(push) - #pragma float_control(precise, on) - #pragma float_control(except, on) - #if defined(_MSC_VER) - __declspec(noinline) - #else /* Linux */ - __attribute__((noinline)) - #endif /* _MSC_VER */ - static double __icc_nan() - { - return sqrt(-1.0); - } - #pragma float_control (pop) - #define Py_NAN __icc_nan() - #else /* ICC_NAN_RELAXED as default for Intel Compiler */ - static union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f}; - #define Py_NAN (__nan_store.__icc_nan) - #endif /* ICC_NAN_STRICT */ -#endif /* __INTEL_COMPILER */ +#if !defined(__INTEL_COMPILER) + #define Py_NAN (Py_HUGE_VAL * 0.) +#else /* __INTEL_COMPILER */ + #if defined(ICC_NAN_STRICT) + #pragma float_control(push) + #pragma float_control(precise, on) + #pragma float_control(except, on) + #if defined(_MSC_VER) + __declspec(noinline) + #else /* Linux */ + __attribute__((noinline)) + #endif /* _MSC_VER */ + static double __icc_nan() + { + return sqrt(-1.0); + } + #pragma float_control (pop) + #define Py_NAN __icc_nan() + #else /* ICC_NAN_RELAXED as default for Intel Compiler */ + static union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f}; + #define Py_NAN (__nan_store.__icc_nan) + #endif /* ICC_NAN_STRICT */ +#endif /* __INTEL_COMPILER */ #endif /* Py_OVERFLOWED(X) diff --git a/contrib/tools/python/src/Include/pymem.h b/contrib/tools/python/src/Include/pymem.h index 0d7e48afab..c8aadff1a8 100644 --- a/contrib/tools/python/src/Include/pymem.h +++ b/contrib/tools/python/src/Include/pymem.h @@ -11,11 +11,11 @@ extern "C" { #endif -PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size); -PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size); -PyAPI_FUNC(void) PyMem_RawFree(void *ptr); - - +PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size); +PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size); +PyAPI_FUNC(void) PyMem_RawFree(void *ptr); + + /* BEWARE: Each interface exports both functions and macros. Extension modules should @@ -54,13 +54,13 @@ PyAPI_FUNC(void) PyMem_RawFree(void *ptr); performed on failure (no exception is set, no warning is printed, etc). */ -PyAPI_FUNC(void *) PyMem_Malloc(size_t size); -PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size); -PyAPI_FUNC(void) PyMem_Free(void *ptr); - -PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str); -PyAPI_FUNC(char *) _PyMem_Strdup(const char *str); +PyAPI_FUNC(void *) PyMem_Malloc(size_t size); +PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size); +PyAPI_FUNC(void) PyMem_Free(void *ptr); +PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str); +PyAPI_FUNC(char *) _PyMem_Strdup(const char *str); + /* Starting from Python 1.6, the wrappers Py_{Malloc,Realloc,Free} are no longer supported. They used to call PyErr_NoMemory() on failure. */ @@ -72,9 +72,9 @@ PyAPI_FUNC(char *) _PyMem_Strdup(const char *str); pymalloc. To solve these problems, allocate an extra byte. */ /* Returns NULL to indicate error if a negative size or size larger than Py_ssize_t can represent is supplied. Helps prevents security holes. */ -#define PyMem_MALLOC(n) PyMem_Malloc(n) -#define PyMem_REALLOC(p, n) PyMem_Realloc(p, n) -#define PyMem_FREE(p) PyMem_Free(p) +#define PyMem_MALLOC(n) PyMem_Malloc(n) +#define PyMem_REALLOC(p, n) PyMem_Realloc(p, n) +#define PyMem_FREE(p) PyMem_Free(p) /* * Type-oriented memory interface @@ -112,67 +112,67 @@ PyAPI_FUNC(char *) _PyMem_Strdup(const char *str); #define PyMem_Del PyMem_Free #define PyMem_DEL PyMem_FREE -typedef enum { - /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */ - PYMEM_DOMAIN_RAW, - - /* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */ - PYMEM_DOMAIN_MEM, - - /* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */ - PYMEM_DOMAIN_OBJ -} PyMemAllocatorDomain; - -typedef struct { - /* user context passed as the first argument to the 3 functions */ - void *ctx; - - /* allocate a memory block */ - void* (*malloc) (void *ctx, size_t size); - - /* allocate or resize a memory block */ - void* (*realloc) (void *ctx, void *ptr, size_t new_size); - - /* release a memory block */ - void (*free) (void *ctx, void *ptr); -} PyMemAllocator; - -/* Get the memory block allocator of the specified domain. */ -PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain, - PyMemAllocator *allocator); - -/* Set the memory block allocator of the specified domain. - - The new allocator must return a distinct non-NULL pointer when requesting - zero bytes. - - For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL - is not held when the allocator is called. - - If the new allocator is not a hook (don't call the previous allocator), the - PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks - on top on the new allocator. */ -PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain, - PyMemAllocator *allocator); - -/* Setup hooks to detect bugs in the following Python memory allocator - functions: - - - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() - - PyMem_Malloc(), PyMem_Realloc(), PyMem_Free() - - PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() - - Newly allocated memory is filled with the byte 0xCB, freed memory is filled - with the byte 0xDB. Additionnal checks: - - - detect API violations, ex: PyObject_Free() called on a buffer allocated - by PyMem_Malloc() - - detect write before the start of the buffer (buffer underflow) - - detect write after the end of the buffer (buffer overflow) - - The function does nothing if Python is not compiled is debug mode. */ -PyAPI_FUNC(void) PyMem_SetupDebugHooks(void); - +typedef enum { + /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */ + PYMEM_DOMAIN_RAW, + + /* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */ + PYMEM_DOMAIN_MEM, + + /* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */ + PYMEM_DOMAIN_OBJ +} PyMemAllocatorDomain; + +typedef struct { + /* user context passed as the first argument to the 3 functions */ + void *ctx; + + /* allocate a memory block */ + void* (*malloc) (void *ctx, size_t size); + + /* allocate or resize a memory block */ + void* (*realloc) (void *ctx, void *ptr, size_t new_size); + + /* release a memory block */ + void (*free) (void *ctx, void *ptr); +} PyMemAllocator; + +/* Get the memory block allocator of the specified domain. */ +PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain, + PyMemAllocator *allocator); + +/* Set the memory block allocator of the specified domain. + + The new allocator must return a distinct non-NULL pointer when requesting + zero bytes. + + For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL + is not held when the allocator is called. + + If the new allocator is not a hook (don't call the previous allocator), the + PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks + on top on the new allocator. */ +PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain, + PyMemAllocator *allocator); + +/* Setup hooks to detect bugs in the following Python memory allocator + functions: + + - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() + - PyMem_Malloc(), PyMem_Realloc(), PyMem_Free() + - PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() + + Newly allocated memory is filled with the byte 0xCB, freed memory is filled + with the byte 0xDB. Additionnal checks: + + - detect API violations, ex: PyObject_Free() called on a buffer allocated + by PyMem_Malloc() + - detect write before the start of the buffer (buffer underflow) + - detect write after the end of the buffer (buffer overflow) + + The function does nothing if Python is not compiled is debug mode. */ +PyAPI_FUNC(void) PyMem_SetupDebugHooks(void); + #ifdef __cplusplus } #endif diff --git a/contrib/tools/python/src/Include/pyport.h b/contrib/tools/python/src/Include/pyport.h index ad2ff5929a..495659eb31 100644 --- a/contrib/tools/python/src/Include/pyport.h +++ b/contrib/tools/python/src/Include/pyport.h @@ -93,11 +93,11 @@ Used in: PY_LONG_LONG * uint32_t to be such a type unless stdint.h or inttypes.h defines uint32_t. * However, it doesn't set HAVE_UINT32_T, so we do that here. */ -#ifdef uint32_t -#define HAVE_UINT32_T 1 -#endif - -#ifdef HAVE_UINT32_T +#ifdef uint32_t +#define HAVE_UINT32_T 1 +#endif + +#ifdef HAVE_UINT32_T #ifndef PY_UINT32_T #define PY_UINT32_T uint32_t #endif @@ -106,32 +106,32 @@ Used in: PY_LONG_LONG /* Macros for a 64-bit unsigned integer type; used for type 'twodigits' in the * long integer implementation, when 30-bit digits are enabled. */ -#ifdef uint64_t -#define HAVE_UINT64_T 1 -#endif - -#ifdef HAVE_UINT64_T +#ifdef uint64_t +#define HAVE_UINT64_T 1 +#endif + +#ifdef HAVE_UINT64_T #ifndef PY_UINT64_T #define PY_UINT64_T uint64_t #endif #endif /* Signed variants of the above */ -#ifdef int32_t -#define HAVE_INT32_T 1 -#endif - -#ifdef HAVE_INT32_T +#ifdef int32_t +#define HAVE_INT32_T 1 +#endif + +#ifdef HAVE_INT32_T #ifndef PY_INT32_T #define PY_INT32_T int32_t #endif #endif - -#ifdef int64_t -#define HAVE_INT64_T 1 -#endif - -#ifdef HAVE_INT64_T + +#ifdef int64_t +#define HAVE_INT64_T 1 +#endif + +#ifdef HAVE_INT64_T #ifndef PY_INT64_T #define PY_INT64_T int64_t #endif @@ -265,7 +265,7 @@ typedef Py_intptr_t Py_ssize_t; * for platforms that support that. * * If PY_LOCAL_AGGRESSIVE is defined before python.h is included, more - * "aggressive" inlining/optimization is enabled for the entire module. This + * "aggressive" inlining/optimization is enabled for the entire module. This * may lead to code bloat, and may slow things down for those reasons. It may * also lead to errors, if the code relies on pointer aliasing. Use with * care. @@ -562,30 +562,30 @@ extern "C" { _Py_set_387controlword(old_387controlword) #endif -/* get and set x87 control word for VisualStudio/x86 */ -#if defined(_MSC_VER) && !defined(_WIN64) /* x87 not supported in 64-bit */ -#define HAVE_PY_SET_53BIT_PRECISION 1 -#define _Py_SET_53BIT_PRECISION_HEADER \ - unsigned int old_387controlword, new_387controlword, out_387controlword -/* We use the __control87_2 function to set only the x87 control word. - The SSE control word is unaffected. */ -#define _Py_SET_53BIT_PRECISION_START \ - do { \ - __control87_2(0, 0, &old_387controlword, NULL); \ - new_387controlword = \ - (old_387controlword & ~(_MCW_PC | _MCW_RC)) | (_PC_53 | _RC_NEAR); \ - if (new_387controlword != old_387controlword) \ - __control87_2(new_387controlword, _MCW_PC | _MCW_RC, \ - &out_387controlword, NULL); \ - } while (0) -#define _Py_SET_53BIT_PRECISION_END \ - do { \ - if (new_387controlword != old_387controlword) \ - __control87_2(old_387controlword, _MCW_PC | _MCW_RC, \ - &out_387controlword, NULL); \ - } while (0) -#endif - +/* get and set x87 control word for VisualStudio/x86 */ +#if defined(_MSC_VER) && !defined(_WIN64) /* x87 not supported in 64-bit */ +#define HAVE_PY_SET_53BIT_PRECISION 1 +#define _Py_SET_53BIT_PRECISION_HEADER \ + unsigned int old_387controlword, new_387controlword, out_387controlword +/* We use the __control87_2 function to set only the x87 control word. + The SSE control word is unaffected. */ +#define _Py_SET_53BIT_PRECISION_START \ + do { \ + __control87_2(0, 0, &old_387controlword, NULL); \ + new_387controlword = \ + (old_387controlword & ~(_MCW_PC | _MCW_RC)) | (_PC_53 | _RC_NEAR); \ + if (new_387controlword != old_387controlword) \ + __control87_2(new_387controlword, _MCW_PC | _MCW_RC, \ + &out_387controlword, NULL); \ + } while (0) +#define _Py_SET_53BIT_PRECISION_END \ + do { \ + if (new_387controlword != old_387controlword) \ + __control87_2(old_387controlword, _MCW_PC | _MCW_RC, \ + &out_387controlword, NULL); \ + } while (0) +#endif + /* default definitions are empty */ #ifndef HAVE_PY_SET_53BIT_PRECISION #define _Py_SET_53BIT_PRECISION_HEADER @@ -659,7 +659,7 @@ extern char * _getpty(int *, int, mode_t, int); /* On QNX 6, struct termio must be declared by including sys/termio.h if TCGETA, TCSETA, TCSETAW, or TCSETAF are used. sys/termio.h must be included before termios.h or it will generate an error. */ -#if defined(HAVE_SYS_TERMIO_H) && !defined(__hpux) +#if defined(HAVE_SYS_TERMIO_H) && !defined(__hpux) #include <sys/termio.h> #endif @@ -701,9 +701,9 @@ extern int fdatasync(int); #ifdef __FreeBSD__ #include <osreldate.h> -#if (__FreeBSD_version >= 500040 && __FreeBSD_version < 602113) || \ - (__FreeBSD_version >= 700000 && __FreeBSD_version < 700054) || \ - (__FreeBSD_version >= 800000 && __FreeBSD_version < 800001) +#if (__FreeBSD_version >= 500040 && __FreeBSD_version < 602113) || \ + (__FreeBSD_version >= 700000 && __FreeBSD_version < 700054) || \ + (__FreeBSD_version >= 800000 && __FreeBSD_version < 800001) # define _PY_PORT_CTYPE_UTF8_ISSUE #endif #endif @@ -715,11 +715,11 @@ extern int fdatasync(int); #ifdef _PY_PORT_CTYPE_UTF8_ISSUE #ifndef __cplusplus - /* The workaround below is unsafe in C++ because - * the <locale> defines these symbols as real functions, - * with a slightly different signature. - * See issue #10910 - */ + /* The workaround below is unsafe in C++ because + * the <locale> defines these symbols as real functions, + * with a slightly different signature. + * See issue #10910 + */ #include <ctype.h> #include <wctype.h> #undef isalnum diff --git a/contrib/tools/python/src/Include/pystate.h b/contrib/tools/python/src/Include/pystate.h index f2cfc30208..1bcee7008c 100644 --- a/contrib/tools/python/src/Include/pystate.h +++ b/contrib/tools/python/src/Include/pystate.h @@ -95,9 +95,9 @@ typedef struct _ts { PyObject *async_exc; /* Asynchronous exception to raise */ long thread_id; /* Thread id where this tstate was created */ - int trash_delete_nesting; - PyObject *trash_delete_later; - + int trash_delete_nesting; + PyObject *trash_delete_later; + /* XXX signal handlers should also be here */ } PyThreadState; diff --git a/contrib/tools/python/src/Include/pythonrun.h b/contrib/tools/python/src/Include/pythonrun.h index ba644b375a..d34f861b52 100644 --- a/contrib/tools/python/src/Include/pythonrun.h +++ b/contrib/tools/python/src/Include/pythonrun.h @@ -113,8 +113,8 @@ PyAPI_FUNC(const char *) Py_GetCompiler(void); PyAPI_FUNC(const char *) Py_GetBuildInfo(void); PyAPI_FUNC(const char *) Py_SubversionRevision(void); PyAPI_FUNC(const char *) Py_SubversionShortBranch(void); -PyAPI_FUNC(const char *) _Py_gitidentifier(void); -PyAPI_FUNC(const char *) _Py_gitversion(void); +PyAPI_FUNC(const char *) _Py_gitidentifier(void); +PyAPI_FUNC(const char *) _Py_gitversion(void); /* Internal -- various one-time initializations */ PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void); @@ -144,7 +144,7 @@ PyAPI_FUNC(void) PyInt_Fini(void); PyAPI_FUNC(void) PyFloat_Fini(void); PyAPI_FUNC(void) PyOS_FiniInterrupts(void); PyAPI_FUNC(void) PyByteArray_Fini(void); -PyAPI_FUNC(void) _PyRandom_Fini(void); +PyAPI_FUNC(void) _PyRandom_Fini(void); /* Stuff with no proper home (yet) */ PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *); @@ -154,7 +154,7 @@ PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState; /* Stack size, in "pointers" (so we get extra safety margins on 64-bit platforms). On a 32-bit platform, this translates - to an 8k margin. */ + to an 8k margin. */ #define PYOS_STACK_MARGIN 2048 #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300 diff --git a/contrib/tools/python/src/Include/sliceobject.h b/contrib/tools/python/src/Include/sliceobject.h index a10cc05f09..be5d5f2608 100644 --- a/contrib/tools/python/src/Include/sliceobject.h +++ b/contrib/tools/python/src/Include/sliceobject.h @@ -38,12 +38,12 @@ PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength); -PyAPI_FUNC(int) _PySlice_Unpack(PyObject *slice, - Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); -PyAPI_FUNC(Py_ssize_t) _PySlice_AdjustIndices(Py_ssize_t length, - Py_ssize_t *start, Py_ssize_t *stop, - Py_ssize_t step); - +PyAPI_FUNC(int) _PySlice_Unpack(PyObject *slice, + Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); +PyAPI_FUNC(Py_ssize_t) _PySlice_AdjustIndices(Py_ssize_t length, + Py_ssize_t *start, Py_ssize_t *stop, + Py_ssize_t step); + #ifdef __cplusplus } #endif diff --git a/contrib/tools/python/src/Include/stringobject.h b/contrib/tools/python/src/Include/stringobject.h index 12cc093c62..45e6156fd8 100644 --- a/contrib/tools/python/src/Include/stringobject.h +++ b/contrib/tools/python/src/Include/stringobject.h @@ -129,7 +129,7 @@ PyAPI_FUNC(PyObject*) PyString_AsEncodedObject( /* Encodes a string object and returns the result as Python string object. - If the codec returns a Unicode object, the object is converted + If the codec returns a Unicode object, the object is converted back to a string using the default encoding. DEPRECATED - use PyString_AsEncodedObject() instead. */ @@ -152,7 +152,7 @@ PyAPI_FUNC(PyObject*) PyString_AsDecodedObject( /* Decodes a string object and returns the result as Python string object. - If the codec returns a Unicode object, the object is converted + If the codec returns a Unicode object, the object is converted back to a string using the default encoding. DEPRECATED - use PyString_AsDecodedObject() instead. */ @@ -164,7 +164,7 @@ PyAPI_FUNC(PyObject*) PyString_AsDecodedString( ); /* Provides access to the internal data buffer and size of a string - object or the default encoded version of a Unicode object. Passing + object or the default encoded version of a Unicode object. Passing NULL as *len parameter will force the string buffer to be 0-terminated (passing a string with embedded NULL characters will cause an exception). */ diff --git a/contrib/tools/python/src/Include/sysmodule.h b/contrib/tools/python/src/Include/sysmodule.h index cf11a2bc50..2c371e93ba 100644 --- a/contrib/tools/python/src/Include/sysmodule.h +++ b/contrib/tools/python/src/Include/sysmodule.h @@ -23,8 +23,8 @@ PyAPI_FUNC(void) PySys_ResetWarnOptions(void); PyAPI_FUNC(void) PySys_AddWarnOption(char *); PyAPI_FUNC(int) PySys_HasWarnOptions(void); -PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *); - +PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *); + #ifdef __cplusplus } #endif diff --git a/contrib/tools/python/src/Include/timefuncs.h b/contrib/tools/python/src/Include/timefuncs.h index a9d26a77a1..a92c5e8fbb 100644 --- a/contrib/tools/python/src/Include/timefuncs.h +++ b/contrib/tools/python/src/Include/timefuncs.h @@ -16,10 +16,10 @@ extern "C" { */ PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x); -/* Get the current time since the epoch in seconds */ -PyAPI_FUNC(double) _PyTime_FloatTime(void); - +/* Get the current time since the epoch in seconds */ +PyAPI_FUNC(double) _PyTime_FloatTime(void); + #ifdef __cplusplus } #endif diff --git a/contrib/tools/python/src/Include/unicodeobject.h b/contrib/tools/python/src/Include/unicodeobject.h index 94419760c5..0f1cb6b250 100644 --- a/contrib/tools/python/src/Include/unicodeobject.h +++ b/contrib/tools/python/src/Include/unicodeobject.h @@ -67,10 +67,10 @@ Copyright (c) Corporation for National Research Initiatives. #else -#undef Py_UNICODE_SIZE -#undef PY_UNICODE_TYPE -#define Py_UNICODE_SIZE ARCADIA_PYTHON_UNICODE_SIZE - +#undef Py_UNICODE_SIZE +#undef PY_UNICODE_TYPE +#define Py_UNICODE_SIZE ARCADIA_PYTHON_UNICODE_SIZE + /* FIXME: MvL's new implementation assumes that Py_UNICODE_SIZE is properly set, but the default rules below doesn't set it. I'll sort this out some other day -- fredrik@pythonware.com */ @@ -106,10 +106,10 @@ Copyright (c) Corporation for National Research Initiatives. #endif -#ifndef PY_UNICODE_TYPE -#define PY_UNICODE_TYPE unsigned short -#endif - +#ifndef PY_UNICODE_TYPE +#define PY_UNICODE_TYPE unsigned short +#endif + /* If the compiler provides a wchar_t type we try to support it through the interface functions PyUnicode_FromWideChar() and PyUnicode_AsWideChar(). */ @@ -403,7 +403,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE; #define Py_UNICODE_FILL(target, value, length) \ do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ - for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ + for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ } while (0) /* Check if substring matches at given offset. the offset must be @@ -521,7 +521,7 @@ PyAPI_FUNC(int) PyUnicode_Resize( Py_ssize_t length /* New length */ ); -/* Coerce obj to a Unicode object and return a reference with +/* Coerce obj to a Unicode object and return a reference with *incremented* refcount. Coercion is done in the following way: @@ -544,7 +544,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject( const char *errors /* error handling */ ); -/* Coerce obj to a Unicode object and return a reference with +/* Coerce obj to a Unicode object and return a reference with *incremented* refcount. Unicode objects are passed back as-is (subclasses are converted to @@ -1146,7 +1146,7 @@ PyAPI_FUNC(int) PyUnicode_EncodeDecimal( These are capable of handling Unicode objects and strings on input (we refer to them as strings in the descriptions) and return - Unicode objects or integers as appropriate. */ + Unicode objects or integers as appropriate. */ /* Concat two strings giving a new Unicode string. */ @@ -1296,7 +1296,7 @@ PyAPI_FUNC(int) PyUnicode_Compare( /* Rich compare two strings and return one of the following: - NULL in case an exception was raised - - Py_True or Py_False for successful comparisons + - Py_True or Py_False for successful comparisons - Py_NotImplemented in case the type combination is unknown Note that Py_EQ and Py_NE comparisons can cause a UnicodeWarning in @@ -1315,7 +1315,7 @@ PyAPI_FUNC(PyObject *) PyUnicode_RichCompare( int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */ ); -/* Apply an argument tuple or dictionary to a format string and return +/* Apply an argument tuple or dictionary to a format string and return the resulting Unicode string. */ PyAPI_FUNC(PyObject *) PyUnicode_Format( @@ -1326,7 +1326,7 @@ PyAPI_FUNC(PyObject *) PyUnicode_Format( /* Checks whether element is contained in container and return 1/0 accordingly. - element has to coerce to a one element Unicode string. -1 is + element has to coerce to a one element Unicode string. -1 is returned in case of an error. */ PyAPI_FUNC(int) PyUnicode_Contains( diff --git a/contrib/tools/python/src/Include/weakrefobject.h b/contrib/tools/python/src/Include/weakrefobject.h index e7c0eae539..eab56ffb1a 100644 --- a/contrib/tools/python/src/Include/weakrefobject.h +++ b/contrib/tools/python/src/Include/weakrefobject.h @@ -63,19 +63,19 @@ PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head); PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self); -/* Explanation for the Py_REFCNT() check: when a weakref's target is part - of a long chain of deallocations which triggers the trashcan mechanism, - clearing the weakrefs can be delayed long after the target's refcount - has dropped to zero. In the meantime, code accessing the weakref will - be able to "see" the target object even though it is supposed to be - unreachable. See issue #16602. */ - -#define PyWeakref_GET_OBJECT(ref) \ - (Py_REFCNT(((PyWeakReference *)(ref))->wr_object) > 0 \ - ? ((PyWeakReference *)(ref))->wr_object \ - : Py_None) - - +/* Explanation for the Py_REFCNT() check: when a weakref's target is part + of a long chain of deallocations which triggers the trashcan mechanism, + clearing the weakrefs can be delayed long after the target's refcount + has dropped to zero. In the meantime, code accessing the weakref will + be able to "see" the target object even though it is supposed to be + unreachable. See issue #16602. */ + +#define PyWeakref_GET_OBJECT(ref) \ + (Py_REFCNT(((PyWeakReference *)(ref))->wr_object) > 0 \ + ? ((PyWeakReference *)(ref))->wr_object \ + : Py_None) + + #ifdef __cplusplus } #endif diff --git a/contrib/tools/python/src/LICENSE b/contrib/tools/python/src/LICENSE index 9dc010d803..141be55f6f 100644 --- a/contrib/tools/python/src/LICENSE +++ b/contrib/tools/python/src/LICENSE @@ -13,11 +13,11 @@ software. In May 2000, Guido and the Python core development team moved to BeOpen.com to form the BeOpen PythonLabs team. In October of the same -year, the PythonLabs team moved to Digital Creations, which became -Zope Corporation. In 2001, the Python Software Foundation (PSF, see -https://www.python.org/psf/) was formed, a non-profit organization -created specifically to own Python-related Intellectual Property. -Zope Corporation was a sponsoring member of the PSF. +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. All Python releases are Open Source (see http://www.opensource.org for the Open Source Definition). Historically, most, but not all, Python @@ -37,7 +37,7 @@ the various releases. 2.1.1 2.1+2.0.1 2001 PSF yes 2.1.2 2.1.1 2002 PSF yes 2.1.3 2.1.2 2002 PSF yes - 2.2 and above 2.1.1 2001-now PSF yes + 2.2 and above 2.1.1 2001-now PSF yes Footnotes: @@ -73,9 +73,9 @@ analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative version -prepared by Licensee. +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make diff --git a/contrib/tools/python/src/README b/contrib/tools/python/src/README index 689a3e38dc..9fa216465f 100644 --- a/contrib/tools/python/src/README +++ b/contrib/tools/python/src/README @@ -1,9 +1,9 @@ -This is Python version 2.7.16 -============================= +This is Python version 2.7.16 +============================= Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation. All -rights reserved. +2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation. All +rights reserved. Copyright (c) 2000 BeOpen.com. All rights reserved. @@ -90,14 +90,14 @@ reStructuredText (2.6+) formats; the LaTeX and reStructuredText versions are primarily for documentation authors, translators, and people with special formatting requirements. -If you would like to contribute to the development of Python, relevant -documentation is available at: - - http://docs.python.org/devguide/ - -For information about building Python's documentation, refer to Doc/README.txt. - +If you would like to contribute to the development of Python, relevant +documentation is available at: + http://docs.python.org/devguide/ + +For information about building Python's documentation, refer to Doc/README.txt. + + Web sites --------- @@ -174,11 +174,11 @@ rebuilt. In this case, you may have to run make again to correctly build your desired target. The interpreter executable is built in the top level directory. -To get an optimized build of Python, "configure --enable-optimizations" before -you run make. This sets the default make targets up to enable Profile Guided -Optimization (PGO) and may be used to auto-enable Link Time Optimization (LTO) -on some platforms. For more details, see the sections bellow. - +To get an optimized build of Python, "configure --enable-optimizations" before +you run make. This sets the default make targets up to enable Profile Guided +Optimization (PGO) and may be used to auto-enable Link Time Optimization (LTO) +on some platforms. For more details, see the sections bellow. + Once you have built a Python interpreter, see the subsections below on testing and installation. If you run into trouble, see the next section. @@ -191,39 +191,39 @@ guidance of the setup.py script, which is run by Make after the interpreter has been built. -Profile Guided Optimization ---------------------------- - -PGO takes advantage of recent versions of the GCC or Clang compilers. -If ran, "make profile-opt" will do several steps. - -First, the entire Python directory is cleaned of temporary files that -may have resulted in a previous compilation. - -Then, an instrumented version of the interpreter is built, using suitable -compiler flags for each flavour. Note that this is just an intermediary -step and the binary resulted after this step is not good for real life -workloads, as it has profiling instructions embedded inside. - -After this instrumented version of the interpreter is built, the Makefile -will automatically run a training workload. This is necessary in order to -profile the interpreter execution. Note also that any output, both stdout -and stderr, that may appear at this step is suppressed. - -Finally, the last step is to rebuild the interpreter, using the information -collected in the previous one. The end result will be a Python binary -that is optimized and suitable for distribution or production installation. - - -Link Time Optimization ----------------------- - -Enabled via configure's --with-lto flag. LTO takes advantages of recent -compiler toolchains ability to optimize across the otherwise arbitrary .o file -boundary when building final executables or shared libraries for additional -performance gains. - - +Profile Guided Optimization +--------------------------- + +PGO takes advantage of recent versions of the GCC or Clang compilers. +If ran, "make profile-opt" will do several steps. + +First, the entire Python directory is cleaned of temporary files that +may have resulted in a previous compilation. + +Then, an instrumented version of the interpreter is built, using suitable +compiler flags for each flavour. Note that this is just an intermediary +step and the binary resulted after this step is not good for real life +workloads, as it has profiling instructions embedded inside. + +After this instrumented version of the interpreter is built, the Makefile +will automatically run a training workload. This is necessary in order to +profile the interpreter execution. Note also that any output, both stdout +and stderr, that may appear at this step is suppressed. + +Finally, the last step is to rebuild the interpreter, using the information +collected in the previous one. The end result will be a Python binary +that is optimized and suitable for distribution or production installation. + + +Link Time Optimization +---------------------- + +Enabled via configure's --with-lto flag. LTO takes advantages of recent +compiler toolchains ability to optimize across the otherwise arbitrary .o file +boundary when building final executables or shared libraries for additional +performance gains. + + Troubleshooting --------------- @@ -287,7 +287,7 @@ longer: - NeXT - Irix 4 and --with-sgi-dl - Linux 1 -- Systems defining __d6_pthread_create (configure.ac) +- Systems defining __d6_pthread_create (configure.ac) - Systems defining PY_PTHREAD_D4, PY_PTHREAD_D6, or PY_PTHREAD_D7 in thread_pthread.h - Systems using --with-dl-dld @@ -726,10 +726,10 @@ platforms, additional compiler and/or linker options are required for threads to work properly. Below is a table of those options, collected by Bill Janssen. We would love to automate this process more, but the information below is not enough to write a patch for the -configure.ac file, so manual intervention is required. If you patch -the configure.ac file and are confident that the patch works, please +configure.ac file, so manual intervention is required. If you patch +the configure.ac file and are confident that the patch works, please send in the patch. (Don't bother patching the configure script itself --- it is regenerated each time the configure.ac file changes.) +-- it is regenerated each time the configure.ac file changes.) Compiler switches for threads ............................. @@ -1247,7 +1247,7 @@ RISCOS/ Files specific to RISC OS port Tools/ Some useful programs written in Python pyconfig.h.in Source from which pyconfig.h is created (GNU autoheader output) configure Configuration shell script (GNU autoconf output) -configure.ac Configuration specification (input for GNU autoconf) +configure.ac Configuration specification (input for GNU autoconf) install-sh Shell script used to install files setup.py Python script used to build extension modules diff --git a/contrib/tools/python/src/config_init.c b/contrib/tools/python/src/config_init.c index 2fa47000b8..35275cd62b 100644 --- a/contrib/tools/python/src/config_init.c +++ b/contrib/tools/python/src/config_init.c @@ -5,7 +5,7 @@ extern void init_bisect(void); extern void init_collections(void); extern void init_csv(void); -extern void init_elementtree(void); +extern void init_elementtree(void); extern void init_functools(void); extern void init_hashlib(void); extern void init_heapq(void); @@ -54,7 +54,7 @@ extern void initspwd(void); #ifdef _DARWIN_ #ifndef __IOS__ extern void init_multiprocessing(void); -extern void init_scproxy(void); +extern void init_scproxy(void); #endif #endif diff --git a/contrib/tools/python/src/config_map.c b/contrib/tools/python/src/config_map.c index 6bfe125ddd..0a6329c908 100644 --- a/contrib/tools/python/src/config_map.c +++ b/contrib/tools/python/src/config_map.c @@ -5,7 +5,7 @@ {"_bisect", init_bisect}, {"_collections", init_collections}, {"_csv", init_csv}, -{"_elementtree", init_elementtree}, +{"_elementtree", init_elementtree}, {"_functools", init_functools}, {"_hashlib", init_hashlib}, {"_heapq", init_heapq}, @@ -54,7 +54,7 @@ #ifdef _DARWIN_ #ifndef __IOS__ {"_multiprocessing", init_multiprocessing}, -{"_scproxy", init_scproxy}, +{"_scproxy", init_scproxy}, #endif #endif diff --git a/contrib/tools/python/ya.make b/contrib/tools/python/ya.make index fc95aaca64..4906dafa08 100644 --- a/contrib/tools/python/ya.make +++ b/contrib/tools/python/ya.make @@ -1,6 +1,6 @@ PROGRAM(python) -OWNER(g:contrib orivej) +OWNER(g:contrib orivej) LICENSE(PSF-2.0) @@ -10,7 +10,7 @@ ORIGINAL_SOURCE(https://github.com/python/cpython) PEERDIR( contrib/tools/python/libpython - contrib/tools/python/src/Modules/_sqlite + contrib/tools/python/src/Modules/_sqlite ) END() |