[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 dag.c

From: Karl Fogel <kfogel_at_galois.collab.net>
Date: 2001-02-07 00:42:17 CET

brane@tigris.org writes:
> Log:
> Oh all right, I give in.
>
> (But I still think svn_fs__parse_skel and friends should take `const
> char*' parameters.)
>
> (dag_init_fs): Make rep_skel and rev_skel non-const and remove casts.

Heh heh.

I've been watching that comment (in the code) for a long time,
wondering when it would get resolved. :-)

> Revision Changes Path
> 1.6 +4 -11 subversion/subversion/libsvn_fs/dag.c
>
> Index: dag.c
> ===================================================================
> RCS file: /cvs/subversion/subversion/libsvn_fs/dag.c,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -r1.5 -r1.6
> --- dag.c 2001/02/07 01:26:41 1.5
> +++ dag.c 2001/02/07 01:30:31 1.6
> @@ -39,20 +39,13 @@
> {
> svn_fs_t *fs = fs_baton;
>
> - /* xbc FIXME: We're creating skels from constant data here. That
> - means the compiler is going to complain about discarding `const',
> - but I refuse to cast away the const, and I'm certainly not about
> - to go building skels by hand; the code is much clearer this
> - way. Maybe svn_fs__parse_skel should take a `const char*'
> - parameter after all. */
> -
> /* Create empty root directory with node revision 0.0:
> "nodes" : "0.0" -> "(fulltext [(dir ()) ()])" */
> {
> - static const char rep_skel[] = "(fulltext ((dir ()) ()))";
> + static char rep_skel[] = "(fulltext ((dir ()) ()))";
> SVN_ERR (svn_fs__put_rep (fs,
> svn_fs_parse_id ("0.0", 3, trail->pool),
> - svn_fs__parse_skel ((char *) rep_skel,
> + svn_fs__parse_skel (rep_skel,
> sizeof (rep_skel) - 1,
> trail->pool),
> trail->db_txn,
> @@ -62,10 +55,10 @@
> /* Link it into filesystem revision 0:
> "revisions" : 0 -> "(revision 3 0.0 ())" */
> {
> - static const char rev_skel[] = "(revision 3 0.0 ())";
> + static char rev_skel[] = "(revision 3 0.0 ())";
> svn_revnum_t rev = 0;
> SVN_ERR (svn_fs__put_rev (&rev, fs,
> - svn_fs__parse_skel ((char *) rev_skel,
> + svn_fs__parse_skel (rev_skel,
> sizeof (rev_skel) - 1,
> trail->pool),
> trail->db_txn,
>
>
>
Received on Sat Oct 21 14:36:21 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.