Re: [vdagent-win PATCH v10 3/6] Write code to decode PNG format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 24, 2017 at 07:32:19AM -0400, Frediano Ziglio wrote:
> > 
> > On Fri, Jul 21, 2017 at 02:51:38PM +0100, Frediano Ziglio wrote:
> > > +    const int palette_colors = out_bits > 8 ? 0 : 1 << (bits == 2 ? 2 :
> > > out_bits);
> > 
> > This really deserves to be split in multiple statements to make this
> > easier to parse :)
> > 
> > Looks good otherwise.
> > 
> > Christophe
> > 
> 
> Maybe just
> 
>     const int palette_colors = out_bits > 8 ? 0 : // no palette
>                                bits == 2 ? 4 :    // 2 bit PNG converted to 4 bit BMP
>                                1 << out_bits;     // palette
> 
> (with the comments too)

I really think this needs to be split in multiple statements, I think I
have a harder time parsing the split version with comments ;)


Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]