[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_fs tree.c

From: Jim Blandy <jimb_at_zwingli.cygnus.com>
Date: 2001-03-11 19:40:18 CET

Greg Stein <gstein@lyra.org> writes:
> On Sat, Mar 10, 2001 at 05:49:45PM -0000, gstein@tigris.org wrote:
> >...
> > --- tree.c 2001/03/10 06:51:17 1.38
> > +++ tree.c 2001/03/10 17:49:45 1.39
> > @@ -591,6 +591,64 @@
> > return SVN_NO_ERROR;
> > }
> >
> > +struct is_kind_args {
> > + int (*query)(dag_node_t *node);
> > + svn_fs_root_t *root;
> > + const char *path;
> > +
> > + int result; /* OUT parameter */
> > +};
>
> Any problem with converting some of the other _args structures to use an
> "out" field(s), rather than a pointer to memory to change? The field is much
> simpler to deal with.

That seems fine. I guess I was worried I'd forget to copy the value
out of the args structure, while the compiler will catch any missing
`*' operators, but they certainly are annoying.

Also, I think it's important that, when a function takes some
arguments by reference, it should leave those arguments untouched if
it returns an error. But this means, effectively, that you have to
fill in all your reference arguments just before you return
SVN_NO_ERROR; see svn_fs_revision_root for an example. So you've got
the risk of forgetting the assignment anyway.

So I don't see any reason any more not to just fill in a field in the
args structure.
Received on Sat Oct 21 14:36:25 2006

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.