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

Re: [PATH] Fix ra_neon_neonprogress data types

From: Dan Christian <dchristian_at_google.com>
Date: 2007-08-17 02:22:33 CEST

On 8/16/07, Daniel Rall <dlr@collab.net> wrote:
> Hey Dan, I see Neon 0.24.7, 0.26.1, and 0.26.3 all use off_t in the
> progress API in ne_session.h, and ne_off_t defined only in
> ne_request.c:

Oh, fun. No wonder such an obvious compile warning didn't show up earlier.

neon trunk is specifying ne_progress with no_off_t. It looks like it
changed in r1094 on trunk. None of the released versions seem to have
it (even though 0.26.2 and later came after that revision).

Drop the patch for now. Hopefully, the neon developers can tell us
how to handle the transition when they are ready to ship it.

>
> /* Progress callback. */
> typedef void (*ne_progress)(void *userdata, off_t progress, off_t total);
>
> What header file should Subversion be importing to get access to
> ne_off_t's definition?

It was already defined for me. Nothing more was needed. The
definition for ne_progress is in src/ne_session.h. The definition for
ne_off_t is in src/ne_defs.h.

It looks like it can be either 32 or 64 bit depending on if NE_LFS is
defined. Ouch, this looks like another nightmare support situation.
Yet another neon build option that can make binary APIs silently
broken.

-Dan C

>
>
> On Thu, 16 Aug 2007, Dan Christian wrote:
>
> > [[[
> > Fix the arguments to ra_neon_neonprogress to match neon definitions.
> >
> > * subversion/libsvn_ra_neon/session.c
> > (ra_neon_neonprogress) Change off_t to ne_off_t and assert that
> > the arguments to the progress callback don't lose precision.
> > ]]]
> >
> > -Dan C
>
> > Index: subversion/libsvn_ra_neon/session.c
> > ===================================================================
> > --- subversion/libsvn_ra_neon/session.c (revision 26123)
> > +++ subversion/libsvn_ra_neon/session.c (working copy)
> > @@ -600,12 +600,13 @@
> > } neonprogress_baton_t;
> >
> > static void
> > -ra_neon_neonprogress(void *baton, off_t progress, off_t total)
> > +ra_neon_neonprogress(void *baton, ne_off_t progress, ne_off_t total)
> > {
> > const neonprogress_baton_t *neonprogress_baton = baton;
> > if (neonprogress_baton->progress_func)
> > {
> > - neonprogress_baton->progress_func(progress, total,
> > + assert(sizeof(apr_off_t) >= sizeof(ne_off_t));
> > + neonprogress_baton->progress_func((apr_off_t)progress, (apr_off_t)total,
> > neonprogress_baton->progress_baton,
> > neonprogress_baton->pool);
> > }
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 17 02:20:29 2007

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.