[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] v4. line_transformer callback

From: Hyrum K. Wright <hyrum_at_hyrumwright.org>
Date: Thu, 27 Aug 2009 22:48:25 +0200

On Aug 27, 2009, at 10:00 PM, Blair Zajac wrote:

> Blair Zajac wrote:
>> Daniel Näslund wrote:
>>> On Thu, Aug 27, 2009 at 07:29:03PM +0100, Stefan Sperling wrote:
>>>> On Thu, Aug 27, 2009 at 06:51:28PM +0200, Daniel Näslund wrote:
>>> I used your suggestions for the log message.
>>
>> Hi Daniel,
>>
>> Thanks for all your work on svn.
>>
>> Minor nit. When you have a long line like this:
>>
>> void
>> svn_stream_set_line_transformer_callback(svn_stream_t *stream,
>> svn_io_line_transformer_cb_t
>> line_transformer_cb)
>> {
>> stream->line_transformer_cb = line_transformer_cb;
>> }
>>
>> It took me a second to see that line_transformer_cb is not a type
>> but the
>> variable name from the previous line. For long lines, we use
>> something like
>> this style:
>>
>> void
>> svn_stream_set_line_transformer_callback
>> (svn_stream_t *stream,
>> svn_io_line_transformer_cb_t line_transformer_cb)
>
> Oops, make that a two space indent:
>
> void
> svn_stream_set_line_transformer_callback
> (svn_stream_t *stream,
> svn_io_line_transformer_cb_t line_transformer_cb)

I think no-space-before-paren disallows this. One convention I've
seen in other parameter lists is:

void
svn_stream_set_line_transformer_callback(svn_stream_t *stream,
                                          svn_io_line_transformer_cb_t
                                                         
line_transformer_cb)
{
   stream->line_transformer_cb = line_transformer_cb;
}

It keeps the indentation of typenames, but also ensures we don't
overflow the line. In any case, I feel like a green[1] bikeshed today.

-Hyrum

[1] http://green.bikeshed.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2388014
Received on 2009-08-27 22:49:22 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.