[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 02:23:49 CET

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?

Cheers,
-g

On Wed, Dec 13, 2000 at 07:02:51PM -0000, jimb@tigris.org wrote:
> User: jimb
> Date: 00/12/13 11:02:51
>
> Modified: subversion/libsvn_fs txn-table.c
> Log:
> * libsvn_fs/txn-table.c (put_txn, svn_fs__get_txn): Acknowledge the
> loss of svn_txn's constness, at a point where it is clear this does no
> harm.
>
> Revision Changes Path
> 1.4 +7 -2 subversion/subversion/libsvn_fs/txn-table.c
>
> Index: txn-table.c
> ===================================================================
> RCS file: /cvs/subversion/subversion/libsvn_fs/txn-table.c,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- txn-table.c 2000/12/13 18:52:41 1.3
> +++ txn-table.c 2000/12/13 19:02:51 1.4
> @@ -72,7 +72,9 @@
> txn_skel);
> svn_fs__prepend (svn_fs__str_atom ("transaction", pool), txn_skel);
>
> - svn_fs__str_to_dbt (&key, svn_txn);
> + /* Only in the context of this function do we know that the DB call
> + will not attempt to modify svn_txn, so the cast belongs here. */
> + svn_fs__str_to_dbt (&key, (char *) svn_txn);
> svn_fs__skel_to_dbt (&value, txn_skel, pool);
> SVN_ERR (DB_WRAP (fs, "storing transaction record",
> fs->transactions->put (fs->transactions, trail->db_txn,
> @@ -174,9 +176,12 @@
> DBT key, value;
> skel_t *transaction;
>
> + /* Only in the context of this function do we know that the DB call
> + will not attempt to modify svn_txn, so the cast belongs here. */
> + svn_fs__str_to_dbt (&key, (char *) svn_txn);
> SVN_ERR (DB_WRAP (fs, "reading transaction",
> fs->transactions->get (fs->transactions, trail->db_txn,
> - svn_fs__str_to_dbt (&key, svn_txn),
> + &key,
> svn_fs__result_dbt (&value),
> 0)));
> svn_fs__track_dbt (&value, trail->pool);
>
>
>

-- 
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.