On Sat, 28 Jul 2012 13:13:37 +0200, Diego Biurrun <[email protected]> wrote: > On Sat, Jul 28, 2012 at 12:42:25PM +0200, Anton Khirnov wrote: > > > > --- a/libavformat/wv.c > > +++ b/libavformat/wv.c > > @@ -87,27 +87,27 @@ static int wv_read_block_header(AVFormatContext *ctx, > > AVIOContext *pb, int appen > > > > - if(size < 24 || size > WV_BLOCK_LIMIT){ > > + if (size < 24 || size > WV_BLOCK_LIMIT){ > > - if(ver < 0x402 || ver > 0x410){ > > + if (ver < 0x402 || ver > 0x410){ > > space before {, probably more in other places > > > @@ -115,51 +115,43 @@ static int wv_read_block_header(AVFormatContext *ctx, > > AVIOContext *pb, int appen > > - switch(size - 2){ > > - case 0: > > - chmask = avio_r8(pb); > > - break; > > - case 1: > > - chmask = avio_rl16(pb); > > - break; > > - case 2: > > - chmask = avio_rl24(pb); > > - break; > > - case 3: > > - chmask = avio_rl32(pb); > > - break; > > + switch (size - 2) { > > + case 0: chmask = avio_r8(pb); break; > > + case 1: chmask = avio_rl16(pb); break; > > + case 2: chmask = avio_rl24(pb); break; > > + case 3: chmask = avio_rl32(pb); break; > > case 5: > > avio_skip(pb, 1); > > - chan |= (avio_r8(pb) & 0xF) << 8; > > + chan |= (avio_r8(pb) & 0xF) << 8; > > chmask = avio_rl24(pb); > > break; > > default: > > That's not an improvement, just leave the lines broken. >
I disagree. In those simple cases, putting the case, statement and break on one line is much more readable. It's already been done in other places as an explicit readability improvement (a quick git log shows e.g. 98161553376478753292cf4fea6fd1cd10b0be2c). -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
