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

Re: [PATCH] Last two ra callbacks for Python binding

From: David James <james_at_cs.toronto.edu>
Date: 2007-08-17 01:55:30 CEST

On 8/16/07, Eric Gillespie <epg@pretzelnet.org> wrote:
> Eric Gillespie <epg@pretzelnet.org> writes:
>
> > structure, but the progress wrapper has some problem. If I use
> > make_ob_pool as for the other ra callbacks, I get a segfault.
> > According to gdb, pool is NULL, but I verified it is not by
> > adding a test block that apr_pstrdups and prints a string. I
> > can't figure out what's wrong.
>
> Dan Christian found my problem:
>
> > + if ((result = PyObject_CallFunction(py_callback,
> > + (char *)"ll", progress, total)) == NULL)
> > +/* Why does this segfault? */
> > +/* (char *)"llO&", progress, total, */
> > +/* make_ob_pool, pool)) == NULL) */
>
> Whoops, apr_off_t is 64 bits! That should be LL. Is that always
> the case? Should I hard-code LL like that, or use a different
> format string depending on sizeof(progress)?

In order for this to work on old versions of APR where
sizeof(apr_off_t) == sizeof(long), you'll have to case this based on
sizeof(progress) and sizeof(long).

Cheers,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 17 01:53:19 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.