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

Formalizing flow control 'goto' macros

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-09-06 19:11:42 CEST

On Wed, 29 Aug 2007, Daniel Rall wrote:

>
> On Aug 29, 2007, at 1:36 AM, Daniel Rall wrote:
>
> >
> >On Aug 28, 2007, at 4:39 AM, Lieven Govaerts wrote:
> >
> >>Quoting Daniel Rall <dlr@finemaltcoding.com>:
> >>
> >>>
> >>>On Aug 26, 2007, at 1:05 AM, Lieven Govaerts wrote:
> >>..
> >>>>In mergeinfo-sqlite-index.c/svn_fs_mergeinfo__get_mergeinfo(), but
> >>>>also
> >>>>in svn_fs_mergeinfo__update_index and
> >>>>svn_fs_mergeinfo__get_mergeinfo_for_tree the call to
> >>>>sqlite3_close is
> >>>>not in the 'finally' path (in java terms), so whenever there's an
> >>>>error
> >>>>accessing the database it's not closed correctly.
> >>>>
> >>>>Does this make sense?
> >>>
> >>>Thanks for the report, Lieven. I've added some simple error
> >>>handling
> >>>improvements in r26340 which fix this problem.
> >>
> >>That should do it. One small remark: What do you think of renaming
> >>the
> >>MAYBE_CLEANUP macro to CLEANUP_ON_ERROR, extending it
> >>to take the 'err' variable as parameter and move to a
> >>common include file so we can use it throughout whole the code?
> >>I've found
> >>hundreds of instances where we use this pattern, might as well
> >>make it more
> >>standard.
> >
> >That's not a bad idea -- I cribbed the pattern from libsvn_wc. I
> >guess this would live in a header file under include/private/?
>
> Were you thinking of something like the attached patch, or perhaps
> with a set of macros corresponding to each common label name (e.g.
> error, cleanup, done)?

I committed this patch as-is in r26483.

  • application/pgp-signature attachment: stored
Received on Thu Sep 6 19:08:33 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.