@@ -9996,14 +9996,14 @@ handle_capital_sigma(int kind, const void *data, Py_ssize_t length, Py_ssize_t i
9996
9996
9997
9997
static int
9998
9998
lower_ucs4 (int kind , const void * data , Py_ssize_t length , Py_ssize_t i ,
9999
- Py_UCS4 c , Py_UCS4 * mapped )
9999
+ Py_UCS4 c , Py_UCS4 * mapped , int mapped_size )
10000
10000
{
10001
10001
/* Obscure special case. */
10002
10002
if (c == 0x3A3 ) {
10003
10003
mapped [0 ] = handle_capital_sigma (kind , data , length , i );
10004
10004
return 1 ;
10005
10005
}
10006
- return PyUnicode_ToLower (c , mapped );
10006
+ return PyUnicode_ToLower (c , mapped , mapped_size );
10007
10007
}
10008
10008
10009
10009
static Py_ssize_t
@@ -10014,14 +10014,14 @@ do_capitalize(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UC
10014
10014
Py_UCS4 c , mapped [3 ];
10015
10015
10016
10016
c = PyUnicode_READ (kind , data , 0 );
10017
- n_res = PyUnicode_ToTitle (c , mapped );
10017
+ n_res = PyUnicode_ToTitle (c , mapped , 3 );
10018
10018
for (j = 0 ; j < n_res ; j ++ ) {
10019
10019
* maxchar = Py_MAX (* maxchar , mapped [j ]);
10020
10020
res [k ++ ] = mapped [j ];
10021
10021
}
10022
10022
for (i = 1 ; i < length ; i ++ ) {
10023
10023
c = PyUnicode_READ (kind , data , i );
10024
- n_res = lower_ucs4 (kind , data , length , i , c , mapped );
10024
+ n_res = lower_ucs4 (kind , data , length , i , c , mapped , 3 );
10025
10025
for (j = 0 ; j < n_res ; j ++ ) {
10026
10026
* maxchar = Py_MAX (* maxchar , mapped [j ]);
10027
10027
res [k ++ ] = mapped [j ];
@@ -10038,10 +10038,10 @@ do_swapcase(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4
10038
10038
Py_UCS4 c = PyUnicode_READ (kind , data , i ), mapped [3 ];
10039
10039
int n_res , j ;
10040
10040
if (Py_UNICODE_ISUPPER (c )) {
10041
- n_res = lower_ucs4 (kind , data , length , i , c , mapped );
10041
+ n_res = lower_ucs4 (kind , data , length , i , c , mapped , 3 );
10042
10042
}
10043
10043
else if (Py_UNICODE_ISLOWER (c )) {
10044
- n_res = PyUnicode_ToUpper (c , mapped );
10044
+ n_res = PyUnicode_ToUpper (c , mapped , 3 );
10045
10045
}
10046
10046
else {
10047
10047
n_res = 1 ;
@@ -10065,9 +10065,9 @@ do_upper_or_lower(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res,
10065
10065
Py_UCS4 c = PyUnicode_READ (kind , data , i ), mapped [3 ];
10066
10066
int n_res , j ;
10067
10067
if (lower )
10068
- n_res = lower_ucs4 (kind , data , length , i , c , mapped );
10068
+ n_res = lower_ucs4 (kind , data , length , i , c , mapped , 3 );
10069
10069
else
10070
- n_res = PyUnicode_ToUpper (c , mapped );
10070
+ n_res = PyUnicode_ToUpper (c , mapped , 3 );
10071
10071
for (j = 0 ; j < n_res ; j ++ ) {
10072
10072
* maxchar = Py_MAX (* maxchar , mapped [j ]);
10073
10073
res [k ++ ] = mapped [j ];
@@ -10096,7 +10096,7 @@ do_casefold(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4
10096
10096
for (i = 0 ; i < length ; i ++ ) {
10097
10097
Py_UCS4 c = PyUnicode_READ (kind , data , i );
10098
10098
Py_UCS4 mapped [3 ];
10099
- int j , n_res = _PyUnicode_ToFoldedFull (c , mapped );
10099
+ int j , n_res = PyUnicode_ToFolded (c , mapped , 3 );
10100
10100
for (j = 0 ; j < n_res ; j ++ ) {
10101
10101
* maxchar = Py_MAX (* maxchar , mapped [j ]);
10102
10102
res [k ++ ] = mapped [j ];
@@ -10118,9 +10118,9 @@ do_title(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *m
10118
10118
int n_res , j ;
10119
10119
10120
10120
if (previous_is_cased )
10121
- n_res = lower_ucs4 (kind , data , length , i , c , mapped );
10121
+ n_res = lower_ucs4 (kind , data , length , i , c , mapped , 3 );
10122
10122
else
10123
- n_res = PyUnicode_ToTitle (c , mapped );
10123
+ n_res = PyUnicode_ToTitle (c , mapped , 3 );
10124
10124
10125
10125
for (j = 0 ; j < n_res ; j ++ ) {
10126
10126
* maxchar = Py_MAX (* maxchar , mapped [j ]);
0 commit comments