diff libinterp/corefcn/utils.cc @ 31105:670a0d878af1

eliminate WHO arguments from interpreter-private functions * interpreter-private.h, inpterpreter-private.cc (__get_interpreter__, __get_dynamic_loader__, __get_error_system__, __get_gh_manager__, __get_help_system__, __get_input_system__, __get_load_path__, __get_load_save_system__, __get_event_manager__, __get_output_system__, __get_type_info__, __get_symbol_table__, __get_current_scope__, __require_current_scope__, __get_evaluator__, __get_bp_table__, __get_child_list__, __get_cdef_manager__, __get_display_info__, __get_gtk_manager__): Eliminate WHO argument. Previously, it was never displayed by __get_interpreter__. And, as pointed out by Petter Tomner in patch #10216, passing a std::string object could have performance issues. (__get_interpreter__): Eliminate useless call to error. Display message to std::cerr then abort.
author John W. Eaton <jwe@octave.org>
date Wed, 22 Jun 2022 12:48:59 -0400
parents c9788d7f6e65
children 076c8f94d7f4
line wrap: on
line diff
--- a/libinterp/corefcn/utils.cc	Tue Jun 21 15:44:03 2022 +0200
+++ b/libinterp/corefcn/utils.cc	Wed Jun 22 12:48:59 2022 -0400
@@ -693,7 +693,7 @@
     if (! suffix.empty ())
       nm.append (suffix);
 
-    load_path& lp = __get_load_path__ ("file_in_path");
+    load_path& lp = __get_load_path__ ();
 
     return sys::env::make_absolute (lp.find_file (nm));
   }
@@ -717,7 +717,7 @@
 
         if (! local_file_ok)
           {
-            load_path& lp = __get_load_path__ ("find_data_file_in_load_path");
+            load_path& lp = __get_load_path__ ();
 
             // Not directly found; search load path.
             std::string tmp = sys::env::make_absolute (lp.find_file (fname));
@@ -754,7 +754,7 @@
           }
         else if (len > 2 && name[len - 2] == '.' && name[len - 1] == 'm')
           {
-            load_path& lp = __get_load_path__ ("fcn_file_in_path");
+            load_path& lp = __get_load_path__ ();
 
             retval = lp.find_fcn_file (name.substr (0, len-2));
           }
@@ -765,7 +765,7 @@
             if (pos != std::string::npos)
               fname = name.substr (0, pos);
 
-            load_path& lp = __get_load_path__ ("fcn_file_in_path");
+            load_path& lp = __get_load_path__ ();
 
             retval = lp.find_fcn_file (fname);
           }
@@ -783,7 +783,7 @@
 
     if (! dir.empty ())
       {
-        load_path& lp = __get_load_path__ ("contents_file_in_path");
+        load_path& lp = __get_load_path__ ();
 
         std::string tcontents
           = sys::file_ops::concat (lp.find_dir (dir), "Contents.m");
@@ -1535,7 +1535,7 @@
     // Allow free access to graphics resources while the interpreter thread
     // is asleep
 
-    gh_manager& gh_mgr = __get_gh_manager__ ("sleep");
+    gh_manager& gh_mgr = __get_gh_manager__ ();
 
     if (do_graphics_events)
       gh_mgr.unlock ();