mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
Merged revisions 68292,68344,68361,68378,68424,68426,68429-68430,68450,68457,68480-68481,68493,68495,68499,68501,68512,68514-68515 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68292 | skip.montanaro | 2009-01-04 11:36:58 +0100 (So, 04 Jan 2009) | 3 lines If user configures --without-gcc give preference to $CC instead of blindly assuming the compiler will be "cc". ........ r68344 | marc-andre.lemburg | 2009-01-05 20:43:35 +0100 (Mo, 05 Jan 2009) | 7 lines Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declaration into the extern "C" section. Add a few more comments and apply some minor edits to make the file contents fit the original structure again. ........ r68361 | antoine.pitrou | 2009-01-06 19:34:08 +0100 (Di, 06 Jan 2009) | 3 lines Use shutil.rmtree rather than os.rmdir. ........ r68378 | mark.dickinson | 2009-01-07 18:48:33 +0100 (Mi, 07 Jan 2009) | 2 lines Issue #4869: clarify documentation for random.expovariate. ........ r68424 | benjamin.peterson | 2009-01-09 03:53:35 +0100 (Fr, 09 Jan 2009) | 1 line specify what -3 warnings are about ........ r68426 | benjamin.peterson | 2009-01-09 04:03:05 +0100 (Fr, 09 Jan 2009) | 1 line fix spelling ........ r68429 | benjamin.peterson | 2009-01-09 04:05:14 +0100 (Fr, 09 Jan 2009) | 1 line add -3 to manpage ........ r68430 | benjamin.peterson | 2009-01-09 04:07:27 +0100 (Fr, 09 Jan 2009) | 1 line be more specific in -3 option help ........ r68450 | jeffrey.yasskin | 2009-01-09 17:47:07 +0100 (Fr, 09 Jan 2009) | 3 lines Fix issue 4884, preventing a crash in the socket code when python is compiled with llvm-gcc and run with a glibc <2.10. ........ r68457 | kristjan.jonsson | 2009-01-09 21:10:59 +0100 (Fr, 09 Jan 2009) | 1 line Issue 3677: Fix import from UNC paths on Windows. ........ r68480 | vinay.sajip | 2009-01-10 14:38:04 +0100 (Sa, 10 Jan 2009) | 1 line Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library. ........ r68481 | vinay.sajip | 2009-01-10 14:42:04 +0100 (Sa, 10 Jan 2009) | 1 line Corrected an incorrect self-reference. ........ r68493 | benjamin.peterson | 2009-01-10 18:18:55 +0100 (Sa, 10 Jan 2009) | 1 line rewrite verbose conditionals ........ r68495 | benjamin.peterson | 2009-01-10 18:36:44 +0100 (Sa, 10 Jan 2009) | 1 line tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901 ........ r68499 | mark.dickinson | 2009-01-10 20:14:55 +0100 (Sa, 10 Jan 2009) | 2 lines Remove an unnecessary check from test_decimal. ........ r68501 | vinay.sajip | 2009-01-10 20:22:57 +0100 (Sa, 10 Jan 2009) | 1 line Corrected minor typo and added .currentmodule directives to fix missing cross-references. ........ r68512 | benjamin.peterson | 2009-01-10 23:42:10 +0100 (Sa, 10 Jan 2009) | 1 line make tests fail if they can't be imported ........ r68514 | benjamin.peterson | 2009-01-11 00:41:59 +0100 (So, 11 Jan 2009) | 1 line move seealso to a more appropiate place ........ r68515 | benjamin.peterson | 2009-01-11 00:49:08 +0100 (So, 11 Jan 2009) | 1 line macos 9 isn't supported ........
This commit is contained in:
parent
a1b22ce68c
commit
c04c2890c7
17 changed files with 103 additions and 53 deletions
|
@ -130,6 +130,10 @@ typedef unsigned int Py_UCS4;
|
|||
typedef unsigned long Py_UCS4;
|
||||
#endif
|
||||
|
||||
/* Py_UNICODE is the native Unicode storage format (code unit) used by
|
||||
Python and represents a single Unicode element in the Unicode
|
||||
type. */
|
||||
|
||||
typedef PY_UNICODE_TYPE Py_UNICODE;
|
||||
|
||||
/* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */
|
||||
|
@ -350,12 +354,12 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
|
|||
|
||||
#else
|
||||
|
||||
/* Since splitting on whitespace is an important use case, and whitespace
|
||||
in most situations is solely ASCII whitespace, we optimize for the common
|
||||
case by using a quick look-up table with an inlined check.
|
||||
*/
|
||||
PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
|
||||
/* Since splitting on whitespace is an important use case, and
|
||||
whitespace in most situations is solely ASCII whitespace, we
|
||||
optimize for the common case by using a quick look-up table
|
||||
_Py_ascii_whitespace (see below) with an inlined check.
|
||||
|
||||
*/
|
||||
#define Py_UNICODE_ISSPACE(ch) \
|
||||
((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
|
||||
|
||||
|
@ -389,13 +393,14 @@ PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
|
|||
#define Py_UNICODE_COPY(target, source, length) \
|
||||
Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE))
|
||||
|
||||
#define Py_UNICODE_FILL(target, value, length) do\
|
||||
{Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\
|
||||
#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_;\
|
||||
} while (0)
|
||||
|
||||
/* check if substring matches at given offset. the offset must be
|
||||
/* Check if substring matches at given offset. the offset must be
|
||||
valid, and the substring must not be empty */
|
||||
|
||||
#define Py_UNICODE_MATCH(string, offset, substring) \
|
||||
((*((string)->str + (offset)) == *((substring)->str)) && \
|
||||
((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \
|
||||
|
@ -405,8 +410,6 @@ PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
|
||||
|
||||
/* --- Unicode Type ------------------------------------------------------- */
|
||||
|
||||
typedef struct {
|
||||
|
@ -605,6 +608,17 @@ PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
|
|||
|
||||
PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal);
|
||||
|
||||
/* --- Free-list management ----------------------------------------------- */
|
||||
|
||||
/* Clear the free list used by the Unicode implementation.
|
||||
|
||||
This can be used to release memory used for objects on the free
|
||||
list back to the Python memory allocator.
|
||||
|
||||
*/
|
||||
|
||||
PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
|
||||
|
||||
/* === Builtin Codecs =====================================================
|
||||
|
||||
Many of these APIs take two arguments encoding and errors. These
|
||||
|
@ -1323,6 +1337,10 @@ PyAPI_FUNC(PyObject *) _PyUnicode_XStrip(
|
|||
|
||||
/* === Characters Type APIs =============================================== */
|
||||
|
||||
/* Helper array used by Py_UNICODE_ISSPACE(). */
|
||||
|
||||
PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
|
||||
|
||||
/* These should not be used directly. Use the Py_UNICODE_IS* and
|
||||
Py_UNICODE_TO* macros instead.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue