[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fe312c65-99de-4519-9072-caeebf44227b@kernel.org>
Date: Tue, 6 May 2025 08:06:43 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Nicolas Pitre <nico@...xnic.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Nicolas Pitre <npitre@...libre.com>, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/8] vt: move glyph determination to a separate function
On 05. 05. 25, 18:55, Nicolas Pitre wrote:
> From: Nicolas Pitre <npitre@...libre.com>
>
> No logical changes. Make it easier for enhancements to come.
...
> @@ -2984,12 +2985,40 @@ static int vc_process_ucs(struct vc_data *vc, int *c, int *tc)
> return 0;
> }
>
> +static int vc_get_glyph(struct vc_data *vc, int tc)
> +{
> + int glyph = conv_uni_to_pc(vc, tc);
> + int charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
Could you keep charmask unsigned? It used to be u16.
> +
> + if (!(glyph & ~charmask))
> + return glyph;
> +
> + if (glyph == -1)
> + return -1; /* nothing to display */
> +
> + /* Glyph not found */
> +
Do no additional \n here ^^.
> + if ((!vc->vc_utf || vc->vc_disp_ctrl || tc < 128) && !(tc & ~charmask)) {
> + /*
> + * In legacy mode use the glyph we get by a 1:1 mapping.
> + * This would make absolutely no sense with Unicode in mind,
> + * but do this for ASCII characters since a font may lack
> + * Unicode mapping info and we don't want to end up with
> + * having question marks only.
Generally: feel free to use 100 characters per line.
> + */
> + return tc;
> + }
> +
> + /* Display U+FFFD (Unicode Replacement Character). */
> + return conv_uni_to_pc(vc, UCS_REPLACEMENT);
> +}
thanks,
--
js
suse labs
Powered by blists - more mailing lists