diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2022-04-25 19:26:19 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2022-04-25 19:26:19 +0000 |
commit | e4a52cfda403448652942cacda0927846c01c4e4 (patch) | |
tree | 88b781feb05d3b60273529f6cf1bfecb853ed7d4 /lib/libX11/src | |
parent | b44fee0a07313bfc44155c2f810882ad90a69551 (diff) |
Update to libX11 1.7.5. No API / ABI changes. ok tb@
Diffstat (limited to 'lib/libX11/src')
-rw-r--r-- | lib/libX11/src/KeyBind.c | 54 | ||||
-rw-r--r-- | lib/libX11/src/xcb_disp.c | 4 | ||||
-rw-r--r-- | lib/libX11/src/xcb_io.c | 15 | ||||
-rw-r--r-- | lib/libX11/src/xkb/XKBCvt.c | 3 | ||||
-rw-r--r-- | lib/libX11/src/xkb/XKBMAlloc.c | 4 | ||||
-rw-r--r-- | lib/libX11/src/xlibi18n/lcUTF8.c | 36 |
6 files changed, 60 insertions, 56 deletions
diff --git a/lib/libX11/src/KeyBind.c b/lib/libX11/src/KeyBind.c index 4809ff622..a8181b91b 100644 --- a/lib/libX11/src/KeyBind.c +++ b/lib/libX11/src/KeyBind.c @@ -290,7 +290,7 @@ UCSConvertCase( register unsigned code, KeySym *lower, KeySym *upper ) { - /* Case conversion for UCS, as in Unicode Data version 4.0.0 */ + /* Case conversion for UCS, as in Unicode Data version 4.0.0. */ /* NB: Only converts simple one-to-one mappings. */ /* Tables are used where they take less space than */ @@ -335,9 +335,9 @@ UCSConvertCase( register unsigned code, 0x01C9, 0x01C9, 0x01CC, 0x01CC, 0x01CC }; - static unsigned short const Greek_upper_mapping[] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000, - 0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000, + static unsigned short const Greek_upper_mapping[] = { /* updated to UD 14.0 */ + 0x0370, 0x0370, 0x0372, 0x0372, 0x0374, 0x0375, 0x0376, 0x0376, + 0x0000, 0x0000, 0x037A, 0x03FD, 0x03FE, 0x03FF, 0x037E, 0x037F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x0386, 0x0387, 0x0388, 0x0389, 0x038A, 0x0000, 0x038C, 0x0000, 0x038E, 0x038F, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, @@ -347,18 +347,18 @@ UCSConvertCase( register unsigned code, 0x03B0, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x03A3, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, - 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x038C, 0x038E, 0x038F, 0x0000, - 0x0392, 0x0398, 0x03D2, 0x03D3, 0x03D4, 0x03A6, 0x03A0, 0x03D7, + 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x038C, 0x038E, 0x038F, 0x03CF, + 0x0392, 0x0398, 0x03D2, 0x03D3, 0x03D4, 0x03A6, 0x03A0, 0x03CF, 0x03D8, 0x03D8, 0x03DA, 0x03DA, 0x03DC, 0x03DC, 0x03DE, 0x03DE, 0x03E0, 0x03E0, 0x03E2, 0x03E2, 0x03E4, 0x03E4, 0x03E6, 0x03E6, 0x03E8, 0x03E8, 0x03EA, 0x03EA, 0x03EC, 0x03EC, 0x03EE, 0x03EE, - 0x039A, 0x03A1, 0x03F9, 0x03F3, 0x03F4, 0x0395, 0x03F6, 0x03F7, - 0x03F7, 0x03F9, 0x03FA, 0x03FA, 0x0000, 0x0000, 0x0000, 0x0000 + 0x039A, 0x03A1, 0x03F9, 0x037F, 0x03F4, 0x0395, 0x03F6, 0x03F7, + 0x03F7, 0x03F9, 0x03FA, 0x03FA, 0x03FC, 0x03FD, 0x03FE, 0x03FF }; - static unsigned short const Greek_lower_mapping[] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000, - 0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000, + static unsigned short const Greek_lower_mapping[] = { /* updated to UD 14.0 */ + 0x0371, 0x0371, 0x0373, 0x0373, 0x0374, 0x0375, 0x0377, 0x0377, + 0x0000, 0x0000, 0x037A, 0x037B, 0x037C, 0x037D, 0x037E, 0x03F3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x03AC, 0x0387, 0x03AD, 0x03AE, 0x03AF, 0x0000, 0x03CC, 0x0000, 0x03CD, 0x03CE, 0x0390, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, @@ -368,13 +368,13 @@ UCSConvertCase( register unsigned code, 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, - 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000, + 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x03D7, 0x03D0, 0x03D1, 0x03D2, 0x03D3, 0x03D4, 0x03D5, 0x03D6, 0x03D7, 0x03D9, 0x03D9, 0x03DB, 0x03DB, 0x03DD, 0x03DD, 0x03DF, 0x03DF, 0x03E1, 0x03E1, 0x03E3, 0x03E3, 0x03E5, 0x03E5, 0x03E7, 0x03E7, 0x03E9, 0x03E9, 0x03EB, 0x03EB, 0x03ED, 0x03ED, 0x03EF, 0x03EF, 0x03F0, 0x03F1, 0x03F2, 0x03F3, 0x03B8, 0x03F5, 0x03F6, 0x03F8, - 0x03F8, 0x03F2, 0x03FB, 0x03FB, 0x0000, 0x0000, 0x0000, 0x0000 + 0x03F8, 0x03F2, 0x03FB, 0x03FB, 0x03FC, 0x037B, 0x037C, 0x037D }; static unsigned short const GreekExt_lower_mapping[] = { @@ -472,7 +472,7 @@ UCSConvertCase( register unsigned code, } /* Latin Extended-A, U+0100 to U+017F */ - if (code >= 0x0100 && code <= 0x017f) { + if (code <= 0x017f) { if ( (code >= 0x0100 && code <= 0x012f) || (code >= 0x0132 && code <= 0x0137) || (code >= 0x014a && code <= 0x0177) ) { @@ -498,13 +498,19 @@ UCSConvertCase( register unsigned code, } /* Latin Extended-B, U+0180 to U+024F */ - if (code >= 0x0180 && code <= 0x024f) { - if (code >= 0x01cd && code <= 0x01dc) { + if (code <= 0x024f) { + if (code >= 0x0180 && code <= 0x01cc) { + *lower = LatinExtB_lower_mapping[code - 0x0180]; + *upper = LatinExtB_upper_mapping[code - 0x0180]; + } + else if (code >= 0x01cd && code <= 0x01dc) { if (code & 1) *lower += 1; else *upper -= 1; } + else if (code == 0x01dd) + *upper = 0x018e; else if ( (code >= 0x01de && code <= 0x01ef) || (code >= 0x01f4 && code <= 0x01f5) || (code >= 0x01f8 && code <= 0x021f) || @@ -512,12 +518,6 @@ UCSConvertCase( register unsigned code, *lower |= 1; *upper &= ~1; } - else if (code >= 0x0180 && code <= 0x01cc) { - *lower = LatinExtB_lower_mapping[code - 0x0180]; - *upper = LatinExtB_upper_mapping[code - 0x0180]; - } - else if (code == 0x01dd) - *upper = 0x018e; else if (code == 0x01f1 || code == 0x01f2) { *lower = 0x01f3; *upper = 0x01f1; @@ -536,11 +536,13 @@ UCSConvertCase( register unsigned code, /* IPA Extensions, U+0250 to U+02AF */ if (code >= 0x0253 && code <= 0x0292) { *upper = IPAExt_upper_mapping[code - 0x0253]; + return; } /* Combining Diacritical Marks, U+0300 to U+036F */ if (code == 0x0345) { *upper = 0x0399; + return; } /* Greek and Coptic, U+0370 to U+03FF */ @@ -551,11 +553,11 @@ UCSConvertCase( register unsigned code, *upper = code; if (*lower == 0) *lower = code; + return; } /* Cyrillic and Cyrillic Supplementary, U+0400 to U+052F */ - if ( (code >= 0x0400 && code <= 0x04ff) || - (code >= 0x0500 && code <= 0x052f) ) { + if ( (code >= 0x0400 && code <= 0x052f) ) { if (code >= 0x0400 && code <= 0x040f) *lower += 0x50; else if (code >= 0x0410 && code <= 0x042f) @@ -578,6 +580,7 @@ UCSConvertCase( register unsigned code, else *upper -= 1; } + return; } /* Armenian, U+0530 to U+058F */ @@ -586,6 +589,7 @@ UCSConvertCase( register unsigned code, *lower += 0x30; else if (code >=0x0561 && code <= 0x0586) *upper -= 0x30; + return; } /* Latin Extended Additional, U+1E00 to U+1EFF */ @@ -599,6 +603,7 @@ UCSConvertCase( register unsigned code, *upper = 0x1e60; else if (code == 0x1e9e) *lower = 0x00df; /* ssharp */ + return; } /* Greek Extended, U+1F00 to U+1FFF */ @@ -609,6 +614,7 @@ UCSConvertCase( register unsigned code, *upper = code; if (*lower == 0) *lower = code; + return; } /* Letterlike Symbols, U+2100 to U+214F */ diff --git a/lib/libX11/src/xcb_disp.c b/lib/libX11/src/xcb_disp.c index 70a602f4d..63e344af2 100644 --- a/lib/libX11/src/xcb_disp.c +++ b/lib/libX11/src/xcb_disp.c @@ -102,6 +102,10 @@ void _XFreeX11XCBStructure(Display *dpy) dpy->xcb->pending_requests = tmp->next; free(tmp); } + if (dpy->xcb->event_notify) + xcondition_clear(dpy->xcb->event_notify); + if (dpy->xcb->reply_notify) + xcondition_clear(dpy->xcb->reply_notify); xcondition_free(dpy->xcb->event_notify); xcondition_free(dpy->xcb->reply_notify); Xfree(dpy->xcb); diff --git a/lib/libX11/src/xcb_io.c b/lib/libX11/src/xcb_io.c index dff441ff5..fd33f4383 100644 --- a/lib/libX11/src/xcb_io.c +++ b/lib/libX11/src/xcb_io.c @@ -32,8 +32,12 @@ #define throw_thread_fail_assert(_message, _var) { \ fprintf(stderr, "[xcb] " _message "\n"); \ - fprintf(stderr, "[xcb] Most likely this is a multi-threaded client " \ - "and XInitThreads has not been called\n"); \ + if (_Xglobal_lock) { \ + fprintf(stderr, "[xcb] You called XInitThreads, this is not your fault\n"); \ + } else { \ + fprintf(stderr, "[xcb] Most likely this is a multi-threaded client " \ + "and XInitThreads has not been called\n"); \ + } \ xcb_fail_assert(_message, _var); \ } @@ -214,7 +218,12 @@ static int handle_error(Display *dpy, xError *err, Bool in_XReply) static void widen(uint64_t *wide, unsigned int narrow) { uint64_t new = (*wide & ~((uint64_t)0xFFFFFFFFUL)) | narrow; - *wide = new + (((uint64_t)(new < *wide)) << 32); + /* If just copying the upper dword of *wide makes the number + * go down by more than 2^31, then it means that the lower + * dword has wrapped (or we have skipped 2^31 requests, which + * is hopefully improbable), so we add a carry. */ + uint64_t wraps = new + (1UL << 31) < *wide; + *wide = new + (wraps << 32); } /* Thread-safety rules: diff --git a/lib/libX11/src/xkb/XKBCvt.c b/lib/libX11/src/xkb/XKBCvt.c index 5317a0a5c..8cef2f729 100644 --- a/lib/libX11/src/xkb/XKBCvt.c +++ b/lib/libX11/src/xkb/XKBCvt.c @@ -57,7 +57,6 @@ from The Open Group. static int _XkbHandleSpecialSym(KeySym keysym, char *buffer, int nbytes, int *extra_rtrn) { - /* try to convert to Latin-1, handling ctrl */ if (!(((keysym >= XK_BackSpace) && (keysym <= XK_Clear)) || (keysym == XK_Return) || (keysym == XK_Escape) || @@ -75,8 +74,6 @@ _XkbHandleSpecialSym(KeySym keysym, char *buffer, int nbytes, int *extra_rtrn) /* if X keysym, convert to ascii by grabbing low 7 bits */ if (keysym == XK_KP_Space) buffer[0] = XK_space & 0x7F; /* patch encoding botch */ - else if (keysym == XK_hyphen) - buffer[0] = (char) (XK_minus & 0xFF); /* map to equiv character */ else buffer[0] = (char) (keysym & 0x7F); return 1; diff --git a/lib/libX11/src/xkb/XKBMAlloc.c b/lib/libX11/src/xkb/XKBMAlloc.c index 61a7359e8..8b3be3039 100644 --- a/lib/libX11/src/xkb/XKBMAlloc.c +++ b/lib/libX11/src/xkb/XKBMAlloc.c @@ -681,7 +681,7 @@ XkbChangeKeycodeRange(XkbDescPtr xkb, if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbVirtualModMapMask, minKC, - &changes->map.first_modmap_key, + &changes->map.first_vmodmap_key, &changes->map.num_vmodmap_keys); } } @@ -766,7 +766,7 @@ XkbChangeKeycodeRange(XkbDescPtr xkb, if (changes) { changes->map.changed = _ExtendRange(changes->map.changed, XkbVirtualModMapMask, maxKC, - &changes->map.first_modmap_key, + &changes->map.first_vmodmap_key, &changes->map.num_vmodmap_keys); } } diff --git a/lib/libX11/src/xlibi18n/lcUTF8.c b/lib/libX11/src/xlibi18n/lcUTF8.c index b18f77e19..8169608ad 100644 --- a/lib/libX11/src/xlibi18n/lcUTF8.c +++ b/lib/libX11/src/xlibi18n/lcUTF8.c @@ -742,20 +742,14 @@ utf8tocs1( continue; } + last_charset = _XlcGetCharSetWithSide(chosen_charset->name, chosen_side); + if (last_charset == NULL) { - last_charset = - _XlcGetCharSetWithSide(chosen_charset->name, chosen_side); - if (last_charset == NULL) { - src += consumed; - unconv_num++; - continue; - } - } else { - if (!(last_charset->xrm_encoding_name == chosen_charset->xrm_name - && (last_charset->side == XlcGLGR - || last_charset->side == chosen_side))) - break; + src += consumed; + unconv_num++; + continue; } + src += consumed; dst += count; break; @@ -1615,20 +1609,14 @@ wcstocs1( continue; } + last_charset = _XlcGetCharSetWithSide(chosen_charset->name, chosen_side); + if (last_charset == NULL) { - last_charset = - _XlcGetCharSetWithSide(chosen_charset->name, chosen_side); - if (last_charset == NULL) { - src++; - unconv_num++; - continue; - } - } else { - if (!(last_charset->xrm_encoding_name == chosen_charset->xrm_name - && (last_charset->side == XlcGLGR - || last_charset->side == chosen_side))) - break; + src++; + unconv_num++; + continue; } + src++; dst += count; break; |