[MPlayer-dev-eng] [PATCH] view stereoscopic videos

Gordon Schmidt gordon.schmidt at s2000.tu-chemnitz.de
Fri Jan 29 10:49:50 CET 2010


On Fri, Jan 29, 2010 at 09:09:27AM +0100, Diego Biurrun wrote:
>>> Please use K&R coding style for new files, no tabs, no trailing
>>> whitespace, 4 spaces indentation.
>> I hope the code is to your convenience now.
>
> No.  At a first glance, case should be indented at the same level as
> switch, { go on the next line for function declarations.
>
> This is a recurring problem, so please tell me how you went about
> this?  Where and how did you research what K&R style consists of?
Sorry, just had a quick look at http://en.wikipedia.org/wiki/Indent_style
and  
http://www.cas.mcmaster.ca/~carette/SE3M04/2004/slides/CCodingStyle.html that  
had quite some differences.

This K&R style seems everything but logical to me. Why do i have to  
put the { on the next line for function declarations, but not for  
control statements? Why do i have to put a whitespace before the  
condition of an control statement but not before the params of a  
function call? And do i put a whitespace before the params of a  
function declaration or not? I've found different rules via google all  
claiming to be K&R. And why shouldn't i indent cases in a switch? They  
are certainly part of the switch and should be indented like any other  
content that's written between a block of { and }.
I'm not sure, if i miss the point here, but aren't coding style rules  
supposed to ease the writing and reading of the code? I don't think  
they do, if the have different rules for statements with similar  
structure like K&R seems to have.
Maybe i'm just using the wrong documentations. In this case you should  
provide a binding set of rules within the repository and i will change  
the style on the next time i have to change something in the source.

Btw: How big is the part of the mplayer source that complies to this  
K&R rules anyway?




More information about the MPlayer-dev-eng mailing list