mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
bpo-41123: Remove Py_UNICODE_COPY() and Py_UNICODE_FILL() (GH-28887)
This commit is contained in:
parent
03ea862b8a
commit
1f316ea3b4
3 changed files with 9 additions and 13 deletions
|
@ -591,3 +591,8 @@ Removed
|
||||||
* ``Py_SET_ERRNO_ON_MATH_ERROR()``
|
* ``Py_SET_ERRNO_ON_MATH_ERROR()``
|
||||||
|
|
||||||
(Contributed by Victor Stinner in :issue:`45412`.)
|
(Contributed by Victor Stinner in :issue:`45412`.)
|
||||||
|
|
||||||
|
* Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated
|
||||||
|
since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()``
|
||||||
|
(``wchar_t*`` string), and ``PyUnicode_Fill()`` functions instead.
|
||||||
|
(Contributed by Victor Stinner in :issue:`41123`.)
|
||||||
|
|
|
@ -50,19 +50,6 @@
|
||||||
Py_UNICODE_ISDIGIT(ch) || \
|
Py_UNICODE_ISDIGIT(ch) || \
|
||||||
Py_UNICODE_ISNUMERIC(ch))
|
Py_UNICODE_ISNUMERIC(ch))
|
||||||
|
|
||||||
Py_DEPRECATED(3.3) static inline void
|
|
||||||
Py_UNICODE_COPY(Py_UNICODE *target, const Py_UNICODE *source, Py_ssize_t length) {
|
|
||||||
memcpy(target, source, (size_t)(length) * sizeof(Py_UNICODE));
|
|
||||||
}
|
|
||||||
|
|
||||||
Py_DEPRECATED(3.3) static inline void
|
|
||||||
Py_UNICODE_FILL(Py_UNICODE *target, Py_UNICODE value, Py_ssize_t length) {
|
|
||||||
Py_ssize_t i;
|
|
||||||
for (i = 0; i < length; i++) {
|
|
||||||
target[i] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* macros to work with surrogates */
|
/* macros to work with surrogates */
|
||||||
#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDFFF)
|
#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDFFF)
|
||||||
#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDBFF)
|
#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDBFF)
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated
|
||||||
|
since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()``
|
||||||
|
(``wchar_t*`` string), and ``PyUnicode_Fill()`` functions instead. Patch by
|
||||||
|
Victor Stinner.
|
Loading…
Add table
Add a link
Reference in a new issue