Run clang-format (#1197)

This commit is contained in:
Jōshin 2024-06-01 13:30:43 -07:00 committed by GitHub
parent ea081b262c
commit f032b5570b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
183 changed files with 1074 additions and 983 deletions

View file

@ -13,25 +13,30 @@
forceinline int tpdecodecb(wint_t *out, int first,
int get(void *arg, uint32_t i), void *arg) {
uint32_t wc, cb, need, msb, j, i = 1;
if (__builtin_expect((wc = first) == -1, 0)) return -1;
if (__builtin_expect((wc = first) == -1, 0))
return -1;
while (__builtin_expect((wc & 0b11000000) == 0b10000000, 0)) {
if ((wc = get(arg, i++)) == -1) return -1;
if ((wc = get(arg, i++)) == -1)
return -1;
}
if (__builtin_expect(!(0 <= wc && wc <= 0x7F), 0)) {
msb = wc < 252 ? bsr(~wc & 0xff) : 1;
need = 7 - msb;
wc &= ((1u << msb) - 1) | 0b00000011;
for (j = 1; j < need; ++j) {
if ((cb = get(arg, i++)) == -1) return -1;
if ((cb = get(arg, i++)) == -1)
return -1;
if ((cb & 0b11000000) == 0b10000000) {
wc = wc << 6 | (cb & 0b00111111);
} else {
if (out) *out = u'\xFFFD';
if (out)
*out = u'\xFFFD';
return -1;
}
}
}
if (__builtin_expect(!!out, 1)) *out = (wint_t)wc;
if (__builtin_expect(!!out, 1))
*out = (wint_t)wc;
return i;
}