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

Re: [PATCH] Add svn_revnum_to_cstring function

From: Erik Huelsmann <e.huelsmann_at_gmx.net>
Date: 2004-05-07 00:16:47 CEST

>This patch adds a function svn_revnum_to_cstring(), chich converts a
>svn_revnum_t into a string. I created a function instead of a macro,
>since we need to convert to UTF-8.

>This is a part of resolving the remaining issues for l10n. A patch that
>replaces occurences of SVN_REVNUM_T_FMT in printf-like context with a call
>to this function will follow.

Hi Peter,

I quickly read your patch below and have put some comments there.

>Add function to convert a svn_revnum_t to a string.
>
>* subversion/include/svn_types.h:
> (svn_revnum_to_cstring): New function.
>* subversion/libsvn_subr/revnum.c
> New file.
Possibly there are other type conversions necessary (although not yet
identified) for SVN or APR types. Those could be added to this new file if
it were named type-convertion.c (or something alike).

[ ... ]

>+const char *
>+svn_revnum_to_cstring (svn_revnum_t revnum,
>+ apr_pool_t* pool)
>+{
>+ svn_error_t *err;
>+ const char *s;
>+ const char *ret;
>+
>+ s = apr_psprintf (pool, "%" SVN_REVNUM_T_FMT, revnum);
>+
>+ err = svn_utf_cstring_to_utf8 (&ret, s, pool);
>+
>+ if (err) {
>+ svn_error_clear (err);
>+ /* Better to give out something than nothing */

Indeed, but not something in the wrong encoding... Hmmm; maybe it just
became impossible to call this conversion in-line because of the need to be
able to error out... ? grep seems to indicate a rewrite of 'only' 178
instances. I need some time to think about a proper solution.

>+ ret = s;
>+ }
>+
>+ return ret;
>+}

-- 
"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 7 00:17:04 2004

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.