Re: [hackers] [libgrapheme][PATCH] Simplify cp_decode and be more strict

From: Mattias Andrée <maandree_AT_kth.se>
Date: Thu, 28 May 2020 19:55:27 +0200

On Thu, 28 May 2020 19:33:12 +0200
Laslo Hunhold <dev_AT_frign.de> wrote:

> On Thu, 28 May 2020 16:49:22 +0200
> Mattias Andrée <maandree_AT_kth.se> wrote:
>
> Dear Mattias,
>
> > > > So would you recommend an explicit cast to uint32_t, i.e.
> > > >
> > > > (uint32_t)1 << 16
> > > >
> > > > to overcome this?
> > >
> > > Yes.
> >
> > Don't forget about 0x10FFFF, where you need UINT32_C(0x10FFFF).
> > Casting doesn't work here unless you also add the L suffix.
>
> thanks for your input on this. I've fixed these problems and also
> simplified the mask-operation as you've suggested.
>
> With best regards
>
> Laslo
>

Looks good. But I wouldn't call the mask operation change
and optimisation (even though it is), than I would have
suggested `*cp = s[0] ^ lut[off].lower`. :)
Received on Thu May 28 2020 - 19:55:27 CEST

This archive was generated by hypermail 2.3.0 : Thu May 28 2020 - 20:00:34 CEST