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

RE: svn commit: r1543596 - in /subversion/trunk/subversion: libsvn_fs_x/changes.c libsvn_fs_x/noderevs.c libsvn_fs_x/reps.c libsvn_fs_x/string_table.c libsvn_subr/packed_data.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Tue, 19 Nov 2013 23:45:50 +0100

> -----Original Message-----
> From: stefan2_at_apache.org [mailto:stefan2_at_apache.org]
> Sent: dinsdag 19 november 2013 23:17
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1543596 - in /subversion/trunk/subversion:
> libsvn_fs_x/changes.c libsvn_fs_x/noderevs.c libsvn_fs_x/reps.c
> libsvn_fs_x/string_table.c libsvn_subr/packed_data.c
>
> Author: stefan2
> Date: Tue Nov 19 22:17:09 2013
> New Revision: 1543596
>
> URL: http://svn.apache.org/r1543596
> Log:
> Silence a number of integer size conversion warnings by casting the output
> of our rather generic reader functions to the correct target type.
>
> * subversion/libsvn_fs_x/string_table.c
> (svn_fs_x__read_string_table): explicitly cast to the target type
> * subversion/libsvn_fs_x/reps.c
> (svn_fs_x__read_reps_container): ditto
> * subversion/libsvn_fs_x/noderevs.c
> (svn_fs_x__read_noderes_container): ditto
> * subversion/libsvn_fs_x/changes.c
> (svn_fs_x__read_changes_container): ditto
> * subversion/libsvn_subr/packed_data.c
> (svn_packed__get_bytes): ditto
>
> Modified:
> subversion/trunk/subversion/libsvn_fs_x/changes.c
> subversion/trunk/subversion/libsvn_fs_x/noderevs.c
> subversion/trunk/subversion/libsvn_fs_x/reps.c
> subversion/trunk/subversion/libsvn_fs_x/string_table.c
> subversion/trunk/subversion/libsvn_subr/packed_data.c
>
> Modified: subversion/trunk/subversion/libsvn_fs_x/changes.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/cha
> nges.c?rev=1543596&r1=1543595&r2=1543596&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/libsvn_fs_x/changes.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_x/changes.c Tue Nov 19
> 22:17:09 2013
> @@ -413,17 +413,17 @@ svn_fs_x__read_changes_container(svn_fs_
> {
> binary_change_t change;
>
> - change.flags = svn_packed__get_uint(changes_stream);
> - change.path = svn_packed__get_uint(changes_stream);
> + change.flags = (int)svn_packed__get_uint(changes_stream);
> + change.path = (apr_size_t)svn_packed__get_uint(changes_stream);
>
> - change.copyfrom_rev = svn_packed__get_uint(changes_stream);
> - change.copyfrom_path = svn_packed__get_uint(changes_stream);
> + change.copyfrom_rev =
> (svn_revnum_t)svn_packed__get_uint(changes_stream);
> + change.copyfrom_path =
> (apr_size_t)svn_packed__get_uint(changes_stream);

I'm not really familiar with the fsx disk format, but in all the other Subversion layers copyfrom_rev would be -1 (=SVN_INVALID_REVNUM) when not copied, so svn_revnum_t can't be one-on-one expressed as an uint.

Is there a specific conversion that sets the revision to invalid in some other place?
(Otherwise adding the cast from uint64 might hide a real problem)

        Bert
Received on 2013-11-19 23:46:35 CET

This is an archived mail posted to the Subversion Dev mailing list.