diff libinterp/corefcn/input.cc @ 27160:6b0c61a5a0f0

move global error configuration and status variables inside a class * error.h, error.cc (error_system): New class. (Vbacktrace_on_warning, Vbeep_on_error, Vdebug_on_caught, Vdebug_on_error, Vdebug_on_warning, Vlast_error_id, Vlast_error_message, Vlast_error_stack, Vlast_warning_id, Vlast_warning_message, Vquiet_warning, Vverbose_warning, buffer_error_messages, discard_error_messages, discard_warning_messages, in_try_catch, warning_options): Move global and file-scope static variables inside error_system class. Change all uses. * interpreter.h, interpreter.cc (m_error_system): New member variable. (get_error_system): New function. * interpreter-private.h, interpreter-private.cc (__get_error_system__): New function.
author John W. Eaton <jwe@octave.org>
date Fri, 31 May 2019 15:49:38 +0000
parents 84ff9953faa1
children eab1c573c4fc
line wrap: on
line diff
--- a/libinterp/corefcn/input.cc	Fri Jun 07 13:29:41 2019 -0400
+++ b/libinterp/corefcn/input.cc	Fri May 31 15:49:38 2019 +0000
@@ -187,13 +187,17 @@
           {
             int parse_status;
 
+            error_system& es = interp.get_error_system ();
+
             unwind_protect frame;
 
-            frame.protect_var (discard_error_messages);
-            frame.protect_var (discard_warning_messages);
+            frame.add_method (es, &error_system::set_discard_error_messages,
+                              es.discard_error_messages ());
+            frame.add_method (es, &error_system::set_discard_warning_messages,
+                              es.discard_warning_messages ());
 
-            discard_error_messages = true;
-            discard_warning_messages = true;
+            es.discard_error_messages (true);
+            es.discard_warning_messages (true);
 
             try
               {