<p dir="ltr"><br>
On Aug 16, 2013 9:31 PM, "Leif Hedstrom" <<a href="mailto:zwoop@apache.org">zwoop@apache.org</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> Hope this is the right channel for this question :). I'm looking at possibly using clang-format to clean up an indentation / formatting style mess for a fairly large project (Apache Traffic Server). One of our "quirks" is that we currently format our functions like:<br>
><br>
> inline const char*<br>
> some_func(int some_arg)<br>
> {<br>
> …<br>
> }<br>
><br>
><br>
> I've tried both<br>
><br>
> PenaltyReturnTypeOnItsOwnLine: 0<br>
><br>
> and<br>
><br>
> PenaltyReturnTypeOnItsOwnLine: 10000<br>
><br>
><br>
> and various numbers in between, but it always formats the above like<br>
><br>
> inline const char* some_func(int some_arg)<br>
> {<br>
> …<br>
> }<br>
><br>
><br>
> Maybe I'm misunderstanding what PenaltyReturnTypeOnItsOwnLine does? </p>
<p dir="ltr">I assume it identifies the 'cost of splitting a line after the return. Relative costs of different splits are used in comparisons to decide on the optimal split - I doubt it'll change anything related to the behavior of the unsplit lines.</p>
<p dir="ltr">> What's even more confusing is that if I use the "mozilla" predefined format, it still doesn't format it like I expect. And I'm 99% certain that Mozilla code also uses the "return type on its own line" formatting.<br>
><br>
> Cheers!<br>
><br>
> -- leif<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</p>