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

Re: [PATCH] pass NULL instead of an unused parameter

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Tue, 11 Jan 2011 10:03:23 -0500

On 01/11/2011 07:17 AM, Prabhu Gnana Sundar wrote:
> Hi Kamesh,
>
>
> On Tuesday 11 January 2011 05:23 PM, Kamesh Jayachandran wrote:
>> Hi Prabhu,
>>
>>> SVN_ERR(svn_config_get_config(&config, opt_state->config_dir, pool));
>>> SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
>>> NULL, NULL,
>>> - config, fs_config, pool));
>>> + NULL, fs_config, pool));
>>
>>
>>
>> If you do not need 'config' as well you need *not* populate it.
>
> Oh yeah ... now I just did the change by not populating the 'config' and
> also undeclared it.
> Thanks for the comments... :)
>
> I have attached the recent patch and the log message with this mail.

I suppose this patch is okay, but I really wish that the documentation for
svn_repos_create() was more clear. I mean, if the function doesn't use
'config', why does it accept 'config'? It tells API consumers that 'config'
can be passed as NULL, but doesn't say why anyone would choose or choose not
to do that. Weird.

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2011-01-11 16:04:06 CET

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