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.

Attachment: signature.asc
Description: Digital signature

Reply via email to