[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r33104 - in trunk/subversion: include libsvn_subr libsvn_wc

From: Stefan Sperling <stsp_at_elego.de>
Date: Tue, 16 Sep 2008 22:32:06 +0200

On Tue, Sep 16, 2008 at 12:32:35PM -0700, Greg Stein wrote:
> On Tue, Sep 16, 2008 at 12:22 PM, <stsp_at_tigris.org> wrote:
> >...
> \> +++ trunk/subversion/libsvn_subr/svn_string.c Tue Sep 16 12:22:13
> 2008 (r33104)
> > @@ -417,6 +417,16 @@ svn_stringbuf_appendcstr(svn_stringbuf_t
> > }
> >
> >
> > +void
> > +svn_stringbuf_appendchar(svn_stringbuf_t *targetstr,
> > + char c)
> > +{
> > + char s[2];
> > +
> > + s[0] = c;
> > + s[1] = '\0';
> > + svn_stringbuf_appendbytes(targetstr, s, 1);
> > +}
>
> That seems more complicated than it needs to be. appendbytes() won't
> look at any bytes past the given length. The above can be wriiten more
> simply as:
>
> {
> svn_stringbuf_appendbytes(targetstr, &c, 1);
> }

Thanks, r33107.

I'd like to get rid of svn_stringbuf_appendchar altogether and
just use svn_stringbuf_appendbytes directly, but unfortunately it's
not possible to take the address of a literal char in C, so &('\n')
won't work. libsvn_wc/tree_conflicts.c needs to append macros
which expand to literal chars to a string.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-09-16 22:32:35 CEST

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.