You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Hyrum K Wright <hy...@hyrumwright.org> on 2011/05/21 00:36:29 UTC

Re: svn commit: r1125327 - /subversion/trunk/subversion/svndumpfilter/main.c

This may be picking nits, but is the format for size_t and apr_size_t
guaranteed to be the same on all platforms?

-Hyrum

On Fri, May 20, 2011 at 4:17 AM,  <ph...@apache.org> wrote:
> Author: philip
> Date: Fri May 20 11:17:58 2011
> New Revision: 1125327
>
> URL: http://svn.apache.org/viewvc?rev=1125327&view=rev
> Log:
> * subversion/svndumpfilter/main.c
>  (write_prop_to_stringbuf): Followup to r1125288, make format match type.
>
> Modified:
>    subversion/trunk/subversion/svndumpfilter/main.c
>
> Modified: subversion/trunk/subversion/svndumpfilter/main.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svndumpfilter/main.c?rev=1125327&r1=1125326&r2=1125327&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svndumpfilter/main.c (original)
> +++ subversion/trunk/subversion/svndumpfilter/main.c Fri May 20 11:17:58 2011
> @@ -90,7 +90,7 @@ write_prop_to_stringbuf(svn_stringbuf_t
>   namelen = strlen(name);
>   svn_stringbuf_appendbytes(*strbuf, "K ", 2);
>
> -  bytes_used = apr_snprintf(buf, sizeof(buf), "%d", namelen);
> +  bytes_used = apr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, namelen);
>   svn_stringbuf_appendbytes(*strbuf, buf, bytes_used);
>   svn_stringbuf_appendbyte(*strbuf, '\n');
>
>
>
>

Re: svn commit: r1125327 - /subversion/trunk/subversion/svndumpfilter/main.c

Posted by Greg Stein <gs...@gmail.com>.
On Fri, May 20, 2011 at 18:36, Hyrum K Wright <hy...@hyrumwright.org> wrote:
> This may be picking nits, but is the format for size_t and apr_size_t
> guaranteed to be the same on all platforms?

size_t might not exist on some (ancient) platforms. That is the entire
purpose behind apr_size_t.

But... if size_t exists, then it will match apr_size_t.

Cheers,
-g

Re: svn commit: r1125327 - /subversion/trunk/subversion/svndumpfilter/main.c

Posted by Branko Čibej <br...@e-reka.si>.
On 21.05.2011 00:36, Hyrum K Wright wrote:
> This may be picking nits, but is the format for size_t and apr_size_t
> guaranteed to be the same on all platforms?

I expect it is. But even if it isn't it's certainly better than %d,
because sizeof(int) and sizeof(size_t) are certainly not guaranteed to
be the same.

-- Brane