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

Re: svn commit: r1100704 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Mon, 09 May 2011 15:48:08 +0100

Hyrum K Wright wrote:
> On Sun, May 8, 2011 at 3:34 AM, <rhuijben_at_apache.org> wrote:
> > - for (i = relpath_depth(local_relpath); i > op_depth; --i)
> > + for (i = (int)relpath_depth(local_relpath); i > op_depth; --i)
> >
> > - for (i = relpath_depth(current_relpath); i > op_depth; i--)
> > + for (i = (int)relpath_depth(current_relpath); i > op_depth; i--)
> >
> > - lock_depth = relpath_depth(local_relpath);
> > + lock_depth = (int)relpath_depth(local_relpath);
> >
> > - levels += relpath_depth(lock_relpath);
> > + levels += (int)relpath_depth(lock_relpath);
> >
> > - int depth = relpath_depth(local_relpath);
> > + int depth = (int)relpath_depth(local_relpath);
> >
> > - lock_level = relpath_depth(local_relpath);
> > + lock_level = (int)relpath_depth(local_relpath);

> Instead of all the casting, why don't we just change the types of the
> various local variables?

Alternatively... I'd like to change all our uses of apr_int64_t for
(wc_id, repos_id, op_depth) to plain "int". I think that would be
better because it would only occupy one syllable of thought-space rather
than eight syllables. And I believe there's no functional or
programmatic reason or benefit for having these three types be int64_t.

To do that, I would need to introduce an additional type letter into the
"bindf" format, because some parameters will still need to be int64_t (I
can't remember what, but I looked at this before and there were some).
Note that revnum_t is not relevant because it already has its own type
letter "r".

I was thinking like this, in sequential steps:
 
  1. In "bindf" introduce letter "I" for int64_t (in parallel with the
current "i" which is currently for int64_t).

  2. Change bindf's callers to use "I" for any parameters that are still
going to be using int64_t (i.e. not wc_id, repos_id, or op_depth).

  3. Change the types of (wc_id, repos_id, op_depth) variables
throughout the code to "int", and simultaneously change "bindf" so type
code "i" means plain "int".

Thoughts?

- Julian
Received on 2011-05-09 16:48:43 CEST

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.