[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: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 11 Jan 2011 17:26:41 +0200

C. Michael Pilato wrote on Tue, Jan 11, 2011 at 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.
>

Forward compatibility: suppose we add a

        % head ~/.subversion/config
        [svnadmin]
        create-readme-file = false

directive. This will be implemented in the library and require no code
changes in svnadmin.
Received on 2011-01-11 16:30:32 CET

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