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