You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@galois.collab.net> on 2001/02/06 23:42:17 UTC
Re: CVS update: subversion/subversion/libsvn_fs dag.c
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,
>
>
>
Re: CVS update: subversion/subversion/libsvn_fs dag.c
Posted by Branko Čibej <br...@xbc.nu>.
Karl Fogel wrote:
> 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. :-)
>
I figured we could always use GCC's -fbounds-check to find the bugs
afterwards. :-\
--
Brane �ibej
home: <br...@xbc.nu> http://www.xbc.nu/brane/
work: <br...@hermes.si> http://www.hermes-softlab.com/
ACM: <br...@acm.org> http://www.acm.org/