@@ -10039,14 +10039,14 @@ handle_capital_sigma(int kind, const void *data, Py_ssize_t length, Py_ssize_t i
1003910039
1004010040static int
1004110041lower_ucs4 (int kind , const void * data , Py_ssize_t length , Py_ssize_t i ,
10042- Py_UCS4 c , Py_UCS4 * mapped )
10042+ Py_UCS4 c , Py_UCS4 * mapped , int mapped_size )
1004310043{
1004410044 /* Obscure special case. */
1004510045 if (c == 0x3A3 ) {
1004610046 mapped [0 ] = handle_capital_sigma (kind , data , length , i );
1004710047 return 1 ;
1004810048 }
10049- return PyUnicode_ToLower (c , mapped );
10049+ return PyUnicode_ToLower (c , mapped , mapped_size );
1005010050}
1005110051
1005210052static Py_ssize_t
@@ -10057,14 +10057,14 @@ do_capitalize(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UC
1005710057 Py_UCS4 c , mapped [3 ];
1005810058
1005910059 c = PyUnicode_READ (kind , data , 0 );
10060- n_res = PyUnicode_ToTitle (c , mapped );
10060+ n_res = PyUnicode_ToTitle (c , mapped , 3 );
1006110061 for (j = 0 ; j < n_res ; j ++ ) {
1006210062 * maxchar = Py_MAX (* maxchar , mapped [j ]);
1006310063 res [k ++ ] = mapped [j ];
1006410064 }
1006510065 for (i = 1 ; i < length ; i ++ ) {
1006610066 c = PyUnicode_READ (kind , data , i );
10067- n_res = lower_ucs4 (kind , data , length , i , c , mapped );
10067+ n_res = lower_ucs4 (kind , data , length , i , c , mapped , 3 );
1006810068 for (j = 0 ; j < n_res ; j ++ ) {
1006910069 * maxchar = Py_MAX (* maxchar , mapped [j ]);
1007010070 res [k ++ ] = mapped [j ];
@@ -10081,10 +10081,10 @@ do_swapcase(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4
1008110081 Py_UCS4 c = PyUnicode_READ (kind , data , i ), mapped [3 ];
1008210082 int n_res , j ;
1008310083 if (Py_UNICODE_ISUPPER (c )) {
10084- n_res = lower_ucs4 (kind , data , length , i , c , mapped );
10084+ n_res = lower_ucs4 (kind , data , length , i , c , mapped , 3 );
1008510085 }
1008610086 else if (Py_UNICODE_ISLOWER (c )) {
10087- n_res = PyUnicode_ToUpper (c , mapped );
10087+ n_res = PyUnicode_ToUpper (c , mapped , 3 );
1008810088 }
1008910089 else {
1009010090 n_res = 1 ;
@@ -10108,9 +10108,9 @@ do_upper_or_lower(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res,
1010810108 Py_UCS4 c = PyUnicode_READ (kind , data , i ), mapped [3 ];
1010910109 int n_res , j ;
1011010110 if (lower )
10111- n_res = lower_ucs4 (kind , data , length , i , c , mapped );
10111+ n_res = lower_ucs4 (kind , data , length , i , c , mapped , 3 );
1011210112 else
10113- n_res = PyUnicode_ToUpper (c , mapped );
10113+ n_res = PyUnicode_ToUpper (c , mapped , 3 );
1011410114 for (j = 0 ; j < n_res ; j ++ ) {
1011510115 * maxchar = Py_MAX (* maxchar , mapped [j ]);
1011610116 res [k ++ ] = mapped [j ];
@@ -10139,7 +10139,7 @@ do_casefold(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4
1013910139 for (i = 0 ; i < length ; i ++ ) {
1014010140 Py_UCS4 c = PyUnicode_READ (kind , data , i );
1014110141 Py_UCS4 mapped [3 ];
10142- int j , n_res = _PyUnicode_ToFoldedFull (c , mapped );
10142+ int j , n_res = PyUnicode_ToFolded (c , mapped , 3 );
1014310143 for (j = 0 ; j < n_res ; j ++ ) {
1014410144 * maxchar = Py_MAX (* maxchar , mapped [j ]);
1014510145 res [k ++ ] = mapped [j ];
@@ -10161,9 +10161,9 @@ do_title(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *m
1016110161 int n_res , j ;
1016210162
1016310163 if (previous_is_cased )
10164- n_res = lower_ucs4 (kind , data , length , i , c , mapped );
10164+ n_res = lower_ucs4 (kind , data , length , i , c , mapped , 3 );
1016510165 else
10166- n_res = PyUnicode_ToTitle (c , mapped );
10166+ n_res = PyUnicode_ToTitle (c , mapped , 3 );
1016710167
1016810168 for (j = 0 ; j < n_res ; j ++ ) {
1016910169 * maxchar = Py_MAX (* maxchar , mapped [j ]);
0 commit comments