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

Re: svn commit: r15948 - in trunk/subversion: libsvn_client libsvn_ra libsvn_ra_dav libsvn_ra_local libsvn_ra_svn

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-08-30 00:13:46 CEST

Peter N. Lundblad wrote:

>On Sun, 28 Aug 2005 brane@tigris.org wrote:
>
>
>>+++ trunk/subversion/libsvn_ra/ra_loader.c Sun Aug 28 08:03:41 2005
>>+svn_error_t *svn_ra_open (svn_ra_session_t **session_p,
>>+ const char *repos_URL,
>>+ const svn_ra_callbacks_t *callbacks,
>>+ void *callback_baton,
>>+ apr_hash_t *config,
>>+ apr_pool_t *pool)
>>+{
>>+ /* Ddeprecated function. Copy the contents of the svn_ra_callbacks_t
>>+ to a new svn_ra_callbacks2_t and call svn_ra_open2(). */
>>+ svn_ra_callbacks2_t callbacks2;
>>
>>
>
>Ooops! Stack smasher. callbacks2 allocated on the stack; used beyond by
>the session.
>
>
Oops indeed... My bad, I should've caught that.

>>+static void
>>+ra_dav_neonprogress(void * baton, off_t progress, off_t total)
>>+{
>>+ /* Important: don't change the svn_ra_callbacks2_t struct here! */
>>
>>
>
>So, that's why it is const below? (Point is: why this comment?)
>
>
See the comment a few lines later:

>+ /* Set the neon callback to make it call the svn_progress_notify_func_t
>+ * Note that ne_set_progress() takes a non-const baton as the third param.
>+ * Since we don't change the callback struct but only use the non-const
>+ * notification callback items of that struct, it's safe to cast */

The baton we give to ra_dav_neonprogress is const, but since we
obviously have no control over Neon's API, the best we can do is leave
the warning in there.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 30 00:14:33 2005

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.