Mercurial > hg > octave-lyh
changeset 9395:1de00ca9c9f2
avoid passing local variable pointers to unwind_protect
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 25 Jun 2009 11:41:46 +0200 |
parents | b3ab22ee8544 |
children | 17af7cce7d1b |
files | src/ChangeLog src/input.cc src/ls-mat5.cc src/ov-fcn-handle.cc src/parse.y src/toplev.cc src/variables.cc |
diffstat | 7 files changed, 17 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2009-06-25 Jaroslav Hajek <highegg@gmail.com> + + * input.cc: Use unwind_protect::add_action_var where appropriate. + * ls-mat5.cc: Ditto. + * ov-fcn-handle.cc: Ditto. + * parse.y: Ditto. + * toplev.cc: Ditto. + * variables.cc: Ditto. + 2009-06-25 Jaroslav Hajek <highegg@gmail.com> * unwind-prot.h (unwind_protect::elem): New polymorphic class.
--- a/src/input.cc +++ b/src/input.cc @@ -669,7 +669,7 @@ // Do this with an unwind-protect cleanup function so that the // forced variables will be unmarked in the event of an interrupt. symbol_table::scope_id scope = symbol_table::top_scope (); - unwind_protect::add (symbol_table::unmark_forced_variables, &scope); + unwind_protect::add_action_var (symbol_table::unmark_forced_variables, scope); // This is the same as yyparse in parse.y. int retval = octave_parse ();
--- a/src/ls-mat5.cc +++ b/src/ls-mat5.cc @@ -875,7 +875,7 @@ // that defines the anonymous function. symbol_table::scope_id local_scope = symbol_table::alloc_scope (); - unwind_protect::add (symbol_table::erase_scope, &local_scope); + unwind_protect::add_action_var (symbol_table::erase_scope, local_scope); symbol_table::set_scope (local_scope);
--- a/src/ov-fcn-handle.cc +++ b/src/ov-fcn-handle.cc @@ -319,7 +319,7 @@ // defines the anonymous function. symbol_table::scope_id local_scope = symbol_table::alloc_scope (); - unwind_protect::add (symbol_table::erase_scope, &local_scope); + unwind_protect::add_action_var (symbol_table::erase_scope, local_scope); symbol_table::set_scope (local_scope); @@ -500,7 +500,7 @@ // defines the anonymous function. symbol_table::scope_id local_scope = symbol_table::alloc_scope (); - unwind_protect::add (symbol_table::erase_scope, &local_scope); + unwind_protect::add_action_var (symbol_table::erase_scope, local_scope); symbol_table::set_scope (local_scope); @@ -945,7 +945,7 @@ // defines the anonymous function. symbol_table::scope_id local_scope = symbol_table::alloc_scope (); - unwind_protect::add (symbol_table::erase_scope, &local_scope); + unwind_protect::add_action_var (symbol_table::erase_scope, local_scope); symbol_table::set_scope (local_scope);
--- a/src/parse.y +++ b/src/parse.y @@ -3262,7 +3262,7 @@ // the forced variables will be unmarked in the event of an // interrupt. symbol_table::scope_id scope = symbol_table::top_scope (); - unwind_protect::add (symbol_table::unmark_forced_variables, &scope); + unwind_protect::add_action_var (symbol_table::unmark_forced_variables, scope); if (! help_txt.empty ()) help_buf.push (help_txt);
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -560,7 +560,7 @@ // the forced variables will be unmarked in the event of an // interrupt. symbol_table::scope_id scope = symbol_table::top_scope (); - unwind_protect::add (symbol_table::unmark_forced_variables, &scope); + unwind_protect::add_action_var (symbol_table::unmark_forced_variables, scope); // This is the same as yyparse in parse.y. retval = octave_parse ();
--- a/src/variables.cc +++ b/src/variables.cc @@ -1389,7 +1389,7 @@ // Set up temporary scope. symbol_table::scope_id tmp_scope = symbol_table::alloc_scope (); - unwind_protect::add (symbol_table::erase_scope, &tmp_scope); + unwind_protect::add_action_var (symbol_table::erase_scope, tmp_scope); symbol_table::set_scope (tmp_scope);