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

Re: Questions about svn_error_clear().

From: Steven Kirk <steven.kirk_at_status-scientific.com>
Date: 2004-12-16 14:19:09 CET

> 3. Make svn_error_clear() a macro like this:
>
> #define svn_error_clear(svn_error_clear__err) \
> do { \
> svn_error__clear_internal(svn_error_clear__err); \
> (svn_error_clear__err) = NULL; \
> } while (0)
>
> PROS: Solves the problem everywhere, forever. Small code change.
> CONS: Code like this in mod_dav_svn/repos.c is no longer possible:
>
> svn_error_clear(svn_fs_open_txn(&(res2->info->root.txn),
> res2->info->repos->fs,
> res2->info->root.txn_name,
> res2->info->repos->pool));
>
> Note that this code would get a compile error ("invalid
> lvalue in assignment"), so it's not like we could end up
> accidentally calling the function twice instead of once.
> However, we would have to rewrite a few places to use an
> external error variable, and fix the doc string of
> svn_error_clear() to not recommend this idiom.
>
>
Another option

  #define svn_error_clear(err) svn_error_clear2(&(err))

And at the end of svn_error_clear_internal:

  *err = NULL;

svn_error_clear() would remain in the svn libs as to not break binary compatibility.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Dec 16 14:20:36 2004

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.