@@ -48,18 +48,18 @@ static const struct {
4848 signed char lower ;
4949 unsigned char len ;
5050} casemaps [] = {
51- CASEMAP (0x00c0 , 0xd6 , 0xe0 ),
52- CASEMAP (0x00d8 , 0xde , 0xf8 ),
53-
54- CASELACE (0x0100 , 0x12e ),
55- CASELACE (0x0132 , 0x136 ),
56- CASELACE (0x0139 , 0x147 ),
57- CASELACE (0x014a , 0x176 ),
58- CASELACE (0x0179 , 0x17d ),
59-
60- CASELACE (0x01a0 , 0x1a4 ),
61- CASELACE (0x01b3 , 0x1b5 ),
62- CASELACE (0x01cd , 0x1db ),
51+ CASEMAP (0x00c0 , 0xd6 , 0xe0 ), // 192 32 23
52+ CASEMAP (0x00d8 , 0xde , 0xf8 ), // 216 32 7
53+
54+ CASELACE (0x0100 , 0x12e ), // 256 1 47
55+ CASELACE (0x0132 , 0x136 ), // 306 1 5
56+ CASELACE (0x0139 , 0x147 ), // 313 1 15
57+ CASELACE (0x014a , 0x176 ), // 330 1 45
58+ CASELACE (0x0179 , 0x17d ), // 377 1 5
59+
60+ CASELACE (0x01a0 , 0x1a4 ), // 416 1 5 O WITH HORN - P WITH HOOK
61+ CASELACE (0x01b3 , 0x1b5 ), // 435 1 3
62+ CASELACE (0x01cd , 0x1db ), // 461 1 15
6363 CASELACE (0x01de , 0x1ee ),
6464 CASELACE (0x01f8 , 0x21e ),
6565 CASELACE (0x0222 , 0x232 ),
@@ -372,8 +372,8 @@ static const unsigned short pairs[][2] = {
372372
373373EXPORT uint32_t _towcase (uint32_t wc , int lower ) {
374374 int i ;
375- int lmul = 2 * lower - 1 ;
376- int lmask = lower - 1 ;
375+ int lmul = 2 * lower - 1 ; // 1 for lower, -1 for upper
376+ int lmask = lower - 1 ; // 0 for lower, -1/0xffff for upper
377377 /* no letters with case in these large ranges */
378378 if (/*(!iswalpha(wc) is broken on some platforms) */
379379 wc < 0x41 || (unsigned )wc - 0x0600 <= 0x0fff - 0x0600 ||
0 commit comments