Greg Stein wrote on Wed, Apr 25, 2012 at 04:35:46 -0400:
> On Wed, Apr 25, 2012 at 04:24, Daniel Shahaf <danie...@elego.de> wrote:
> >...
> > SVN_ERR_ASSERT(x) === SVN_ERR_ASSERT(x, SVN_NO_ERROR)
> >
> > Still, I would prefer not to deprecate SVN_ERR_ASSERT() because that
> > would kill readability for the 99% common case.  So:
> >
> > - I'll redefine SVN_ERR_ASSERT() as above
> 
> Does that imply a compose_create() call where arg2 is always SVN_NO_ERROR? 
> Ugh.
> 

Yes.  We could restructure things though -- implement
svn_error_compose_create() as a macro, or have SVN_ERR_ASSERT2() (in its
new name) optimize for the case that ERR is NULL:

if (!(expr)) {
  svn_error_t *e1 = (err), *e2 = svn_error__malfunction();
  return (e1 ? svn_error_compose_create(e2, e1) : e2);
}

Reply via email to