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

Re: svn commit: r35207 - in trunk/subversion: include libsvn_client

From: Greg Stein <gstein_at_gmail.com>
Date: Tue, 13 Jan 2009 08:57:18 -0800

Why are these apr_off_t rather than svn_filesize_t? The latter was
created *specifically* to represent the size of an svn file, and has
always been defined as a 64-bit value.

On Tue, Jan 13, 2009 at 07:23, Julian Foad <julianfoad_at_btopenworld.com> wrote:
> Author: julianfoad
> Date: Tue Jan 13 07:23:28 2009
> New Revision: 35207
>
> Log:
> Follow up r35191: rename the constants related to svn_info_t's new 64-bit
> file size fields to reflect that relationship, and tweak the comments.
>
> * subversion/include/svn_client.h
> (SVN_FILE_SIZE_UNKNOWN): Rename to ...
> (SVN_INFO_SIZE64_UNKNOWN): ... new name.
> (svn_info_t): Tweak comments.
>
> * subversion/libsvn_client/info.c
> (build_info_from_dirent, build_info_from_entry, build_info_for_unversioned):
> Adjust accordingly and tweak comments.
>
> Modified:
> trunk/subversion/include/svn_client.h
> trunk/subversion/libsvn_client/info.c
>
> Modified: trunk/subversion/include/svn_client.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_client.h?pathrev=35207&r1=35206&r2=35207
> ==============================================================================
> --- trunk/subversion/include/svn_client.h Tue Jan 13 06:59:46 2009 (r35206)
> +++ trunk/subversion/include/svn_client.h Tue Jan 13 07:23:28 2009 (r35207)
> @@ -4310,7 +4310,7 @@ svn_client_unlock(const apr_array_header
> *
> * @since New in 1.6
> */
> -#define SVN_FILE_SIZE_UNKNOWN ((apr_off_t) -1)
> +#define SVN_INFO_SIZE64_UNKNOWN ((apr_off_t) -1)
>
> /**
> * A structure which describes various system-generated metadata about
> @@ -4378,39 +4378,39 @@ typedef struct svn_info_t
> svn_depth_t depth;
>
> /**
> - * Similar to working_size64, but working_size will be
> - * @c SVN_INFO_SIZE_UNKNOWN when its value overflows apr_size_t.
> + * Similar to working_size64, but will be @c SVN_INFO_SIZE_UNKNOWN when
> + * its value would overflow apr_size_t (so when size >= 4 GB - 1 byte).
> *
> * @deprecated Provided for backward compatibility with the 1.5 API.
> */
> - apr_size_t working_size; /* ### Overflows on > 4 GB files. */
> + apr_size_t working_size;
>
> /** @} */
>
> /**
> * Similar to size64, but size will be @c SVN_INFO_SIZE_UNKNOWN when
> - * its value overflows apr_size_t.
> + * its value would overflow apr_size_t (so when size >= 4 GB - 1 byte).
> *
> * @deprecated Provided for backward compatibility with the 1.5 API.
> */
> apr_size_t size;
> -
> +
> /**
> * The size of the file in the repository (untranslated,
> * e.g. without adjustment of line endings and keyword
> * expansion). Only applicable for file -- not directory -- URLs.
> - * For working copy paths, size will be @c SVN_FILE_SIZE_UNKNOWN.
> + * For working copy paths, size64 will be @c SVN_INFO_SIZE64_UNKNOWN.
> * @since New in 1.6.
> */
> apr_off_t size64;
> -
> +
> /**
> * The size of the file after being translated into its local
> - * representation, or @c SVN_FILE_SIZE_UNKNOWN if
> + * representation, or @c SVN_INFO_SIZE64_UNKNOWN if
> * unknown. Not applicable for directories.
> * @since New in 1.6.
> * @name Working-copy path fields
> - * @{
> + * @{
> */
> apr_off_t working_size64;
>
>
> Modified: trunk/subversion/libsvn_client/info.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/info.c?pathrev=35207&r1=35206&r2=35207
> ==============================================================================
> --- trunk/subversion/libsvn_client/info.c Tue Jan 13 06:59:46 2009 (r35206)
> +++ trunk/subversion/libsvn_client/info.c Tue Jan 13 07:23:28 2009 (r35207)
> @@ -57,14 +57,14 @@ build_info_from_dirent(svn_info_t **info
> tmpinfo->lock = lock;
> tmpinfo->depth = svn_depth_unknown;
> tmpinfo->working_size = SVN_INFO_SIZE_UNKNOWN;
> -
> +
> if (((apr_size_t)dirent->size) == dirent->size)
> tmpinfo->size = (apr_size_t)dirent->size;
> - else /* >= 4GB - 1 byte */
> - tmpinfo->size = SVN_INFO_SIZE_UNKNOWN;
> -
> + else /* >= 4GB */
> + tmpinfo->size = SVN_INFO_SIZE_UNKNOWN;
> +
> tmpinfo->size64 = dirent->size;
> - tmpinfo->working_size = SVN_FILE_SIZE_UNKNOWN;
> + tmpinfo->working_size = SVN_INFO_SIZE64_UNKNOWN;
> tmpinfo->tree_conflict = NULL;
>
> *info = tmpinfo;
> @@ -109,11 +109,11 @@ build_info_from_entry(svn_info_t **info,
>
> if (((apr_size_t)entry->working_size) == entry->working_size)
> tmpinfo->working_size = (apr_size_t)entry->working_size;
> - else /* >= 4GB - 1 byte */
> + else /* >= 4GB */
> tmpinfo->working_size = SVN_INFO_SIZE_UNKNOWN;
>
> tmpinfo->size = SVN_INFO_SIZE_UNKNOWN;
> - tmpinfo->size64 = SVN_FILE_SIZE_UNKNOWN;
> + tmpinfo->size64 = SVN_INFO_SIZE64_UNKNOWN;
>
> tmpinfo->working_size64 = entry->working_size;
>
> @@ -154,8 +154,8 @@ build_info_for_unversioned(svn_info_t **
> tmpinfo->lock = NULL;
> tmpinfo->working_size = SVN_INFO_SIZE_UNKNOWN;
> tmpinfo->size = SVN_INFO_SIZE_UNKNOWN;
> - tmpinfo->size64 = SVN_FILE_SIZE_UNKNOWN;
> - tmpinfo->working_size64 = SVN_FILE_SIZE_UNKNOWN;
> + tmpinfo->size64 = SVN_INFO_SIZE64_UNKNOWN;
> + tmpinfo->working_size64 = SVN_INFO_SIZE64_UNKNOWN;
> tmpinfo->tree_conflict = NULL;
>
> *info = tmpinfo;
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1022087
>
Received on 2009-01-13 17:58:20 CET

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