Re: [dev] [st utf8 3/4] Change internal character representation.

From: suigin <suigin_AT_national.shitposting.agency>
Date: Wed, 22 Apr 2015 02:40:47 -0700

On Tue, Apr 21, 2015 at 09:28:38PM +0000, noname wrote:

> typedef struct {
> - char c[UTF_SIZ]; /* character code */
> - ushort mode; /* attribute flags */
> - uint32_t fg; /* foreground */
> - uint32_t bg; /* background */
> + long u; /* character code */
> + ushort mode; /* attribute flags */
> + uint32_t fg; /* foreground */
> + uint32_t bg; /* background */
> } Glyph;

GCC and Clang define long as 64-bits by default for x86_64, AArch64,
and many other 64-bit target architectures, which is wasteful for
Unicode code points.

In C11, a new standard header was added named uchar.h, which defines
char32_t to be an integral type with the same size as uint_least32_t.

Might be better to change all uses of long to uint_least32_t for
UCS4/UTF32 characters.


Received on Wed Apr 22 2015 - 11:40:47 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 22 2015 - 11:48:08 CEST