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

Christophe Fergeau cfergeau at redhat.com
Mon Jul 24 12:12:21 UTC 2017


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170724/a788010c/attachment.sig>


More information about the Spice-devel mailing list