Re: [PATCH 10/11] vt: update ucs_width.c following latest gen_ucs_width.py

From: Jiri Slaby
Date: Mon Apr 14 2025 - 03:17:15 EST


On 10. 04. 25, 3:14, Nicolas Pitre wrote:
From: Nicolas Pitre <npitre@xxxxxxxxxxxx>

Split table ranges into BMP (16-bit) and non-BMP (above 16-bit).
This reduces the corresponding text size by 20-25%.
...
@@ -483,7 +517,9 @@ static bool is_in_interval(uint32_t cp, const struct interval *intervals, size_t
*/
bool ucs_is_zero_width(uint32_t cp)
{
- return is_in_interval(cp, zero_width_ranges, ARRAY_SIZE(zero_width_ranges));
+ return (cp <= 0xFFFF)

This calls for some is_bmp() helper.

And then the classic way:
if (is_bmp())
return is_in_interval16();

return is_in_interval32();

thanks,
--
js
suse labs