# HG changeset patch # User Rik # Date 1631243249 25200 # Node ID 4f039927308bff167d7dce32c05a4fd456d92436 # Parent 1955fc6e2128317059b942d0a68d34808ca81830 maint: use "s_" prefix for static variables in class load_path. * load-path.cc, load-path.h: Use "s_" prefix for static variables in class load_path. diff -r 1955fc6e2128 -r 4f039927308b libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Thu Sep 09 13:04:56 2021 -0700 +++ b/libinterp/corefcn/load-path.cc Thu Sep 09 20:07:29 2021 -0700 @@ -225,8 +225,8 @@ Vlast_prompt_time.stamp (); } - std::string load_path::sys_path; - load_path::abs_dir_cache_type load_path::abs_dir_cache; + std::string load_path::s_sys_path; + load_path::abs_dir_cache_type load_path::s_abs_dir_cache; load_path::load_path (interpreter& interp) : add_hook ([=] (const std::string& dir) { this->execute_pkg_add (dir); }), @@ -238,19 +238,19 @@ void load_path::initialize (bool set_initial_path) { - sys_path = ""; + s_sys_path = ""; if (set_initial_path) { - maybe_add_path_elts (sys_path, config::local_ver_oct_file_dir ()); - maybe_add_path_elts (sys_path, config::local_api_oct_file_dir ()); - maybe_add_path_elts (sys_path, config::local_oct_file_dir ()); - maybe_add_path_elts (sys_path, config::local_ver_fcn_file_dir ()); - maybe_add_path_elts (sys_path, config::local_api_fcn_file_dir ()); - maybe_add_path_elts (sys_path, config::local_fcn_file_dir ()); - maybe_add_path_elts (sys_path, config::oct_file_dir ()); - maybe_add_path_elts (sys_path, config::fcn_file_dir ()); - maybe_add_path_elts (sys_path, config::oct_data_dir ()); + maybe_add_path_elts (s_sys_path, config::local_ver_oct_file_dir ()); + maybe_add_path_elts (s_sys_path, config::local_api_oct_file_dir ()); + maybe_add_path_elts (s_sys_path, config::local_oct_file_dir ()); + maybe_add_path_elts (s_sys_path, config::local_ver_fcn_file_dir ()); + maybe_add_path_elts (s_sys_path, config::local_api_fcn_file_dir ()); + maybe_add_path_elts (s_sys_path, config::local_fcn_file_dir ()); + maybe_add_path_elts (s_sys_path, config::oct_file_dir ()); + maybe_add_path_elts (s_sys_path, config::fcn_file_dir ()); + maybe_add_path_elts (s_sys_path, config::oct_data_dir ()); } std::string tpath = load_path::m_command_line_path; @@ -264,11 +264,11 @@ { xpath = tpath; - if (! sys_path.empty ()) - xpath += directory_path::path_sep_str () + sys_path; + if (! s_sys_path.empty ()) + xpath += directory_path::path_sep_str () + s_sys_path; } else - xpath = sys_path; + xpath = s_sys_path; set (xpath, false, true); } @@ -1349,9 +1349,9 @@ { std::string abs_name = sys::canonicalize_file_name (dir_name); - const_abs_dir_cache_iterator p = abs_dir_cache.find (abs_name); - - if (p != abs_dir_cache.end ()) + const_abs_dir_cache_iterator p = s_abs_dir_cache.find (abs_name); + + if (p != s_abs_dir_cache.end ()) { // The directory is in the cache of all directories we have // visited (indexed by absolute name). If it is out of date, @@ -1455,7 +1455,7 @@ // directory information, so there could be some resource // problems. Perhaps it should be pruned from time to time. - abs_dir_cache[abs_dir_name] = *this; + s_abs_dir_cache[abs_dir_name] = *this; } catch (const execution_exception&) { @@ -1935,8 +1935,8 @@ // more than one to exist in the load path. if (fname != "Contents.m" - && sys_path.find (old.dir_name) != std::string::npos - && in_path_list (sys_path, old.dir_name)) + && s_sys_path.find (old.dir_name) != std::string::npos + && in_path_list (s_sys_path, old.dir_name)) { std::string fcn_path = sys::file_ops::concat (dir_name, fname); diff -r 1955fc6e2128 -r 4f039927308b libinterp/corefcn/load-path.h --- a/libinterp/corefcn/load-path.h Thu Sep 09 13:04:56 2021 -0700 +++ b/libinterp/corefcn/load-path.h Thu Sep 09 20:07:29 2021 -0700 @@ -209,7 +209,7 @@ return m_command_line_path; } - std::string system_path (void) const { return sys_path; } + std::string system_path (void) const { return s_sys_path; } static const int M_FILE = 1; static const int OCT_FILE = 2; @@ -561,9 +561,9 @@ //-------- - static std::string sys_path; + static std::string s_sys_path; - static abs_dir_cache_type abs_dir_cache; + static abs_dir_cache_type s_abs_dir_cache; interpreter& m_interpreter;