On 08/01/13 09:58, Diego Biurrun wrote:
> On Mon, Jan 07, 2013 at 04:38:23PM -0500, Justin Ruggles wrote:
>> On 01/07/2013 04:11 PM, Diego Biurrun wrote:
>>> On Mon, Jan 07, 2013 at 01:23:37PM +0100, Anton Khirnov wrote:
>>>> --- a/libavcodec/rawdec.c
>>>> +++ b/libavcodec/rawdec.c
>>>> @@ -78,19 +79,23 @@ static av_cold int raw_init_decoder(AVCodecContext
>>>> *avctx)
>>>> - if((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample
>>>> == 2) &&
>>>> - avctx->pix_fmt==AV_PIX_FMT_PAL8 &&
>>>> - (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){
>>>> + if ((avctx->bits_per_coded_sample == 4 ||
>>>> avctx->bits_per_coded_sample == 2) &&
>>>> + avctx->pix_fmt == AV_PIX_FMT_PAL8 &&
>>>> + (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' ')))
>>>> {
>>>
>>> missing space after ,
>>>
>>>> @@ -98,28 +103,30 @@ static av_cold int raw_init_decoder(AVCodecContext
>>>> *avctx)
>>>>
>>>> - if((avctx->extradata_size >= 9 && !memcmp(avctx->extradata +
>>>> avctx->extradata_size - 9, "BottomUp", 9)) ||
>>>> - avctx->codec_tag == MKTAG(3, 0, 0, 0) || avctx->codec_tag ==
>>>> MKTAG('W','R','A','W'))
>>>> + if ((avctx->extradata_size >= 9 &&
>>>> + !memcmp(avctx->extradata + avctx->extradata_size - 9,
>>>> "BottomUp", 9)) ||
>>>> + avctx->codec_tag == MKTAG(3, 0, 0, 0) ||
>>>> + avctx->codec_tag == MKTAG('W','R','A','W'))
>>>
>>> same
>>
>> I personally think leaving out the extra spaces on MKTAG and the like
>> makes it easier to read.
>
> I think making up special indentation rules for certain constructs is
> a very bad idea. Where do you draw the line? Where do you document
> all the exceptions? How do you teach them to all the newbies?
>
> The point of using a common style is not picking anybody's personal
> favorite style and making it easy to adapt for newcomers. Special
> rules like that defeat the purpose. Marginal, debatable, improvements
> in readability do not offset that disadvantage enough to be worth
> the trouble. Besides, between
>
> MKTAG('W','R','A','W'))
>
> and
>
> MKTAG('W', 'R', 'A', 'W'))
>
> the latter is hardly unreadable.
You can use the alternate syntax AV_RL32("WRAW") and be done with that,
not sure if the code generated for MKTAG() leads to a proper constant
while AV_RL32 results something worse. For slow path code it isn't a
problem anyway.
lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel