You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2008/11/21 14:36:22 UTC

Re: svn commit: r34304 - trunk/subversion/svn

On Fri, Nov 21, 2008 at 06:33,  <st...@tigris.org> wrote:
>...
> +++ trunk/subversion/svn/tree-conflicts.h       Fri Nov 21 06:33:02 2008        (r34304)
> @@ -35,14 +35,16 @@ extern "C" {
>
>
>  /**
> - * Append to @a descriptions a possibly localized human readable
> + * Return in @a desc a possibly localized human readable
>  * description of a tree conflict described by @a conflict.
>  *
> + * Allocate the result in @a pool.
> + *
>  * @since New in 1.6.
>  */
>  svn_error_t *
> -svn_cl__append_human_readable_tree_conflict_description(
> -  svn_stringbuf_t *descriptions,
> +svn_cl__get_human_readable_tree_conflict_description(
> +  svn_string_t **desc,
>   const svn_wc_conflict_description_t *conflict,
>   apr_pool_t *pool);

Does this need to be an svn_string_t ? Couldn't it be a simple const char * ?

Cheers,
-g

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r34304 - trunk/subversion/svn

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Nov 21, 2008 at 10:16:48AM -0500, C. Michael Pilato wrote:
> Stefan Sperling wrote:
> > On Fri, Nov 21, 2008 at 06:36:22AM -0800, Greg Stein wrote:
> >> On Fri, Nov 21, 2008 at 06:33,  <st...@tigris.org> wrote:
> >>> ...
> >>> +++ trunk/subversion/svn/tree-conflicts.h       Fri Nov 21 06:33:02 2008        (r34304)
> >>> @@ -35,14 +35,16 @@ extern "C" {
> >>>
> >>>
> >>>  /**
> >>> - * Append to @a descriptions a possibly localized human readable
> >>> + * Return in @a desc a possibly localized human readable
> >>>  * description of a tree conflict described by @a conflict.
> >>>  *
> >>> + * Allocate the result in @a pool.
> >>> + *
> >>>  * @since New in 1.6.
> >>>  */
> >>>  svn_error_t *
> >>> -svn_cl__append_human_readable_tree_conflict_description(
> >>> -  svn_stringbuf_t *descriptions,
> >>> +svn_cl__get_human_readable_tree_conflict_description(
> >>> +  svn_string_t **desc,
> >>>   const svn_wc_conflict_description_t *conflict,
> >>>   apr_pool_t *pool);
> >> Does this need to be an svn_string_t ? Couldn't it be a simple const char * ?
> > 
> > There seems to no API for creating C strings from a format string.
> 
> apr_psprintf() ?

Yes, apr_psprintf indeed, see r34309.

I only searched our own headers for a suitable function, not APR.
Will do so next time.

Thanks,
Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r34304 - trunk/subversion/svn

Posted by "C. Michael Pilato" <cm...@collab.net>.
Stefan Sperling wrote:
> On Fri, Nov 21, 2008 at 06:36:22AM -0800, Greg Stein wrote:
>> On Fri, Nov 21, 2008 at 06:33,  <st...@tigris.org> wrote:
>>> ...
>>> +++ trunk/subversion/svn/tree-conflicts.h       Fri Nov 21 06:33:02 2008        (r34304)
>>> @@ -35,14 +35,16 @@ extern "C" {
>>>
>>>
>>>  /**
>>> - * Append to @a descriptions a possibly localized human readable
>>> + * Return in @a desc a possibly localized human readable
>>>  * description of a tree conflict described by @a conflict.
>>>  *
>>> + * Allocate the result in @a pool.
>>> + *
>>>  * @since New in 1.6.
>>>  */
>>>  svn_error_t *
>>> -svn_cl__append_human_readable_tree_conflict_description(
>>> -  svn_stringbuf_t *descriptions,
>>> +svn_cl__get_human_readable_tree_conflict_description(
>>> +  svn_string_t **desc,
>>>   const svn_wc_conflict_description_t *conflict,
>>>   apr_pool_t *pool);
>> Does this need to be an svn_string_t ? Couldn't it be a simple const char * ?
> 
> There seems to no API for creating C strings from a format string.

apr_psprintf() ?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn commit: r34304 - trunk/subversion/svn

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Nov 21, 2008 at 06:36:22AM -0800, Greg Stein wrote:
> On Fri, Nov 21, 2008 at 06:33,  <st...@tigris.org> wrote:
> >...
> > +++ trunk/subversion/svn/tree-conflicts.h       Fri Nov 21 06:33:02 2008        (r34304)
> > @@ -35,14 +35,16 @@ extern "C" {
> >
> >
> >  /**
> > - * Append to @a descriptions a possibly localized human readable
> > + * Return in @a desc a possibly localized human readable
> >  * description of a tree conflict described by @a conflict.
> >  *
> > + * Allocate the result in @a pool.
> > + *
> >  * @since New in 1.6.
> >  */
> >  svn_error_t *
> > -svn_cl__append_human_readable_tree_conflict_description(
> > -  svn_stringbuf_t *descriptions,
> > +svn_cl__get_human_readable_tree_conflict_description(
> > +  svn_string_t **desc,
> >   const svn_wc_conflict_description_t *conflict,
> >   apr_pool_t *pool);
> 
> Does this need to be an svn_string_t ? Couldn't it be a simple const char * ?

There seems to no API for creating C strings from a format string.
So since we have to create a svn_string_t anyway, why not pass it up?
I don't see much point in passing around naked pointers to C strings
wherever possible. Why have svn_string_t in the first place if we just
use it to create naked C strings from a format string (i.e. create
a svn_string_t s, but then return s->data)?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org