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

Re: CVS update: subversion/subversion/libsvn_delta xml_parse.c

From: Greg Stein <gstein_at_lyra.org>
Date: 2000-10-20 20:39:39 CEST

On Fri, Oct 20, 2000 at 06:26:10PM -0000, sussman@tigris.org wrote:
> User: sussman
> Date: 00/10/20 11:26:10
>
> Modified: subversion/libsvn_delta xml_parse.c
> Log:
> Remove silly style of calling function pointers.
>
> Revision Changes Path
> 1.126 +16 -16 subversion/subversion/libsvn_delta/xml_parse.c
>
> Index: xml_parse.c
> ===================================================================
> RCS file: /cvs/subversion/subversion/libsvn_delta/xml_parse.c,v
> retrieving revision 1.125
> retrieving revision 1.126
> diff -u -r1.125 -r1.126
> --- xml_parse.c 2000/10/12 21:21:50 1.125
> +++ xml_parse.c 2000/10/20 18:26:10 1.126
> @@ -478,14 +478,14 @@
>
> /* Call our editor's callback. */
> if (replace_p)
> - err = (* (digger->editor->replace_directory))
> + err = digger->editor->replace_directory
> (dir_name,
> youngest_frame->baton,
> youngest_frame->ancestor_path,
> youngest_frame->ancestor_version,
> &(youngest_frame->baton));

Personally, I find (*funcptr)(args) much more readable than funcptr(args).
In the former case, you *know* that you have a *variable* holding a function
pointer.

Consider:

    replace_directory(args);

In the above call, is replace_directory a function pointer or the function
name itself? You have to find the variable or find the function before you
can resolve that issue.

    (*replace_directory)(args);

In the above, I *know* it is a function pointer.

So, to follow suit with people requesting stylistic changes, can we please
stick to deref'ing function pointers explicitly?

thx,
-g

-- 
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:12 2006

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