[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 txn-table.c

From: Greg Stein <gstein_at_lyra.org>
Date: 2000-12-14 13:54:35 CET

On Thu, Dec 14, 2000 at 07:44:14AM -0500, Jim Blandy wrote:
> > Actually, isn't this a facet of all calls to svn_fs__*_to_dbt()? That you're
> > feeding data to the DBT for insertion, and that nothing will attempt to
> > change the DBT after that point?
> >
> > IOW, why wouldn't this cast move inside of str_to_dbt and a "const" applied
> > to the str_to_dbt prototype?
> The other *_to_dbt calls actually copy their arguments, so making
> their arguments const is appropriate there. str_to_dbt points to its
> argument, and we can't promise that the DB won't modify it (there are
> some calls that both read and write a DBT). So the cast needs to be
> made by code which can be sure it's correct.

Gotcha. Cool.

btw, I'm happy to be seeing more "const" appearing in your code. It
definitely helps in understanding what is an "in" vs "out" (or in/out)


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

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